Skip to content

Commit

Permalink
fix #77: Prepend empty merger option
Browse files Browse the repository at this point in the history
  • Loading branch information
quafzi committed Mar 24, 2017
1 parent 382892a commit ab10d25
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/app/shell/merger.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const methods = (userSettings, settingsApi, exampleMergers) => {
function examplesView (scope) {
if (Object.keys(scope.examples()).length) {
const options = Object.keys(scope.examples())
options.unshift(t('shell.merger.example.own')) // prepend option to add own merger
options.unshift(t('shell.merger.example.none')) // prepend empty option
return m('.examples.column', m('select.form-control', {
onchange: (e) => {
Expand All @@ -59,7 +60,7 @@ function examplesView (scope) {
scope.query(scope.examples()[e.target.value] || 'rows')
scope.update(scope.examples()[e.target.value] || 'rows')
codemirror.reload(scope.query())
if (e.target.value === t('shell.merger.example.none')) {
if (e.target.value === t('shell.merger.example.own')) {
scope.origName = e.target.value
scope.showDetails = true
}
Expand All @@ -76,9 +77,9 @@ function inputView (scope) {
const BR = "\n"
const buttons = []
const code = scope.query()
if (scope.name !== t('shell.merger.example.none') && code && code.trim().length) {
if (scope.name !== t('shell.merger.example.own') && code && code.trim().length) {
const isCustom = (scope.origName &&
scope.origName !== t('shell.merger.example.none') &&
scope.origName !== t('shell.merger.example.own') &&
scope.origName !== t('shell.merger.example.groupByActivity')
)
if (isCustom) {
Expand Down
3 changes: 2 additions & 1 deletion src/translations/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ module.exports = {
'shell.merger.button.update.label': 'Überschreiben',
'shell.merger.description': 'Du kannst die Einträge nach Belieben verändern. Nutze dafür eigenen Code oder wähle aus den Vorlagen:',
'shell.merger.example.groupByActivity': 'nach Aktivität zusammenfassen',
'shell.merger.example.none': 'eigener Code',
'shell.merger.example.own': 'eigener Code',
'shell.merger.example.none': '–',
'tag.add': 'Ein neues Tag hinzufügen',
'tag.property.name': 'Name des Tags',
'tag.list.disabled.empty': 'Ich habe keine inaktiven Tags gefunden.',
Expand Down
11 changes: 9 additions & 2 deletions src/translations/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,15 @@ module.exports = {
'service.remove.confirm': 'Won\'t you offer {service} anymore?',
'shell.activity.placeholder': 'Add activity ({shortcut})',
'shell.filter.placeholder': 'Filter list ({shortcut})',
'shell.merger.example.none': 'custom code',
'shell.merger.example.groupByActivity': 'merge by activity',
'shell.merger.button.create.label': 'Add',
'shell.merger.button.delete.label': 'Delete',
'shell.merger.button.update.label': 'Overwrite',
'shell.merger.codename.label': 'This code should',
'shell.merger.description': 'You may modify these items as you want. Use your own code or choose from the existing ones:',
'shell.merger.example.groupByActivity': 'group by activity',
'shell.merger.example.none': '–',
'shell.merger.example.own': 'own code',
'shell.merger.title': 'configure list',
'tag.add': 'Add tag',
'tag.property.name': 'Tag name',
'tag.list.disabled.empty': 'There are no disabled tags.',
Expand Down

0 comments on commit ab10d25

Please sign in to comment.