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);
},
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() {
let searchIcon = <Glyphicon glyph='search' className="filter-glyph"/>;
@ -51,16 +74,8 @@ let PieceListToolbar = React.createClass({
addonAfter={searchIcon} />
</span>
<span className="pull-right">
<PieceListToolbarOrderWidget
orderParams={this.props.orderParams}
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}/>
{this.getOrderWidget()}
{this.getFilterWidget()}
</span>
</div>
</div>

View File

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

View File

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

View File

@ -80,6 +80,25 @@ hr {
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 {
padding: 0;
height: 45px;