mirror of
https://github.com/wekan/wekan.git
synced 2026-02-18 05:58:07 +01:00
fixed #5698
This commit is contained in:
parent
9c8b72100e
commit
a7755fa20c
3 changed files with 31 additions and 7 deletions
|
|
@ -24,6 +24,7 @@ template(name="boardActions")
|
|||
| {{_'r-the-board'}}
|
||||
div.trigger-dropdown
|
||||
select(id="board-id")
|
||||
option(value="" disabled selected if=not boards.length) {{loadingBoardsLabel}}
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||
|
|
@ -84,12 +85,13 @@ template(name="boardActions")
|
|||
div.trigger-text
|
||||
| {{_'r-the-board'}}
|
||||
div.trigger-dropdown
|
||||
select(id="board-id-link")
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||
else
|
||||
option(value="{{_id}}") {{title}}
|
||||
select(id="board-id-link")
|
||||
option(value="" disabled selected if=not boards.length) {{loadingBoardsLabel}}
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||
else
|
||||
option(value="{{_id}}") {{title}}
|
||||
div.trigger-text
|
||||
| {{_'r-in-list'}}
|
||||
div.trigger-dropdown
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {},
|
||||
onCreated() {
|
||||
// Ensure boards are available for the actions dropdowns. This subscription
|
||||
// is lightweight because the server publication already filters boards
|
||||
// to those visible to the user.
|
||||
this.subscribe('boards');
|
||||
},
|
||||
|
||||
boards() {
|
||||
const ret = ReactiveCache.getBoards(
|
||||
|
|
@ -19,6 +25,17 @@ BlazeComponent.extendComponent({
|
|||
return ret;
|
||||
},
|
||||
|
||||
loadingBoardsLabel() {
|
||||
// Provide a translated label when available, otherwise fallback to English
|
||||
try {
|
||||
const txt = TAPi18n.__('loading-boards');
|
||||
if (txt && !txt.startsWith("key '")) return txt;
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
return 'Loading boards...';
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue