DotaNoobs main site.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.7 KiB

11 years ago
  1. {% extends "layout.html" %}
  2. {% block title %}Edit Event - DotaNoobs {% endblock %}
  3. {% block content %}
  4. <div class="uk-grid" data-uk-grid-margin>
  5. <div class="uk-width-1-1">
  6. {% if event.name == None %}
  7. <h2 class="uk-float-left"><i class="uk-icon-calendar uk-icon-large"></i> New Event</h2>
  8. {% else %}
  9. <h2 class="uk-float-left"><i class="uk-icon-calendar uk-icon-large"></i> {{ event.name }}</h2>
  10. {% endif %}
  11. </div>
  12. <!--Main content area -->
  13. <div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel">
  14. <form class="uk-form uk-form-width-large" action="" method="post" name="settings">
  15. {{ form.hidden_tag() }}
  16. <fieldset data-uk-margin>
  17. <div class="uk-form-row">
  18. <label class="uk-form-label">Event Name: </label><br/>
  19. {{ form.name(placeholder="e.g. Tuesday Tango", class="uk-form-width-medium") }}
  20. </div>
  21. <div class="uk-form-row">
  22. <label class="uk-form-label">Type: </label>
  23. {{ form.type }}
  24. </div>
  25. <div class="uk-form-row">
  26. <label class="uk-form-label">Points: </labeb>
  27. {{ form.points(placeholder="e.g. 20") }}
  28. </div>
  29. <div class="uk-form-row">
  30. <label class="uk-form-label">Time To Earn: </label>
  31. {{ form.reward_threshold(placeholder="e.g. 30 (minutes)") }}
  32. </div>
  33. <br/>
  34. <div class="uk-form-row">
  35. <label class="uk-form-label">Starts</label><br/>
  36. <input id="start_d" placeholder="01.01.2015" data-uk-datepicker />
  37. <input id="start_t" placeholder="14:30" data-uk-timepicker />
  38. {{ form.start_time(class="datepicker uk-hidden") }}
  39. </div>
  40. <div class="uk-form-row">
  41. <label class="uk-form-label">Ends</label><br/>
  42. <input id="end_d" placeholder="01.01.2015" data-uk-datepicker />
  43. <input id="end_t" placeholder="09:30" data-uk-timepicker />
  44. {{ form.end_time(class="datepicker uk-hidden") }}
  45. </div>
  46. <div class="uk-form-row">
  47. <label class="uk-form-label">Description</label><br/>
  48. {{ form.desc(rows="10", class="uk-width-1-1", placeholder="A brief description of the event your planning; convince people to come!") }}
  49. </div>
  50. <div class="uk-form-controls uk-margin-top">
  51. <button class="uk-button uk-button-success" type="submit">Save</button>
  52. <a class="uk-button" href="{{ url_for('user_profile', userid=g.user.id) }}">Cancel</a>
  53. </div>
  54. </fieldset>
  55. </form>
  56. </div>
  57. </div>
  58. {% endblock %}
  59. {% block pagescripts %}
  60. <script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/datepicker/datepicker.min.js"></script>
  61. <script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/timepicker/timepicker.min.js"></script>
  62. <link rel=stylesheet href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/datepicker/datepicker.gradient.css"></link>
  63. <script>
  64. $(".uk-form").submit(function(event) {
  65. var s = moment($("#start_d").val() + ' ' + $("#start_t").val(), "DD.MM.YYYY HH:mm");
  66. var e = moment($("#end_d").val() + ' ' + $("#end_t").val(), "DD.MM.YYYY HH:mm");
  67. $("#start_time").val(s.utc().format("DD.MM.YYYY HH:mm"));
  68. $("#end_time").val(e.utc().format("DD.MM.YYYY HH:mm"));
  69. return true;
  70. });
  71. </script>
  72. {% endblock %}