Merge pull request #10540 from guerler/enable_custom_logo

Allow admins to add an additional custom logo to the masthead
This commit is contained in:
Enis Afgan
2020-10-29 09:40:35 -04:00
committed by GitHub
8 changed files with 58 additions and 5 deletions
+13 -2
View File
@@ -9,6 +9,7 @@
>
<b-navbar-brand :href="brandLink" aria-label="homepage">
<img alt="logo" class="navbar-brand-image" :src="brandImage" />
<img alt="logo" class="navbar-brand-image" :src="brandImageSecondary" v-if="brandImageSecondary" />
<span class="navbar-brand-title">{{ brandTitle }}</span>
</b-navbar-brand>
@@ -44,27 +45,39 @@ export default {
},
brand: {
type: String,
default: null,
},
brandLink: {
type: String,
default: null,
},
brandImage: {
type: String,
default: null,
},
brandImageSecondary: {
type: String,
default: null,
},
activeTab: {
type: String,
default: null,
},
mastheadState: {
type: Object,
default: null,
},
appRoot: {
type: String,
default: null,
},
galaxy: {
type: Object,
default: null,
},
menuOptions: {
type: Object,
default: null,
},
},
components: {
@@ -141,5 +154,3 @@ export default {
},
};
</script>
<style scoped></style>
+1
View File
@@ -51,6 +51,7 @@ export function mountMasthead(el, options, mastheadState) {
brand: options.brand,
brandLink: options.logo_url,
brandImage: options.logo_src,
brandImageSecondary: options.logo_src_secondary,
appRoot: getAppRoot(),
galaxy: getGalaxyInstance(),
menuOptions: options,
+1
View File
@@ -390,6 +390,7 @@ body {
display: inline;
margin-right: 0.3rem;
border: none;
max-height: 2rem;
}
.navbar-brand-title {
color: $brand-masthead-text;
+20
View File
@@ -1711,6 +1711,26 @@
:Type: str
~~~~~~~~~~~~
``logo_src``
~~~~~~~~~~~~
:Description:
The brand image source.
:Default: ``/static/favicon.png``
:Type: str
~~~~~~~~~~~~~~~~~~~~~~
``logo_src_secondary``
~~~~~~~~~~~~~~~~~~~~~~
:Description:
The custom brand image source.
:Default: ``None``
:Type: str
~~~~~~~~~~~~~~~~
``helpsite_url``
~~~~~~~~~~~~~~~~
@@ -925,6 +925,12 @@ galaxy:
# The URL linked by the "Galaxy/brand" text.
#logo_url: /
# The brand image source.
#logo_src: /static/favicon.png
# The custom brand image source.
#logo_src_secondary: null
# The URL linked by the "Galaxy Help" link in the "Help" menu.
#helpsite_url: null
+2 -2
View File
@@ -43,9 +43,9 @@ class ConfigSerializer(base.ModelSerializer):
'is_admin_user' : lambda *a, **c: False,
'brand' : _use_config,
'display_galaxy_brand' : _use_config,
# TODO: this doesn't seem right
'logo_url' : lambda config, key, **context: self.url_for(config.get(key, '/')),
'logo_src' : lambda config, key, **context: self.url_for('/static/favicon.png'),
'logo_src' : lambda config, key, **context: self.url_for(config.get(key, '/static/favicon.png')),
'logo_src_secondary' : lambda config, key, **context: self.url_for(config.get(key)) if config.get(key) else None,
'terms_url' : _use_config,
'myexperiment_target_url' : _use_config,
'wiki_url' : _use_config,
@@ -1246,6 +1246,19 @@ mapping:
desc: |
The URL linked by the "Galaxy/brand" text.
logo_src:
type: str
default: /static/favicon.png
required: false
desc: |
The brand image source.
logo_src_secondary:
type: str
required: false
desc: |
The custom brand image source.
helpsite_url:
type: str
required: false
@@ -24,7 +24,8 @@
'terms_url' : app.config.terms_url or '',
'allow_user_creation' : app.config.allow_user_creation,
'logo_url' : h.url_for(app.config.logo_url),
'logo_src' : h.url_for( app.config.get( 'logo_src', '/static/favicon.png' ) ),
'logo_src' : h.url_for(app.config.get('logo_src', '/static/favicon.png')),
'logo_src_secondary' : h.url_for(app.config.get('logo_src_secondary')) if app.config.get('logo_src_secondary') else None,
'is_admin_user' : trans.user_is_admin,
'active_view' : active_view,
'ftp_upload_site' : app.config.ftp_upload_site,