Add custom styling for PR

This commit is contained in:
Tim Daubenschütz 2015-12-08 16:43:45 +01:00
parent 7e5662676c
commit 32bc4b0c69
6 changed files with 60 additions and 20 deletions

View File

@ -37,16 +37,9 @@ import { constructHead } from '../utils/dom_utils';
let Header = React.createClass({
propTypes: {
showAddWork: React.PropTypes.bool,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
},
getDefaultProps() {
return {
showAddWork: true
};
},
getInitialState() {
return mergeOptions(
WhitelabelStore.getState(),

View File

@ -13,7 +13,7 @@ export function AuthPrizeRoleRedirect({ to, when }) {
return function(currentUser, query) {
const exprToValidate = when
.map((role) => currentUser[role])
.map(role => currentUser[role])
.reduce((a, b) => a || b);
if(exprToValidate) {

View File

@ -52,7 +52,7 @@ let PRApp = React.createClass({
header = <Hero />;
style = { paddingTop: '0 !important' };
} else if(currentUser && (currentUser.is_admin || currentUser.is_jury || currentUser.is_judge)) {
header = <Header routes={routes} showAddWork={false} />;
header = <Header routes={routes} />;
} else {
style = { paddingTop: '0 !important' };
}

View File

@ -61,15 +61,14 @@ const ROUTES = {
),
portfolioreview: (
<Route path='/' component={PRApp}>
<IndexRoute component={PRLanding} />
<IndexRoute component={ProxyHandler(AuthPrizeRoleRedirect({ to: '/collection', when: ['is_admin', 'is_judge', 'is_jury'] }))(PRLanding)} />
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PRRegisterPiece)}
headerTitle='+ NEW WORK'/>
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PRRegisterPiece)}/>
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
headerTitle='COLLECTION'/>
headerTitle='SUBMISSIONS'/>
<Route
path='login'
component={ProxyHandler(

View File

@ -48,7 +48,9 @@ let PrizePieceList = React.createClass({
},
getButtonSubmit() {
if (this.state.prize && this.state.prize.active && !this.state.currentUser.is_jury){
const { currentUser } = this.state;
if (this.state.prize && this.state.prize.active &&
!currentUser.is_jury && !currentUser.is_admin && !currentUser.is_judge){
return (
<LinkContainer to="/register_piece">
<Button>
@ -57,9 +59,6 @@ let PrizePieceList = React.createClass({
</LinkContainer>
);
}
else if (this.state.prize && this.state.currentUser.is_judge){
return null;
}
return null;
},

View File

@ -22,10 +22,59 @@ $pr--button-color: $pr--nav-fg-prim-color;
}
}
.navbar-default {
.navbar-nav > .ascribe-powered-by, li > a {
color: $pr--button-color !important;
}
.active a {
border-bottom-color: $pr--button-color !important;
color: $pr--button-color !important;
}
}
.search-bar > .form-group > .input-group input {
&::-webkit-input-placeholder {
color: rgba($pr--button-color, 0.5);
}
&::-moz-placeholder {
color: rgba($pr--button-color, 0.5);
}
&:-ms-input-placeholder {
color: rgba($pr--button-color, 0.5);
}
&:-moz-placeholder {
color: rgba($pr--button-color, 0.5);
}
}
.icon-ascribe-search {
color: $pr--button-color;
}
// filter widget
.ascribe-piece-list-toolbar-filter-widget button {
background-color: transparent !important;
border-color: transparent !important;
color: $pr--button-color !important;
&:hover,
&:active {
background-color: $pr--button-color !important;
border-color: $pr--button-color !important;
color: white !important;
}
}
.ascribe-property {
> p > span:not(> .span),
> textarea,
> input {
> div,
> input,
> pre,
> select,
> span:not(.glyphicon),
> p,
> p > span,
> textarea {
color: $pr--nav-fg-prim-color;
}
}