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

code styling

This commit is contained in:
Tim Daubenschütz 2015-06-03 10:45:23 +02:00
parent 82d14b30fc
commit b4076aeef7
5 changed files with 52 additions and 15 deletions

View File

@ -5,7 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ascribe</title> <title>ascribe</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="node_modules/react-datepicker/dist/react-datepicker.css">
<link rel="stylesheet" href="//brick.a.ssl.fastly.net/Source+Sans+Pro:400,600,700,900"> <link rel="stylesheet" href="//brick.a.ssl.fastly.net/Source+Sans+Pro:400,600,700,900">
<link rel="stylesheet" href="build/css/main.css"> <link rel="stylesheet" href="build/css/main.css">
</head> </head>

View File

@ -53,10 +53,53 @@ let AccordionListItemTableEditions = React.createClass({
render() { render() {
let columnList = [ let columnList = [
new TableColumnContentModel((item) => { return { 'editionId': item.id, 'pieceId': this.props.parentId, 'selectItem': this.selectItem, 'selected': item.selected }}, '', '', TableItemCheckbox, 1, false), new TableColumnContentModel(
new TableColumnContentModel((item) => { return { 'content': item.edition_number }}, 'num_editions', '#', TableItemText, 1, false), (item) => {
new TableColumnContentModel((item) => { return { 'content': item.bitcoin_id }}, 'bitcoin_id', getLangText('Bitcoin Address'), TableItemText, 5, false), return {
new TableColumnContentModel((item) => { return { 'content': item.acl }}, 'acl', getLangText('Actions'), TableItemAclFiltered, 4, false) 'editionId': item.id,
'pieceId': this.props.parentId,
'selectItem': this.selectItem,
'selected': item.selected
}},
'',
'',
TableItemCheckbox,
1,
false
),
new TableColumnContentModel(
(item) => {
return {
'content': item.edition_number
}},
'num_editions',
'#',
TableItemText,
1,
false
),
new TableColumnContentModel(
(item) => {
return {
'content': item.bitcoin_id
}},
'bitcoin_id',
getLangText('Bitcoin Address'),
TableItemText,
5,
false
),
new TableColumnContentModel(
(item) => {
return {
'content': item.acl
}},
'acl',
getLangText('Actions'),
TableItemAclFiltered,
4,
false
)
]; ];
return ( return (

View File

@ -33,17 +33,13 @@ let PieceListBulkModal = React.createClass({
UserStore.unlisten(this.onChange); UserStore.unlisten(this.onChange);
}, },
filterForSelected(edition) {
return edition.selected;
},
fetchSelectedEditionList() { fetchSelectedEditionList() {
let selectedEditionList = []; let selectedEditionList = [];
Object Object
.keys(this.state.editionList) .keys(this.state.editionList)
.forEach((key) => { .forEach((key) => {
let filteredEditionsForPiece = this.state.editionList[key].filter(this.filterForSelected); let filteredEditionsForPiece = this.state.editionList[key].filter((edition) => edition.selected);
selectedEditionList = selectedEditionList.concat(filteredEditionsForPiece); selectedEditionList = selectedEditionList.concat(filteredEditionsForPiece);
}); });
@ -54,10 +50,6 @@ let PieceListBulkModal = React.createClass({
return a.filter((val) => b.indexOf(val) > -1); return a.filter((val) => b.indexOf(val) > -1);
}, },
bulk(action) {
console.log(action);
},
getAvailableAcls() { getAvailableAcls() {
let availableAcls = []; let availableAcls = [];
let selectedEditionList = this.fetchSelectedEditionList(); let selectedEditionList = this.fetchSelectedEditionList();

View File

@ -7,8 +7,10 @@ let TableItemAclFiltered = React.createClass({
}, },
render() { render() {
var availableAcls = ['consign', 'loan', 'transfer', 'view'];
let filteredAcls = this.props.content.filter((v) => { let filteredAcls = this.props.content.filter((v) => {
return v === 'consign' || v === 'loan' || v === 'transfer' || v === 'view'; return availableAcls.indexOf(v) > -1;
}); });
return ( return (

View File

@ -3,6 +3,7 @@
@import 'variables'; @import 'variables';
@import 'ascribe_variables'; @import 'ascribe_variables';
@import '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap'; @import '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap';
@import '../node_modules/react-datepicker/dist/react-datepicker';
@import './ascribe-fonts/style'; @import './ascribe-fonts/style';
@import './ascribe-fonts/ascribe-fonts'; @import './ascribe-fonts/ascribe-fonts';
@import 'ascribe_accordion_list'; @import 'ascribe_accordion_list';