From 409d71ed471703be8c56f2639a3ecb0fa387e6a7 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 4 Aug 2026 07:07:05 +0200 Subject: Give node lists a flag column and a shared action bar --- app/views/events/index.html.erb | 10 ++++++---- app/views/nodes/_node_list.html.erb | 40 +++++++++++++++++++++++++++---------- app/views/nodes/index.html.erb | 33 +----------------------------- app/views/users/_user.html.erb | 18 ++++++++--------- app/views/users/edit.html.erb | 4 ++-- 5 files changed, 48 insertions(+), 57 deletions(-) (limited to 'app/views') diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index a2710c2a..cc3f163d 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -22,10 +22,12 @@ <% @events.each do |event| %> - - <%= flag("clock-off", Event.human_attribute_name(:allday)) if event.allday %> - - <%= link_to event.display_title, event %> +
+ + <%= flag("clock-off", Event.human_attribute_name(:allday)) if event.allday %> + +
<%= link_to event.display_title, event %>
+
<%= admin_datetime(event.start_time) %> <%= admin_datetime(event.end_time) %> diff --git a/app/views/nodes/_node_list.html.erb b/app/views/nodes/_node_list.html.erb index 0dc3c5a0..458ab1ae 100644 --- a/app/views/nodes/_node_list.html.erb +++ b/app/views/nodes/_node_list.html.erb @@ -15,26 +15,46 @@ <%= will_paginate @nodes %> - - <% @nodes.each do |node| %> "> - - - + <% end %>
<%= t("admin.columns.id") %> <%= t("admin.columns.title") %> <%= t("admin.columns.actions") %><%= t("admin.columns.locked_by") %> <%= t("admin.columns.rev") %>
<%= node.id %> -

<%= link_to title_for_node(node), node_path(node) %>

-

<%= link_to_path(node.unique_name, node.unique_name) %>

+
+ + <%= flag("lock", t(".flag_locked", :login => node.lock_owner.login), + :tier => :attention) if node.lock_owner %> + <%= flag("calendar-clock", + t(".flag_embargo", :date => admin_datetime(node.head.published_at)), + :tier => :attention) if node.embargoed? %> + <%= flag("file-pencil", t(".flag_draft")) if node.draft %> + <%= flag("file-off", t(".flag_no_head")) unless node.head %> + +
+
<%= link_to title_for_node(node), node_path(node) %>
+
<%= link_to_path(node.unique_name, node.unique_name) %>
+
+
- <%= link_to 'show', node_path(node) %> - <%= link_to 'edit', edit_node_path(node) %> - <%= link_to 'revisions', node_revisions_path(node) %> +
+ + <%= link_to node_path(node), "aria-label" => t("admin.common.show"), + title: t("admin.common.show") do %> + <%= icon("eye", library: "tabler", "aria-hidden": true) %> + <% end %> + + + <%= link_to node_revisions_path(node), "aria-label" => t("admin.common.revisions"), + title: t("admin.common.revisions") do %> + <%= icon("history", library: "tabler", "aria-hidden": true) %> + <% end %> + +
<%= node.lock_owner.login if node.lock_owner %><%= node.draft ? node.draft.revision : (node.head ? node.head.revision : t(".no_revision")) %><%= node.head ? node.head.revision : t(".no_revision") %>
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 7ab5679e..357c938b 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb @@ -7,35 +7,4 @@ <%= t(".create_hint") %> -<%= will_paginate @nodes %> - - - - - - - - - <% @nodes.each do |node| %> - "> - - - - - - - <% end %> -
<%= t("admin.columns.id") %><%= t("admin.columns.title") %><%= t("admin.columns.actions") %><%= t("admin.columns.locked_by") %><%= t("admin.columns.rev") %>
<%= node.id %> -

<%= link_to title_for_node(node), node_path(node) %>

-

<%= link_to_path(node.unique_name, node.unique_name) %>

-
- <%= link_to 'show', node_path(node) %> - <%= link_to 'edit', edit_node_path(node) %> - <%= link_to 'revisions', node_revisions_path(node) %> - - <%= node.lock_owner.login if node.lock_owner %> - - <%= node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY") %> -
-<%= will_paginate @nodes %> - +<%= render 'node_list' %> diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index be92ad1d..028ee02f 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -27,17 +27,17 @@ <%= t(".no_roles") %> <% end %> - -
- + +
+ <%= link_to user_path(user), "aria-label" => t("admin.common.show"), title: t("admin.common.show") do %> <%= icon("eye", library: "tabler", "aria-hidden": true) %> <% end %> - - <% if current_user.admin? || current_user == user %> + + <% if current_user.is_admin? || current_user == user %> <%= link_to edit_user_path(user), "aria-label" => t("admin.common.edit"), title: t("admin.common.edit") do %> <%= icon("edit", library: "tabler", "aria-hidden": true) %> @@ -45,15 +45,15 @@ <% end %> - + <%= link_to admin_log_path(:user_id => user.id), "aria-label" => t(".action_log"), title: t(".action_log") do %> <%= icon("history", library: "tabler", "aria-hidden": true) %> <% end %> - - <% if current_user.admin? && current_user != user %> + + <% if current_user.is_admin? && current_user != user %> <% if user.alumni? %> <%= button_to reactivate_user_path(user), method: :put, form: { class: 'button_to state_changing' }, @@ -71,7 +71,7 @@ <% end %> - + <% if current_user.redaktion? && !user.alumni? %> <% if user.redaktion? %> <% unless user == current_user %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index ad2e0891..1763394d 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -20,7 +20,7 @@
<%= t("users.labels.confirm") %>
<%= f.password_field :password_confirmation, :autocomplete => "new-password" %>
- <% if current_user.admin? %> + <% if current_user.is_admin? %>
<%= t("users.labels.roles") %>
<% User::ROLES.each do |role| %> @@ -62,7 +62,7 @@ <% end %> <% end %>
- <% elsif current_user.admin? && @user.otp_enrolled? %> + <% elsif current_user.is_admin? && @user.otp_enrolled? %>
<%= t(".second_factor") %>
<%= t(".enabled") %> -- cgit v1.3