koalagator 4.1.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +661 -0
  3. data/README.md +74 -21
  4. data/app/assets/config/calagator/manifest.js +5 -1
  5. data/app/assets/images/external_sites/mastodon.png +0 -0
  6. data/app/assets/images/nav_marker.png +0 -0
  7. data/app/assets/javascripts/calagator/forms.js +7 -0
  8. data/app/assets/stylesheets/calagator/custom/calendar.css +137 -0
  9. data/app/assets/stylesheets/calagator/errors.css +2 -4
  10. data/app/assets/stylesheets/calagator/forms.scss +5 -0
  11. data/app/assets/stylesheets/calagator/layout.scss +31 -9
  12. data/app/assets/stylesheets/calagator/typography.scss +39 -9
  13. data/app/assets/stylesheets/calagator/utils.scss +44 -0
  14. data/app/controllers/calagator/admin/curations_controller.rb +62 -0
  15. data/app/controllers/calagator/admin/users_controller.rb +79 -0
  16. data/app/controllers/calagator/application_controller.rb +29 -5
  17. data/app/controllers/calagator/curations_controller.rb +32 -0
  18. data/app/controllers/calagator/events_controller.rb +6 -0
  19. data/app/controllers/calagator/paper_trail_manager_controller.rb +5 -0
  20. data/app/controllers/calagator/passwords_controller.rb +4 -0
  21. data/app/controllers/calagator/registrations_controller.rb +5 -0
  22. data/app/controllers/calagator/sessions_controller.rb +4 -0
  23. data/app/controllers/calagator/site_controller.rb +10 -0
  24. data/app/controllers/calagator/sources_controller.rb +2 -0
  25. data/app/controllers/calagator/venues_controller.rb +5 -1
  26. data/app/controllers/calagator/versions_controller.rb +1 -1
  27. data/app/controllers/paper_trail_manager/changes_controller.rb +16 -16
  28. data/app/helpers/calagator/application_helper.rb +32 -3
  29. data/app/helpers/calagator/time_range_helper.rb +1 -1
  30. data/app/helpers/paper_trail_manager/changes_helper.rb +7 -7
  31. data/app/javascript/calagator/calendar/calendar.js +82 -0
  32. data/app/javascript/calagator/calendar/event.js +94 -0
  33. data/app/javascript/calagator/calendar/lib/components.js +120 -0
  34. data/app/javascript/calagator/calendar/lib/utils.js +67 -0
  35. data/app/models/calagator/curation.rb +32 -0
  36. data/app/models/calagator/event/browse.rb +3 -2
  37. data/app/models/calagator/event/cloner.rb +1 -1
  38. data/app/models/calagator/event/ical_renderer.rb +1 -1
  39. data/app/models/calagator/event/overview.rb +3 -1
  40. data/app/models/calagator/event/saver.rb +6 -1
  41. data/app/models/calagator/event/search.rb +1 -1
  42. data/app/models/calagator/event/search_engine.rb +1 -1
  43. data/app/models/calagator/event.rb +22 -5
  44. data/app/models/calagator/source/parser/hcal.rb +1 -1
  45. data/app/models/calagator/source/parser.rb +3 -3
  46. data/app/models/calagator/source.rb +23 -6
  47. data/app/models/calagator/user.rb +50 -0
  48. data/app/models/calagator/venue/geocoder.rb +1 -1
  49. data/app/models/calagator/venue/search.rb +1 -1
  50. data/app/models/calagator/venue/search_engine.rb +1 -1
  51. data/app/models/calagator/venue.rb +20 -1
  52. data/app/models/concerns/calagator/event_filterable.rb +22 -0
  53. data/app/views/calagator/admin/curations/_form.html.erb +56 -0
  54. data/app/views/calagator/admin/curations/_index.html.erb +12 -0
  55. data/app/views/calagator/admin/curations/edit.html.erb +2 -0
  56. data/app/views/calagator/admin/curations/index.html.erb +21 -0
  57. data/app/views/calagator/admin/curations/new.html.erb +2 -0
  58. data/app/views/calagator/admin/index.html.erb +6 -2
  59. data/app/views/calagator/admin/users/_form.html.erb +28 -0
  60. data/app/views/calagator/admin/users/edit.html.erb +7 -0
  61. data/app/views/calagator/admin/users/index.html.erb +38 -0
  62. data/app/views/calagator/admin/users/invite.html.erb +19 -0
  63. data/app/views/calagator/admin/users/new.html.erb +3 -0
  64. data/app/views/calagator/curations/show.html.erb +17 -0
  65. data/app/views/calagator/events/_index.html.erb +59 -0
  66. data/app/views/calagator/events/_item.html.erb +10 -3
  67. data/app/views/calagator/events/_subnav.html.erb +7 -2
  68. data/app/views/calagator/events/_subnav_custom.html.erb +0 -0
  69. data/app/views/calagator/events/index.atom.builder +1 -1
  70. data/app/views/calagator/events/index.html.erb +9 -60
  71. data/app/views/calagator/events/show.html.erb +5 -3
  72. data/app/views/calagator/shared/_calendar.html.erb +7 -0
  73. data/app/views/calagator/shared/_subnav_curations.html.erb +5 -0
  74. data/app/views/calagator/shared/_subnav_pinned_venues.html.erb +5 -0
  75. data/app/views/calagator/site/_contact.html.erb +1 -0
  76. data/app/views/calagator/site/_description.html.erb +2 -2
  77. data/app/views/calagator/site/about.html.erb +9 -0
  78. data/app/views/calagator/site/closed_registrations.html.erb +2 -0
  79. data/app/views/calagator/site/embed.html.erb +16 -0
  80. data/app/views/calagator/site/index.html.erb +1 -1
  81. data/app/views/calagator/sources/index.html.erb +1 -1
  82. data/app/views/calagator/sources/show.html.erb +1 -1
  83. data/app/views/calagator/venues/_form.html.erb +5 -1
  84. data/app/views/calagator/venues/_subnav.html.erb +9 -1
  85. data/app/views/calagator/venues/_subnav_custom.html.erb +0 -0
  86. data/app/views/calagator/venues/show.html.erb +1 -1
  87. data/app/views/layouts/calagator/_devise.html.erb +17 -0
  88. data/app/views/layouts/calagator/_footer.html.erb +3 -1
  89. data/app/views/layouts/calagator/_head.html.erb +0 -0
  90. data/app/views/layouts/calagator/_header.html.erb +3 -0
  91. data/app/views/layouts/calagator/application.html.erb +3 -0
  92. data/app/views/layouts/calagator/embed.html.erb +15 -0
  93. data/app/views/paper_trail_manager/changes/_version.html.erb +5 -5
  94. data/app/views/paper_trail_manager/changes/index.atom.builder +12 -12
  95. data/bin/{calagator → koalagator} +12 -14
  96. data/config/importmap.rb +11 -0
  97. data/config/initializers/admin_user.rb +15 -0
  98. data/config/initializers/observers.rb +1 -1
  99. data/config/initializers/paper_trail_manager.rb +1 -1
  100. data/config/locales/devise.en.yml +65 -0
  101. data/config/routes.rb +26 -1
  102. data/db/migrate/20240319042449_devise_create_calagator_users.rb +43 -0
  103. data/db/migrate/20240319061154_add_admin_flag_to_calagator_user.rb +5 -0
  104. data/db/migrate/20240320043535_add_name_to_calagator_user.rb +8 -0
  105. data/db/migrate/20240322035554_add_created_by_to_records.rb +12 -0
  106. data/db/migrate/20240510051940_create_calagator_curations.rb +15 -0
  107. data/db/migrate/20240628055300_add_pinned_to_venue.rb +5 -0
  108. data/db/seeds.rb +49 -0
  109. data/lib/calagator/decode_html_entities_hack.rb +1 -1
  110. data/lib/calagator/engine.rb +16 -1
  111. data/lib/calagator/machine_tag.rb +1 -1
  112. data/lib/calagator/strip_whitespace.rb +1 -1
  113. data/lib/calagator/vcalendar.rb +4 -4
  114. data/lib/calagator/version.rb +4 -1
  115. data/lib/generators/calagator/install_generator.rb +9 -1
  116. data/lib/generators/calagator/templates/app/views/devise/registrations/edit.html.erb +48 -0
  117. data/lib/generators/calagator/templates/app/views/devise/registrations/new.html.erb +29 -0
  118. data/lib/generators/calagator/templates/config/initializers/01_calagator.rb +34 -6
  119. data/lib/generators/calagator/templates/config/initializers/04_devise.rb +314 -0
  120. data/lib/{calagator.rb → koalagator.rb} +15 -3
  121. data/lib/paper_trail_manager.rb +11 -11
  122. data/lib/theme_reader.rb +1 -1
  123. data/rails_template.rb +6 -6
  124. data/vendor/javascript/@event-calendar--core.js +10 -0
  125. data/vendor/javascript/@event-calendar--day-grid.js +2 -0
  126. data/vendor/javascript/@event-calendar--list.js +2 -0
  127. data/vendor/javascript/ical.js.js +2 -0
  128. metadata +145 -92
  129. data/MIT-LICENSE.txt +0 -23
  130. data/app/models/calagator/event/search_engine/apache_sunspot.rb +0 -106
  131. data/app/models/calagator/venue/search_engine/apache_sunspot.rb +0 -85
  132. data/lib/tasks/sunspot_reindex_calagator.rake +0 -20
  133. data/lib/tasks/sunspot_solr_restart_enhancements.rake +0 -20
  134. data/lib/wait_for_solr.rb +0 -26
