Merge pull request #3138 from mlorb/ml-sci-5456

Change the title Projects to folder/subfolder title [SCI-5456]
This commit is contained in:
mlorb 2021-02-05 13:50:13 +01:00 committed by GitHub
commit 480893c8c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View file

@ -495,6 +495,7 @@
},
success: function(data) {
$('#breadcrumbsWrapper').html(data.breadcrumbs_html);
$(projectsWrapper).find('.projects-title').html(data.title);
$(toolbarWrapper).html(data.toolbar_html);
viewContainer.data('projects-cards-url', data.projects_cards_url);
viewContainer.removeClass('no-results');

View file

@ -31,6 +31,7 @@ class ProjectsController < ApplicationController
def cards
overview_service = ProjectsOverviewService.new(current_team, current_user, current_folder, params)
title = params[:view_mode] == 'archived' ? t('projects.index.head_title_archived') : t('projects.index.head_title')
if filters_included?
render json: {
@ -44,6 +45,7 @@ class ProjectsController < ApplicationController
render json: {
projects_cards_url: current_folder ? project_folder_cards_url(current_folder) : cards_projects_url,
breadcrumbs_html: current_folder ? render_to_string(partial: 'projects/index/breadcrumbs.html.erb') : '',
title: current_folder ? current_folder&.name : title,
toolbar_html: render_to_string(partial: 'projects/index/toolbar.html.erb'),
cards_html: render_to_string(
partial: 'projects/index/team_projects.html.erb',

View file

@ -11,7 +11,7 @@
<% end %>
<div id="projectsWrapper" class="content-pane flexible projects-index <%= projects_view_mode %>" data-view-mode="<%= projects_view_mode %>">
<%= render partial: 'projects/index/header' %>
<%= render partial: 'projects/index/header', locals: { current_folder: current_folder} %>
<span style="display: none;" data-hook="projects-index-html"></span>

View file

@ -1,7 +1,10 @@
<div class="content-header sticky-header">
<div class="title-row">
<h1 data-view-mode="active"><%= t('projects.index.head_title') %></h1>
<h1 data-view-mode="archived"><i class="fas fa-archive"></i>&nbsp;<%= t('projects.index.head_title_archived') %></h1>
<h1 data-view-mode="active" class="projects-title"><%= current_folder&.name || t('projects.index.head_title') %></h1>
<h1 data-view-mode="archived">
<i class="fas fa-archive"></i>&nbsp;
<span class="projects-title"><%= current_folder&.name || t('projects.index.head_title_archived') %></span>
</h1>
<div class="sci-btn-group header-actions">
<%= render layout: 'shared/view_switch', locals: { disabled: false } do %>