diff options
| -rw-r--r-- | app/views/events/edit.html.erb | 30 | ||||
| -rw-r--r-- | public/javascripts/admin_interface.js | 6 |
2 files changed, 33 insertions, 3 deletions
diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb index 5aee501..d37c299 100644 --- a/app/views/events/edit.html.erb +++ b/app/views/events/edit.html.erb | |||
| @@ -18,8 +18,34 @@ | |||
| 18 | <%= f.datetime_select :end_time %> | 18 | <%= f.datetime_select :end_time %> |
| 19 | </p> | 19 | </p> |
| 20 | <p> | 20 | <p> |
| 21 | <%= f.label :rrule %><br /> | 21 | <%= f.label :rrule, "Recurrence" %> |
| 22 | <%= f.text_field :rrule %> | 22 | <div id="rrule_builder"> |
| 23 | <p> | ||
| 24 | <label><%= radio_button_tag "rrule_freq", "weekly", true %> Weekly</label> | ||
| 25 | <label><%= radio_button_tag "rrule_freq", "monthly" %> Monthly</label> | ||
| 26 | </p> | ||
| 27 | <div id="rrule_weekly_options"> | ||
| 28 | <p><label><%= check_box_tag "rrule_biweekly" %> Every 2 weeks</label></p> | ||
| 29 | <p> | ||
| 30 | <% %w[MO TU WE TH FR SA SU].each do |code| %> | ||
| 31 | <label><%= check_box_tag "rrule_byday_#{code}" %> <%= RruleHumanizer::WEEKDAY_NAMES_ABBR[:de][code] %></label> | ||
| 32 | <% end %> | ||
| 33 | </p> | ||
| 34 | </div> | ||
| 35 | <div id="rrule_monthly_options" style="display: none;"> | ||
| 36 | <p><label><%= check_box_tag "rrule_monthly_ordinal" %> On a specific weekday each month</label></p> | ||
| 37 | <p id="rrule_ordinal_fields" style="display: none;"> | ||
| 38 | <%= select_tag "rrule_ordinal", options_for_select([["1.", 1], ["2.", 2], ["3.", 3], ["4.", 4], ["letzter", -1], ["vorletzter", -2]]) %> | ||
| 39 | <%= select_tag "rrule_ordinal_day", options_for_select(%w[MO TU WE TH FR SA SU].map { |c| [RruleHumanizer::WEEKDAY_NAMES[:de][c], c] }) %> | ||
| 40 | </p> | ||
| 41 | </div> | ||
| 42 | <p> | ||
| 43 | <label><%= check_box_tag "rrule_exclude_month" %> Except in one month</label> | ||
| 44 | <%= select_tag "rrule_excluded_month", options_for_select((1..12).map { |m| [RruleHumanizer::MONTH_NAMES[:de][m-1], m] }), style: "display: none;" %> | ||
| 45 | </p> | ||
| 46 | <span class="field_hint">Builds the field below automatically. If your pattern is more complex than this covers, just edit it directly below - these controls won't touch it unless you use them.</span> | ||
| 47 | </div> | ||
| 48 | <%= f.text_field :rrule, id: "event_rrule" %> | ||
| 23 | </p> | 49 | </p> |
| 24 | <p> | 50 | <p> |
| 25 | <%= f.label :tag_list, "Tags" %><br /> | 51 | <%= f.label :tag_list, "Tags" %><br /> |
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index 450438f..cb32d5a 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js | |||
| @@ -50,7 +50,11 @@ $(document).ready(function () { | |||
| 50 | if ($("#move_to_search_term").length != 0) { | 50 | if ($("#move_to_search_term").length != 0) { |
| 51 | move_to_search.initialize_search(); | 51 | move_to_search.initialize_search(); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | if ($("#rrule_builder").length != 0) { | ||
| 55 | rrule_builder.initialize(); | ||
| 56 | } | ||
| 57 | |||
| 54 | if ($('#recent_changes_toggle').length != 0) { | 58 | if ($('#recent_changes_toggle').length != 0) { |
| 55 | hide_all(); | 59 | hide_all(); |
| 56 | $('#recent_changes_toggle').attr("class", "selected"); | 60 | $('#recent_changes_toggle').attr("class", "selected"); |
