UX: Replaced locked topic "lock" icon with "comment-slash" icon

This commit is contained in:
Kris 2020-04-21 17:34:59 -04:00
parent f51b48b421
commit b6489d2690
9 changed files with 39 additions and 19 deletions

View File

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

View File

@ -30,7 +30,7 @@ addBulkButton("showChangeCategory", "change_category", {
class: "btn-default"
});
addBulkButton("closeTopics", "close_topics", {
icon: "lock",
icon: "discourse-comment-slash",
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("lock", "locked_and_archived");
renderIcon("discourse-comment-slash", "locked_and_archived");
} else {
renderIconIf("closed", "lock", "locked");
renderIconIf("archived", "lock", "archived");
renderIconIf("closed", "discourse-comment-slash", "locked");
renderIconIf("archived", "discourse-comment-slash", "archived");
}
this.forEach(args => renderIconIf(...args));

View File

@ -38,11 +38,14 @@ export default EmberObject.extend({
}
if (topic.get("closed") && topic.get("archived")) {
results.push({ icon: "lock", key: "locked_and_archived" });
results.push({
icon: "discourse-comment-slash",
key: "locked_and_archived"
});
} else if (topic.get("closed")) {
results.push({ icon: "lock", key: "locked" });
results.push({ icon: "discourse-comment-slash", key: "locked" });
} else if (topic.get("archived")) {
results.push({ icon: "lock", key: "archived" });
results.push({ icon: "discourse-comment-slash", key: "archived" });
}
if (topic.get("pinned")) {

View File

@ -233,7 +233,7 @@
{{#if showNotificationsTab}}
<li>
{{#link-to 'userNotifications'}}
{{d-icon "comment" class="glyph"}}{{i18n 'user.notifications'}}
{{d-icon "discourse-comment" class="glyph"}}{{i18n 'user.notifications'}}
{{/link-to}}
</li>
{{/if}}

View File

@ -32,10 +32,10 @@ export function actionDescription(actionCode, createdAt, username) {
}
const icons = {
"closed.enabled": "lock",
"closed.disabled": "unlock-alt",
"autoclosed.enabled": "lock",
"autoclosed.disabled": "unlock-alt",
"closed.enabled": "discourse-comment-slash",
"closed.disabled": "discourse-comment",
"autoclosed.enabled": "discourse-comment-slash",
"autoclosed.disabled": "discourse-comment",
"archived.enabled": "folder",
"archived.disabled": "folder-open",
"pinned.enabled": "thumbtack",
@ -52,7 +52,7 @@ const icons = {
user_left: "minus-circle",
removed_user: "minus-circle",
removed_group: "minus-circle",
public_topic: "comment",
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: "unlock",
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: "lock",
icon: "discourse-comment-slash",
label: "actions.close"
});
}
@ -239,7 +239,7 @@ export default createWidget("topic-admin-menu", {
action: isPrivateMessage
? "convertToPublicTopic"
: "convertToPrivateMessage",
icon: isPrivateMessage ? "comment" : "envelope",
icon: isPrivateMessage ? "discourse-comment" : "envelope",
label: isPrivateMessage
? "actions.make_public"
: "actions.make_private"

View File

@ -62,6 +62,8 @@ module SvgSprite
"discourse-bell-one",
"discourse-bell-slash",
"discourse-compress",
"discourse-comment",
"discourse-comment-slash",
"discourse-expand",
"download",
"ellipsis-h",

View File

@ -27,4 +27,13 @@ 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 Slash" is a version of https://fontawesome.com/icons/comment-slash?style=regular that has been recreated to be more legible at small sizes -->
<symbol id='discourse-comment-slash' viewBox="0 0 640 512">
<path d="M634 471L481.6 351.8l-6.8-5.3L36 3.5C29.1-2 19-.9 13.5 6l-10 12.5C-2 25.4-.9 35.5 6 41l598 467.5c6.9 5.5 17 4.4 22.5-2.5l10-12.5c5.5-6.9 4.4-17-2.5-22.5zM224.2 89.9c36.8-19.6 81.2-29.1 127.6-24.6 59 5.6 113 33.3 148 76.1 29.5 36 43.3 80 38.8 123.7-2.1 20.4-8 39.7-17 57.3l41.6 32.5c14.8-25.9 24.1-54.4 27.2-84.5 5.9-57.7-11.9-115.2-50.3-162-43.8-53.4-110.7-88-183.4-94.9-63.4-6.1-125.6 8.8-176.5 42l44 34.4zM407.1 416c-22 7.2-45.8 11.1-70.4 11.1-7.4 0-14.9-.4-22.5-1.1-29.6-2.8-57.7-11-83.6-24.4-3.7-1.9-7.8-2.9-11.9-2.9-2.2 0-4.4.3-6.6.9l-102.9 27 38.5-87c3.9-8.7 2.6-18.9-3.2-26.5-15.2-19.6-20.9-48.8-17-86.9.9-8.6 2.5-17 4.7-25.2l-43.6-34.1c-6.5 17.2-10.8 35.3-12.8 54-4.6 44.6 1.7 81.8 18.6 110.7L39.7 454.9c-4 9.1-2.5 19.8 4 27.4 5 5.9 12.3 9.2 19.8 9.2 2.2 0 4.4-.3 6.6-.9l145.8-38.2c29.3 13.8 60.6 22.3 93.4 25.4 9.2.9 18.5 1.3 27.6 1.3 41.4 0 81.5-8.9 117.7-25.9L407.1 416z"/>
</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-slash icon -->
<symbol id='discourse-comment' viewBox="0 0 554 479.3">
<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>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB