From f052d8912b324a02c55100d89409c7e29c670f8e Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 8 Nov 2018 15:16:39 +0900 Subject: [PATCH] =?UTF-8?q?wip:=20=E3=83=95=E3=82=A9=E3=83=AD=E3=83=BC/?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=AF=E3=83=BC=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=20(#3157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit フォロー/フォロワーページ --- locales/ja-JP.yml | 4 + package.json | 1 + .../app/common/views/components/ui/button.vue | 2 +- src/client/app/config.ts | 2 + src/client/app/desktop/script.ts | 3 + .../views/components/followers-window.vue | 32 ---- .../desktop/views/components/followers.vue | 26 ---- .../views/components/following-window.vue | 32 ---- .../desktop/views/components/following.vue | 26 ---- .../app/desktop/views/components/index.ts | 8 +- .../{users-list.item.vue => user-card.vue} | 30 ++-- .../desktop/views/components/users-list.vue | 145 ------------------ .../pages/user-following-or-followers.vue | 126 +++++++++++++++ .../desktop/views/pages/user/user.header.vue | 20 +-- src/client/app/init.ts | 2 + webpack.config.ts | 2 + 16 files changed, 155 insertions(+), 306 deletions(-) delete mode 100644 src/client/app/desktop/views/components/followers-window.vue delete mode 100644 src/client/app/desktop/views/components/followers.vue delete mode 100644 src/client/app/desktop/views/components/following-window.vue delete mode 100644 src/client/app/desktop/views/components/following.vue rename src/client/app/desktop/views/components/{users-list.item.vue => user-card.vue} (77%) delete mode 100644 src/client/app/desktop/views/components/users-list.vue create mode 100644 src/client/app/desktop/views/pages/user-following-or-followers.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 572c8ccdfe..66a9a83353 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -810,6 +810,10 @@ desktop/views/components/renote-form.vue: desktop/views/components/renote-form-window.vue: title: "この投稿をRenoteしますか?" +desktop/views/pages/user-following-or-followers.vue: + following: "{user}のフォロー" + followers: "{user}のフォロワー" + desktop/views/components/settings-window.vue: settings: "設定" diff --git a/package.json b/package.json index ea00e41178..0ff686c2fb 100644 --- a/package.json +++ b/package.json @@ -215,6 +215,7 @@ "vue-color": "2.7.0", "vue-content-loading": "1.5.3", "vue-cropperjs": "2.2.2", + "vue-i18n": "8.3.0", "vue-js-modal": "1.3.26", "vue-loader": "15.4.2", "vue-router": "3.0.1", diff --git a/src/client/app/common/views/components/ui/button.vue b/src/client/app/common/views/components/ui/button.vue index 71496da5cd..132518da92 100644 --- a/src/client/app/common/views/components/ui/button.vue +++ b/src/client/app/common/views/components/ui/button.vue @@ -53,7 +53,7 @@ export default Vue.extend({ display block width 100% margin 0 - padding 8px + padding 8px 10px text-align center font-weight normal font-size 16px diff --git a/src/client/app/config.ts b/src/client/app/config.ts index 2abc3f7226..637d643d8d 100644 --- a/src/client/app/config.ts +++ b/src/client/app/config.ts @@ -1,5 +1,6 @@ declare const _LANG_: string; declare const _LANGS_: string; +declare const _LOCALE_: { [key: string]: any }; declare const _THEME_COLOR_: string; declare const _COPYRIGHT_: string; declare const _VERSION_: string; @@ -16,6 +17,7 @@ export const apiUrl = url + '/api'; export const wsUrl = url.replace('http://', 'ws://').replace('https://', 'wss://') + '/streaming'; export const lang = _LANG_; export const langs = _LANGS_; +export const locale = _LOCALE_; export const themeColor = _THEME_COLOR_; export const copyright = _COPYRIGHT_; export const version = _VERSION_; diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index eabb1fe163..ca9771e2fe 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -24,6 +24,7 @@ import MkIndex from './views/pages/index.vue'; import MkHome from './views/pages/home.vue'; import MkDeck from './views/pages/deck/deck.vue'; import MkUser from './views/pages/user/user.vue'; +import MkUserFollowingOrFollowers from './views/pages/user-following-or-followers.vue'; import MkFavorites from './views/pages/favorites.vue'; import MkSelectDrive from './views/pages/selectdrive.vue'; import MkDrive from './views/pages/drive.vue'; @@ -66,6 +67,8 @@ init(async (launch) => { { path: '/share', component: MkShare }, { path: '/reversi/:game?', component: MkReversi }, { path: '/@:user', name: 'user', component: MkUser }, + { path: '/@:user/following', name: 'userFollowing', component: MkUserFollowingOrFollowers }, + { path: '/@:user/followers', name: 'userFollowers', component: MkUserFollowingOrFollowers }, { path: '/notes/:note', name: 'note', component: MkNote }, { path: '/authorize-follow', component: MkFollow } ] diff --git a/src/client/app/desktop/views/components/followers-window.vue b/src/client/app/desktop/views/components/followers-window.vue deleted file mode 100644 index d5214adb2f..0000000000 --- a/src/client/app/desktop/views/components/followers-window.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/components/followers.vue b/src/client/app/desktop/views/components/followers.vue deleted file mode 100644 index 1ef9f69771..0000000000 --- a/src/client/app/desktop/views/components/followers.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - diff --git a/src/client/app/desktop/views/components/following-window.vue b/src/client/app/desktop/views/components/following-window.vue deleted file mode 100644 index aa9f2bde7b..0000000000 --- a/src/client/app/desktop/views/components/following-window.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/components/following.vue b/src/client/app/desktop/views/components/following.vue deleted file mode 100644 index d55ce1c0d4..0000000000 --- a/src/client/app/desktop/views/components/following.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - diff --git a/src/client/app/desktop/views/components/index.ts b/src/client/app/desktop/views/components/index.ts index ff4e845f62..2478f75ac4 100644 --- a/src/client/app/desktop/views/components/index.ts +++ b/src/client/app/desktop/views/components/index.ts @@ -22,9 +22,7 @@ import settings from './settings.vue'; import calendar from './calendar.vue'; import activity from './activity.vue'; import friendsMaker from './friends-maker.vue'; -import followers from './followers.vue'; -import following from './following.vue'; -import usersList from './users-list.vue'; +import userCard from './user-card.vue'; import userListTimeline from './user-list-timeline.vue'; import widgetContainer from './widget-container.vue'; @@ -50,8 +48,6 @@ Vue.component('mk-settings', settings); Vue.component('mk-calendar', calendar); Vue.component('mk-activity', activity); Vue.component('mk-friends-maker', friendsMaker); -Vue.component('mk-followers', followers); -Vue.component('mk-following', following); -Vue.component('mk-users-list', usersList); +Vue.component('mk-user-card', userCard); Vue.component('mk-user-list-timeline', userListTimeline); Vue.component('mk-widget-container', widgetContainer); diff --git a/src/client/app/desktop/views/components/users-list.item.vue b/src/client/app/desktop/views/components/user-card.vue similarity index 77% rename from src/client/app/desktop/views/components/users-list.item.vue rename to src/client/app/desktop/views/components/user-card.vue index 66a002c708..ccc0a49dc0 100644 --- a/src/client/app/desktop/views/components/users-list.item.vue +++ b/src/client/app/desktop/views/components/user-card.vue @@ -9,7 +9,6 @@
-

%i18n:@followed%

@@ -34,17 +33,18 @@ export default Vue.extend({ diff --git a/src/client/app/desktop/views/components/users-list.vue b/src/client/app/desktop/views/components/users-list.vue deleted file mode 100644 index 05fe6c292e..0000000000 --- a/src/client/app/desktop/views/components/users-list.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/user-following-or-followers.vue b/src/client/app/desktop/views/pages/user-following-or-followers.vue new file mode 100644 index 0000000000..db0de20b64 --- /dev/null +++ b/src/client/app/desktop/views/pages/user-following-or-followers.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/user/user.header.vue b/src/client/app/desktop/views/pages/user/user.header.vue index 4c30942828..6d7827d1ae 100644 --- a/src/client/app/desktop/views/pages/user/user.header.vue +++ b/src/client/app/desktop/views/pages/user/user.header.vue @@ -22,8 +22,8 @@
{{ user.notesCount | number }}%i18n:@posts% - {{ user.followingCount | number }}%i18n:@following% - {{ user.followersCount | number }}%i18n:@followers% + {{ user.followingCount | number }}%i18n:@following% + {{ user.followersCount | number }}%i18n:@followers%
@@ -31,8 +31,6 @@ diff --git a/src/client/app/init.ts b/src/client/app/init.ts index bc5a349987..3d1560633a 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -8,6 +8,7 @@ import VueRouter from 'vue-router'; import VAnimateCss from 'v-animate-css'; import VModal from 'vue-js-modal'; import VueSweetalert2 from 'vue-sweetalert2'; +import VueI18n from 'vue-i18n'; import VueHotkey from './common/hotkey'; import App from './app.vue'; @@ -121,6 +122,7 @@ Vue.use(VAnimateCss); Vue.use(VModal); Vue.use(VueHotkey); Vue.use(VueSweetalert2); +Vue.use(VueI18n); Vue.component('fa', FontAwesomeIcon); diff --git a/webpack.config.ts b/webpack.config.ts index 03ceeaa51c..37faec0069 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -66,6 +66,7 @@ const consts = { _CODENAME_: codename, _LANG_: '%lang%', _LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]), + _LOCALE_: '%locale%', _ENV_: process.env.NODE_ENV }; @@ -100,6 +101,7 @@ const plugins = [ src = src.replace(i18nReplacer.pattern, i18nReplacer.replacement); src = src.replace('%lang%', lang); + src = src.replace('"%locale%"', JSON.stringify(locales[lang])); fs.writeFileSync(`${__dirname}/built/client/assets/${file}.${version}.${lang}.js`, src, 'utf-8'); });