Skip to content

Commit

Permalink
Merge pull request #387 from sparcs-kaist/refactor/recent_scrap-board
Browse files Browse the repository at this point in the history
Improve recent & scrap board usability
  • Loading branch information
000wan authored Jun 28, 2023
2 parents 2f05f54 + da3a557 commit 53151c0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/TheBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default {
}
if (this.$route.query.page) {
query.from_page = this.$route.query.page
query.current = this.$route.query.page
}
return query
Expand Down
14 changes: 12 additions & 2 deletions src/components/ThePostHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export default {
return { name, params, query: { ...query, topic: topicId } }
}
if (fromView === 'scrap') {
return { name: 'archive', query }
return { name: 'my-info', query: { board: 'archive', ...query } }
}
if (fromView === 'recent') {
return { name: 'my-info', query: { board: 'recent', ...query } }
}
if (fromView === '-portal') {
return { name, query: { ...query, portal: 'exclude' } }
Expand All @@ -177,7 +180,10 @@ export default {
return this.boardName
}
if (fromView === 'scrap') {
return this.$t('archive')
return this.$t('archive-board')
}
if (fromView === 'recent') {
return this.$t('recent-board')
}
if (this.hasHistory()) {
if (fromView === 'all') {
Expand Down Expand Up @@ -218,6 +224,8 @@ ko:
confirm-delete: '정말로 삭제하시겠습니까?'
all: '전체보기'
prev-page: '이전 페이지'
recent-board: '최근 본 글'
archive-board: '담아둔 글'
status:
polling: '달성전'
preparing: '답변 준비중'
Expand All @@ -239,6 +247,8 @@ en:
confirm-delete: 'Are you really want to delete this post?'
all: 'All'
prev-page: 'Previous Page'
recent-board: 'Recent Articles'
archive-board: 'Bookmarks'
status:
polling: 'Polling'
preparing: 'Preparing'
Expand Down
2 changes: 2 additions & 0 deletions src/components/TheSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<SmallBoard
:listitems="recentPosts"
:from-query="{ from_view: 'recent' }"
:href="{ name: 'my-info', query: { board: 'recent' } }"
sidebar
>
{{ $t('recent') }}
Expand All @@ -16,6 +17,7 @@
<SmallBoard
:listitems="archiveList"
:from-query="{ from_view: 'scrap' }"
:href="{ name: 'my-info', query: { board: 'archive' } }"
sidebar
>
{{ $t('archive') }}
Expand Down
2 changes: 1 addition & 1 deletion src/views/MyInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export default {
this.user[key] = !this.user[key]
// Toast
this.$store.dispatch('dialog/toast', {
text: ('success'),
text: this.$t('success'),
type: 'confirm'
})
} catch (err) {
Expand Down
6 changes: 3 additions & 3 deletions src/views/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ export default {
computed: {
/* eslint-disable camelcase */
context () {
const { from_view, from_page, search_query } = this.$route.query
const { from_view, current, search_query } = this.$route.query
const query = {}
if (from_page) {
query.page = from_page
if (current) {
query.page = current
}
if (search_query) {
Expand Down

0 comments on commit 53151c0

Please sign in to comment.