@@ -0,0 +1,56 @@
1
+ <%= form_with model: curation, url: (curation.new_record? ? admin_curations_path : admin_curation_path(curation)) do |form| %>
2
+ <div class="flex flex-col items-start">
3
+ <%= form.label :name, class: "font-bold required" %>
4
+ <%= form.text_field :name, required: true, oninput: "formatNameField(event)", pattern: "[a-z0-9_\-]+" %>
5
+ </div>
6
+
7
+ <div class="flex flex-col items-start">
8
+ <%= form.label :display_name, class: "font-bold required" %>
9
+ <%= form.text_field :display_name, required: true %>
10
+ </div>
11
+
12
+ <div class="flex flex-col items-start">
13
+ <%= form.label :description, class: "font-bold" %>
14
+ <%= form.text_area :description %>
15
+ </div>
16
+
17
+ <div class="flex flex-col items-start">
18
+ <%= form.label :priority, class: "font-bold required" %>
19
+ <%= form.number_field :priority, required: true %>
20
+ </div>
21
+
22
+ <div class="flex flex-col items-start">
23
+ <%= form.label :unlisted, class: "font-bold required" %>
24
+ <%= form.check_box :unlisted %>
25
+ </div>
26
+
27
+ <fieldset style="margin-top: 1rem;">
28
+ <legend class="font-bold">Tag Filters</legend>
29
+ <p>Configure tags, comma separated, to configure the curated events.</p>
30
+
31
+ <div class="flex flex-col items-start mb-2">
32
+ <%= form.label :block_list, class: "font-bold" %>
33
+ <%= form.text_field :block_list, value: curation.block_list.to_s %>
34
+ <span>Events with any of these tags will <strong>always</strong> be excluded.</span>
35
+ </div>
36
+
37
+ <div class="flex flex-col items-start mb-2">
38
+ <%= form.label :require_list, class: "font-bold" %>
39
+ <%= form.text_field :require_list, value: curation.require_list.to_s %>
40
+ <span>Events <strong>must</strong> have one of these tags to be included.</span>
41
+ </div>
42
+
43
+ <div class="flex flex-col items-start mb-2">
44
+ <%= form.label :deny_list, class: "font-bold" %>
45
+ <%= form.text_field :deny_list, value: curation.deny_list.to_s %>
46
+ <span>Events with any of these tags will be excluded.</span>
47
+ </div>
48
+
49
+ <div class="flex flex-col items-start mb-2">
50
+ <%= form.label :allow_list, class: "font-bold" %>
51
+ <%= form.text_field :allow_list, value: curation.allow_list.to_s %>
52
+ <span>Events with any of these tags will be included, <strong>overriding</strong> the deny list.</span>
53
+ </div>
54
+ </fieldset>
55
+ <%= form.submit %>
56
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <tr>
2
+ <td><%= curation.priority %></td>
3
+ <td><%= !curation.unlisted %></td>
4
+ <td><%= curation.name %></td>
5
+ <td><%= curation.display_name %></td>
6
+ <td><%= curation.description %></td>
7
+ <td>
8
+ <%= link_to "Edit", edit_admin_curation_path(curation) %>
9
+ |
10
+ <%= button_to "Destroy", destroy_user_session_path, method: :delete, class: "a-like", form_class: "inline", data: { confirm: "Are you sure?" } %>
11
+ </td>
12
+ </tr>
@@ -0,0 +1,2 @@
1
+ <h2>Edit Curation</h2>
2
+ <%= render partial: "form", locals: {curation: @curation} %>
@@ -0,0 +1,21 @@
1
+ <h2>
2
+ <%= link_to "Admin", admin_path %> / Curations
3
+ </h2>
4
+ <div class="flex flex-col items-start">
5
+ <%= link_to "New Curation", new_admin_curation_path %>
6
+ <table class="w-auto">
7
+ <thead>
8
+ <tr>
9
+ <th>Priority</th>
10
+ <th>Listed?</th>
11
+ <th>Name</th>
12
+ <th>Display Name</th>
13
+ <th>Description</th>
14
+ <th>Actions</th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+ <%= render partial: "index", collection: @curations, as: :curation %>
19
+ </tbody>
20
+ </table>
21
+ </div>
@@ -0,0 +1,2 @@
1
+ <h2>New Curation</h2>
2
+ <%= render partial: "form", locals: {curation: @curation} %>
@@ -1,8 +1,12 @@
1
- <h2>Calagator Admin Tools</h2>
1
+ <h2><%= distro_name %> Admin Tools</h2>
2
2
 
