UX: replace closed topic icon with discourse-no-entry

This commit is contained in:
Kris 2020-04-24 17:31:34 -04:00
parent e638d43f0a
commit 040b8c00a4
9 changed files with 22 additions and 36 deletions

View File

@ -23,21 +23,17 @@ export default Component.extend({
@discourseComputed("topic.closed", "topic.archived")
topicClosedArchived(closed, archived) {
if (closed && archived) {
this._set(
"closedArchived",
"discourse-comment-close",
"locked_and_archived"
);
this._set("closedArchived", "discourse-no-entry", "locked_and_archived");
this._reset("closed");
this._reset("archived");
return true;
} else {
this._reset("closedArchived");
closed
? this._set("closed", "discourse-comment-close", "locked")
? this._set("closed", "discourse-no-entry", "locked")
: this._reset("closed");
archived
? this._set("archived", "discourse-comment-close", "archived")
? this._set("archived", "discourse-no-entry", "archived")
: this._reset("archived");
return false;
}

View File

@ -30,7 +30,7 @@ addBulkButton("showChangeCategory", "change_category", {
class: "btn-default"
});
addBulkButton("closeTopics", "close_topics", {
icon: "discourse-comment-close",
icon: "discourse-no-entry",
class: "btn-default"
});
addBulkButton("archiveTopics", "archive_topics", {

View File

@ -10,10 +10,10 @@ export default ArrayProxy.extend({
};
if (topic.get("closed") && topic.get("archived")) {
renderIcon("discourse-comment-close", "locked_and_archived");
renderIcon("discourse-no-entry", "locked_and_archived");
} else {
renderIconIf("closed", "discourse-comment-close", "locked");
renderIconIf("archived", "discourse-comment-close", "archived");
renderIconIf("closed", "discourse-no-entry", "locked");
renderIconIf("archived", "discourse-no-entry", "archived");
}
this.forEach(args => renderIconIf(...args));

View File

@ -39,13 +39,13 @@ export default EmberObject.extend({
if (topic.get("closed") && topic.get("archived")) {
results.push({
icon: "discourse-comment-close",
icon: "discourse-no-entry",
key: "locked_and_archived"
});
} else if (topic.get("closed")) {
results.push({ icon: "discourse-comment-close", key: "locked" });
results.push({ icon: "discourse-no-entry", key: "locked" });
} else if (topic.get("archived")) {
results.push({ icon: "discourse-comment-close", key: "archived" });
results.push({ icon: "discourse-no-entry", key: "archived" });
}
if (topic.get("pinned")) {

View File

@ -32,10 +32,8 @@ export function actionDescription(actionCode, createdAt, username) {
}
const icons = {
"closed.enabled": "discourse-comment-close",
"closed.disabled": "discourse-comment-plus",
"autoclosed.enabled": "discourse-comment-close",
"autoclosed.disabled": "discourse-comment-plus",
"closed.enabled": "discourse-no-entry",
"autoclosed.enabled": "discourse-no-entry",
"archived.enabled": "folder",
"archived.disabled": "folder-open",
"pinned.enabled": "thumbtack",
@ -52,7 +50,7 @@ const icons = {
user_left: "minus-circle",
removed_user: "minus-circle",
removed_group: "minus-circle",
public_topic: "discourse-comment-plus",
public_topic: "discourse-comment",
private_topic: "envelope",
autobumped: "hand-point-right"
};

View File

@ -165,7 +165,7 @@ export default createWidget("topic-admin-menu", {
className: "topic-admin-open",
buttonClass: "btn-default",
action: "toggleClosed",
icon: "discourse-comment-plus",
icon: "discourse-comment",
label: "actions.open"
});
} else {
@ -173,7 +173,7 @@ export default createWidget("topic-admin-menu", {
className: "topic-admin-close",
buttonClass: "btn-default",
action: "toggleClosed",
icon: "discourse-comment-close",
icon: "discourse-no-entry",
label: "actions.close"
});
}
@ -239,7 +239,7 @@ export default createWidget("topic-admin-menu", {
action: isPrivateMessage
? "convertToPublicTopic"
: "convertToPrivateMessage",
icon: isPrivateMessage ? "discourse-comment-plus" : "envelope",
icon: isPrivateMessage ? "discourse-comment" : "envelope",
label: isPrivateMessage
? "actions.make_public"
: "actions.make_private"

View File

@ -63,8 +63,7 @@ module SvgSprite
"discourse-bell-slash",
"discourse-compress",
"discourse-comment",
"discourse-comment-plus",
"discourse-comment-close",
"discourse-no-entry",
"discourse-expand",
"download",
"ellipsis-h",

View File

@ -12,7 +12,7 @@ widgetTest("basics", {
});
},
test(assert) {
assert.ok(find(".topic-status .d-icon-discourse-comment-close").length);
assert.ok(find(".topic-status .d-icon-discourse-no-entry").length);
}
});

View File

@ -19,7 +19,7 @@ Additional SVG icons
<symbol id='discourse-bell-exclamation' viewBox="0 0 448 512">
<path d="M439.4 362.3c-19.3-20.8-55.5-52-55.5-154.3 0-77.7-54.5-139.9-127.9-155.2V32c0-17.7-14.3-32-32-32s-32 14.3-32 32v20.8C118.6 68.1 64.1 130.3 64.1 208c0 102.3-36.2 133.5-55.5 154.3-6 6.4-8.6 14.1-8.6 21.7.1 16.4 13 32 32.1 32h383.8c19.1 0 32-15.6 32.1-32 .1-7.6-2.6-15.3-8.6-21.7zM201.7 116.6h44.6c6.5 0 11.7 5.5 11.4 12l-6.5 123.8c-.3 6.1-5.3 10.9-11.4 10.9h-31.6c-6.1 0-11.1-4.8-11.4-10.9l-6.5-123.8c-.3-6.6 4.9-12 11.4-12zM224 361.3c-18.6 0-33.7-15.1-33.7-33.7s15.1-33.7 33.7-33.7 33.7 15.1 33.7 33.7-15.1 33.7-33.7 33.7zM224 512c35.3 0 64-28.7 64-64H160c0 35.3 28.7 64 64 64z"/>
</symbol>
<!-- Discourse Bell One" is a Discourse derivative of https://fontawesome.com/icons/bell -->
<!-- "Discourse Bell One" is a Discourse derivative of https://fontawesome.com/icons/bell -->
<symbol id='discourse-bell-one' viewBox="0 0 448 512">
<path d="M224 512c35.3 0 64-28.7 64-64H160c0 35.3 28.7 64 64 64zM439.4 362.3c-19.3-20.8-55.5-52-55.5-154.3 0-77.7-54.5-139.9-127.9-155.2V32c0-17.7-14.3-32-32-32s-32 14.3-32 32v20.8C118.6 68.1 64.1 130.3 64.1 208c0 102.3-36.2 133.5-55.5 154.3-6 6.4-8.6 14.1-8.6 21.7.1 16.4 13 32 32.1 32h383.8c19.1 0 32-15.6 32.1-32 .1-7.6-2.6-15.3-8.6-21.7zm-145.2-28c0 8.6-7 15.5-15.5 15.5h-97c-8.6 0-15.5-7-15.5-15.5v-15.8c0-8.6 7-15.5 15.5-15.5h27.1V192.5l-5.1 3.1c-6 6.1-15.9 6.2-22 .1l-11.2-11.1c-6.1-6-6.2-15.9-.1-22l31.6-31.9c3.2-3.2 7.4-4.7 11.5-4.6h26.6c8.6 0 11.5 7 11.5 15.5v161.3h27.1c8.6 0 15.5 7 15.5 15.5v15.9z"/>
</symbol>
@ -27,18 +27,11 @@ Additional SVG icons
<symbol id='discourse-bell-slash' viewBox="0 0 448 512">
<path d="M442.7 396.2L36.5 70.7c-6.9-5.5-17-4.4-22.5 2.5L4 85.6c-5.5 6.9-4.4 17 2.5 22.5l406.2 325.5c6.9 5.5 17 4.4 22.5-2.5l10-12.5c5.5-6.9 3.7-17.7-3.2-23.2l.7.8zM67.5 368c16.7-22 34.5-55.8 41.4-110.6l-45.5-35.6C60.2 312.6 27 342.5 8.6 362.3 2.6 368.7 0 376.4 0 384c.1 16.4 13 32 32.1 32h279.7l-61.4-48H67.5zM224 96c61.9 0 112 50.1 112 112 0 .2-.1.4-.1.6 0 16.8 1.2 31.8 2.8 45.7l59.5 46.5c-8.3-22.1-14.3-51.5-14.3-92.9 0-77.7-54.5-139.9-127.9-155.2V32c0-17.7-14.3-32-32-32s-32 14.3-32 32v20.8c-26 5.4-49.4 16.9-69.1 32.7l38.2 29.8C179 103.2 200.6 96 224 96zm0 416c35.3 0 64-28.6 64-64H160c0 35.4 28.7 64 64 64z"/>
</symbol>
<!-- "Discourse Comment" is a Discourse derivative of https://fontawesome.com/icons/comment?style=regular that has been built to match the custom discourse-comment-close icon -->
<!-- "Discourse Comment" is a Discourse derivative of https://fontawesome.com/icons/comment?style=regular that has been built to be a bit more legible at small sizes -->
<symbol id='discourse-comment' viewBox="0 0 550 512">
<path d="M26 479.3c-7.5 0-14.8-3.3-19.8-9.2-6.5-7.6-8-18.3-4-27.4l54.6-123.2c-17-28.9-23.2-66.1-18.6-110.7C44.6 146.2 77.8 90.2 131.6 51 184.4 12.4 251.1-5.2 319.2 1.3c72.8 7 139.6 41.5 183.3 94.9 38.4 46.8 56.3 104.4 50.3 162-6.5 62.5-39.6 118.5-93.4 157.7-45.7 33.3-101.7 51-160 51-9.2 0-18.4-.4-27.6-1.3-32.8-3.1-64.2-11.7-93.4-25.4L32.6 478.4c-2.2.6-4.4.9-6.6.9zm155.2-92.7c4.1 0 8.2 1 11.9 2.9 25.9 13.4 54 21.6 83.6 24.4 7.5.7 15 1.1 22.5 1.1 104 0 192.3-69.1 201.9-162 4.5-43.8-9.3-87.7-38.8-123.7-35-42.7-89-70.4-148-76.1-113.5-10.9-214.1 61.4-224.4 161-3.9 38.1 1.8 67.3 17 86.9 5.9 7.6 7.1 17.7 3.2 26.5l-38.5 87 102.9-27c2.3-.7 4.5-1 6.7-1z"/>
</symbol>
<!-- "Discourse Comment Plus" is a version of https://fontawesome.com/icons/comment-plus?style=regular that has been recreated to match the custom discourse-comment icon -->
<symbol id="discourse-comment-plus" viewBox="0 0 550 512">
<path d="M26 479.3c-7.5 0-14.8-3.3-19.8-9.2-6.5-7.6-8-18.3-4-27.4l54.6-123.2c-17-28.9-23.2-66.1-18.6-110.7C44.6 146.2 77.8 90.2 131.6 51 184.4 12.4 251.1-5.2 319.2 1.3c72.8 7 139.6 41.5 183.3 94.9 38.4 46.8 56.3 104.4 50.3 162-6.5 62.5-39.6 118.5-93.4 157.7-45.7 33.3-101.7 51-160 51-9.2 0-18.4-.4-27.6-1.3-32.8-3.1-64.2-11.7-93.4-25.4L32.6 478.4c-2.2.6-4.4.9-6.6.9zm155.2-92.7c4.1 0 8.2 1 11.9 2.9 25.9 13.4 54 21.6 83.6 24.4 7.5.7 15 1.1 22.5 1.1 104 0 192.3-69.1 201.9-162 4.5-43.8-9.3-87.7-38.8-123.7-35-42.7-89-70.4-148-76.1-113.5-10.9-214.1 61.4-224.4 161-3.9 38.1 1.8 67.3 17 86.9 5.9 7.6 7.1 17.7 3.2 26.5l-38.5 87 102.9-27c2.3-.7 4.5-1 6.7-1z"/>
<path d="M385.8 199.7h-61.4v-61.4c0-12-9.7-21.8-21.8-21.8h-15.1c-12 0-21.8 9.7-21.8 21.8v61.4h-61.4c-12 0-21.8 9.7-21.8 21.8v15.1c0 12 9.7 21.8 21.8 21.8h61.4v61.4c0 12 9.7 21.8 21.8 21.8h15.1c12 0 21.8-9.7 21.8-21.8v-61.4h61.4c12 0 21.8-9.7 21.8-21.8v-15c-.1-12-9.8-21.9-21.8-21.9z"/>
</symbol>
<!-- "Discourse Comment Close" is a version of https://fontawesome.com/icons/comment-times?style=regular that has been recreated to match the custom discourse-comment icon -->
<symbol id="discourse-comment-close" viewBox="0 0 550 512">
<path d="M26 479.3c-7.5 0-14.8-3.3-19.8-9.2-6.5-7.6-8-18.3-4-27.4l54.6-123.2c-17-28.9-23.2-66.1-18.6-110.7C44.6 146.2 77.8 90.2 131.6 51 184.4 12.4 251.1-5.2 319.2 1.3c72.8 7 139.6 41.5 183.3 94.9 38.4 46.8 56.3 104.4 50.3 162-6.5 62.5-39.6 118.5-93.4 157.7-45.7 33.3-101.7 51-160 51-9.2 0-18.4-.4-27.6-1.3-32.8-3.1-64.2-11.7-93.4-25.4L32.6 478.4c-2.2.6-4.4.9-6.6.9zm155.2-92.7c4.1 0 8.2 1 11.9 2.9 25.9 13.4 54 21.6 83.6 24.4 7.5.7 15 1.1 22.5 1.1 104 0 192.3-69.1 201.9-162 4.5-43.8-9.3-87.7-38.8-123.7-35-42.7-89-70.4-148-76.1-113.5-10.9-214.1 61.4-224.4 161-3.9 38.1 1.8 67.3 17 86.9 5.9 7.6 7.1 17.7 3.2 26.5l-38.5 87 102.9-27c2.3-.7 4.5-1 6.7-1z"/>
<path d="M379.9 272.5L336.5 229l43.4-43.4c8.5-8.5 8.5-22.3 0-30.8l-10.7-10.7c-8.5-8.5-22.3-8.5-30.8 0L295 187.5l-43.4-43.4c-8.5-8.5-22.3-8.5-30.8 0l-10.7 10.7c-8.5 8.5-8.5 22.3 0 30.8l43.4 43.4-43.4 43.4c-8.5 8.5-8.5 22.3 0 30.8l10.7 10.7c8.5 8.5 22.3 8.5 30.8 0l43.4-43.4 43.4 43.4c8.5 8.5 22.3 8.5 30.8 0l10.6-10.6c8.5-8.5 8.6-22.4.1-30.8z"/>
<symbol id='discourse-no-entry' viewBox="0 0 496 496">
<path d="M248 0C111 0 0 111 0 248s111 248 248 248 248-111 248-248S385 0 248 0zm161.3 299.9H86.6c-11.4 0-20.6-10.1-20.6-22.5v-58.7c0-12.4 9.2-22.5 20.6-22.5h322.5c11.4 0 20.7 10.2 20.7 22.7v58.5c.1 12.4-9.1 22.5-20.5 22.5z"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB