mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
A feature's guide now sits under the menu it is used from, read from the templates rather than from where somebody once put it: Header-Bar, All-Boards, Pages, Board-Header (search and every Board View), Board-Sidebar (Board Settings, Filter, Members, Labels, Archive), Rules, Swimlanes, Lists, Cards, Member-Settings, Admin-Panel and Login-Page. Topics used from several menus (editor, history, theme, translations, email, troubleshooting) are in General. - Each area has a README mapping its menu entries to their guides and to the template or server module that implements them. Board-Header/README.md lists all 40 Board View entries with the template boardBody.jade renders; five views (Table, Calendar Mode, Time, Timeline, Map) have no guide of their own yet and say so. - Board-View.md listed 25 views while BOARD_VIEWS has 40; it now lists all of them with their English labels. - Pages keep their file names. Where a released changelog links an old path, a "# Moved" page stays there and points to the new one; test-menu.sh skips folders holding only those. - Undo was filed under Login; it is General/Undo now. - Every link in docs, code comments, scripts and tests follows the move; docsLinksResolve checks them all. Tests that read a doc follow it to its new place. boardViewSettings now fails when Board-View.md or Board-Header/README.md differs from BOARD_VIEWS, or names a template boardBody.jade does not render. Thanks to xet7 !
51 lines
1.8 KiB
JavaScript
51 lines
1.8 KiB
JavaScript
import { ReactiveCache } from '/imports/reactiveCache';
|
|
import { Session } from 'meteor/session';
|
|
import { TAPi18n } from '/imports/i18n';
|
|
import AccessibilitySettings from '/models/accessibilitySettings';
|
|
|
|
// The three pages that carry a name of their own: an admin can rename Support
|
|
// and Accessibility, and Import names the source it is importing from.
|
|
//
|
|
// They live HERE, not in the pages themselves, because the top header bar has
|
|
// to ask for them and the header is loaded by the layout - that is, very early.
|
|
// Importing a page's own module from the header pulls that module into the
|
|
// header's graph and runs it before its .jade has registered, so
|
|
// `Template.import.onCreated` was `undefined.onCreated`: a TypeError at module
|
|
// load, which aborts every module after it. That is why `connectionMethod` and
|
|
// the rest went missing at the same time.
|
|
//
|
|
// This module registers no template and touches no DOM, so it is safe to load
|
|
// at any point. models/lib/pageTitles.js, docs/Features/Header-Bar/Header.md
|
|
|
|
export function supportPageTitle() {
|
|
const setting = ReactiveCache.getCurrentSetting();
|
|
return (setting && setting.supportTitle) || '';
|
|
}
|
|
|
|
export function accessibilityPageTitle() {
|
|
const setting = AccessibilitySettings.findOne({});
|
|
return (setting && setting.title) || '';
|
|
}
|
|
|
|
const IMPORT_SOURCE_NAMES = {
|
|
trello: 'Trello',
|
|
wekan: 'JSON',
|
|
csv: 'CSV-TSV',
|
|
excel: 'Excel',
|
|
jira: 'Jira',
|
|
kanboard: 'Kanboard',
|
|
deck: 'NextCloud Deck',
|
|
openproject: 'OpenProject',
|
|
github: 'GitHub',
|
|
gitlab: 'GitLab',
|
|
gitea: 'Gitea',
|
|
forgejo: 'Forgejo',
|
|
asana: 'Asana',
|
|
zenkit: 'Zenkit',
|
|
};
|
|
|
|
export function importPageTitle() {
|
|
const sourceName = IMPORT_SOURCE_NAMES[Session.get('importSource')] || 'JSON';
|
|
return `${TAPi18n.__('import')} / ${sourceName}`;
|
|
}
|