Skip to content

A platform for community discussion. Free, open, simple.

UX: Don't link to theme source unless it's http(s)

David Taylore67474daf4e6
diff --git a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6
index f572813c8a0..b54d1e9b09a 100644
--- a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js.es6
@@ -147,6 +147,10 @@ export default Ember.Controller.extend({
"scss"
);
},
+ sourceIsHttp: Ember.computed.match(
+ "model.remote_theme.remote_url",
+ /^http(s)?:\/\//
+ ),
actions: {
updateToLatest() {
this.set("updatingRemote", true);
diff --git a/app/assets/javascripts/admin/templates/customize-themes-show.hbs b/app/assets/javascripts/admin/templates/customize-themes-show.hbs
index 2a2bfa09043..d904f7d053b 100644
--- a/app/assets/javascripts/admin/templates/customize-themes-show.hbs
+++ b/app/assets/javascripts/admin/templates/customize-themes-show.hbs
@@ -38,7 +38,11 @@
{{#if model.remote_theme}}
{{#if model.remote_theme.remote_url}}
- <a class="remote-url" href="{{model.remote_theme.remote_url}}">{{i18n "admin.customize.theme.source_url"}} {{d-icon "link"}}</a>
+ {{#if sourceIsHttp}}
+ <a class="remote-url" href="{{model.remote_theme.remote_url}}">{{i18n "admin.customize.theme.source_url"}} {{d-icon "link"}}</a>
+ {{else}}
+ <div class="remote-url"><code>{{model.remote_theme.remote_url}}</code></div>
+ {{/if}}
{{/if}}
{{#if model.remote_theme.about_url}}
<a class="url about-url" href="{{model.remote_theme.about_url}}">{{i18n "admin.customize.theme.about_theme"}} {{d-icon "link"}}</a>
diff --git a/app/assets/stylesheets/common/admin/customize.scss b/app/assets/stylesheets/common/admin/customize.scss
index 068f1441e7e..ccc8eed9561 100644
--- a/app/assets/stylesheets/common/admin/customize.scss
+++ b/app/assets/stylesheets/common/admin/customize.scss
@@ -140,9 +140,14 @@
}
}
- .remote-url,
- .about-url,
- .license-url {
+ div.remote-url {
+ font-size: $font-down-1;
+ margin-bottom: 7px;
+ }
+
+ a.remote-url,
+ a.about-url,
+ a.license-url {
display: inline-block;
margin-right: 10px;
}