summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/src
diff options
context:
space:
mode:
authorJoachim Bauch <bauch@struktur.de>2019-03-25 10:50:18 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-26 16:46:44 +0100
commit10aab0cdab53d7d3389d04b2c3712b223bbc0971 (patch)
treea6cf536e2c72cd99824e9ca942ab74da1451c1b7 /apps/twofactor_backupcodes/src
parentfce1ddc04e0ec7253fb34ebdff5f6161e96c4d2a (diff)
downloadnextcloud-server-10aab0cdab53d7d3389d04b2c3712b223bbc0971.tar.gz
nextcloud-server-10aab0cdab53d7d3389d04b2c3712b223bbc0971.zip
Use name from theme when downloading/printing twofactor backup codes.
Signed-off-by: Joachim Bauch <bauch@struktur.de> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/twofactor_backupcodes/src')
-rw-r--r--apps/twofactor_backupcodes/src/service/PrintService.js5
-rw-r--r--apps/twofactor_backupcodes/src/views/PersonalSettings.vue9
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/twofactor_backupcodes/src/service/PrintService.js b/apps/twofactor_backupcodes/src/service/PrintService.js
index 6ea8d4732cc..7f4a0f46c59 100644
--- a/apps/twofactor_backupcodes/src/service/PrintService.js
+++ b/apps/twofactor_backupcodes/src/service/PrintService.js
@@ -1,6 +1,7 @@
export function print (data) {
- const newTab = window.open('', t('twofactor_backupcodes', 'Nextcloud backup codes'));
- newTab.document.write('<h1>' + t('twofactor_backupcodes', 'Nextcloud backup codes') + '</h1>');
+ const name = OC.theme.name || 'Nextcloud';
+ const newTab = window.open('', t('twofactor_backupcodes', '{name} backup codes', {name: name}));
+ newTab.document.write('<h1>' + t('twofactor_backupcodes', '{name} backup codes', {name: name}) + '</h1>');
newTab.document.write('<pre>' + data + '</pre>');
newTab.print();
newTab.close();
diff --git a/apps/twofactor_backupcodes/src/views/PersonalSettings.vue b/apps/twofactor_backupcodes/src/views/PersonalSettings.vue
index 2ca389461c8..15e20395e1b 100644
--- a/apps/twofactor_backupcodes/src/views/PersonalSettings.vue
+++ b/apps/twofactor_backupcodes/src/views/PersonalSettings.vue
@@ -15,7 +15,7 @@
</ul>
<a :href="downloadUrl"
class="button primary"
- download="Nextcloud-backup-codes.txt">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>
+ :download="downloadFilename">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>
<button class="button"
v-on:click="printCodes">{{ t('twofactor_backupcodes', 'Print backup codes') }}</button>
</template>
@@ -52,6 +52,10 @@
return prev + code + '\r\n';
}, ''));
},
+ downloadFilename: function() {
+ const name = OC.theme.name || 'Nextcloud';
+ return name + '-backup-codes.txt';
+ },
enabled: function() {
return this.$store.state.enabled
},
@@ -63,6 +67,9 @@
},
codes: function() {
return this.$store.state.codes
+ },
+ name: function() {
+ return OC.theme.name || 'Nextcloud'
}
},
methods: {