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

BC-7618 - Missing breadcrumbs #3476

Merged
merged 6 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion controllers/coursegroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ router.get('/:courseGroupId/', (req, res, next) => {
lessons,
doneSubmissions,
openSubmissions,
breadcrumb: [{
breadcrumbs: [{
title: res.$t("courses.headline.myCourses"),
url: '/rooms-overview',
},
Expand Down
2 changes: 1 addition & 1 deletion controllers/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ router.get('/:courseId/', async (req, res, next) => {
ltiTools,
courseGroups,
baseUrl,
breadcrumb: [
breadcrumbs: [
{
title: res.$t('courses.headline.myCourses'),
url: '/rooms-overview',
Expand Down
24 changes: 12 additions & 12 deletions controllers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const getBreadcrumbs = (req, dirId, breadcrumbs = []) => api(req).get(`/files/${
}

breadcrumbs.push({
label: directory.name,
title: directory.name,
id: directory._id,
});

Expand Down Expand Up @@ -565,7 +565,7 @@ router.get('/my/:folderId?/:subFolderId?', FileGetter, async (req, res, next) =>
.map(addThumbnails);

let breadcrumbs = [{
label: res.$t('files.label.myPersonalData'),
title: res.$t('files.label.myPersonalData'),
url: basePath,
}];

Expand Down Expand Up @@ -627,7 +627,7 @@ router.get('/shared/', (req, res) => {
title: res.$t('files.headline.sharedFiles'),
path: '/',
breadcrumbs: [{
label: res.$t('files.label.filesSharedWithMe'),
title: res.$t('files.label.filesSharedWithMe'),
url: '/files/shared/',
}],
canUploadFile: false,
Expand All @@ -651,7 +651,7 @@ router.get('/courses/', (req, res, next) => {
const basePath = '/files/courses/';
getScopeDirs(req, res, 'courses').then(async (directories) => {
const breadcrumbs = [{
label: res.$t('files.label.filesFromMyCourse'),
title: res.$t('files.label.filesFromMyCourse'),
url: basePath,
}];

Expand All @@ -673,10 +673,10 @@ router.get('/courses/:courseId/:folderId?', FileGetter, async (req, res, next) =
let canCreateFile = true;

let breadcrumbs = [{
label: res.$t('files.label.filesFromMyCourse'),
title: res.$t('files.label.filesFromMyCourse'),
url: basePath,
}, {
label: record.name,
title: record.name,
url: basePath + record._id,
}];

Expand Down Expand Up @@ -718,7 +718,7 @@ router.get('/teams/', (req, res, next) => {
const basePath = '/files/teams/';
getScopeDirs(req, res, 'teams').then(async (directories) => {
const breadcrumbs = [{
label: res.$t('files.label.filesFromMyTeam'),
title: res.$t('files.label.filesFromMyTeam'),
url: basePath,
}];

Expand All @@ -741,10 +741,10 @@ router.get('/teams/:teamId/:folderId?', FileGetter, async (req, res, next) => {
res.locals.files.files = res.locals.files.files.map(addThumbnails);

let breadcrumbs = [{
label: res.$t('files.label.filesFromMyTeam'),
title: res.$t('files.label.filesFromMyTeam'),
url: basePath,
}, {
label: team.name,
title: team.name,
url: basePath + team._id,
}];

Expand Down Expand Up @@ -792,7 +792,7 @@ router.get('/teams/:teamId/:folderId?', FileGetter, async (req, res, next) => {
router.get('/classes/', (req, res, next) => {
getScopeDirs(req, res, 'classes').then(async (directories) => {
const breadcrumbs = [{
label: res.$t('files.label.filesFromMyClasses'),
title: res.$t('files.label.filesFromMyClasses'),
url: '/files/classes/',
}];

Expand All @@ -813,10 +813,10 @@ router.get('/classes/:classId/:folderId?', FileGetter, (req, res, next) => {
const files = res.locals.files.map(addThumbnails);

let breadcrumbs = [{
label: res.$t('files.label.filesFromMyClasses'),
title: res.$t('files.label.filesFromMyClasses'),
url: req.query.CKEditor ? '#' : changeQueryParams(req.originalUrl, { dir: '' }, basePath),
}, {
label: record.name,
title: record.name,
url: changeQueryParams(req.originalUrl, { dir: '' }, basePath + record._id),
}];

Expand Down
10 changes: 5 additions & 5 deletions controllers/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ router.get('/releases', (req, res, next) => {
});

res.render('help/releases', {
breadcrumb: [
breadcrumbs: [
{
title: res.$t('help.headline.helpSection'),
url: '/help/articles',
Expand All @@ -62,7 +62,7 @@ router.get('/releases', (req, res, next) => {

router.get('/confluence/:id', (req, res, next) => {
res.render('help/confluence', {
breadcrumb: [
breadcrumbs: [
{
title: res.$t('help.headline.helpSection'),
url: '/help/articles',
Expand All @@ -76,7 +76,7 @@ router.get('/confluence/:id', (req, res, next) => {
router.get('/faq/people', (req, res, next) => {
res.render('help/people', {
title: res.$t('help.headline.contactDetails'),
breadcrumb: [
breadcrumbs: [
{
title: res.$t('help.headline.helpSection'),
url: '/help/articles',
Expand All @@ -88,7 +88,7 @@ router.get('/faq/people', (req, res, next) => {
router.get('/lernNuggets', (req, res, next) => {
res.render('help/lern-nuggets', {
title: res.$t('help.headline.privacyCourse'),
breadcrumb: [
breadcrumbs: [
{
title: res.$t('help.headline.helpSection'),
url: '/help/articles',
Expand All @@ -110,7 +110,7 @@ router.get('/faq/documents', async (req, res, next) => {

return res.render('help/accordion-sections', {
title: res.$t('help.headline.documentsToDownload'),
breadcrumb: [
breadcrumbs: [
{
title: res.$t('help.headline.helpSection'),
url: '/help/articles',
Expand Down
6 changes: 3 additions & 3 deletions controllers/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ router.get('/:teamId', async (req, res, next) => {
...course,
title: course.name,
activeTab: req.query.activeTab,
breadcrumb: [
breadcrumbs: [
{
title: res.$t('teams.headline.myTeams'),
url: '/teams',
Expand Down Expand Up @@ -1141,7 +1141,7 @@ router.get('/:teamId/members', async (req, res, next) => {
users: filteredUsers,
federalStates,
currentFederalState: currentFederalStateId,
breadcrumb: [
breadcrumbs: [
{
title: res.$t('teams.headline.myTeams'),
url: '/teams',
Expand Down Expand Up @@ -1351,7 +1351,7 @@ router.get('/:teamId/topics', async (req, res, next) => {
myhomeworks: homeworksData.filter((task) => task.private),
ltiToolIds,
courseGroups: courseGroupsData,
breadcrumb: [
breadcrumbs: [
{
title: res.$t('teams.headline.myTeams'),
url: '/teams',
Expand Down
2 changes: 1 addition & 1 deletion controllers/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ router.get('/:topicId', (req, res, next) => {
courseId: req.params.courseId,
isCourseGroupTopic: courseGroup._id !== undefined,
isTeacher,
breadcrumb: [{
breadcrumbs: [{
title: res.$t('courses.headline.myCourses'),
url: '/rooms-overview',
},
Expand Down
64 changes: 26 additions & 38 deletions views/files/files.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,33 @@

{{#content "page"}}
<div class="route-files">
<section class="section-title">
<div class="container-fluid">
<div class="row">
<h2 class="h5">
{{#each breadcrumbs}}
<a class="{{#if @last}}active{{/if}}" href="{{this.url}}" data-testid="file-section-title">{{{stripOnlyScript this.label}}}</a><span> /
</span>
{{/each}}
</h2>
</div>
</div>
</section>
<div style="clear: both">
{{#if useNextcloud}}
<a href="{{../nextcloudUrl}}" target="_blank" class="btn btn-add btn-primary pull-right{{#unless ../nextcloudUrl}}disabled{{/unless}}" style="margin-left: 5px">
<i class="fa fa-external-link" aria-hidden="true"></i>
{{$t "teams._team.files.button.toNextcloud"}}
<span class="tag">{{$t "teams._team.files.button.newTag"}}</span>
</a>
{{/if}}
<div style="clear: both">
{{#if useNextcloud}}
<a href="{{../nextcloudUrl}}" target="_blank" class="btn btn-add btn-primary pull-right{{#unless ../nextcloudUrl}}disabled{{/unless}}" style="margin-left: 5px">
<i class="fa fa-external-link" aria-hidden="true"></i>
{{$t "teams._team.files.button.toNextcloud"}}
<span class="tag">{{$t "teams._team.files.button.newTag"}}</span>
</a>
{{/if}}

{{#if courseUrl}}
<a href="{{courseUrl}}" data-testid="navigate-to-course-btn" class="btn btn-secondary pull-right">
<i class="fa fa-users"></i>
{{ toCourseText }}
</a>
{{/if}}
</div>
<div style="clear: both">
{{#if useNextcloud}}
<div class="alert info-custom" role="alert">
<i class="fa fa-info-circle pr-1"></i>
<div>{{{$t "info.text.nextcloudLink" (dict "title" theme.title)}}}</div>
</div>
{{/if}}
</div>
{{#if canUploadFile}}
{{#embed "files/file-upload"}}{{/embed}}
{{/if}}
{{#if courseUrl}}
<a href="{{courseUrl}}" data-testid="navigate-to-course-btn" class="btn btn-secondary pull-right">
<i class="fa fa-users"></i>
{{ toCourseText }}
</a>
{{/if}}
</div>
<div style="clear: both">
{{#if useNextcloud}}
<div class="alert info-custom" role="alert">
<i class="fa fa-info-circle pr-1"></i>
<div>{{{$t "info.text.nextcloudLink" (dict "title" theme.title)}}}</div>
</div>
{{/if}}
</div>
{{#if canUploadFile}}
{{#embed "files/file-upload"}}{{/embed}}
{{/if}}
{{#if sortOptions}}
<div class="pull-right personal-files-filter">
<label for="sortBy" style="position: absolute;left:-999px;">{{$t "files.label.sortBy"}}</label>
Expand Down
93 changes: 46 additions & 47 deletions views/lib/loggedin.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,6 @@
<a class="sc-branding" href="/" title="{{$t "global.link.landing"}}" data-testid="{{$t "global.link.landing"}}">
<div class="cloud-logo"></div>
</a>
{{#if breadcrumb}}
<ol class="breadcrumb">
{{#each breadcrumb}}
{{#if this.title}}
<li class="breadcrumb-item {{this.class}}">
<a href="{{this.url}}">{{{stripOnlyScript this.title}}}</a>
</li>
{{/if}}
{{/each}}
</ol>
{{/if}}

<ul class="nav navbar-nav float-xs-none dropdowns">
<li class="nav-item alert-button">
<div class="dropdown minimal-button minimal-button-loggedin">
Expand Down Expand Up @@ -252,41 +240,52 @@
{{/hasConfig}}

<section class="section-title">
<div class="container-fluid">
<div class="row" id="titlebar">
<div class="col-sm-9">
{{#unless notitle}}
{{#if title}}
<div>
<h1 class="h4" id="page-title" data-testid="{{title}}">{{{stripOnlyScript title}}}</h1>
</div>
{{/if}}
{{/unless}}
<div>
{{subtitle}}
</div>
</div>
{{#if showSearch}}
<div id="searchBar" class="col-sm-3 hide-inline">
{{#unless liveSearch}}<form class="search-wrapper" action="{{#if searchLabel}}{{searchAction}}{{else}}/content/{{/if}}" method="get">{{/unless}}
<a href="" class="mobile-search-toggle" aria-label="{{$t "global.lib.loggedin.label.search"}}">
{{#unless liveSearch}}<i class="fa fa-search"></i>{{/unless}}
</a>
<div class="input-group input-group-sm">
<label for="search-box" hidden>{{#if searchLabel}}{{truncatePure searchLabel21}}{{else}}{{$t "lib.loggedin.input.searchFor"}}{{/if}}</label>
<input id="search-box" type="text" class="{{#if liveSearch}}js-search{{/if}} form-control search-field {{searchClass}}" placeholder="{{#if searchLabel}}{{truncatePure searchLabel 21}}{{else}}{{$t "lib.loggedin.input.searchFor"}}{{/if}}" name="q" />
{{> "lib/components/csrfInput"}}
<span class="input-group-btn">
<button type="submit" class="btn btn-secondary" aria-label="{{#if searchLabel}}{{truncatePure searchLabel 21}}{{else}}{{$t "lib.loggedin.input.searchFor"}}{{/if}}">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</div>
{{#unless liveSearch}}</form>{{/unless}}
</div>
{{/if}}
</div>
</div>
<div class="container-fluid">
<div class="row" id="titlebar">
<div class="col-sm-9">
{{#if this.breadcrumbs}}
<div style="margin-bottom: 0.4rem; font-size: 14px;">
<span>
{{#each this.breadcrumbs}}
{{#if this.title}}
<a class="{{#if @last}}active{{/if}}" href="{{this.url}}">{{{stripOnlyScript this.title}}} </a> /
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the space before closing
you could add remove the space and &nbsp; / &nbsp; but that is also not good.... best is to use css

{{/if}}
{{/each}}
</span>
</div>
{{/if}}
{{#unless notitle}}
{{#if title}}
<div>
<h1 class="h4" id="page-title" data-testid="{{title}}">{{{stripOnlyScript title}}}</h1>
</div>
{{/if}}
{{/unless}}
<div>
{{subtitle}}
</div>
</div>
{{#if showSearch}}
<div id="searchBar" class="col-sm-3 hide-inline">
{{#unless liveSearch}}<form class="search-wrapper" action="{{#if searchLabel}}{{searchAction}}{{else}}/content/{{/if}}" method="get">{{/unless}}
<a href="" class="mobile-search-toggle" aria-label="{{$t "global.lib.loggedin.label.search"}}">
{{#unless liveSearch}}<i class="fa fa-search"></i>{{/unless}}
</a>
<div class="input-group input-group-sm">
<label for="search-box" hidden>{{#if searchLabel}}{{truncatePure searchLabel21}}{{else}}{{$t "lib.loggedin.input.searchFor"}}{{/if}}</label>
<input id="search-box" type="text" class="{{#if liveSearch}}js-search{{/if}} form-control search-field {{searchClass}}" placeholder="{{#if searchLabel}}{{truncatePure searchLabel 21}}{{else}}{{$t "lib.loggedin.input.searchFor"}}{{/if}}" name="q" />
{{> "lib/components/csrfInput"}}
<span class="input-group-btn">
<button type="submit" class="btn btn-secondary" aria-label="{{#if searchLabel}}{{truncatePure searchLabel 21}}{{else}}{{$t "lib.loggedin.input.searchFor"}}{{/if}}">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</div>
{{#unless liveSearch}}</form>{{/unless}}
</div>
{{/if}}
</div>
</div>
</section>

<p id="preferences" hidden>{{ json currentUser.preferences }}</p>
Expand Down
Loading