diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/chat_panel/chat_panel.vue | 2 | ||||
| -rw-r--r-- | src/components/nav_panel/nav_panel.vue | 8 | ||||
| -rw-r--r-- | src/components/notification/notification.vue | 2 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 2 | ||||
| -rw-r--r-- | src/components/status/status.vue | 6 | ||||
| -rw-r--r-- | src/components/user_card/user_card.vue | 2 | ||||
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 6 | ||||
| -rw-r--r-- | src/components/user_profile/user_profile.js | 11 | ||||
| -rw-r--r-- | src/components/who_to_follow_panel/who_to_follow_panel.vue | 6 |
9 files changed, 25 insertions, 20 deletions
diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 30070d3e..e3671818 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -13,7 +13,7 @@ <img :src="message.author.avatar" /> </span> <div class="chat-content"> - <router-link class="chat-name" :to="{ name: 'user-profile', params: { id: message.author.id } }"> + <router-link class="chat-name" :to="{ name: 'user-profile', params: { name: message.author.username } }"> {{message.author.username}} </router-link> <br> diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index b224c5f3..c52d1e52 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -3,7 +3,7 @@ <div class="panel panel-default"> <ul> <li v-if='currentUser'> - <router-link @click.native="activatePanel('timeline')" to='/main/friends'> + <router-link @click.native="activatePanel('timeline')" :to="{ name: 'friends' }"> {{ $t("nav.timeline") }} </router-link> </li> @@ -18,17 +18,17 @@ </router-link> </li> <li v-if='currentUser && currentUser.locked'> - <router-link @click.native="activatePanel('timeline')" to='/friend-requests'> + <router-link @click.native="activatePanel('timeline')" :to="{ name: 'friend-requests' }"> {{ $t("nav.friend_requests") }} </router-link> </li> <li> - <router-link @click.native="activatePanel('timeline')" to='/main/public'> + <router-link @click.native="activatePanel('timeline')" :to="{ name: 'public-timeline' }"> {{ $t("nav.public_tl") }} </router-link> </li> <li> - <router-link @click.native="activatePanel('timeline')" to='/main/all'> + <router-link @click.native="activatePanel('timeline')" :to="{ name: 'public-external-timeline' }"> {{ $t("nav.twkn") }} </router-link> </li> diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 13a5c0aa..40146513 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -28,7 +28,7 @@ <small class="timeago"><router-link v-if="notification.status" :to="{ name: 'conversation', params: { id: notification.status.id } }"><timeago :since="notification.action.created_at" :auto-update="240"></timeago></router-link></small> </span> <div class="follow-text" v-if="notification.type === 'follow'"> - <router-link :to="{ name: 'user-profile', params: { id: notification.action.user.id } }">@{{notification.action.user.screen_name}}</router-link> + <router-link :to="{ name: 'user-profile', params: { name: notification.action.user.screen_name } }">@{{notification.action.user.screen_name}}</router-link> </div> <template v-else> <status v-if="notification.status" class="faint" :compact="true" :statusoid="notification.status" :noHeading="true"></status> diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index e4c46b9a..9bd106fe 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -7,7 +7,7 @@ path="post_status.account_not_locked_warning" tag="p" class="visibility-notice"> - <router-link to="/user-settings">{{ $t('post_status.account_not_locked_warning_link') }}</router-link> + <router-link :to="{ name: 'user-settings' }">{{ $t('post_status.account_not_locked_warning_link') }}</router-link> </i18n> <p v-if="this.newStatus.visibility == 'direct'" class="visibility-notice">{{ $t('post_status.direct_warning') }}</p> <input diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 984884ff..f29e0d1e 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -2,7 +2,7 @@ <div class="status-el" v-if="!hideReply && !deleted" :class="[{ 'status-el_focused': isFocused }, { 'status-conversation': inlineExpanded }]"> <template v-if="muted && !noReplyLinks"> <div class="media status container muted"> - <small><router-link :to="{ name: 'user-profile', params: { id: status.user.id } }">{{status.user.screen_name}}</router-link></small> + <small><router-link :to="{ name: 'user-profile', params: { name: status.user.screen_name } }">{{status.user.screen_name}}</router-link></small> <small class="muteWords">{{muteWordHits.join(', ')}}</small> <a href="#" class="unmute" @click.prevent="toggleMute"><i class="icon-eye-off"></i></a> </div> @@ -34,10 +34,10 @@ <h4 class="user-name" v-if="status.user.name_html" v-html="status.user.name_html"></h4> <h4 class="user-name" v-else>{{status.user.name}}</h4> <span class="links"> - <router-link :to="{ name: 'user-profile', params: { id: status.user.id } }">{{status.user.screen_name}}</router-link> + <router-link :to="{ name: 'user-profile', params: { name: status.user.screen_name } }">{{status.user.screen_name}}</router-link> <span v-if="status.in_reply_to_screen_name" class="faint reply-info"> <i class="icon-right-open"></i> - <router-link :to="{ name: 'user-profile', params: { id: status.in_reply_to_user_id } }"> + <router-link :to="{ name: 'user-profile', params: { id: status.in_reply_to_screen_name } }"> {{status.in_reply_to_screen_name}} </router-link> </span> diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5a8e5531..3e1a7205 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -19,7 +19,7 @@ {{ $t('user_card.follows_you') }} </span> </div> - <router-link class='user-screen-name' :to="{ name: 'user-profile', params: { id: user.id } }"> + <router-link class='user-screen-name' :to="{ name: 'user-profile', params: { name: user.screen_name } }"> @{{user.screen_name}} </router-link> </div> diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 4b8a730f..bde1d139 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -2,20 +2,20 @@ <div id="heading" class="profile-panel-background" :style="headingStyle"> <div class="panel-heading text-center"> <div class='user-info'> - <router-link @click.native="activatePanel('timeline')" to='/user-settings' style="float: right; margin-top:16px;" v-if="!isOtherUser"> + <router-link @click.native="activatePanel('timeline')" :to="{ name: 'user-settings' }" style="float: right; margin-top:16px;" v-if="!isOtherUser"> <i class="icon-cog usersettings" :title="$t('tool_tip.user_settings')"></i> </router-link> <a :href="user.statusnet_profile_url" target="_blank" class="floater" v-if="isOtherUser"> <i class="icon-link-ext usersettings"></i> </a> <div class='container'> - <router-link :to="{ name: 'user-profile', params: { id: user.id } }"> + <router-link :to="{ name: 'user-profile', params: { name: user.screen_name } }"> <StillImage class="avatar" :src="user.profile_image_url_original"/> </router-link> <div class="name-and-screen-name"> <div :title="user.name" class='user-name' v-if="user.name_html" v-html="user.name_html"></div> <div :title="user.name" class='user-name' v-else>{{user.name}}</div> - <router-link class='user-screen-name':to="{ name: 'user-profile', params: { id: user.id } }"> + <router-link class='user-screen-name' :to="{ name: 'user-profile', params: { name: user.screen_name } }"> <span>@{{user.screen_name}}</span><span v-if="user.locked"><i class="icon icon-lock"></i></span> <span v-if="!hideUserStatsLocal" class="dailyAvg">{{dailyAvg}} {{ $t('user_card.per_day') }}</span> </router-link> diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 1d79713d..d7e19b36 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -15,18 +15,23 @@ const UserProfile = { computed: { timeline () { return this.$store.state.statuses.timelines.user }, userId () { - return this.$route.params.id + return this.user.id + }, + userName () { + return this.$route.params.name }, user () { if (this.timeline.statuses[0]) { return this.timeline.statuses[0].user } else { - return this.$store.state.users.usersObject[this.userId] || false + return Object.values(this.$store.state.users.usersObject).filter(user => { + return user.name === this.userName + })[0] || false } } }, watch: { - userId () { + userName () { this.$store.dispatch('stopFetching', 'user') this.$store.commit('clearTimeline', { timeline: 'user' }) this.$store.dispatch('startFetching', ['user', this.userId]) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index d031318d..35722ffa 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -8,9 +8,9 @@ </div> <div class="panel-body who-to-follow"> <p> - <img v-bind:src="img1"/> <router-link :to="{ name: 'user-profile', params: { id: id1 } }">{{ name1 }}</router-link><br> - <img v-bind:src="img2"/> <router-link :to="{ name: 'user-profile', params: { id: id2 } }">{{ name2 }}</router-link><br> - <img v-bind:src="img3"/> <router-link :to="{ name: 'user-profile', params: { id: id3 } }">{{ name3 }}</router-link><br> + <img v-bind:src="img1"/> <router-link :to="{ name: 'user-profile', params: { name: name1 } }">{{ name1 }}</router-link><br> + <img v-bind:src="img2"/> <router-link :to="{ name: 'user-profile', params: { name: name2 } }">{{ name2 }}</router-link><br> + <img v-bind:src="img3"/> <router-link :to="{ name: 'user-profile', params: { name: name3 } }">{{ name3 }}</router-link><br> <img v-bind:src="$store.state.instance.logo"> <a v-bind:href="moreUrl" target="_blank">{{$t('who_to_follow.more')}}</a> </p> </div> |
