Skip to content

Commit

Permalink
Updates for branding
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-cos committed Aug 4, 2023
1 parent b930c43 commit ce09855
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 16 deletions.
3 changes: 2 additions & 1 deletion app/preprints/index/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Preprints extends Route {
try {
const provider_id = params.provider_id ? params.provider_id : 'osf';

const provider = await this.store.findRecord('preprint-provider', provider_id);
const provider = await this.store.findRecord('preprint-provider', provider_id, {include: 'brand'});
this.theme.set('providerType', 'preprint');
this.theme.set('id', provider_id);

Expand All @@ -37,6 +37,7 @@ export default class Preprints extends Route {
provider,
taxonomies,
brandedProviders,
brand: provider.brand.content,
};

} catch (error) {
Expand Down
26 changes: 18 additions & 8 deletions app/preprints/index/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
background-color: var(--secondary-color);
color: var(--primary-color) !important;

&.osf {
background: url('images/default-brand/bg-dark.jpg');
}

a:not(:global(.btn)) {
color: var(--primary-color);
text-decoration: underline;
Expand All @@ -38,6 +34,20 @@
align-items: center;
color: var(--primary-color);

.or-container {
font-size: 21px;
margin-bottom: 20px;
font-weight: 300;
line-height: 1.4;
color: $color-text-white;

width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.example-container {
display: flex;
justify-content: center;
Expand Down Expand Up @@ -83,7 +93,7 @@

/* Preprint providers and become provider */
.preprint-tool-container {
background: url('images/default-brand/bg-dark.jpg');
background: var(--hero-background-img-url);
color: $color-text-white;
text-shadow: 0 0 5px #506069;
background-size: cover;
Expand Down Expand Up @@ -142,9 +152,7 @@
.links {
color: $color-text-white;
text-decoration: underline;

}

}

.contact {
Expand All @@ -156,7 +164,9 @@
h2 {
text-transform: capitalize;
}

}

.osf-preprint-advisory-container {
background-image: none;
}
}
11 changes: 7 additions & 4 deletions app/preprints/index/template.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{page-title (t 'preprints.title')}}

<div local-class='preprints-page-container' {{with-branding (get-model this.theme.provider.brand) }}
<div local-class='preprints-page-container'
{{with-branding this.model.brand}}
data-analytics-scope='preprints landing page'
>

{{!HEADER}}
<div local-class='preprint-header'>
<BrandedHeader
Expand All @@ -29,7 +29,7 @@
{{#branded-header.row}}
{{#if this.theme.provider.allowSubmissions}}
<div local-class='submit-container'>
<div class='lead'>{{t 'preprints.header.or'}}</div>
<div local-class='or-container'>{{t 'preprints.header.or'}}</div>
<OsfLink
data-test-submit-button
data-analytics-name='submit button'
Expand Down Expand Up @@ -152,7 +152,10 @@

{{!ADVISORY GROUP}}
{{#if this.theme.provider.advisoryBoard.length}}
<div class='preprint-advisory-container'>
<div
class='preprint-advisory-container'
local-class='{{if this.isOsf 'osf-preprint-advisory-container'}}'
>
<div class='preprint-advisory-inner-container'>
{{html-safe this.theme.provider.advisoryBoard 'advisory-board'}}
</div>
Expand Down
3 changes: 1 addition & 2 deletions app/styles/_branding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
--primary-color: #{$color-osf-primary};
--secondary-color: #{$color-osf-secondary};
--navbar-logo-img-url: url('images/default-brand/cos-logo-white.svg');
--hero-logo-registries-img-url: url('images/default-brand/osf-registries-white.png');
--hero-logo-preprints-img-url: url('images/default-brand/osf-preprints-white.png');
--hero-logo-img-url: url('images/default-brand/osf-registries-white.png');
--hero-background-img-url: url('images/default-brand/bg-dark.jpg');
}

Expand Down
1 change: 1 addition & 0 deletions app/styles/_preprint.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// stylelint-disable max-nesting-depth, selector-max-compound-selectors

.preprint-advisory-container {
background: var(--hero-background-img-url);
background-color: $color-bg-gray-lighter;
border-bottom: 1px solid #6d8a98;
padding-top: 15px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
justify-content: center;
align-items: center;
color: $color-text-white;
background: var(--hero-background-img-url);

.lead {
font-size: 21px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

.provider-logo {
background: var(--hero-logo-registries-img-url) top center no-repeat;
background: var(--hero-logo-img-url) top center no-repeat;
background-size: contain;
height: 70px;
width: 100%;
Expand Down
3 changes: 3 additions & 0 deletions mirage/scenarios/preprints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ function buildOSF(
const brand = server.create('brand', {
primaryColor: '#286090',
secondaryColor: '#fff',
heroLogoImage: 'images/default-brand/osf-preprints-white.png',
heroBackgroundImage: 'images/default-brand/bg-dark.jpg',
});
const currentUserModerator = server.create('moderator',
{ id: currentUser.id, user: currentUser, provider: osf }, 'asAdmin');
Expand Down Expand Up @@ -49,6 +51,7 @@ function buildThesisCommons(
const brand = server.create('brand', {
primaryColor: '#721a0e',
secondaryColor: '#fec216',
heroBackgroundImage: 'https://singlecolorimage.com/get/fec216/1000x1000',
});
const currentUserModerator = server.create('moderator',
{ id: currentUser.id, user: currentUser, provider: thesisCommons }, 'asAdmin');
Expand Down

0 comments on commit ce09855

Please sign in to comment.