UX: Show anchor icon instead of text when topic bump is disabled

This commit is contained in:
Gerhard Schlager 2018-08-11 21:51:13 +02:00
parent a960a57c72
commit 448e95b97d
5 changed files with 8 additions and 20 deletions

View File

@ -195,13 +195,6 @@ export default Ember.Controller.extend({
}
},
@computed("model.noBump")
topicBumpText(noBump) {
if (noBump) {
return I18n.t("composer.no_topic_bump");
}
},
@computed
isStaffUser() {
const currentUser = this.currentUser;

View File

@ -21,8 +21,8 @@
{{#if whisperOrUnlistTopicText}}
<span class='whisper'>({{whisperOrUnlistTopicText}})</span>
{{/if}}
{{#if topicBumpText}}
<span class="no-bump">{{topicBumpText}}</span>
{{#if model.noBump}}
<span class="no-bump">{{d-icon "anchor"}}</span>
{{/if}}
{{/unless}}
@ -123,10 +123,8 @@
{{d-icon "eye-slash"}}
</span>
{{/if}}
{{#if topicBumpText}}
<span class="no-bump">
{{d-icon "anchor"}}
</span>
{{#if model.noBump}}
<span class="no-bump">{{d-icon "anchor"}}</span>
{{/if}}
{{/if}}

View File

@ -153,7 +153,6 @@
}
.whisper,
.no-bump,
.display-edit-reason {
font-style: italic;
}

View File

@ -1318,7 +1318,6 @@ en:
whisper: "whisper"
unlist: "unlisted"
blockquote_text: "Blockquote"
no_topic_bump: "(no bump)"
add_warning: "This is an official warning."
toggle_whisper: "Toggle Whisper"

View File

@ -261,10 +261,9 @@ QUnit.test("replying to post - toggle_topic_bump", async assert => {
await composerActions.expand();
await composerActions.selectRowByValue("toggle_topic_bump");
assert.equal(
find(".composer-fields .no-bump").text(),
I18n.t("composer.no_topic_bump"),
"no-bump text is visible"
assert.ok(
find(".composer-fields .no-bump").length === 1,
"no-bump icon is visible"
);
await composerActions.expand();
@ -272,7 +271,7 @@ QUnit.test("replying to post - toggle_topic_bump", async assert => {
assert.ok(
find(".composer-fields .no-bump").length === 0,
"no-bump text is not visible"
"no-bump icon is not visible"
);
});