1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

sorting acl and styling

This commit is contained in:
diminator 2015-08-14 15:38:30 +02:00
parent e843e2fa52
commit 5b2e90a03c
4 changed files with 61 additions and 13 deletions

View File

@ -31,6 +31,29 @@ let PieceListToolbar = React.createClass({
this.props.searchFor(searchTerm); this.props.searchFor(searchTerm);
}, },
getFilterWidget(){
if (this.props.filterParams){
return (
<PieceListToolbarFilterWidget
filterParams={this.props.filterParams}
filterBy={this.props.filterBy}
applyFilterBy={this.props.applyFilterBy} />
);
}
return null;
},
getOrderWidget(){
if (this.props.orderParams){
return (
<PieceListToolbarOrderWidget
orderParams={this.props.orderParams}
orderBy={this.props.orderBy}
applyOrderBy={this.props.applyOrderBy}/>
);
}
return null;
},
render() { render() {
let searchIcon = <Glyphicon glyph='search' className="filter-glyph"/>; let searchIcon = <Glyphicon glyph='search' className="filter-glyph"/>;
@ -51,16 +74,8 @@ let PieceListToolbar = React.createClass({
addonAfter={searchIcon} /> addonAfter={searchIcon} />
</span> </span>
<span className="pull-right"> <span className="pull-right">
<PieceListToolbarOrderWidget {this.getOrderWidget()}
orderParams={this.props.orderParams} {this.getFilterWidget()}
orderBy={this.props.orderBy}
applyOrderBy={this.props.applyOrderBy}/>
</span>
<span className="pull-right">
<PieceListToolbarFilterWidget
filterParams={this.props.filterParams}
filterBy={this.props.filterBy}
applyFilterBy={this.props.applyFilterBy}/>
</span> </span>
</div> </div>
</div> </div>

View File

@ -3,23 +3,34 @@
import React from 'react'; import React from 'react';
import PieceList from '../../../piece_list'; import PieceList from '../../../piece_list';
import UserActions from '../../../../actions/user_actions';
import UserStore from '../../../../stores/user_store';
import PrizeActions from '../actions/prize_actions'; import PrizeActions from '../actions/prize_actions';
import PrizeStore from '../stores/prize_store'; import PrizeStore from '../stores/prize_store';
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink'; import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
import AccordionListItemPrize from './ascribe_accordion_list/accordion_list_item_prize'; import AccordionListItemPrize from './ascribe_accordion_list/accordion_list_item_prize';
import { mergeOptions } from '../../../../utils/general_utils';
let PrizePieceList = React.createClass({ let PrizePieceList = React.createClass({
getInitialState() { getInitialState() {
return PrizeStore.getState(); return mergeOptions(
PrizeStore.getState(),
UserStore.getState()
);
}, },
componentDidMount() { componentDidMount() {
UserStore.listen(this.onChange);
UserActions.fetchCurrentUser();
PrizeStore.listen(this.onChange); PrizeStore.listen(this.onChange);
PrizeActions.fetchPrize(); PrizeActions.fetchPrize();
}, },
componentWillUnmount() { componentWillUnmount() {
UserStore.unlisten(this.onChange);
PrizeStore.unlisten(this.onChange); PrizeStore.unlisten(this.onChange);
}, },
@ -43,7 +54,8 @@ let PrizePieceList = React.createClass({
<PieceList <PieceList
redirectTo="register_piece" redirectTo="register_piece"
accordionListItemType={AccordionListItemPrize} accordionListItemType={AccordionListItemPrize}
orderParams={['rating', 'title']} orderParams={this.state.currentUser.is_jury ? ['rating', 'title'] : ['artist_name', 'title']}
filterParams={null}
customSubmitButton={this.getButtonSubmit()}/> customSubmitButton={this.getButtonSubmit()}/>
</div> </div>
); );

View File

@ -14,11 +14,13 @@
.ascribe-input-glyph > .form-group > .input-group { .ascribe-input-glyph > .form-group > .input-group {
margin-left: 6px; margin-left: 6px;
input { input {
box-shadow: none;
background-color: transparent;
border: 1px solid #02b6a3; border: 1px solid #02b6a3;
border-right: 0; border-right: 0;
} }
> .input-group-addon { > .input-group-addon {
background-color: white; background-color: transparent;
> .filter-glyph { > .filter-glyph {
color: #02b6a3; color: #02b6a3;
} }

View File

@ -80,6 +80,25 @@ hr {
font-size: 0.8em; font-size: 0.8em;
} }
.navbar-default .navbar-nav > .active {
a {
background-color: transparent!important;
> span {color: #02b6a3;}
color: #02b6a3;
border-bottom: 1px solid #02b6a3;
&:hover, &:focus{
> span {color: #02b6a3;}
color: #02b6a3;
background-color: transparent;
border-bottom: 1px solid #02b6a3;
}
}
}
.navbar-default .navbar-nav > li > a {
border: 1px solid rgba(0,0,0,0);
}
.img-brand { .img-brand {
padding: 0; padding: 0;
height: 45px; height: 45px;