diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 28225d7d..e7c4e632 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -629,7 +629,8 @@ LINK_EDIT: 'Edit', BTN_DELETE: ' Delete ', BTN_SUBMIT: 'Submit New Topic', - BTN_POST_NEW: 'Post New Topic', + BTN_POST_NEW_TOPIC: 'Post New Topic', + BTN_POST_NEW_REPLY: 'Post New Reply', ADD_SUCCESSFULLY: 'Forum added successfully', ADD_FAILED: 'Forum added failed', EDIT_SUCCESSFULLY: 'Forum edited successfully', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index c975a57b..8b28d62d 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -629,7 +629,8 @@ LINK_EDIT: '编辑', BTN_DELETE: ' 删除 ', BTN_SUBMIT: ' 提交新话题 ', - BTN_POST_NEW: ' 发起新话题 ', + BTN_POST_NEW_TOPIC: ' 发起新话题 ', + BTN_POST_NEW_REPLY: ' 回复 ', ADD_SUCCESSFULLY: '版块添加成功', ADD_FAILED: '版块添加失败', EDIT_SUCCESSFULLY: '版块编辑成功', diff --git a/modules/forums/client/controllers/forums-post.client.controller.js b/modules/forums/client/controllers/forums-post.client.controller.js index ec839f98..ebe0f13c 100644 --- a/modules/forums/client/controllers/forums-post.client.controller.js +++ b/modules/forums/client/controllers/forums-post.client.controller.js @@ -15,6 +15,13 @@ vm.user = Authentication.user; vm.forumPath = []; + /** + * If user is not signed in then redirect back home + */ + if (!Authentication.user) { + $state.go('authentication.signin'); + } + /** * init */ diff --git a/modules/forums/client/controllers/forums-topic.client.controller.js b/modules/forums/client/controllers/forums-topic.client.controller.js index 63c20b21..d90ca438 100644 --- a/modules/forums/client/controllers/forums-topic.client.controller.js +++ b/modules/forums/client/controllers/forums-topic.client.controller.js @@ -15,6 +15,13 @@ vm.user = Authentication.user; vm.forumPath = []; + /** + * If user is not signed in then redirect back home + */ + if (!Authentication.user) { + $state.go('authentication.signin'); + } + /** * init */ @@ -41,5 +48,15 @@ }; + /** + * getTopicContent + * @param t + * @returns {*} + */ + vm.getTopicContent = function (t) { + if (t) { + return marked(t.content, {sanitize: true}); + } + }; } }()); diff --git a/modules/forums/client/controllers/forums-view.client.controller.js b/modules/forums/client/controllers/forums-view.client.controller.js index 2801303d..a66220ce 100644 --- a/modules/forums/client/controllers/forums-view.client.controller.js +++ b/modules/forums/client/controllers/forums-view.client.controller.js @@ -15,6 +15,13 @@ vm.user = Authentication.user; vm.forumPath = []; + /** + * If user is not signed in then redirect back home + */ + if (!Authentication.user) { + $state.go('authentication.signin'); + } + /** * init */ diff --git a/modules/forums/client/controllers/forums.client.controller.js b/modules/forums/client/controllers/forums.client.controller.js index f13d094a..c63c2fe4 100644 --- a/modules/forums/client/controllers/forums.client.controller.js +++ b/modules/forums/client/controllers/forums.client.controller.js @@ -14,6 +14,13 @@ vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig; vm.user = Authentication.user; + /** + * If user is not signed in then redirect back home + */ + if (!Authentication.user) { + $state.go('authentication.signin'); + } + /** * init */ diff --git a/modules/forums/client/less/forum.less b/modules/forums/client/less/forum.less index d24ed280..e0577970 100644 --- a/modules/forums/client/less/forum.less +++ b/modules/forums/client/less/forum.less @@ -204,6 +204,144 @@ } } +.reply-list { + .pagination { + margin-bottom: 5px; + margin-top: 10px; + } + .table-category { + border-radius: 6px; + } + table { + border-spacing: 0; + border-collapse: inherit; + border: solid 3px @brand-primary; + thead { + background-color: @brand-primary; + border: solid 1px @brand-primary; + color: #efefef; + tr { + th { + border: solid 2px @brand-primary; + padding: 13px 10px; + .count-info { + font-size: 12px; + font-weight: normal; + } + } + } + } + tbody { + tr { + td { + border-top: none; + white-space: normal !important; + border-bottom: solid 2px lighten(@brand-primary, 45%); + } + } + tr:last-child { + td { + border-bottom: none; + } + } + } + } +} + +.reply-item { + .reply-wrapper { + padding-left: 60px; + margin: 20px 30px; + .reply-comment { + position: relative; + background-color: #fff; + border: 1px solid #d1d5da; + border-radius: 3px; + &::before { + position: absolute; + top: 11px; + right: 100%; + left: -16px; + display: block; + width: 0; + height: 0; + pointer-events: none; + content: " "; + border-color: transparent; + border-style: solid solid outset; + + border-width: 8px; + border-right-color: #d1d5da; + } + &::after { + position: absolute; + top: 11px; + right: 100%; + left: -16px; + display: block; + width: 0; + height: 0; + pointer-events: none; + content: " "; + border-color: transparent; + border-style: solid solid outset; + + margin-top: 1px; + margin-left: 2px; + border-width: 7px; + border-right-color: lighten(@comment-background-default, 2%); + } + .reply-comment-header { + padding-right: 15px; + padding-left: 15px; + color: #586069; + background-color: lighten(@comment-background-default, 2%); + border-bottom: 1px dashed #d1d5da; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + min-height: 42px; + .reply-comment-header-text { + max-width: 70%; + padding-top: 10px; + padding-bottom: 10px; + .user-ud-text { + font-size: 12px; + color: lighten(@gray-base, 60%); + } + } + .reply-comment-header-time-text { + font-size: 12px; + color: lighten(@gray-base, 60%); + margin-left: 5px; + } + } + .reply-comment-body { + padding-right: 15px; + padding-left: 15px; + min-height: 42px; + .reply-comment-body-text { + padding-top: 10px; + } + .reply-comment-body-edited-text { + font-size: 12px; + color: lighten(@gray-base, 60%); + margin-right: 15px; + } + } + } + .reply-avatar { + img { + cursor: pointer; + float: left; + margin-left: -60px; + border-radius: 3px; + height: 44px; + width: 44px; + } + } + } +} + .add-moderator-popover { max-width: 250px; max-height: 150px; diff --git a/modules/forums/client/views/topic.client.view.html b/modules/forums/client/views/topic.client.view.html index c1a10791..c69450a8 100644 --- a/modules/forums/client/views/topic.client.view.html +++ b/modules/forums/client/views/topic.client.view.html @@ -36,11 +36,76 @@ -
|
+ {{vm.topic.title}}
+
+
+ {{'FORUMS.FIELDS.VIEWS' | translate}}: {{vm.topic.viewCount}},
+ {{'FORUMS.FIELDS.REPLIES' | translate}}: {{vm.topic.replyCount}}
+
+ |
+
|---|
| + + | +