index.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% import "bootstrap/wtf.html" as wtf %}
  2. {% import "bootstrap/utils.html" as utils %}
  3. {%- extends "base.html" %}
  4. {% block content %}
  5. <div class="container">
  6. <div class="col-md-12">
  7. {% if result_url %}
  8. <script type=text/javascript>
  9. $(function() {
  10. $('a#fetch_data').bind('click', function() {
  11. $.getJSON('{{ result_url }}', function(data) {
  12. $("#result").text(data.result);
  13. });
  14. return false;
  15. });
  16. });
  17. </script>
  18. <p class="text-center"><a class="btn btn-primary" href="#" role="button" id="fetch_data">Click to show the secret</a></p>
  19. <p class="h4 text-center mb-4">Remember, this is the last time you see it.</p>
  20. <br>
  21. <pre>
  22. <span id=result></span>
  23. </pre>
  24. {% endif %}
  25. {% with messages = get_flashed_messages() %}
  26. {% if messages %}
  27. <ul class=flashes>
  28. {% for message in messages %}
  29. <li>{{ message }}</li>
  30. {% endfor %}
  31. </ul>
  32. {% endif %}
  33. {% endwith %}
  34. {% if form %}
  35. <section class="form-elegant">
  36. <form method="POST" action="{{ url_for('frontend.add_entry') }}">
  37. {{ form.csrf_token }}
  38. <p class="h4 text-center mb-4">Put here the secret you want to share.</p>
  39. <p class="h4 text-center mb-4">It will be available for the next 24h.</p>
  40. <p class="h4 text-center mb-4">After the first reading, it will self-destruct.</p>
  41. <br><br>
  42. <textarea type="text" id="defaultFormContactMessageEx" class="form-control" rows="6" name="secrets"></textarea>
  43. <br><br>
  44. <div class="text-center mb-3">
  45. <button type="submit" class="btn blue-gradient btn-block btn-rounded z-depth-1a">Save my secret</button>
  46. </div>
  47. </form>
  48. </section>
  49. {% endif %}
  50. </div>
  51. </div>
  52. {%- endblock %}