diff --git a/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 b/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 index 9eac352d6ba..f0d3cc1141e 100644 --- a/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 @@ -22,12 +22,22 @@ export default createWidget('post-edits-indicator', { }, html(attrs) { - const contents = [attrs.version - 1, ' ', iconNode('pencil')]; + let icon = 'pencil'; + let titleKey = 'post.last_edited_on'; const updatedAt = new Date(attrs.updated_at); + let className = this.historyHeat(updatedAt); - const title = `${I18n.t('post.last_edited_on')} ${longDate(updatedAt)}`; + if (attrs.wiki) { + icon = 'pencil-square-o'; + titleKey = 'post.wiki_last_edited_on'; + className = `${className} wiki`; + } + + const contents = [attrs.version - 1, ' ', iconNode(icon)]; + + const title = `${I18n.t(titleKey)} ${longDate(updatedAt)}`; return h('a', { - className: this.historyHeat(updatedAt), + className, attributes: { title } }, contents); }, diff --git a/app/assets/javascripts/discourse/widgets/post.js.es6 b/app/assets/javascripts/discourse/widgets/post.js.es6 index 7e9fd93496c..f92dd1d9546 100644 --- a/app/assets/javascripts/discourse/widgets/post.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post.js.es6 @@ -110,20 +110,6 @@ createWidget('post-avatar', { } }); - -createWidget('wiki-edit-button', { - tagName: 'div.post-info.wiki', - title: 'post.wiki.about', - - html() { - return iconNode('pencil-square-o'); - }, - - click() { - this.sendWidgetAction('editPost'); - } -}); - createWidget('post-email-indicator', { tagName: 'div.post-info.via-email', @@ -185,10 +171,6 @@ createWidget('post-meta-data', { result.push(this.attach('post-edits-indicator', attrs)); } - if (attrs.wiki) { - result.push(this.attach('wiki-edit-button', attrs)); - } - if (attrs.multiSelect) { result.push(this.attach('select-post', attrs)); } diff --git a/app/assets/stylesheets/common/base/discourse.scss b/app/assets/stylesheets/common/base/discourse.scss index 1429c55124e..58cd75db007 100644 --- a/app/assets/stylesheets/common/base/discourse.scss +++ b/app/assets/stylesheets/common/base/discourse.scss @@ -80,15 +80,6 @@ body { .coldmap-low { color: dark-light-choose(scale-color($primary, $lightness: 50%), scale-color($secondary, $lightness: 50%)) !important; } - .heatmap-high { - color: #fe7a15 !important; - } - .heatmap-med { - color: #cf7721 !important; - } - .heatmap-low { - color: #9b764f !important; - } #loading-message { position: absolute; diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss index b946073cc8a..22345f03d93 100644 --- a/app/assets/stylesheets/common/base/topic-post.scss +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -220,16 +220,17 @@ aside.quote { } .post-info { - &.wiki, &.via-email, &.whisper { + &.via-email, &.whisper { margin-right: 5px; i.fa { font-size: 1em; } } - &.wiki { - cursor: pointer; - color: #408040; + + .wiki { + color: green !important; } + &.via-email { color: dark-light-choose(scale-color($primary, $lightness: 70%), scale-color($secondary, $lightness: 30%)); } diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss index 75680a10612..f060add16fd 100644 --- a/app/assets/stylesheets/desktop/topic-post.scss +++ b/app/assets/stylesheets/desktop/topic-post.scss @@ -155,10 +155,6 @@ nav.post-controls { box-shadow: none; } - &.wikied { - color: green; - } - &.bookmark {padding: 8px 11px; } .read-icon { diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss index 92c004d0640..c8e2d1ffad4 100644 --- a/app/assets/stylesheets/mobile/topic-post.scss +++ b/app/assets/stylesheets/mobile/topic-post.scss @@ -76,7 +76,7 @@ button { margin:10px 0 10px 0; } &.has-like {color: $love;} - &.wikied { color: green; } + .read-icon { &:before { font-family: "FontAwesome"; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 0620de21f37..17e68926ed4 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1700,6 +1700,7 @@ en: edit: "Editing {{link}} {{replyAvatar}} {{username}}" edit_reason: "Reason: " post_number: "post {{number}}" + wiki_last_edited_on: "wiki last edited on" last_edited_on: "post last edited on" reply_as_new_topic: "Reply as linked Topic" continue_discussion: "Continuing the discussion from {{postLink}}:" @@ -1752,9 +1753,6 @@ en: via_auto_generated_email: "this post arrived via an auto generated email" whisper: "this post is a private whisper for moderators" - wiki: - about: "this post is a wiki" - archetypes: save: 'Save Options' diff --git a/test/javascripts/widgets/post-test.js.es6 b/test/javascripts/widgets/post-test.js.es6 index 67886da7689..559ac879601 100644 --- a/test/javascripts/widgets/post-test.js.es6 +++ b/test/javascripts/widgets/post-test.js.es6 @@ -17,15 +17,15 @@ widgetTest('basic elements', { }); widgetTest('wiki', { - template: '{{mount-widget widget="post" args=args editPost="editPost"}}', + template: '{{mount-widget widget="post" args=args showHistory="showHistory"}}', setup() { - this.set('args', { wiki: true }); - this.on('editPost', () => this.editPostCalled = true); + this.set('args', { wiki: true, version: 2, canViewEditHistory: true }); + this.on('showHistory', () => this.historyShown = true); }, test(assert) { - click('.post-info.wiki'); + click('.post-info .wiki'); andThen(() => { - assert.ok(this.editPostCalled, 'clicking the wiki icon edits the post'); + assert.ok(this.historyShown, 'clicking the wiki icon displays the post history'); }); } });