Finalize FA5 fixes

This commit is contained in:
Penar Musaraj 2018-11-15 11:12:32 -05:00
parent 3d6743dd14
commit 061322e53a
6 changed files with 21 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import { categoryLinkHTML } from "discourse/helpers/category-link";
import { autoUpdatingRelativeAge } from "discourse/lib/formatter";
import { bufferedRender } from "discourse-common/lib/buffered-render";
import { iconHTML, convertIconClass } from "discourse-common/lib/icon-library";
function icon_or_image_replacement(str, ctx) {
str = Ember.get(ctx.contexts[0], str);
@ -8,8 +9,9 @@ function icon_or_image_replacement(str, ctx) {
return "";
}
if (str.indexOf("fa-") === 0) {
return new Handlebars.SafeString("<i class='fa " + str + "'></i>");
if (str.indexOf("fa-") > -1) {
const icon = iconHTML(convertIconClass(str));
return new Handlebars.SafeString(icon);
} else {
return new Handlebars.SafeString("<img src='" + str + "'>");
}

View File

@ -19,7 +19,7 @@
{{#if othersDirty}}
<div class="warning">
{{fa-icon "warning"}}
{{d-icon "warning"}}
{{i18n "explorer.others_dirty"}}
</div>
{{/if}}

View File

@ -1,8 +1,8 @@
<div class="schema-table-name">
{{#if table.open}}
<i class="fa fa-caret-down"></i>
{{d-icon "caret-down"}}
{{else}}
<i class="fa fa-caret-right"></i>
{{d-icon "caret-right"}}
{{/if}}
{{table.name}}
</div>
@ -13,7 +13,7 @@
<div>
<dt class="{{if col.sensitive "sensitive"}}" title="{{if col.sensitive (i18n "explorer.schema.sensitive")}}">
{{#if col.sensitive}}
<i class="fa fa-warning"></i>
{{d-icon "warning"}}
{{/if}}
{{col.column_name}}
</dt>
@ -22,14 +22,15 @@
{{#if col.havetypeinfo}}
<br>
{{#if col.havepopup}}
<i class="fa fa-info popup-info">
<div class="popup-info">
{{d-icon "info"}}
<div class="popup">
{{col.column_desc}}
{{#if col.enum}}
{{explorer-schema-enuminfo col=col}}
{{/if}}
</div>
</i>
</div>
{{/if}}
<span class="schema-typenotes">
{{col.notes}}

View File

@ -8,5 +8,5 @@
<div class="jsfu-paste">
{{textarea value=value}}
</div>
<div class="jsfu-shade {{if hover '' 'hidden'}}"><span class="text">{{fa-icon "upload"}}</span></div>
<div class="jsfu-shade {{if hover '' 'hidden'}}"><span class="text">{{d-icon "upload"}}</span></div>
</div>

View File

@ -2,7 +2,6 @@
<aside class="quote" data-post="{{post.post_number}}" data-topic="{{post.topic_id}}">
<div class="title">
<div class="quote-controls">
{{!<i class="fa fa-chevron-down" title="expand/collapse"></i>}}
<a href="/t/via-quote/{{post.topic_id}}/{{post.post_number}}"
title="go to the quoted post"
class="quote-other-topic">

View File

@ -7,8 +7,15 @@
enabled_site_setting :data_explorer_enabled
register_asset 'stylesheets/explorer.scss'
register_svg_icon "upload" if respond_to?(:register_svg_icon)
register_svg_icon "chevron-left" if respond_to?(:register_svg_icon)
if respond_to?(:register_svg_icon)
register_svg_icon "caret-down"
register_svg_icon "caret-right"
register_svg_icon "chevron-left"
register_svg_icon "exclamation-circle"
register_svg_icon "info"
register_svg_icon "pencil-alt"
register_svg_icon "upload"
end
# route: /admin/plugins/explorer
add_admin_route 'explorer.title', 'explorer'