From 0a25df67bc44f0b5a08889dfc08ceae3c6e74164 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 25 Jan 2017 13:12:24 +0800 Subject: [PATCH] Revert "FIX: Incorrect parameter being passed to component." This reverts commit d354a6f7a40e9746c957badb0d9ef5cf9a1287d5. --- .../javascripts/discourse/templates/modal/history.hbs | 4 ++-- .../discourse/widgets/post-edits-indicator.js.es6 | 7 ++++++- app/controllers/posts_controller.rb | 2 +- config/locales/client.en.yml | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/modal/history.hbs b/app/assets/javascripts/discourse/templates/modal/history.hbs index 4bd8c65e538..9714e004096 100644 --- a/app/assets/javascripts/discourse/templates/modal/history.hbs +++ b/app/assets/javascripts/discourse/templates/modal/history.hbs @@ -34,7 +34,7 @@ → {{bound-avatar-template model.user_changes.current.avatar_template "small"}} {{model.user_changes.current.username}} {{/if}} {{#if model.wiki_changes}} - — {{disabled-icon icon="pencil-square-o" disabled=wikiDisabled}} + — {{disabled-icon icon="pencil-square-o" secondary=wikiDisabled}} {{/if}} {{#if model.post_type_changes}} — {{disabled-icon icon="shield" disabled=postTypeDisabled}} @@ -59,7 +59,7 @@ {{/if}} {{#if model.wiki_changes}}
- {{disabled-icon icon="pencil-square-o" disabled=wikiDisabled}} + {{disabled-icon icon="pencil-square-o" secondary=wikiDisabled}}
{{/if}} {{#if model.post_type_changes}} 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 c4646ffc700..531e4396850 100644 --- a/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 @@ -31,7 +31,12 @@ export default createWidget('post-edits-indicator', { if (attrs.wiki) { icon = 'pencil-square-o'; className = `${className} wiki`; - title = `${I18n.t('post.last_edited_on')} ${date}`; + + if (attrs.version > 1) { + title = `${I18n.t('post.last_edited_on')} ${date}`; + } else { + title = I18n.t('post.wiki.about'); + } } else { title = `${I18n.t('post.last_edited_on')} ${date}`; } diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 52618c5cafd..054310d393c 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -394,7 +394,7 @@ class PostsController < ApplicationController post = find_post_from_params guardian.ensure_can_wiki!(post) - post.revise(current_user, { wiki: params[:wiki] }) + post.revise(current_user, { wiki: params[:wiki] }, { skip_revision: true }) render nothing: true end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index d502aa3a1e4..ebdaee27768 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1753,6 +1753,9 @@ 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'