3
3
  <ul>
4
4
  <li><%= link_to "Recent changes", '/changes' %></li>
5
5
  <li><%= link_to "Squash duplicate events", duplicates_events_path %></li>
6
- <li><%= link_to "Squash duplicate vennues", duplicates_venues_path %></li>
6
+ <li><%= link_to "Squash duplicate venues", duplicates_venues_path %></li>
7
7
  <li><%= link_to "Lock events", admin_events_path %></li>
8
+ <% if Calagator.devise_enabled %>
9
+ <li><%= link_to "Manage users", admin_users_path %></li>
10
+ <% end %>
11
+ <li><%= link_to "Manage curations", admin_curations_path %></li>
8
12
  </ul>
@@ -0,0 +1,28 @@
1
+ <%= form_with model: user, url: user.new_record? ? admin_users_path : admin_user_path(user) do |form| %>
2
+ <div class="flex flex-col max-w-content">
3
+ <%= form.label :email %>
4
+ <%= form.email_field :email %>
5
+ </div>
6
+
7
+ <div class="flex flex-col max-w-content">
8
+ <%= form.label :name %>
9
+ <%= form.text_field :name %>
10
+ </div>
11
+
12
+ <div class="flex flex-col max-w-content">
13
+ <%= form.label :display_name %>
14
+ <%= form.text_field :display_name %>
15
+ </div>
16
+
17
+ <div>
18
+ <%= form.label :admin %>
19
+ <%= form.check_box :admin %>
20
+ </div>
21
+
22
+ <div class="flex gap-2">
23
+ <%= form.submit %>
24
+ <%= link_to admin_users_path do %>
25
+ <button type="button">Cancel</button>
26
+ <% end %>
27
+ </div>
28
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <div>
2
+ <h2>Editing User</h2>
3
+ <%= render partial: "form", locals: {user: @user} %>
4
+ <% unless @user.admin? || @user == current_user %>
5
+ <%= button_to "Delete User", admin_user_path(@user), method: :delete, data: { confirm: "Are you sure?" }, form_class: "mt-2" %>
6
+ <% end %>
7
+ </div>
@@ -0,0 +1,38 @@
1
+ <h2>
2
+ <%= link_to "Admin", admin_path %> / Users
3
+ </h2>
4
+
5
+ <div class="flex flex-col items-start">
6
+ <%= link_to "Invite User", new_admin_user_path %>
7
+ <%= will_paginate @users %>
8
+ <table class="w-auto">
9
+ <thead>
10
+ <tr>
11
+ <th>ID</th>
12
+ <th>Email</th>
13
+ <th>Name</th>
14
+ <th>Display Name</th>
15
+ <th>Admin?</th>
16
+ <th>Created At</th>
17
+ <th>Updated At</th>
18
+ <th>Actions</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <% @users.each do |user| %>
23
+ <tr>
24
+ <td><%= user.id %></td>
25
+ <td><%= user.email %></td>
26
+ <td><%= user.name %></td>
27
+ <td><%= user.display_name %></td>
28
+ <td><%= user.admin %></td>
29
+ <td><%= user.created_at %></td>
30
+ <td><%= user.updated_at %></td>
31
+ <td>
32
+ <%= link_to "Edit", edit_admin_user_path(user) %>
33
+ </td>
34
+ </tr>
35
+ <% end %>
36
+ </tbody>
37
+ </table>
38
+ </div>
@@ -0,0 +1,19 @@
1
+ <p>
2
+ User <strong><%= @user.name %></strong> has been created.
3
+ </p>
4
+
5
+ <p>
6
+ If email has been properly set up on this instance, they should receive an email shortly instructing them to reset their password.
7
+ </p>
8
+
9
+ <p>
10
+ Otherwise, you can manually provide them with the following link:
11
+ </p>
12
+
13
+ <p>
14
+ <code><%= "#{root_url}users/password/edit?reset_password_token=#{params[:token]}" %></code>
15
+ </p>
16
+
17
+ <%= link_to admin_users_path do %>
18
+ <button type="button">Back</button>
19
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <div>
2
+ <%= render partial: "form", locals: {user: @user} %>
3
+ </div>
@@ -0,0 +1,17 @@
1
+ <%= content_for :title, @curation.display_name %>
2
+
3
+ <h2 class="font-bold"><%= @curation.display_name %></h2>
4
+ <div id="curation_description">
5
+ <%== markdown @curation.description %>
6
+ <hr class="hr-sm">
7
+ </div>
8
+ <%= render partial: "calagator/events/index", locals: {
9
+ browse: @browse,
10
+ links: {
11
+ ical: curation_url(@curation.name, format: :ics, protocol: :webcal),
12
+ atom: curation_url(@curation.name, format: :atom),
13
+ google: "https://www.google.com/calendar/render?cid=" + curation_url(@curation.name, format: :ics, protocol: :webcal),
14
+ ical_export: curation_path(@curation.name, format: :ics),
15
+ }
16
+ }
17
+ %>
@@ -0,0 +1,59 @@
1
+ <% links ||= {} %>
2
+ <div class='list_description'>
3
+ <h2>Viewing <strong><%= browse.events.size %></strong>
4
+ <%= browse.date ? 'filtered' : 'future' %> events
5
+ <%= events_sort_label(browse.order) %></h2>
6
+ </div>
7
+
8
+ <div id='list_filters' class='sidebar'>
9
+
10
+ <h3 class='first'>Filter:</h3>
11
+
12
+ <%= form_tag events_url, :method => 'get' do -%>
13
+
14
+ <div id="date_filter">
15
+ <h4>by date</h4>
16
+ <div id='start_calendar'>
17
+ <label for='date_start'>From</label>
18
+ <%= text_field_tag 'date[start]', browse.start_date, :id => 'date_start', :class => 'date_picker' %>
19
+ </div>
20
+ <div id='end_calendar'>
21
+ <label for='date_end'>To</label>
22
+ <%= text_field_tag 'date[end]', browse.end_date, :id => 'date_end', :class => 'date_picker' %>
23
+ </div>
24
+ </div>
25
+ <div id='time_filter'>
26
+ <h4>by time</h4>
27
+ <div id='start_time_picker'>
28
+ <label for="time_start">Begins after:</label>
29
+ <%= text_field_tag 'time[start]', browse.start_time, :id => 'filter_time_start', :class => 'time_picker_filter' %>
30
+ </div>
31
+ <div id='end_time_picker'>
32
+ <label for="time_end">Ends before:</label>
33
+ <%= text_field_tag 'time[end]', browse.end_time, :id => 'filter_time_end', :class => 'time_picker_filter' %>
34
+ </div>
35
+ </div>
36
+ <div>
37
+ <label for="commit">&nbsp;</label>
38
+ <%= submit_tag 'Filter' %>
39
+ <span class="clear_filter"><%= link_to 'Reset', events_url %></span>
40
+ </div>
41
+ <% end %>
42
+
43
+ <h3>Subscribe to</h3>
44
+ <ul>
45
+ <li><%= link_to "iCalendar feed", links[:ical] %></li>
46
+ <li><%= link_to "Atom feed", links[:atom] %></li>
47
+ <li><%= link_to "Google Calendar", links[:google] %></li>
48
+ </ul>
49
+
50
+ <h3>Export to</h3>
51
+ <ul>
52
+ <li><%= link_to "iCalendar file", links[:ical_export] %></li>
53
+ </ul>
54
+
55
+ </div>
56
+
57
+ <div class='list_items'>
58
+ <%= render :partial => 'calagator/events/table', :locals => { :events => browse.events } %>
59
+ </div>
@@ -82,7 +82,16 @@ html_classes << " contentbar" if has_contentbar
82
82
  <% if event.persisted? %>
