summaryrefslogtreecommitdiff
path: root/app/views/events/index.html.erb
blob: 3116dfc1b708c29915a3b92b88fbb0150e1cbadb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<%= render "shared/page_actions",
      :title => t(".title"),
      :icon_name => "calendar-plus",
      :label => t(".create_event"),
      :options => [[t(".create_event"), new_event_path]] %>

<%= render "shared/search_form", :placeholder => t(".search_placeholder") %>

<%= will_paginate @events %>

<table class="admin_table events_table">
  <thead>
    <tr class="header">
      <th><%= t("admin.columns.title") %></th>
      <th><%= t(".when") %></th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @events.each do |event| %>
    <tr>
      <td class="title">
        <div class="title_with_flags">
          <span class="flag_stack">
            <%= flag("hours-24", Event.human_attribute_name(:allday)) if event.allday %>
            <%= flag("sticker", t(".flag_own_title")) if event.title.present? %>
          </span>
          <div class="title_body">
            <div class="row_primary event_title"><%= link_to event.display_title, event %></div>
            <% if event.node %>
              <div class="row_secondary event_meta">
                <%= icon("file", library: "tabler", "aria-hidden": true) %>
                <%= link_to event.node.unique_name, node_path(event.node) %>
              </div>
            <% end %>
            <% if event.url.present? %>
              <div class="row_secondary event_meta">
                <%= icon("external-link", library: "tabler", "aria-hidden": true) %>
                <%= external_url_link(event.url) %>
              </div>
            <% end %>
          </div>
        </div>
      </td>
      <td class="event_when">
        <div class="when_body">
          <% if event.rrule.present? %>
            <% if event.humanize_rrule %>
              <span title="<%= event.rrule %>"><%= event_schedule_text(event) %></span>
            <% else %>
              <span class="rrule_raw" title="<%= event.rrule %>">
                <%= t("events.schedule.unreadable") %>
              </span>
              <% if event.start_time %>
                <div class="row_secondary event_meta"><%= admin_date(event.start_time) %></div>
              <% end %>
            <% end %>
          <% else %>
            <%= event_date_range(event) %>
          <% end %>
        </div>
      </td>
      <td class="actions">
        <div class="action_grid">
          <span class="action_item">
            <%= link_to event_path(event), "aria-label" => t("admin.common.show"),
                  title: t("admin.common.show") do %>
              <%= icon("eye", library: "tabler", "aria-hidden": true) %>
            <% end %>
          </span>
          <span class="action_item">
            <%= link_to edit_event_path(event), "aria-label" => t("admin.common.edit"),
                  title: t("admin.common.edit") do %>
              <%= icon("edit", library: "tabler", "aria-hidden": true) %>
            <% end %>
          </span>
        </div>
      </td>
    </tr>
    <% end %>
  </tbody>
</table>