Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[53809] Update PageHeaders & SubHeaders in the (rails) global index pages #16769

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions app/components/add_button_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<li class="<%= li_css_class %>">
<a href="<%= dynamic_path %>"
id="<%= id %>"
title="<%= title %>"
arial-label="<%= aria_label %>"
class="<%= link_css_class %>">
<%= icon %>
<%= label %>
</a>
</li>
<a href="<%= dynamic_path %>"
id="<%= id %>"
title="<%= title %>"
arial-label="<%= aria_label %>"
class="<%= link_css_class %>">
<%= icon %>
<%= label %>
</a>

4 changes: 0 additions & 4 deletions app/components/add_button_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ def id
raise "Implement the id for this component"
end

def li_css_class
"toolbar-item"
end

def title
accessibility_label_text
end
Expand Down
12 changes: 10 additions & 2 deletions app/views/activities/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ See COPYRIGHT and LICENSE files for more details.

<%= call_hook :activity_index_head %>

<%= toolbar title: (@author.nil? ? t(:label_activity) : t(:label_user_activity, value: link_to_user(@author))).html_safe,
subtitle: t(:label_date_from_to, start: format_date(@date_to - @days), end: format_date(@date_to-1))
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { (@author.nil? ? t(:label_activity) : t(:label_user_activity, value: link_to_user(@author))) }
header.with_breadcrumbs([t(:label_activity)])
end
%>
<%=
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_text {t(:label_date_from_to, start: format_date(@date_to - @days), end: format_date(@date_to-1))}
end
%>

<%= render(Activities::DaysComponent.new(events: @events, current_project: @project, activity_page: @activity_page)) %>
Expand Down
8 changes: 7 additions & 1 deletion app/views/homescreen/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.

++#%>
<% breadcrumb_paths(nil) %>
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { I18n.t("label_home") }
header.with_breadcrumbs([I18n.t(:label_home)])
end
%>

<h2 class="headline--application">
<span><%= organization_icon %></span>
<%= organization_name %>
Expand Down
34 changes: 20 additions & 14 deletions app/views/news/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ See COPYRIGHT and LICENSE files for more details.
managable = User.current.allowed_in_project?(:manage_news, @project)
%>

<% html_title(t(:label_news_plural)) -%>
<%= toolbar title: t(:label_news_plural) do %>
<% if managable %>
<li class="toolbar-item">
<%= link_to new_project_news_path(@project),
{ class: 'button -primary',
id: 'new_news_link',
aria: {label: t(:label_news_new)},
title: t(:label_news_new)} do %>
<%= op_icon('button--icon icon-add') %>
<span class="button--text"><%= t(:label_news_singular) %></span>
<% end %>
</li>
<% end %>
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:label_news_plural) }
header.with_breadcrumbs([t(:label_news_plural)])
end
%>
<% if managable %>
<%=
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(scheme: :primary,
aria: { label: t(:label_news_new)},
title: I18n.t(:label_work_package_status_new),
tag: :a,
id: 'new_news_link',
href: new_project_news_path(@project)) do |button|
button.with_leading_visual_icon(icon: :plus)
t(:label_news_singular)
end
end
%>
<% end %>

<% if @newss.any? %>
Expand Down
17 changes: 14 additions & 3 deletions modules/boards/app/views/boards/boards/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,20 @@ See COPYRIGHT and LICENSE files for more details.

<% html_title(t('boards.label_boards')) -%>

<%= toolbar title: t('boards.label_boards') do %>
<%= render Boards::AddButtonComponent.new(current_project: @project) %>
<% end %>
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t("boards.label_boards") }
header.with_breadcrumbs([t("boards.label_boards")])
end
%>

<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render Boards::AddButtonComponent.new(current_project: @project)
end
end
%>

<% if @board_grids.empty? -%>
<%= no_results_box %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<li class="<%= li_css_class %>">
<a href="<%= dynamic_path %>"
id="<%= id %>"
title="<%= title %>"
arial-label="<%= aria_label %>"
class="<%= link_css_class %>">
<%= icon %>
<%= label %>
</a>
</li>
<a href="<%= dynamic_path %>"
id="<%= id %>"
title="<%= title %>"
arial-label="<%= aria_label %>"
class="<%= link_css_class %>">
<%= icon %>
<%= label %>
</a>
18 changes: 15 additions & 3 deletions modules/calendar/app/views/calendar/calendars/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,20 @@ See COPYRIGHT and LICENSE files for more details.
++#%>

<% html_title(t(:label_calendar_plural)) -%>
<%= toolbar title: t(:label_calendar_plural) do %>
<%= render Calendar::AddButtonComponent.new(current_project: @project) %>
<% end %>
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:label_calendar_plural) }
header.with_breadcrumbs([t(:label_calendar_plural)])
end
%>

<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render Calendar::AddButtonComponent.new(current_project: @project)
end
end
%>


<%= render ::Calendar::TableComponent.new(rows: @views, current_project: @project, current_user: current_user) %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<% html_title(t('team_planner.label_team_planner_plural')) -%>
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t('team_planner.label_team_planner_plural') }
header.with_breadcrumbs([t('team_planner.label_team_planner_plural')])
end
%>

<%= toolbar title: t(:'team_planner.label_team_planner_plural') do %>
<%= render ::TeamPlanner::AddButtonComponent.new %>
<% end %>
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render ::TeamPlanner::AddButtonComponent.new
end
end
%>

<%= render ::TeamPlanner::Overview::TableComponent.new(rows: @views, current_user: current_user) %>
Loading