83
83
  <h3>Share</h3>
84
84
  <div class="share">
85
- <a class="fb-share" href="#"
85
+ <a class="mastodon-share social-popover" href="#"
86
+ onclick="
87
+ window.open(
88
+ 'https://mastodonshare.com/share?url='+encodeURIComponent('<%= shareable_event_url(event) %>'),
89
+ 'facebook-share-dialog',
90
+ 'width=626,height=436');
91
+ return false;">
92
+ Share
93
+ </a>
94
+ <a class="facebook-share social-popover" href="#"
86
95
  onclick="
87
96
  window.open(
88
97
  'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent('<%= shareable_event_url(event) %>'),
@@ -91,8 +100,6 @@ html_classes << " contentbar" if has_contentbar
91
100
  return false;">
92
101
  Share
93
102
  </a>
94
- <a href="https://twitter.com/share" class="twitter-share-button" data-url="<%= shareable_event_url(event) %>" data-text="<%= tweet_text(event) %>" data-related="calagator" data-dnt="true">Tweet</a>
95
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
96
103
  </div>
97
104
  <% end %>
98
105
  <% unless event.tags.blank? -%>
@@ -1,8 +1,13 @@
1
- <div id="events_subnav" class="subnav">
1
+ <div id="events_subnav" class="subnav flex justify-between">
2
2
  <ul class="clearfix">
3
- <li><%= link_to 'Browse events', root_url,
3
+ <li><%= link_to 'Home', root_url,
4
4
  :class => subnav_class_for("site", "index") %>
5
5
  </li>
6
+ <%= render partial: "calagator/shared/subnav_curations", locals: { curations: Calagator::Curation.order_by_priority } %>
7
+ <%= render partial: "calagator/shared/subnav_pinned_venues", locals: { venues: Calagator::Venue.pinned } %>
8
+ <%= render partial: "calagator/events/subnav_custom" %>
9
+ </ul>
10
+ <ul>
6
11
  <li><%= link_to 'Add an event', new_event_url,
7
12
  :class => subnav_class_for("events", "new") %>
8
13
  </li>
@@ -26,7 +26,7 @@ cache_if(@perform_caching, Calagator::CacheObserver.daily_key_for("events_atom",
26
26
  entry.start_time(event.start_time.xmlschema)
27
27
  entry.end_time(event.end_time.xmlschema) if event.end_time
28
28
  entry.content(render(partial: "feed_item", locals: {event: event}, formats: [:html]), type: "html")
29
- if event.venue&.latitude && event.venue&.longitude
29
+ if event.venue&.latitude && event.venue.longitude
30
30
  entry.georss :point, "#{event.venue.latitude} #{event.venue.longitude}"
31
31
  end
32
32
  end
@@ -1,62 +1,11 @@
1
1
  <%= content_for :title, "Events" %>
2
2
 
3
- <% cache_if(@browse.default?, Calagator::CacheObserver.daily_key_for("events_index", request)) do %>
4
- <div class='list_description'>
5
- <h2>Viewing <strong><%= @browse.events.size %></strong>
6
- <%= @browse.date ? 'filtered' : 'future' %> events
7
- <%= events_sort_label(@browse.order) %></h2>
8
- </div>
9
-
10
- <div id='list_filters' class='sidebar'>
11
-
12
- <h3 class='first'>Filter:</h3>
13
-
14
- <%= form_tag events_url, :method => 'get' do -%>
15
-
16
- <div id="date_filter">
17
- <h4>by date</h4>
18
- <div id='start_calendar'>
19
- <label for='date_start'>From</label>
20
- <%= text_field_tag 'date[start]', @browse.start_date, :id => 'date_start', :class => 'date_picker' %>
21
- </div>
22
- <div id='end_calendar'>
23
- <label for='date_end'>To</label>
24
- <%= text_field_tag 'date[end]', @browse.end_date, :id => 'date_end', :class => 'date_picker' %>
25
- </div>
26
- </div>
27
- <div id='time_filter'>
28
- <h4>by time</h4>
29
- <div id='start_time_picker'>
30
- <label for="time_start">Begins after:</label>
31
- <%= text_field_tag 'time[start]', @browse.start_time, :id => 'filter_time_start', :class => 'time_picker_filter' %>
32
- </div>
33
- <div id='end_time_picker'>
34
- <label for="time_end">Ends before:</label>
35
- <%= text_field_tag 'time[end]', @browse.end_time, :id => 'filter_time_end', :class => 'time_picker_filter' %>
36
- </div>
37
- </div>
38
- <div>
39
- <label for="commit">&nbsp;</label>
40
- <%= submit_tag 'Filter' %>
41
- <span class="clear_filter"><%= link_to 'Reset', events_url %></span>
42
- </div>
43
- <% end %>
44
-
45
- <h3>Subscribe to</h3>
46
- <ul>
47
- <li><%= link_to "iCalendar feed", icalendar_feed_link %></li>
48
- <li><%= link_to "Atom feed", atom_feed_link %></li>
49
- <li><%= link_to "Google Calendar", google_events_subscription_link %></li>
50
- </ul>
51
-
52
- <h3>Export to</h3>
53
- <ul>
54
- <li><%= link_to "iCalendar file", icalendar_export_link %></li>
55
- </ul>
56
-
57
- </div>
58
-
59
- <div class='list_items'>
60
- <%= render :partial => 'table', :locals => { :events => @browse.events } %>
61
- </div>
62
- <% end %>
3
+ <% cache_if(@browse.default? && Calagator.cache_enabled, Calagator::CacheObserver.daily_key_for("events_index", request)) do %>
4
+ <%= render partial: "index", locals: {browse: @browse, links: {
5
+ ical: icalendar_feed_link,
6
+ atom: atom_feed_link,
7
+ google: google_events_subscription_link,
8
+ ical_export: icalendar_export_link
9
+ }}
10
+ %>
11
+ <% end %>
@@ -38,12 +38,14 @@
38
38
  <% if @event.locked %>
39
39
  <p>This event is currently locked and cannot be edited. Please contact an admin for assistance.</p>
40
40
  <% else %>
41
- <p>
41
+ <span>
42
42
  You can
43
43
  <%= link_to "edit", edit_event_url(@event) %>,
44
44
  <%= link_to "clone", clone_event_url(@event) %>,
45
- or
46
- <%= link_to "delete", event_url(@event), method: :delete, data: { confirm: "Are you sure?" } %>
45
+ or
46
+ </span>
47
+ <%= button_to "delete", event_url(@event), method: :delete, data: { confirm: "Are you sure?" }, form_class: "inline", class: "a-like" %>
48
+ <span>
47
49
  this event.
48
50
  </p>
49
51
  <% end %>
@@ -0,0 +1,7 @@
1
+ <% content_for :head do %>
2
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@3.3.0/event-calendar.min.css">
3
+ <%= stylesheet_link_tag "calagator/custom/calendar" %>
4
+ <%= javascript_import_module_tag "calendar/calendar" %>
5
+ <% end %>
6
+
7
+ <events-calendar id="calendar" src="<%= src %>"></events-calendar>
@@ -0,0 +1,5 @@
1
+ <% curations.listed.each do |curation| %>
2
+ <li><%= link_to curation.display_name, curation_path(curation.name),
3
+ :class => subnav_class_for("curations", "show", curation.name) %>
4
+ </li>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <% venues.each do |venue| %>
2
+ <li><%= link_to venue.title, venue_path(venue),
3
+ :class => subnav_class_for("venues", "show", venue.id.to_s) %>
4
+ </li>
5
+ <% end %>
@@ -0,0 +1 @@
1
+ <p><strong>Admin Email:</strong> <a href="mailto:<%= Calagator.administrator_email %>"><%= Calagator.administrator_email %></a></p>
@@ -1,8 +1,8 @@
1
1
  <div class='replace-this-text'>
2
- <h2>Hi there.</h2>
2
+ <h2>G'day!</h2>
3
3
  <p>
4
4
  Make a new file <code>app/views/calagator/site/_description.html.erb</code> and describe your site there!
5
5
  <br/>
6
- (This text comes from a file in that location in the calagator gem)
6
+ (This text comes from a file in that location in the <%= distro_name.downcase %> gem)
7
7
  </p>
8
8
  </div>
@@ -9,4 +9,13 @@
9
9
  and <code>get_involved</code>. These are optional, of course, but if you don't want them remember to create your own
10
10
  <code>app/views/calagator/site/_sidebar_menu.html.erb</code> to override the existing view.
11
11
  </p>
12
+
13
+ <div class="replace-this-text">
14
+ <p>
15
+ Configure your contact details in the partial: <code>app/views/calagator/site/_contact.html.erb</code>.
16
+ This partial is used wherever it is suggested that a user contact the administrators for support.
17
+ </p>
18
+ <h2>Contact Details</h2>
19
+ <%= render partial: "calagator/site/contact" %>
20
+ </div>
12
21
  </div>
@@ -0,0 +1,2 @@
1
+ Registrations on this instance are closed. Please contact the administrators for an account.
2
+ <%= render partial: "calagator/site/contact" %>
@@ -0,0 +1,16 @@
1
+ <%= render partial: "calagator/shared/calendar", locals: {src: params[:src]} %>
2
+
3
+ <script>
4
+ function getView() {
5
+ if (window.matchMedia('(max-width: 945px)').matches) {
6
+ return 'listMonth'
7
+ }
8
+ return 'dayGridMonth'
9
+ }
10
+
11
+ const calendar = document.getElementById("calendar")
12
+ const resizeObserver = new ResizeObserver(() => {
13
+ calendar.setAttribute("view", getView())
14
+ })
15
+ resizeObserver.observe(calendar)
16
+ </script>
@@ -1,4 +1,4 @@
1
- <% cache(Calagator::CacheObserver.daily_key_for("site_index", request)) do %>
1
+ <% cache_if(Calagator.cache_enabled, Calagator::CacheObserver.daily_key_for("site_index", request)) do %>
2
2
  <a href="#" id="homepage_sidebar_toggle" class="expander_toggle">Hi there. Learn about this site and how to use it...</a>
3
3
  <div id="homepage_sidebar">
4
4
  <div id="project_description">
@@ -10,7 +10,7 @@
10
10
  <tr class="<%= cycle 'odd', 'even' %>">
11
11
  <td>
12
12
  <%= link_to 'Show', source %> |
13
- <%= link_to 'Destroy', source, method: :delete, data: {confirm: 'Are you sure?' } %>
13
+ <%= button_to 'Destroy', source, class: "a-like", form_class: "inline", method: :delete, data: {confirm: 'Are you sure?' } %>
14
14
  </td>
15
15
  <td><%= source_url_link source %></td>
16
16
  </tr>
@@ -13,4 +13,4 @@
13
13
  </p>
14
14
 
15
15
  <%= link_to 'Back', sources_path %> |
16
- <%= link_to 'Destroy', @source, method: :delete, data: { confirm: 'Are you sure?' } %>
16
+ <%= button_to 'Destroy', @source, class: "a-like", form_class: "inline", method: :delete, data: { confirm: 'Are you sure?' } %>
@@ -39,7 +39,11 @@
39
39
  :as => :boolean,
40
40
  :hint => venue.location \
41
41
  ? "([#{venue.latitude}, #{venue.longitude}] currently; if checked, we'll try again.)" \
42
- : "(if checked, we'll try to determine a map position for this venue.)" %>
42
+ : "(If checked, we'll try to determine a map position for this venue.)" %>
43
+ <% end %>
44
+
45
+ <% if Calagator.devise_enabled && current_user&.admin? %>
46
+ <%= f.input :pinned, label: "Pinned to Navbar?", as: :boolean, hint: "(If checked, this venue will be featured in the navbar.)" %>
43
47
  <% end %>
44
48
 
45
49
  <li class='trap'>
@@ -1,5 +1,13 @@
1
- <div id="venues_subnav" class="subnav">
1
+ <div id="venues_subnav" class="subnav flex justify-between">
2
2
  <ul class="clearfix">
3
+ <li><%= link_to 'Home', root_url,
4
+ :class => subnav_class_for("site", "index") %>
5
+ </li>
6
+ <%= render partial: "calagator/shared/subnav_curations", locals: { curations: Calagator::Curation.order_by_priority } %>
7
+ <%= render partial: "calagator/shared/subnav_pinned_venues", locals: { venues: Calagator::Venue.pinned } %>
8
+ <%= render partial: "calagator/venues/subnav_custom" %>
9
+ </ul>
10
+ <ul>
3
11
  <li><%= link_to 'Browse venues', venues_url,
4
12
  :class => subnav_class_for("venues", "index") %>
5
13
  </li>
@@ -10,7 +10,7 @@
10
10
  <div id='edit_link'>
11
11
  <p>
12
12
  You can <%= link_to "edit", edit_venue_url(@venue) %>
13
- or <%= link_to "delete", venue_url(@venue), method: :delete, data: { confirm: "Are you sure?" } %>
13
+ or <%= button_to "delete", venue_url(@venue), class: "a-like", form_class: "inline", method: :delete, data: { confirm: "Are you sure?" } %>
14
14
  this venue.
15
15
  </p>
16
16
  </div>
@@ -0,0 +1,17 @@
1
+ <div id="devise_header">
2
+ <% if current_user.present? %>
3
+ <% if current_user.admin? %>
4
+ <span>Signed in as <%= link_to display_username(current_user), admin_path %>
5
+ <% else %>
6
+ <span>Signed in as <%= display_username(current_user) %>
7
+ <% end %>
8
+ <span>-</span>
9
+ <%= button_to "Sign Out", destroy_user_session_path, method: :delete, class: "a-like", form_class: "inline" %>
10
+ <% else %>
11
+ <% if Calagator.open_registration %>
12
+ <%= link_to "Sign Up", new_user_registration_path %>
13
+ <span>or</span>
14
+ <% end %>
15
+ <%= link_to "Log In", new_user_session_path %>
16
+ <% end %>
17
+ </div>
@@ -1,6 +1,8 @@
1
1
  <div id="top_footer">
2
2
  <%= URI.parse(Calagator.url).host %>
3
- <%= source_code_version %>
3
+ -
4
+ <%= Calagator::GEMSPEC %>
5
+ <%= Calagator::VERSION %>
4
6
  &nbsp;
5
7
  &nbsp;
6
8
  &nbsp;
File without changes
@@ -9,6 +9,9 @@
9
9
  </ul>
10
10
  </div>
11
11
  <%= render partial: 'layouts/calagator/global_search' %>
12
+ <% if Calagator.devise_enabled %>
13
+ <%= render partial: 'layouts/calagator/devise' %>
14
+ <% end %>
12
15
  </div>
13
16
  </div>
14
17