diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/assets/index.html.erb | 10 | ||||
| -rw-r--r-- | app/views/events/index.html.erb | 12 | ||||
| -rw-r--r-- | app/views/menu_items/index.html.erb | 10 | ||||
| -rw-r--r-- | app/views/nodes/_node_list.html.erb | 8 | ||||
| -rw-r--r-- | app/views/nodes/index.html.erb | 14 | ||||
| -rw-r--r-- | app/views/shared/_page_actions.html.erb | 32 | ||||
| -rw-r--r-- | app/views/users/_user.html.erb | 6 | ||||
| -rw-r--r-- | app/views/users/index.html.erb | 18 |
8 files changed, 64 insertions, 46 deletions
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index 81d2686a..af11f54f 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <%= render "shared/page_actions", |
| 2 | 2 | :title => t(".title"), | |
| 3 | <%= link_to new_asset_path, class: 'action_button' do %> | 3 | :icon_name => "photo-plus", |
| 4 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_asset") %> | 4 | :label => t(".create_asset"), |
| 5 | <% end %> | 5 | :options => [[t(".create_asset"), new_asset_path]] %> |
| 6 | 6 | ||
| 7 | <%= will_paginate @assets %> | 7 | <%= will_paginate @assets %> |
| 8 | 8 | ||
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index cc3f163d..c4f0a7f9 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb | |||
| @@ -1,10 +1,8 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <%= render "shared/page_actions", |
| 2 | 2 | :title => t(".title"), | |
| 3 | <div class="button_row"> | 3 | :icon_name => "calendar-plus", |
| 4 | <%= link_to new_event_path, class: 'action_button' do %> | 4 | :label => t(".create_event"), |
| 5 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_event") %> | 5 | :options => [[t(".create_event"), new_event_path]] %> |
| 6 | <% end %> | ||
| 7 | </div> | ||
| 8 | 6 | ||
| 9 | <%= will_paginate @events %> | 7 | <%= will_paginate @events %> |
| 10 | 8 | ||
diff --git a/app/views/menu_items/index.html.erb b/app/views/menu_items/index.html.erb index 0eacc34a..b1c235da 100644 --- a/app/views/menu_items/index.html.erb +++ b/app/views/menu_items/index.html.erb | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <%= render "shared/page_actions", |
| 2 | 2 | :title => t(".title"), | |
| 3 | <%= link_to new_menu_item_path, class: 'action_button' do %> | 3 | :icon_name => "list-details", |
| 4 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_item") %> | 4 | :label => t(".create_item"), |
| 5 | <% end %> | 5 | :options => [[t(".create_item"), new_menu_item_path]] %> |
| 6 | 6 | ||
| 7 | <p class="field_hint"><%= t(".reorder_hint") %></p> | 7 | <p class="field_hint"><%= t(".reorder_hint") %></p> |
| 8 | 8 | ||
diff --git a/app/views/nodes/_node_list.html.erb b/app/views/nodes/_node_list.html.erb index 458ab1ae..f3101058 100644 --- a/app/views/nodes/_node_list.html.erb +++ b/app/views/nodes/_node_list.html.erb | |||
| @@ -14,11 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | <%= will_paginate @nodes %> | 15 | <%= will_paginate @nodes %> |
| 16 | <table class="node_table"> | 16 | <table class="node_table"> |
| 17 | <tr class="header"> | ||
| 18 | <th class="title"><%= t("admin.columns.title") %></th> | ||
| 19 | <th class="actions"><%= t("admin.columns.actions") %></th> | ||
| 20 | <th class="revision"><%= t("admin.columns.rev") %></th> | ||
| 21 | </tr> | ||
| 22 | <% @nodes.each do |node| %> | 17 | <% @nodes.each do |node| %> |
| 23 | <tr class="<%= cycle("even", "odd") %>"> | 18 | <tr class="<%= cycle("even", "odd") %>"> |
| 24 | <td class="title"> | 19 | <td class="title"> |
| @@ -30,7 +25,7 @@ | |||
| 30 | t(".flag_embargo", :date => admin_datetime(node.head.published_at)), | 25 | t(".flag_embargo", :date => admin_datetime(node.head.published_at)), |
| 31 | :tier => :attention) if node.embargoed? %> | 26 | :tier => :attention) if node.embargoed? %> |
| 32 | <%= flag("file-pencil", t(".flag_draft")) if node.draft %> | 27 | <%= flag("file-pencil", t(".flag_draft")) if node.draft %> |
| 33 | <%= flag("file-off", t(".flag_no_head")) unless node.head %> | 28 | <%= flag("world-off", t(".flag_no_head")) unless node.head %> |
| 34 | </span> | 29 | </span> |
| 35 | <div class="title_body"> | 30 | <div class="title_body"> |
| 36 | <div class="node_title"><%= link_to title_for_node(node), node_path(node) %></div> | 31 | <div class="node_title"><%= link_to title_for_node(node), node_path(node) %></div> |
| @@ -54,7 +49,6 @@ | |||
| 54 | </span> | 49 | </span> |
| 55 | </div> | 50 | </div> |
| 56 | </td> | 51 | </td> |
| 57 | <td><%= node.head ? node.head.revision : t(".no_revision") %></td> | ||
| 58 | </tr> | 52 | </tr> |
| 59 | <% end %> | 53 | <% end %> |
| 60 | </table> | 54 | </table> |
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 357c938b..b88eca06 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb | |||
| @@ -1,10 +1,8 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <%= render "shared/page_actions", |
| 2 | 2 | :title => t(".title"), | |
| 3 | <div> | 3 | :icon_name => "file-plus", |
| 4 | <%= link_to new_node_path, class: 'action_button' do %> | 4 | :label => t(".create_node"), |
| 5 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_node") %> | 5 | :options => [[t(".create_node"), new_node_path]], |
| 6 | <% end %> | 6 | :hint => t(".create_hint") %> |
| 7 | <span class="field_hint"><%= t(".create_hint") %></span> | ||
| 8 | </div> | ||
| 9 | 7 | ||
| 10 | <%= render 'node_list' %> | 8 | <%= render 'node_list' %> |
diff --git a/app/views/shared/_page_actions.html.erb b/app/views/shared/_page_actions.html.erb new file mode 100644 index 00000000..66aeb785 --- /dev/null +++ b/app/views/shared/_page_actions.html.erb | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | <div class="page_actions"> | ||
| 2 | <h1><%= title %></h1> | ||
| 3 | |||
| 4 | <% if options.size == 1 %> | ||
| 5 | <%= link_to options.first.last, class: "action_button", | ||
| 6 | "aria-label" => options.first.first, title: options.first.first do %> | ||
| 7 | <%= icon(icon_name, library: "tabler", "aria-hidden": true) %> | ||
| 8 | <% end %> | ||
| 9 | <% else %> | ||
| 10 | <div class="page_action_group"> | ||
| 11 | <details class="action_menu"> | ||
| 12 | <summary class="action_button" aria-label="<%= label %>" title="<%= label %>"> | ||
| 13 | <%= icon(icon_name, library: "tabler", "aria-hidden": true) %> | ||
| 14 | <%= icon("chevron-down", library: "tabler", "aria-hidden": true) %> | ||
| 15 | </summary> | ||
| 16 | <div class="action_menu_items"> | ||
| 17 | <% options.each do |option_label, path| %> | ||
| 18 | <%= link_to option_label, path, class: "action_button" %> | ||
| 19 | <% end %> | ||
| 20 | </div> | ||
| 21 | </details> | ||
| 22 | |||
| 23 | <% if local_assigns[:hint].present? %> | ||
| 24 | <details class="action_hint"> | ||
| 25 | <summary aria-label="<%= t("admin.common.explain") %>" | ||
| 26 | title="<%= t("admin.common.explain") %>">?</summary> | ||
| 27 | <p><%= hint %></p> | ||
| 28 | </details> | ||
| 29 | <% end %> | ||
| 30 | </div> | ||
| 31 | <% end %> | ||
| 32 | </div> | ||
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index 028ee02f..e70c7032 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb | |||
| @@ -79,7 +79,7 @@ | |||
| 79 | form: { data: { confirm: t(".confirm_revoke_redaktion", :login => user.login) }, | 79 | form: { data: { confirm: t(".confirm_revoke_redaktion", :login => user.login) }, |
| 80 | class: 'button_to destructive' }, | 80 | class: 'button_to destructive' }, |
| 81 | "aria-label" => t(".revoke_redaktion"), title: t(".revoke_redaktion") do %> | 81 | "aria-label" => t(".revoke_redaktion"), title: t(".revoke_redaktion") do %> |
| 82 | <%= icon("user-minus", library: "tabler", "aria-hidden": true) %> | 82 | <%= icon("users-minus", library: "tabler", "aria-hidden": true) %> |
| 83 | <% end %> | 83 | <% end %> |
| 84 | <% end %> | 84 | <% end %> |
| 85 | <% elsif user.otp_enrolled? %> | 85 | <% elsif user.otp_enrolled? %> |
| @@ -87,13 +87,13 @@ | |||
| 87 | form: { data: { confirm: t(".confirm_grant_redaktion", :login => user.login) }, | 87 | form: { data: { confirm: t(".confirm_grant_redaktion", :login => user.login) }, |
| 88 | class: 'button_to state_changing' }, | 88 | class: 'button_to state_changing' }, |
| 89 | "aria-label" => t(".grant_redaktion"), title: t(".grant_redaktion") do %> | 89 | "aria-label" => t(".grant_redaktion"), title: t(".grant_redaktion") do %> |
| 90 | <%= icon("user-plus", library: "tabler", "aria-hidden": true) %> | 90 | <%= icon("users-plus", library: "tabler", "aria-hidden": true) %> |
| 91 | <% end %> | 91 | <% end %> |
| 92 | <% else %> | 92 | <% else %> |
| 93 | <button type="button" class="disabled_action" disabled | 93 | <button type="button" class="disabled_action" disabled |
| 94 | title="<%= t(".grant_redaktion_blocked") %>" | 94 | title="<%= t(".grant_redaktion_blocked") %>" |
| 95 | aria-label="<%= t(".grant_redaktion_blocked") %>"> | 95 | aria-label="<%= t(".grant_redaktion_blocked") %>"> |
| 96 | <%= icon("user-plus", library: "tabler", "aria-hidden": true) %> | 96 | <%= icon("users-plus", library: "tabler", "aria-hidden": true) %> |
| 97 | </button> | 97 | </button> |
| 98 | <% end %> | 98 | <% end %> |
| 99 | <% end %> | 99 | <% end %> |
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 2936bbea..71102c2c 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb | |||
| @@ -1,14 +1,10 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <%= render "shared/page_actions", |
| 2 | 2 | :title => t(".title"), | |
| 3 | <p class="button_row"> | 3 | :icon_name => "user-plus", |
| 4 | <% UsersController::ROLE_PRESETS.each_key do |preset| %> | 4 | :label => t(".create_account"), |
| 5 | <%= link_to new_user_path(:preset => preset), class: 'action_button' do %> | 5 | :options => UsersController::ROLE_PRESETS.each_key.map { |preset| |
| 6 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> | 6 | [t(".create_#{preset}"), new_user_path(:preset => preset)] }, |
| 7 | <%= t(".create_#{preset}") %> | 7 | :hint => t(".admin_hint") %> |
| 8 | <% end %> | ||
| 9 | <% end %> | ||
| 10 | </p> | ||
| 11 | <p class="field_hint"><%= t(".admin_hint") %></p> | ||
| 12 | 8 | ||
| 13 | <% UsersController::GROUP_ORDER.each do |group| %> | 9 | <% UsersController::GROUP_ORDER.each do |group| %> |
| 14 | <% members = @users[group] || [] %> | 10 | <% members = @users[group] || [] %> |
