Skip to content

Commit

Permalink
Resolve #342
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Nov 22, 2019
1 parent bb36c4f commit 2ebd6ab
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,8 @@ common/views/components/user-list-editor.vue:
delete-are-you-sure: "Delete list \"$1\"?"
deleted: "Deleted successfully"
hide-from-home: "Hide these users from home"
add-user: "Add a user"
enter-username: "Please enter username"
common/views/components/user-lists.vue:
create-list: "Create a list"
list-name: "List name"
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ common/views/components/user-list-editor.vue:
hosts: "ホスト"
add-host: "ホストの追加"
remove-host: "ホストを削除"
add-user: "ユーザーを追加"
enter-username: "ユーザー名を入力してください"

common/views/components/user-lists.vue:
create-list: "リストを作成"
Expand Down
19 changes: 18 additions & 1 deletion src/client/app/common/views/components/user-list-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

<ui-card>
<template #title><fa :icon="faUsers"/> {{ $t('users') }}</template>

<div style="margin: 8px">
<a @click="addUser">{{ $t('add-user') }}</a>
</div>
<section>
<sequential-entrance animation="entranceFromTop" delay="25">
<div class="phcqulfl" v-for="user in users" :key="user.id">
Expand Down Expand Up @@ -161,6 +163,21 @@ export default Vue.extend({
});
},
addUser() {
this.$root.dialog({
title: this.$t('enter-username'),
user: true
}).then(({ canceled, result: user }) => {
if (canceled) return;
this.$root.api('users/lists/push', {
listId: this.list.id,
userId: user.id
}).then(() => {
this.fetchList();
});
});
},
addHost() {
this.$root.dialog({
title: this.$t('add-host'),
Expand Down

0 comments on commit 2ebd6ab

Please sign in to comment.