From d354a6f7a40e9746c957badb0d9ef5cf9a1287d5 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 25 Jan 2017 13:09:08 +0800 Subject: [PATCH] FIX: Incorrect parameter being passed to component. --- .../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, 4 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/modal/history.hbs b/app/assets/javascripts/discourse/templates/modal/history.hbs index 9714e004096..4bd8c65e538 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" secondary=wikiDisabled}} + — {{disabled-icon icon="pencil-square-o" disabled=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" secondary=wikiDisabled}} + {{disabled-icon icon="pencil-square-o" disabled=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 531e4396850..c4646ffc700 100644 --- a/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 @@ -31,12 +31,7 @@ export default createWidget('post-edits-indicator', { if (attrs.wiki) { icon = 'pencil-square-o'; className = `${className} wiki`; - - if (attrs.version > 1) { - title = `${I18n.t('post.last_edited_on')} ${date}`; - } else { - title = I18n.t('post.wiki.about'); - } + title = `${I18n.t('post.last_edited_on')} ${date}`; } else { title = `${I18n.t('post.last_edited_on')} ${date}`; } diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 054310d393c..52618c5cafd 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] }, { skip_revision: true }) + post.revise(current_user, { wiki: params[:wiki] }) render nothing: true end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index ebdaee27768..d502aa3a1e4 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1753,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'