1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Merge branch 'master' into piece-detail-mediaplayer

Conflicts:
	js/components/edition.js
This commit is contained in:
vrde 2015-06-02 14:00:47 +02:00
commit 3e7a670509
56 changed files with 1647 additions and 230 deletions

2
.gitignore vendored
View File

@ -14,6 +14,6 @@ results
node_modules
npm-debug.log
build/app.js
build
.DS_Store

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -9,13 +9,19 @@ var browserify = require('browserify');
var browserSync = require('browser-sync');
var babelify = require('babelify');
var notify = require('gulp-notify');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var _ = require('lodash');
var config = {
bootstrapDir: './node_modules/bootstrap-sass'
};
gulp.task('build', function() {
bundle(false);
});
gulp.task('serve', ['browser-sync'], function() {
gulp.task('serve', ['browser-sync', 'sass', 'sass:watch', 'copy'], function() {
bundle(true);
});
@ -28,6 +34,36 @@ gulp.task('browser-sync', function() {
});
});
gulp.task('sass', function () {
gulp.src('./sass/**/main.scss')
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: [
config.bootstrapDir + '/assets/stylesheets'
]
}).on('error', sass.logError))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./build/css'))
.pipe(browserSync.stream());;
});
gulp.task('sass:watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
});
gulp.task('copy', function () {
var files = [
'./fonts/**/*',
'./img/**/*'
];
gulp.src(files, {base: './'})
.pipe(gulp.dest('build'));
gulp.src(config.bootstrapDir + '/assets/fonts/**/*')
.pipe(gulp.dest('./build/fonts'));
});
function bundle(watch) {
var bro;

View File

@ -5,18 +5,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ascribe</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/ascribe-fonts/ascribe-fonts.css">
<link rel="stylesheet" href="css/ascribe-fonts/style.css">
<link rel="stylesheet" href="build/css/main.css">
<link rel="stylesheet" href="//brick.a.ssl.fastly.net/Source+Sans+Pro:400,600,700,900">
</head>
<body>
<div id="main" class="container"></div>
<div id="main" class="container clear-margins-and-paddings"></div>
<div id="modal" class="container"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="build/app.js"></script>
</body>
</html>

View File

@ -6,7 +6,8 @@ class EditionListActions {
constructor() {
this.generateActions(
'updateEditionList',
'selectEdition'
'selectEdition',
'clearAllEditionSelections'
);
}

View File

@ -14,6 +14,7 @@ class PieceListActions {
PieceListFetcher
.fetch(page, pageSize, search, orderBy, orderAsc)
.then((res) => {
console.log(res);
this.actions.updatePieceList({
page,
pageSize,
@ -23,9 +24,6 @@ class PieceListActions {
'pieceList': res.pieces,
'pieceListCount': res.count
});
})
.catch((err) => {
console.log(err);
});
}

View File

@ -2,12 +2,34 @@
import React from 'react';
import Router from 'react-router';
import promise from 'es6-promise';
promise.polyfill();
import AscribeApp from './components/ascribe_app';
import AppConstants from './constants/application_constants';
import ApiUrls from './constants/api_urls';
import routes from './routes';
import alt from './alt';
import fetch from './utils/fetch';
import AlertDismissable from './components/ascribe_forms/alert';
fetch.defaults({
urlMap: ApiUrls,
http: {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64,
'Accept': 'application/json',
'Content-Type': 'application/json'
}
},
fatalErrorHandler: (err) => {
console.log(err);
//alert('Something went wrong, please reload the page');
}
});
Router.run(routes, Router.HashLocation, (AscribeApp) => {
React.render(
<AscribeApp />,

View File

@ -5,24 +5,21 @@ import AppConstants from '../constants/application_constants';
let AclButton = React.createClass({
propTypes: {
action: React.PropTypes.oneOf(AppConstants.aclList).isRequired,
availableAcls: React.PropTypes.array.isRequired
availableAcls: React.PropTypes.array.isRequired,
actionFunction: React.PropTypes.func.isRequired
},
actionFunction() {
this.props.actionFunction(this.props.action);
},
render() {
let shouldDisplay = this.props.availableAcls.indexOf(this.props.action) > -1;
let styles = {};
if(shouldDisplay) {
styles.display = 'inline-block';
} else {
styles.display = 'none';
}
return (
<button
style={styles}
type="button"
className="btn btn-default btn-sm">
className={shouldDisplay ? 'btn btn-default btn-sm' : 'hidden'}
onClick={this.actionFunction}>
{this.props.action.toUpperCase()}
</button>
);

View File

@ -0,0 +1,26 @@
import React from 'react';
import ReactAddons from 'react/addons';
let AccordionList = React.createClass({
propTypes: {
className: React.PropTypes.string,
children: React.PropTypes.arrayOf(React.PropTypes.element).isRequired
},
render() {
if(this.props.itemList && this.props.itemList.length > 0) {
return (
<div className={this.props.className}>
{this.props.children}
</div>
);
} else {
return (
<p>Loading</p>
);
}
}
});
export default AccordionList;

View File

@ -0,0 +1,33 @@
import React from 'react';
import AccordionListItemTable from './accordion_list_item_table';
let AccordionListItem = React.createClass({
propTypes: {
className: React.PropTypes.string,
content: React.PropTypes.object
},
render() {
return (
<div className="row">
<div className={this.props.className}>
<div className="wrapper">
<div className="thumbnail-wrapper">
<img src={this.props.content.thumbnail} />
</div>
<div className="info-wrapper">
<h1>{this.props.content.title}</h1>
<h3>by {this.props.content.artist_name}</h3>
</div>
<span style={{'clear': 'both'}}></span>
</div>
</div>
{this.props.children}
</div>
);
}
});
export default AccordionListItem;

View File

@ -0,0 +1,87 @@
import React from 'react';
import Table from '../ascribe_table/table';
import TableItem from '../ascribe_table/table_item';
import TableColumnContentModel from '../../models/table_column_content_model';
let AccordionListItemTable = React.createClass({
getInitialState() {
return {
'show': false
};
},
propTypes: {
className: React.PropTypes.string,
parentId: React.PropTypes.number,
fetchData: React.PropTypes.func,
itemList: React.PropTypes.array,
columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)),
numOfTableItems: React.PropTypes.number
},
toggleTable() {
this.props.fetchData();
this.setState({
'show': !this.state.show
});
},
render() {
if(this.props.itemList && this.state.show) {
return (
<div className={this.props.className}>
<Table
columnList={this.props.columnList}
itemList={this.props.itemList}>
{this.props.itemList.map((item, i) => {
return (
<TableItem
className="ascribe-table-item-selectable"
key={i}>
</TableItem>
);
})}
</Table>
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.toggleTable}
show={this.state.show}
numOfTableItems={this.props.numOfTableItems} />
</div>
);
} else {
return (
<div className={this.props.className}>
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.toggleTable}
show={this.state.show}
numOfTableItems={this.props.numOfTableItems} />
</div>
);
}
}
});
let AccordionListItemTableToggle = React.createClass({
propTypes: {
className: React.PropTypes.string,
onClick: React.PropTypes.func,
show: React.PropTypes.bool,
numOfTableItems: React.PropTypes.number
},
render() {
return (
<span
className={this.props.className}
onClick={this.props.onClick}>
{this.props.show ? 'Hide all ' + this.props.numOfTableItems + ' Editions' : 'Show all ' + this.props.numOfTableItems + ' Editions'}
</span>
);
}
});
export default AccordionListItemTable;

View File

@ -0,0 +1,67 @@
import React from 'react';
import EditionListStore from '../../stores/edition_list_store';
import EditionListActions from '../../actions/edition_list_actions';
import AccordionListItemTable from './accordion_list_item_table';
import TableColumnContentModel from '../../models/table_column_content_model';
import TableItemImg from '../ascribe_table/table_item_img';
import TableItemText from '../ascribe_table/table_item_text';
import TableItemCheckbox from '../ascribe_table/table_item_checkbox';
import TableItemAclFiltered from '../ascribe_table/table_item_acl_filtered';
let AccordionListItemTableEditions = React.createClass({
propTypes: {
className: React.PropTypes.string,
parentId: React.PropTypes.number,
numOfEditions: React.PropTypes.number
},
getInitialState() {
return EditionListStore.getState();
},
onChange(state) {
this.setState(state);
},
componentDidMount() {
EditionListStore.listen(this.onChange);
},
componentDidUnmount() {
EditionListStore.unlisten(this.onChange);
},
getEditionList() {
EditionListActions.fetchEditionList(this.props.parentId);
},
selectItem(pieceId, editionId) {
EditionListActions.selectEdition({pieceId, editionId});
},
render() {
let columnList = [
new TableColumnContentModel((item) => { return { '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', 'Nr', TableItemText, 1, false),
new TableColumnContentModel((item) => { return { 'content': item.bitcoin_id }}, 'bitcoin_id', 'Bitcoin Address', TableItemText, 5, false),
new TableColumnContentModel((item) => { return { 'content': item.acl }}, 'acl', 'Actions', TableItemAclFiltered, 4, false)
];
return (
<AccordionListItemTable
className={this.props.className}
parentId={this.props.parentId}
fetchData={this.getEditionList}
itemList={this.state.editionList[this.props.parentId]}
columnList={columnList}
numOfTableItems={this.props.numOfEditions} />
);
}
});
export default AccordionListItemTableEditions;

View File

@ -28,4 +28,4 @@ let AlertDismissable = React.createClass({
}
});
export default AlertDismissable;
export default AlertDismissable;

View File

@ -1,10 +1,16 @@
import React from 'react';
import EditionListStore from '../../stores/edition_list_store';
import EditionListActions from '../../actions/edition_list_actions';
import AclButton from '../acl_button';
import PieceListToolbarSelectedEditionsWidget from './piece_list_toolbar_selected_editions_widget';
let PieceListToolbar = React.createClass({
propTypes: {
className: React.PropTypes.string
},
getInitialState() {
return EditionListStore.getState();
},
@ -42,6 +48,10 @@ let PieceListToolbar = React.createClass({
return a.filter((val) => b.indexOf(val) > -1);
},
bulk(action) {
console.log(action);
},
getAvailableAcls() {
let availableAcls = [];
let selectedEditionList = this.fetchSelectedEditionList();
@ -61,21 +71,46 @@ let PieceListToolbar = React.createClass({
return availableAcls;
},
clearAllSelections() {
EditionListActions.clearAllEditionSelections();
},
render() {
let availableAcls = this.getAvailableAcls();
return (
<div className="row no-margin">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12 piece-list-toolbar">
<div className="pull-right">
<AclButton availableAcls={availableAcls} action="transfer" />
<AclButton availableAcls={availableAcls} action="consign" />
<AclButton availableAcls={availableAcls} action="share" />
<AclButton availableAcls={availableAcls} action="loan" />
if(availableAcls.length > 0) {
return (
<div className={this.props.className}>
<div className="row no-margin">
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12 piece-list-toolbar">
<p></p>
<div className="row">
<div className="text-center">
<PieceListToolbarSelectedEditionsWidget
numberOfSelectedEditions={this.fetchSelectedEditionList().length} />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span
className="piece-list-toolbar-clear-all"
onClick={this.clearAllSelections}>clear all</span>
</div>
</div>
<p></p>
<div className="row">
<div className="text-center">
<AclButton availableAcls={availableAcls} action="transfer" actionFunction={this.bulk} />
<AclButton availableAcls={availableAcls} action="consign" actionFunction={this.bulk} />
<AclButton availableAcls={availableAcls} action="share" actionFunction={this.bulk} />
<AclButton availableAcls={availableAcls} action="loan" actionFunction={this.bulk} />
</div>
</div>
</div>
</div>
</div>
</div>
);
);
} else {
return null;
}
}
});

View File

@ -0,0 +1,17 @@
import React from 'react';
let PieceListToolbarSelectedEditionsWidget = React.createClass({
propTypes: {
numberOfSelectedEditions: React.PropTypes.number.isRequired
},
render() {
return (
<span className={this.props.numberOfSelectedEditions < 1 ? 'hidden' : ''}>
{this.props.numberOfSelectedEditions} Editions selected
</span>
);
}
});
export default PieceListToolbarSelectedEditionsWidget;

View File

@ -9,7 +9,7 @@ let Table = React.createClass({
propTypes: {
columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)),
changeOrder: React.PropTypes.func // turn isRequired on again after editions order implemented
changeOrder: React.PropTypes.func
},
renderChildren() {
@ -24,24 +24,20 @@ let Table = React.createClass({
},
render() {
if(this.props.itemList && this.props.itemList.length > 0) {
return (
<div className="ascribe-table">
<TableHeader
columnList={this.props.columnList}
itemList={this.props.itemList}
fetchList={this.props.fetchList}
changeOrder={this.props.changeOrder}
orderAsc={this.props.orderAsc}
orderBy={this.props.orderBy} />
return (
<div className="ascribe-table">
<TableHeader
columnList={this.props.columnList}
itemList={this.props.itemList}
fetchList={this.props.fetchList}
changeOrder={this.props.changeOrder}
orderAsc={this.props.orderAsc}
orderBy={this.props.orderBy} />
<div className="row">
{this.renderChildren()}
</div>
);
} else {
return (
<p>Loading</p>
);
}
</div>
);
}
});

View File

@ -11,13 +11,12 @@ let TableItem = React.createClass({
columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)),
columnContent: React.PropTypes.object,
onClick: React.PropTypes.func, // See: https://facebook.github.io/react/tips/expose-component-functions.html
classNames: React.PropTypes.string
className: React.PropTypes.string
},
render() {
return (
<div
className={this.props.classNames + ' col-xs-12 col-sm-12 col-md-12 col-lg-12 ascribe-table-item'}
<div className={this.props.className + ' col-xs-12 col-sm-12 col-md-12 col-lg-12 ascribe-table-item'}
onClick={this.props.onClick}>
<div className="row">
<TableItemWrapper

View File

@ -0,0 +1,22 @@
import React from 'react';
let TableItemAclFiltered = React.createClass({
propTypes: {
content: React.PropTypes.array.isRequired
},
render() {
let filteredAcls = this.props.content.filter((v) => {
return v === 'consign' || v === 'loan' || v === 'transfer' || v === 'view';
});
return (
<span>
{filteredAcls.join('/')}
</span>
);
}
});
export default TableItemAclFiltered;

View File

@ -0,0 +1,23 @@
import React from 'react';
let TableItemCheckbox = React.createClass({
propTypes: {
editionId: React.PropTypes.number,
pieceId: React.PropTypes.number,
selectItem: React.PropTypes.func,
selected: React.PropTypes.bool
},
selectItem() {
this.props.selectItem(this.props.pieceId, this.props.editionId);
},
render() {
return (
<input type="checkbox" onChange={this.selectItem} checked={this.props.selected}/>
);
}
});
export default TableItemCheckbox;

View File

@ -26,12 +26,13 @@ let TableItemSelectable = React.createClass({
return (
<TableItem
classNames={tableItemClasses + ' ' + this.props.className}
className={tableItemClasses + ' ' + this.props.className}
columnList={this.props.columnList}
columnContent={this.props.columnContent}
onClick={this.selectItem}>
</TableItem>
);
}
});

View File

@ -61,7 +61,7 @@ let TableItemSubtable = React.createClass({
let renderEditionListTable = () => {
let columnList = [
new TableColumnContentModel('edition_number', 'Edition Number', TableItemText, 2, false),
new TableColumnContentModel('edition_number', 'Number', TableItemText, 2, false),
new TableColumnContentModel('user_registered', 'User', TableItemText, 4, true),
new TableColumnContentModel('acl', 'Actions', TableItemAcl, 4, true)
];

View File

@ -17,11 +17,13 @@ let TableItemWrapper = React.createClass({
{this.props.columnList.map((column, i) => {
let TypeElement = column.displayType;
let typeElementProps = column.transformFn(this.props.columnContent);
let columnClass = this.calcColumnClasses(this.props.columnList, i, this.props.columnWidth);
return (
<div className={columnClass + ' ascribe-table-item-column'} key={i}>
<TypeElement content={this.props.columnContent[column.columnName]} width="50" />
<TypeElement {...typeElementProps} />
</div>
);

View File

@ -1,12 +1,7 @@
import React from 'react';
<<<<<<< HEAD
import ResourceViewer from './ascribe_media/resource_viewer';
=======
import ImageViewer from './ascribe_media/image_viewer';
import TransferModalButton from './ascribe_modal/modal_transfer';
import ShareModalButton from './ascribe_modal/modal_share';
>>>>>>> master
/**
* This is the component that implements display-specific functionality

View File

@ -24,7 +24,7 @@ let Header = React.createClass({
render() {
return (
<nav className="navbar navbar-default navbar-fixed-top">
<nav className="navbar navbar-default">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
@ -35,15 +35,12 @@ let Header = React.createClass({
</button>
<a className="navbar-brand" href="#">
<span>ascribe </span>
<span className="glyph-ascribe-spool-chunked"></span>
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
</a>
</div>
<div id="navbar" className="navbar-collapse collapse">
<ul className="nav navbar-nav navbar-left">
<li>
<Link to="pieces">Pieces</Link>
</li>
</ul>
<ul className="nav navbar-nav navbar-right">
<li className="dropdown">

View File

@ -4,14 +4,9 @@ import AltContainer from 'alt/AltContainer';
import PieceListStore from '../stores/piece_list_store';
import PieceListActions from '../actions/piece_list_actions';
import Table from './ascribe_table/table';
import TableItem from './ascribe_table/table_item';
import TableItemImg from './ascribe_table/table_item_img';
import TableItemText from './ascribe_table/table_item_text';
import TableItemSubtable from './ascribe_table/table_item_subtable';
import TableItemSubtableButton from './ascribe_table/table_item_subtable_button';
import TableColumnContentModel from '../models/table_column_content_model';
import AccordionList from './ascribe_accordion_list/accordion_list';
import AccordionListItem from './ascribe_accordion_list/accordion_list_item';
import AccordionListItemTableEditions from './ascribe_accordion_list/accordion_list_item_table_editions';
import Pagination from './ascribe_pagination/pagination';
@ -44,55 +39,48 @@ let PieceList = React.createClass({
this.state.orderAsc);
},
tableChangeOrder(orderBy, orderAsc) {
accordionChangeOrder(orderBy, orderAsc) {
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize,
this.state.search, orderBy, orderAsc);
},
render() {
let columnList = [
new TableColumnContentModel('thumbnail', '', TableItemImg, 2, false),
new TableColumnContentModel('artist_name', 'Artist', TableItemText, 4, true),
new TableColumnContentModel('title', 'Title', TableItemText, 4, true)
];
let currentPage = parseInt(this.props.query.page, 10) || 1;
let totalPages = Math.ceil(this.state.pieceListCount / this.state.pageSize)
if(this.state.pieceList && this.state.pieceList.length > 0) {
return (
<div>
<PieceListToolbar />
<Table
columnList={columnList}
changeOrder={this.tableChangeOrder}
itemList={this.state.pieceList}
itemListCount={this.state.pieceListCount}
orderBy={this.state.orderBy}
orderAsc={this.state.orderAsc}
search={this.state.search}
page={this.state.page}
pageSize={this.state.pageSize}>
{this.state.pieceList.map((item, i) => {
return (
<TableItemSubtable
key={i}>
</TableItemSubtable>
);
})}
</Table>
<Pagination currentPage={currentPage}
totalPages={totalPages}
goToPage={this.paginationGoToPage}>
</Pagination>
</div>
);
} else {
return (
<p>Loading</p>
);
}
return (
<div>
<PieceListToolbar className="ascribe-piece-list-toolbar" />
<AccordionList
className="ascribe-accordion-list"
changeOrder={this.accordionChangeOrder}
itemList={this.state.pieceList}
orderBy={this.state.orderBy}
orderAsc={this.state.orderAsc}
search={this.state.search}
page={this.state.page}
pageSize={this.state.pageSize}>
{this.state.pieceList.map((item, i) => {
return (
<AccordionListItem
className="col-xs-12 col-sm-10 col-md-8 col-lg-8 col-sm-offset-1 col-md-offset-2 col-lg-offset-2 ascribe-accordion-list-item"
content={item}
key={i}>
<AccordionListItemTableEditions
className="ascribe-accordion-list-item-table col-xs-6 col-sm-6 col-md-6 col-lg-6 col-xs-offset-3 col-sm-offset-3 col-md-offset-3 col-lg-offset-3"
parentId={item.id}
numOfEditions={item.num_editions}/>
</AccordionListItem>
);
})}
</AccordionList>
<Pagination
currentPage={currentPage}
totalPages={totalPages}
goToPage={this.paginationGoToPage}>
</Pagination>
</div>
);
}
});

View File

@ -2,7 +2,15 @@ import AppConstants from './application_constants';
let apiUrls = {
'ownership_shares_mail' : AppConstants.baseUrl + 'ownership/shares/mail/',
'ownership_transfers' : AppConstants.baseUrl + 'ownership/transfers/'
'ownership_transfers' : AppConstants.baseUrl + 'ownership/transfers/',
'user': AppConstants.baseUrl + 'users/',
'pieces_list': AppConstants.baseUrl + 'pieces/',
'piece': AppConstants.baseUrl + 'pieces/${piece_id}',
'edition': AppConstants.baseUrl + 'editions/${bitcoin_id}/',
'editions_list': AppConstants.baseUrl + 'pieces/${piece_id}/editions/'
};
export default apiUrls;
export default apiUrls;

View File

@ -1,7 +1,8 @@
let constants = {
'baseUrl': 'http://localhost:8000/api/',
//'baseUrl': 'http://localhost:8000/api/',
'baseUrl': 'http://staging.ascribe.io/api/',
'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000
'aclList': ['edit', 'consign', 'transfer', 'loan', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']
};
export default constants;
export default constants;

View File

@ -1,4 +1,4 @@
import fetch from 'isomorphic-fetch';
import fetch from '../utils/fetch';
import AppConstants from '../constants/application_constants';
import FetchApiUtils from '../utils/fetch_api_utils';
@ -11,13 +11,7 @@ let EditionFetcher = {
*
*/
fetchOne(editionId) {
return fetch(AppConstants.baseUrl + 'editions/' + editionId + '/', {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
}
}).then(
(res) => res.json()
);
return fetch.get('edition', {'bitcoin_id': editionId});
}
};

View File

@ -1,4 +1,4 @@
import fetch from 'isomorphic-fetch';
import fetch from '../utils/fetch';
import AppConstants from '../constants/application_constants';
@ -8,13 +8,8 @@ let EditionListFetcher = {
* Fetches a list of editions from the API.
*/
fetch(pieceId) {
return fetch(AppConstants.baseUrl + 'pieces/' + pieceId + '/editions/', {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
}
}).then((res) => res.json());
return fetch.get('editions_list', { 'piece_id': pieceId });
}
};
export default EditionListFetcher;
export default EditionListFetcher;

View File

@ -1,7 +1,6 @@
import fetch from 'isomorphic-fetch';
import fetch from '../utils/fetch';
import AppConstants from '../constants/application_constants';
import FetchApiUtils from '../utils/fetch_api_utils';
let PieceFetcher = {
@ -11,11 +10,7 @@ let PieceFetcher = {
*
*/
fetchOne(pieceId) {
return fetch(AppConstants.baseUrl + 'pieces/' + pieceId + '/', {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
}
}).then((res) => res.json());
return fetch.get('piece');
}
};

View File

@ -1,7 +1,6 @@
import fetch from 'isomorphic-fetch';
import AppConstants from '../constants/application_constants';
import FetchApiUtils from '../utils/fetch_api_utils';
import fetch from '../utils/fetch';
let PieceListFetcher = {
@ -10,21 +9,8 @@ let PieceListFetcher = {
* Can be called with all supplied queryparams the API.
*/
fetch(page, pageSize, search, orderBy, orderAsc) {
let ordering = FetchApiUtils.generateOrderingQueryParams(orderBy, orderAsc);
let params = FetchApiUtils.argsToQueryParams({
page,
pageSize,
search,
ordering
});
return fetch(AppConstants.baseUrl + 'pieces/' + params, {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
}
}).then((res) => res.json());
return fetch.get('pieces_list', { page, pageSize, search, ordering });
}
};

View File

@ -1,4 +1,4 @@
import fetch from 'isomorphic-fetch';
import fetch from '../utils/fetch';
import AppConstants from '../constants/application_constants';
import FetchApiUtils from '../utils/fetch_api_utils';
@ -11,11 +11,7 @@ let UserFetcher = {
*
*/
fetchOne() {
return fetch(AppConstants.baseUrl + 'users/', {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
}
}).then((res) => res.json());
return fetch.get('user');
}
};

View File

@ -1,3 +1,4 @@
import fetch from '../utils/fetch';
import React from 'react';
import AppConstants from '../constants/application_constants'
@ -10,45 +11,30 @@ export const FormMixin = {
, status: null
}
},
submit(e) {
e.preventDefault();
this.setState({submitted: true});
fetch(this.url(), {
method: 'post',
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(this.getFormData())
})
.then(
(response) => this.handleResponse(response)
);
fetch
.post(this.url(), { body: this.getFormData() })
.then(response => { this.props.onRequestHide(); })
.catch(this.handleError);
},
handleResponse(response){
if (response.status >= 200 && response.status < 300){
this.props.onRequestHide();
}
else if (response.status >= 400 && response.status < 500) {
this.handleError(response);
}
else {
handleError(err){
if (err.json) {
for (var input in errors){
if (this.refs && this.refs[input] && this.refs[input].state) {
this.refs[input].setAlerts(errors[input]);
}
}
this.setState({submitted: false});
} else {
this.setState({submitted: false, status: response.status});
}
},
handleError(response){
response.json().then((response) => this.dispatchErrors(response.errors));
},
dispatchErrors(errors){
for (var input in errors){
if (this.refs && this.refs[input] && this.refs[input].state){
this.refs[input].setAlerts(errors[input]);
}
}
this.setState({submitted: false});
},
render(){
let alert = null;
if (this.state.status >= 500){

View File

@ -42,12 +42,12 @@ let InjectInHeadMixin = {
},
inject(src) {
debugger;
let ext = src.split('.').pop();
let tag = null;
try {
let tag = mapAttr(src);
tag = mapAttr(src);
} catch (e) {
throw new Error(`Cannot inject ${src} in the DOM, cannot guess the tag name from extension ${ext}. Valid extensions are "js" and "css".`);
throw new Error(`Cannot inject ${src} in the DOM, cannot guess the tag name from extension "${ext}". Valid extensions are "js" and "css".`);
}
InjectInHeadMixin.injectTag(tag, src);
}

View File

@ -1,6 +1,7 @@
class TableColumnContentModel {
// ToDo: Add validation for all passed-in parameters
constructor(columnName, displayName, displayType, rowWidth, canBeOrdered) {
constructor(transformFn, columnName, displayName, displayType, rowWidth, canBeOrdered) {
this.transformFn = transformFn;
this.columnName = columnName;
this.displayName = displayName;
this.displayType = displayType;

View File

@ -9,8 +9,8 @@ let Route = Router.Route;
let routes = (
<Route name="app" path="/" handler={AscribeApp}>
<Route name="pieces" path="/pieces" handler={PieceList}>
<Route name="app" handler={AscribeApp}>
<Route name="pieces" path="/" handler={PieceList}>
</Route>
<Route name="edition" path="/editions/:editionId" handler={EditionContainer}>

View File

@ -21,9 +21,8 @@ class EditionListStore {
}
onSelectEdition({pieceId, editionId}) {
this.editionList[pieceId].forEach((edition) => {
if(edition.edition_number === editionId) {
if(edition.id === editionId) {
if(edition.selected) {
edition.selected = false;
} else {
@ -31,7 +30,21 @@ class EditionListStore {
}
}
});
}
onClearAllEditionSelections() {
Object
.keys(this.editionList)
.forEach((pieceId) => {
this.editionList[pieceId]
.forEach((edition) => {
try {
delete edition.selected;
} catch(err) {
//just ignore
}
});
});
}
};

113
js/utils/fetch.js Normal file
View File

@ -0,0 +1,113 @@
import { default as _fetch } from 'isomorphic-fetch';
import FetchApiUtils from '../utils/fetch_api_utils';
class UrlMapError extends Error {};
class ServerError extends Error {};
class APIError extends Error {};
class Fetch {
_merge(defaults, options) {
let merged = {};
for (let key in defaults) {
merged[key] = defaults[key];
}
for (let key in options) {
merged[key] = options[key];
}
return merged;
}
unpackResponse(response) {
if (response.status >= 500) {
throw new ServerError();
}
return response.text();
}
handleFatalError(err) {
this.fatalErrorHandler(err);
throw new ServerError(err);
}
handleAPIError(json) {
if (!json['success']) {
let error = new APIError();
error.json = json;
throw error;
}
return json;
}
getUrl(url) {
let name = url;
if (!url.match(/^http/)) {
url = this.urlMap[url];
if (!url) {
throw new UrlMapError(`Cannot find a mapping for "${name}"`);
}
}
return url;
}
prepareUrl(url, params, attachParamsToQuery) {
let newUrl = this.getUrl(url);
let re = /\${(\w+)}/g;
newUrl = newUrl.replace(re, (match, key) => {
let val = params[key]
if (!val) {
throw new Error(`Cannot find param ${key}`);
}
delete params[key];
return val;
});
if (attachParamsToQuery && params && Object.keys(params).length > 0) {
newUrl += FetchApiUtils.argsToQueryParams(params);
}
return newUrl;
}
request(verb, url, options) {
options = options || {};
let merged = this._merge(this.httpOptions, options);
merged['method'] = verb;
return _fetch(url, merged)
.then(this.unpackResponse)
.then(JSON.parse)
.catch(this.handleFatalError.bind(this))
.then(this.handleAPIError);
}
get(url, params) {
let paramsCopy = this._merge(params);
let newUrl = this.prepareUrl(url, params);
return this.request('get', newUrl, true);
}
post(url, params) {
let paramsCopy = this._merge(params);
let newUrl = this.prepareUrl(url, params);
let body = null;
if (params['body']) {
body = JSON.stringify(params['body'])
}
return this.request('post', url, { body });
}
defaults(options) {
this.httpOptions = options.http || {};
this.urlMap = options.urlMap || {};
this.fatalErrorHandler = options.fatalErrorHandler || (() => {});
}
}
let fetch = new Fetch();
export default fetch;

View File

@ -5,15 +5,19 @@
"main": "js/app.js",
"author": "Ascribe",
"license": "Copyright",
"private": true,
"devDependencies": {
"babel-jest": "^4.0.0",
"babelify": "^6.1.2",
"bootstrap-sass": "^3.3.4",
"browser-sync": "^2.7.5",
"browserify": "^9.0.8",
"envify": "^3.4.0",
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2",
"gulp-if": "^1.2.5",
"gulp-notify": "^2.2.0",
"gulp-sass": "^2.0.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-util": "^3.0.4",
"jest-cli": "^0.4.0",
@ -26,12 +30,13 @@
"dependencies": {
"alt": "^0.16.5",
"classnames": "^1.2.2",
"es6-promise": "^2.1.1",
"isomorphic-fetch": "^2.0.2",
"object-assign": "^2.0.0",
"react": "^0.13.2",
"react-bootstrap": "~0.22.6",
"react-router": "^0.13.3",
"uglifyjs": "^2.4.10",
"react-bootstrap": "~0.22.6"
"uglifyjs": "^2.4.10"
},
"jest": {
"scriptPreprocessor": "node_modules/babel-jest",

View File

@ -0,0 +1,78 @@
$ascribe-accordion-list-item-height: 9em;
$ascribe-accordion-list-font: 'Source Sans Pro';
.ascribe-accordion-list-item {
background-color: rgba(0,0,0,0.004);
border: 1px solid black;
height: $ascribe-accordion-list-item-height;
padding-left:0;
padding-right:0;
overflow:hidden;
border-left: 0.1em solid #E0E0E0;
border-right: 0.1em solid #E0E0E0;
border-top: 0.1em solid #E0E0E0;
border-radius: 5px;
border-bottom: 0.2em solid #E0E0E0;
.wrapper {
width:100%;
height:100%;
// ToDo: Include media queries for thumbnail
.thumbnail-wrapper {
float:left;
height:100%;
width:$ascribe-accordion-list-item-height;
overflow:hidden;
padding-left:0;
padding-right:0;
img {
height: $ascribe-accordion-list-item-height;
}
}
.info-wrapper {
float:left;
font-family: $ascribe-accordion-list-font;
margin-left: 2em;
padding-top: .75em;
h1 {
font-size: 2.25em;
}
h3 {
font-size: 1.1em;
margin: .7em 0 0 0;
}
}
}
}
.ascribe-accordion-list-item-table {
text-align: center;
margin-bottom: 3em;
background-color: rgba(0,0,0,0.004);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: 0.15em solid #E0E0E0;
border-left: 0.1em solid #E0E0E0;
border-right: 0.1em solid #E0E0E0;
}
span.ascribe-accordion-list-table-toggle {
::selection { background: transparent; }
::-moz-selection { background: transparent; }
&:hover {
color: $ascribe-color-dark;
cursor:pointer;
}
}
.ascribe-accordion-list-table-list {
margin-bottom: .5em;
th, td {
font-size:.85em;
text-align: center;
}
}

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'ascribe';
src:url('ascribe.eot?-oi6ttk');
src:url('ascribe.eot?#iefix-oi6ttk') format('embedded-opentype'),
url('ascribe.woff?-oi6ttk') format('woff'),
url('ascribe.ttf?-oi6ttk') format('truetype'),
url('ascribe.svg?-oi6ttk#ascribe') format('svg');
src:url('../../fonts/ascribe.eot?-oi6ttk');
src:url('../../fonts/ascribe.eot?#iefix-oi6ttk') format('embedded-opentype'),
url('../../fonts/ascribe.woff?-oi6ttk') format('woff'),
url('../../fonts/ascribe.ttf?-oi6ttk') format('truetype'),
url('../../fonts/ascribe.svg?-oi6ttk#ascribe') format('svg');
font-weight: normal;
font-style: normal;
}

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'ascribe';
src:url('ascribe.eot?-6bb2dq');
src:url('ascribe.eot?#iefix-6bb2dq') format('embedded-opentype'),
url('ascribe.woff?-6bb2dq') format('woff'),
url('ascribe.ttf?-6bb2dq') format('truetype'),
url('ascribe.svg?-6bb2dq#ascribe') format('svg');
src:url('../../fonts/ascribe.eot?-6bb2dq');
src:url('../../fonts/ascribe.eot?#iefix-6bb2dq') format('embedded-opentype'),
url('../../fonts/ascribe.woff?-6bb2dq') format('woff'),
url('../../fonts/ascribe.ttf?-6bb2dq') format('truetype'),
url('../../fonts/ascribe.svg?-6bb2dq#ascribe') format('svg');
font-weight: normal;
font-style: normal;
}

View File

@ -0,0 +1,20 @@
.ascribe-piece-list-toolbar {
position: fixed;
top:0;
width:1170px;
height:6em;
background-color: #FAFAFA;
border-left: 0.1em solid #E0E0E0;
border-right: 0.1em solid #E0E0E0;
border-top: 0.1em solid #E0E0E0;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom: 0.2em solid #E0E0E0;
z-index:9999;
}
.piece-list-toolbar-clear-all {
text-decoration: underline;
cursor:pointer;
}

View File

@ -0,0 +1,2 @@
$ascribe-color: rgba(2, 182, 163, 0.5);
$ascribe-color-dark: rgba(2, 182, 163, 0.8);

View File

@ -1,5 +1,30 @@
#main {
padding-top: 70px;
// If you import a new .scss file, make sure to restart gulp
// otherwise it will not be included
@import 'variables';
@import 'ascribe-variables';
@import '../node_modules/bootstrap-sass/assets/stylesheets/bootstrap';
@import './ascribe-fonts/style';
@import './ascribe-fonts/ascribe-fonts';
@import 'ascribe-accordion_list';
@import 'ascribe-piece-list-toolbar';
.hidden {
display: none;
}
.navbar-default {
border-left:0;
border-right:0;
margin-bottom: 3em;
}
.clear-margins-and-paddings {
padding-left:0;
padding-right:0;
}
.ascribe-color {
color: $ascribe-color;
}
/* Taken from http://stackoverflow.com/a/20548578 */
@ -10,8 +35,7 @@
}
.ascribe-table-header-row {
border-bottom: 2px solid rgba(2, 182, 163, 0.5);
border-top: 2px solid rgba(2, 182, 163, 0.5);
border-bottom: 2px solid #E0E0E0;
padding: 0;
}
@ -26,8 +50,7 @@
vertical-align: middle;
font-family: 'Source Sans Pro';
font-weight: 600;
color: rgba(2, 182, 163, 1);
font-size: 1.4em;
color: #424242;
}
.ascribe-table-header-column > span > .glyphicon {
@ -45,13 +68,16 @@
.ascribe-table-item-column {
display: table;
font-family: 'Source Sans Pro';
font-size: 1.2em;
font-size: .8em;
height:3em;
}
.ascribe-table-item-column > * {
display: table-cell;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.ascribe-table-item-selected {
@ -62,10 +88,6 @@
cursor: default;
}
.piece-list-toolbar {
height:3em;
}
.no-margin {
margin-right: 0;
margin-left: 0;

866
sass/variables.scss Normal file
View File

@ -0,0 +1,866 @@
$bootstrap-sass-asset-helper: false !default;
//
// Variables
// --------------------------------------------------
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
$gray-base: #000 !default;
$gray-darker: lighten($gray-base, 13.5%) !default; // #222
$gray-dark: lighten($gray-base, 20%) !default; // #333
$gray: lighten($gray-base, 33.5%) !default; // #555
$gray-light: lighten($gray-base, 46.7%) !default; // #777
$gray-lighter: lighten($gray-base, 93.5%) !default; // #eee
$brand-primary: darken(#428bca, 6.5%) !default; // #337ab7
$brand-success: #5cb85c !default;
$brand-info: #5bc0de !default;
$brand-warning: #f0ad4e !default;
$brand-danger: #d9534f !default;
//== Scaffolding
//
//## Settings for some of the most global styles.
//** Background color for `<body>`.
$body-bg: #fff !default;
//** Global text color on `<body>`.
$text-color: $gray-dark !default;
//** Global textual link color.
$link-color: $brand-primary !default;
//** Link hover color set via `darken()` function.
$link-hover-color: darken($link-color, 15%) !default;
//** Link hover decoration.
$link-hover-decoration: underline !default;
//== Typography
//
//## Font, line-height, and color for body text, headings, and more.
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;
$font-size-base: 14px !default;
$font-size-large: ceil(($font-size-base * 1.25)) !default; // ~18px
$font-size-small: ceil(($font-size-base * 0.85)) !default; // ~12px
$font-size-h1: floor(($font-size-base * 2.6)) !default; // ~36px
$font-size-h2: floor(($font-size-base * 2.15)) !default; // ~30px
$font-size-h3: ceil(($font-size-base * 1.7)) !default; // ~24px
$font-size-h4: ceil(($font-size-base * 1.25)) !default; // ~18px
$font-size-h5: $font-size-base !default;
$font-size-h6: ceil(($font-size-base * 0.85)) !default; // ~12px
//** Unit-less `line-height` for use in components like buttons.
$line-height-base: 1.428571429 !default; // 20/14
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
$line-height-computed: floor(($font-size-base * $line-height-base)) !default; // ~20px
//** By default, this inherits from the `<body>`.
$headings-font-family: inherit !default;
$headings-font-weight: 500 !default;
$headings-line-height: 1.1 !default;
$headings-color: inherit !default;
//== Iconography
//
//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
//** Load fonts from this directory.
// [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
// [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
$icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;
//** File name for all font files.
$icon-font-name: "glyphicons-halflings-regular" !default;
//** Element ID within SVG icon file.
$icon-font-svg-id: "glyphicons_halflingsregular" !default;
//== Components
//
//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
$padding-base-vertical: 6px !default;
$padding-base-horizontal: 12px !default;
$padding-large-vertical: 10px !default;
$padding-large-horizontal: 16px !default;
$padding-small-vertical: 5px !default;
$padding-small-horizontal: 10px !default;
$padding-xs-vertical: 1px !default;
$padding-xs-horizontal: 5px !default;
$line-height-large: 1.3333333 !default; // extra decimals for Win 8.1 Chrome
$line-height-small: 1.5 !default;
$border-radius-base: 4px !default;
$border-radius-large: 6px !default;
$border-radius-small: 3px !default;
//** Global color for active items (e.g., navs or dropdowns).
$component-active-color: #fff !default;
//** Global background color for active items (e.g., navs or dropdowns).
$component-active-bg: $brand-primary !default;
//** Width of the `border` for generating carets that indicator dropdowns.
$caret-width-base: 4px !default;
//** Carets increase slightly in size for larger components.
$caret-width-large: 5px !default;
//== Tables
//
//## Customizes the `.table` component with basic values, each used across all table variations.
//** Padding for `<th>`s and `<td>`s.
$table-cell-padding: 8px !default;
//** Padding for cells in `.table-condensed`.
$table-condensed-cell-padding: 5px !default;
//** Default background color used for all tables.
$table-bg: transparent !default;
//** Background color used for `.table-striped`.
$table-bg-accent: #f9f9f9 !default;
//** Background color used for `.table-hover`.
$table-bg-hover: #f5f5f5 !default;
$table-bg-active: $table-bg-hover !default;
//** Border color for table and cell borders.
$table-border-color: #ddd !default;
//== Buttons
//
//## For each of Bootstrap's buttons, define text, background and border color.
$btn-font-weight: normal !default;
$btn-default-color: #333 !default;
$btn-default-bg: #fff !default;
$btn-default-border: #ccc !default;
$btn-primary-color: #fff !default;
$btn-primary-bg: $brand-primary !default;
$btn-primary-border: darken($btn-primary-bg, 5%) !default;
$btn-success-color: #fff !default;
$btn-success-bg: $brand-success !default;
$btn-success-border: darken($btn-success-bg, 5%) !default;
$btn-info-color: #fff !default;
$btn-info-bg: $brand-info !default;
$btn-info-border: darken($btn-info-bg, 5%) !default;
$btn-warning-color: #fff !default;
$btn-warning-bg: $brand-warning !default;
$btn-warning-border: darken($btn-warning-bg, 5%) !default;
$btn-danger-color: #fff !default;
$btn-danger-bg: $brand-danger !default;
$btn-danger-border: darken($btn-danger-bg, 5%) !default;
$btn-link-disabled-color: $gray-light !default;
//== Forms
//
//##
//** `<input>` background color
$input-bg: #fff !default;
//** `<input disabled>` background color
$input-bg-disabled: $gray-lighter !default;
//** Text color for `<input>`s
$input-color: $gray !default;
//** `<input>` border color
$input-border: #ccc !default;
// TODO: Rename `$input-border-radius` to `$input-border-radius-base` in v4
//** Default `.form-control` border radius
// This has no effect on `<select>`s in some browsers, due to the limited stylability of `<select>`s in CSS.
$input-border-radius: $border-radius-base !default;
//** Large `.form-control` border radius
$input-border-radius-large: $border-radius-large !default;
//** Small `.form-control` border radius
$input-border-radius-small: $border-radius-small !default;
//** Border color for inputs on focus
$input-border-focus: #66afe9 !default;
//** Placeholder text color
$input-color-placeholder: #999 !default;
//** Default `.form-control` height
$input-height-base: ($line-height-computed + ($padding-base-vertical * 2) + 2) !default;
//** Large `.form-control` height
$input-height-large: (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default;
//** Small `.form-control` height
$input-height-small: (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default;
//** `.form-group` margin
$form-group-margin-bottom: 15px !default;
$legend-color: $gray-dark !default;
$legend-border-color: #e5e5e5 !default;
//** Background color for textual input addons
$input-group-addon-bg: $gray-lighter !default;
//** Border color for textual input addons
$input-group-addon-border-color: $input-border !default;
//** Disabled cursor for form controls and buttons.
$cursor-disabled: not-allowed !default;
//== Dropdowns
//
//## Dropdown menu container and contents.
//** Background for the dropdown menu.
$dropdown-bg: #fff !default;
//** Dropdown menu `border-color`.
$dropdown-border: rgba(0,0,0,.15) !default;
//** Dropdown menu `border-color` **for IE8**.
$dropdown-fallback-border: #ccc !default;
//** Divider color for between dropdown items.
$dropdown-divider-bg: #e5e5e5 !default;
//** Dropdown link text color.
$dropdown-link-color: $gray-dark !default;
//** Hover color for dropdown links.
$dropdown-link-hover-color: darken($gray-dark, 5%) !default;
//** Hover background for dropdown links.
$dropdown-link-hover-bg: #f5f5f5 !default;
//** Active dropdown menu item text color.
$dropdown-link-active-color: $component-active-color !default;
//** Active dropdown menu item background color.
$dropdown-link-active-bg: $component-active-bg !default;
//** Disabled dropdown menu item background color.
$dropdown-link-disabled-color: $gray-light !default;
//** Text color for headers within dropdown menus.
$dropdown-header-color: $gray-light !default;
//** Deprecated `$dropdown-caret-color` as of v3.1.0
$dropdown-caret-color: #000 !default;
//-- Z-index master list
//
// Warning: Avoid customizing these values. They're used for a bird's eye view
// of components dependent on the z-axis and are designed to all work together.
//
// Note: These variables are not generated into the Customizer.
$zindex-navbar: 1000 !default;
$zindex-dropdown: 1000 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
$zindex-navbar-fixed: 1030 !default;
$zindex-modal-background: 1040 !default;
$zindex-modal: 1050 !default;
//== Media queries breakpoints
//
//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
// Extra small screen / phone
//** Deprecated `$screen-xs` as of v3.0.1
$screen-xs: 480px !default;
//** Deprecated `$screen-xs-min` as of v3.2.0
$screen-xs-min: $screen-xs !default;
//** Deprecated `$screen-phone` as of v3.0.1
$screen-phone: $screen-xs-min !default;
// Small screen / tablet
//** Deprecated `$screen-sm` as of v3.0.1
$screen-sm: 768px !default;
$screen-sm-min: $screen-sm !default;
//** Deprecated `$screen-tablet` as of v3.0.1
$screen-tablet: $screen-sm-min !default;
// Medium screen / desktop
//** Deprecated `$screen-md` as of v3.0.1
$screen-md: 992px !default;
$screen-md-min: $screen-md !default;
//** Deprecated `$screen-desktop` as of v3.0.1
$screen-desktop: $screen-md-min !default;
// Large screen / wide desktop
//** Deprecated `$screen-lg` as of v3.0.1
$screen-lg: 1200px !default;
$screen-lg-min: $screen-lg !default;
//** Deprecated `$screen-lg-desktop` as of v3.0.1
$screen-lg-desktop: $screen-lg-min !default;
// So media queries don't overlap when required, provide a maximum
$screen-xs-max: ($screen-sm-min - 1) !default;
$screen-sm-max: ($screen-md-min - 1) !default;
$screen-md-max: ($screen-lg-min - 1) !default;
//== Grid system
//
//## Define your custom responsive grid.
//** Number of columns in the grid.
$grid-columns: 12 !default;
//** Padding between columns. Gets divided in half for the left and right.
$grid-gutter-width: 30px !default;
// Navbar collapse
//** Point at which the navbar becomes uncollapsed.
$grid-float-breakpoint: $screen-sm-min !default;
//** Point at which the navbar begins collapsing.
$grid-float-breakpoint-max: ($grid-float-breakpoint - 1) !default;
//== Container sizes
//
//## Define the maximum width of `.container` for different screen sizes.
// Small screen / tablet
$container-tablet: (720px + $grid-gutter-width) !default;
//** For `$screen-sm-min` and up.
$container-sm: $container-tablet !default;
// Medium screen / desktop
$container-desktop: (940px + $grid-gutter-width) !default;
//** For `$screen-md-min` and up.
$container-md: $container-desktop !default;
// Large screen / wide desktop
$container-large-desktop: (1140px + $grid-gutter-width) !default;
//** For `$screen-lg-min` and up.
$container-lg: $container-large-desktop !default;
//== Navbar
//
//##
// Basics of a navbar
$navbar-height: 50px !default;
$navbar-margin-bottom: $line-height-computed !default;
$navbar-border-radius: 0 !default;
$navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default;
$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default;
$navbar-collapse-max-height: 340px !default;
$navbar-default-color: #777 !default;
$navbar-default-bg: white !default;
$navbar-default-border: darken($navbar-default-bg, 6.5%) !default;
// Navbar links
$navbar-default-link-color: #777 !default;
$navbar-default-link-hover-color: #333 !default;
$navbar-default-link-hover-bg: transparent !default;
$navbar-default-link-active-color: #555 !default;
$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default;
$navbar-default-link-disabled-color: #ccc !default;
$navbar-default-link-disabled-bg: transparent !default;
// Navbar brand label
$navbar-default-brand-color: black !default;
$navbar-default-brand-hover-color: darken($navbar-default-brand-color, 10%) !default;
$navbar-default-brand-hover-bg: transparent !default;
// Navbar toggle
$navbar-default-toggle-hover-bg: #ddd !default;
$navbar-default-toggle-icon-bar-bg: #888 !default;
$navbar-default-toggle-border-color: #ddd !default;
// Inverted navbar
// Reset inverted navbar basics
$navbar-inverse-color: lighten($gray-light, 15%) !default;
$navbar-inverse-bg: #222 !default;
$navbar-inverse-border: darken($navbar-inverse-bg, 10%) !default;
// Inverted navbar links
$navbar-inverse-link-color: lighten($gray-light, 15%) !default;
$navbar-inverse-link-hover-color: #fff !default;
$navbar-inverse-link-hover-bg: transparent !default;
$navbar-inverse-link-active-color: $navbar-inverse-link-hover-color !default;
$navbar-inverse-link-active-bg: darken($navbar-inverse-bg, 10%) !default;
$navbar-inverse-link-disabled-color: #444 !default;
$navbar-inverse-link-disabled-bg: transparent !default;
// Inverted navbar brand label
$navbar-inverse-brand-color: $navbar-inverse-link-color !default;
$navbar-inverse-brand-hover-color: #fff !default;
$navbar-inverse-brand-hover-bg: transparent !default;
// Inverted navbar toggle
$navbar-inverse-toggle-hover-bg: #333 !default;
$navbar-inverse-toggle-icon-bar-bg: #fff !default;
$navbar-inverse-toggle-border-color: #333 !default;
//== Navs
//
//##
//=== Shared nav styles
$nav-link-padding: 10px 15px !default;
$nav-link-hover-bg: $gray-lighter !default;
$nav-disabled-link-color: $gray-light !default;
$nav-disabled-link-hover-color: $gray-light !default;
//== Tabs
$nav-tabs-border-color: #ddd !default;
$nav-tabs-link-hover-border-color: $gray-lighter !default;
$nav-tabs-active-link-hover-bg: $body-bg !default;
$nav-tabs-active-link-hover-color: $gray !default;
$nav-tabs-active-link-hover-border-color: #ddd !default;
$nav-tabs-justified-link-border-color: #ddd !default;
$nav-tabs-justified-active-link-border-color: $body-bg !default;
//== Pills
$nav-pills-border-radius: $border-radius-base !default;
$nav-pills-active-link-hover-bg: $component-active-bg !default;
$nav-pills-active-link-hover-color: $component-active-color !default;
//== Pagination
//
//##
$pagination-color: $link-color !default;
$pagination-bg: #fff !default;
$pagination-border: #ddd !default;
$pagination-hover-color: $link-hover-color !default;
$pagination-hover-bg: $gray-lighter !default;
$pagination-hover-border: #ddd !default;
$pagination-active-color: #fff !default;
$pagination-active-bg: $brand-primary !default;
$pagination-active-border: $brand-primary !default;
$pagination-disabled-color: $gray-light !default;
$pagination-disabled-bg: #fff !default;
$pagination-disabled-border: #ddd !default;
//== Pager
//
//##
$pager-bg: $pagination-bg !default;
$pager-border: $pagination-border !default;
$pager-border-radius: 15px !default;
$pager-hover-bg: $pagination-hover-bg !default;
$pager-active-bg: $pagination-active-bg !default;
$pager-active-color: $pagination-active-color !default;
$pager-disabled-color: $pagination-disabled-color !default;
//== Jumbotron
//
//##
$jumbotron-padding: 30px !default;
$jumbotron-color: inherit !default;
$jumbotron-bg: $gray-lighter !default;
$jumbotron-heading-color: inherit !default;
$jumbotron-font-size: ceil(($font-size-base * 1.5)) !default;
//== Form states and alerts
//
//## Define colors for form feedback states and, by default, alerts.
$state-success-text: #3c763d !default;
$state-success-bg: #dff0d8 !default;
$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default;
$state-info-text: #31708f !default;
$state-info-bg: #d9edf7 !default;
$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default;
$state-warning-text: #8a6d3b !default;
$state-warning-bg: #fcf8e3 !default;
$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default;
$state-danger-text: #a94442 !default;
$state-danger-bg: #f2dede !default;
$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default;
//== Tooltips
//
//##
//** Tooltip max width
$tooltip-max-width: 200px !default;
//** Tooltip text color
$tooltip-color: #fff !default;
//** Tooltip background color
$tooltip-bg: #000 !default;
$tooltip-opacity: .9 !default;
//** Tooltip arrow width
$tooltip-arrow-width: 5px !default;
//** Tooltip arrow color
$tooltip-arrow-color: $tooltip-bg !default;
//== Popovers
//
//##
//** Popover body background color
$popover-bg: #fff !default;
//** Popover maximum width
$popover-max-width: 276px !default;
//** Popover border color
$popover-border-color: rgba(0,0,0,.2) !default;
//** Popover fallback border color
$popover-fallback-border-color: #ccc !default;
//** Popover title background color
$popover-title-bg: darken($popover-bg, 3%) !default;
//** Popover arrow width
$popover-arrow-width: 10px !default;
//** Popover arrow color
$popover-arrow-color: $popover-bg !default;
//** Popover outer arrow width
$popover-arrow-outer-width: ($popover-arrow-width + 1) !default;
//** Popover outer arrow color
$popover-arrow-outer-color: fade_in($popover-border-color, 0.05) !default;
//** Popover outer arrow fallback color
$popover-arrow-outer-fallback-color: darken($popover-fallback-border-color, 20%) !default;
//== Labels
//
//##
//** Default label background color
$label-default-bg: $gray-light !default;
//** Primary label background color
$label-primary-bg: $brand-primary !default;
//** Success label background color
$label-success-bg: $brand-success !default;
//** Info label background color
$label-info-bg: $brand-info !default;
//** Warning label background color
$label-warning-bg: $brand-warning !default;
//** Danger label background color
$label-danger-bg: $brand-danger !default;
//** Default label text color
$label-color: #fff !default;
//** Default text color of a linked label
$label-link-hover-color: #fff !default;
//== Modals
//
//##
//** Padding applied to the modal body
$modal-inner-padding: 15px !default;
//** Padding applied to the modal title
$modal-title-padding: 15px !default;
//** Modal title line-height
$modal-title-line-height: $line-height-base !default;
//** Background color of modal content area
$modal-content-bg: #fff !default;
//** Modal content border color
$modal-content-border-color: rgba(0,0,0,.2) !default;
//** Modal content border color **for IE8**
$modal-content-fallback-border-color: #999 !default;
//** Modal backdrop background color
$modal-backdrop-bg: #000 !default;
//** Modal backdrop opacity
$modal-backdrop-opacity: .5 !default;
//** Modal header border color
$modal-header-border-color: #e5e5e5 !default;
//** Modal footer border color
$modal-footer-border-color: $modal-header-border-color !default;
$modal-lg: 900px !default;
$modal-md: 600px !default;
$modal-sm: 300px !default;
//== Alerts
//
//## Define alert colors, border radius, and padding.
$alert-padding: 15px !default;
$alert-border-radius: $border-radius-base !default;
$alert-link-font-weight: bold !default;
$alert-success-bg: $state-success-bg !default;
$alert-success-text: $state-success-text !default;
$alert-success-border: $state-success-border !default;
$alert-info-bg: $state-info-bg !default;
$alert-info-text: $state-info-text !default;
$alert-info-border: $state-info-border !default;
$alert-warning-bg: $state-warning-bg !default;
$alert-warning-text: $state-warning-text !default;
$alert-warning-border: $state-warning-border !default;
$alert-danger-bg: $state-danger-bg !default;
$alert-danger-text: $state-danger-text !default;
$alert-danger-border: $state-danger-border !default;
//== Progress bars
//
//##
//** Background color of the whole progress component
$progress-bg: #f5f5f5 !default;
//** Progress bar text color
$progress-bar-color: #fff !default;
//** Variable for setting rounded corners on progress bar.
$progress-border-radius: $border-radius-base !default;
//** Default progress bar color
$progress-bar-bg: $brand-primary !default;
//** Success progress bar color
$progress-bar-success-bg: $brand-success !default;
//** Warning progress bar color
$progress-bar-warning-bg: $brand-warning !default;
//** Danger progress bar color
$progress-bar-danger-bg: $brand-danger !default;
//** Info progress bar color
$progress-bar-info-bg: $brand-info !default;
//== List group
//
//##
//** Background color on `.list-group-item`
$list-group-bg: #fff !default;
//** `.list-group-item` border color
$list-group-border: #ddd !default;
//** List group border radius
$list-group-border-radius: $border-radius-base !default;
//** Background color of single list items on hover
$list-group-hover-bg: #f5f5f5 !default;
//** Text color of active list items
$list-group-active-color: $component-active-color !default;
//** Background color of active list items
$list-group-active-bg: $component-active-bg !default;
//** Border color of active list elements
$list-group-active-border: $list-group-active-bg !default;
//** Text color for content within active list items
$list-group-active-text-color: lighten($list-group-active-bg, 40%) !default;
//** Text color of disabled list items
$list-group-disabled-color: $gray-light !default;
//** Background color of disabled list items
$list-group-disabled-bg: $gray-lighter !default;
//** Text color for content within disabled list items
$list-group-disabled-text-color: $list-group-disabled-color !default;
$list-group-link-color: #555 !default;
$list-group-link-hover-color: $list-group-link-color !default;
$list-group-link-heading-color: #333 !default;
//== Panels
//
//##
$panel-bg: #fff !default;
$panel-body-padding: 15px !default;
$panel-heading-padding: 10px 15px !default;
$panel-footer-padding: $panel-heading-padding !default;
$panel-border-radius: $border-radius-base !default;
//** Border color for elements within panels
$panel-inner-border: #ddd !default;
$panel-footer-bg: #f5f5f5 !default;
$panel-default-text: $gray-dark !default;
$panel-default-border: #ddd !default;
$panel-default-heading-bg: #f5f5f5 !default;
$panel-primary-text: #fff !default;
$panel-primary-border: $brand-primary !default;
$panel-primary-heading-bg: $brand-primary !default;
$panel-success-text: $state-success-text !default;
$panel-success-border: $state-success-border !default;
$panel-success-heading-bg: $state-success-bg !default;
$panel-info-text: $state-info-text !default;
$panel-info-border: $state-info-border !default;
$panel-info-heading-bg: $state-info-bg !default;
$panel-warning-text: $state-warning-text !default;
$panel-warning-border: $state-warning-border !default;
$panel-warning-heading-bg: $state-warning-bg !default;
$panel-danger-text: $state-danger-text !default;
$panel-danger-border: $state-danger-border !default;
$panel-danger-heading-bg: $state-danger-bg !default;
//== Thumbnails
//
//##
//** Padding around the thumbnail image
$thumbnail-padding: 4px !default;
//** Thumbnail background color
$thumbnail-bg: $body-bg !default;
//** Thumbnail border color
$thumbnail-border: #ddd !default;
//** Thumbnail border radius
$thumbnail-border-radius: $border-radius-base !default;
//** Custom text color for thumbnail captions
$thumbnail-caption-color: $text-color !default;
//** Padding around the thumbnail caption
$thumbnail-caption-padding: 9px !default;
//== Wells
//
//##
$well-bg: #f5f5f5 !default;
$well-border: darken($well-bg, 7%) !default;
//== Badges
//
//##
$badge-color: #fff !default;
//** Linked badge text color on hover
$badge-link-hover-color: #fff !default;
$badge-bg: $gray-light !default;
//** Badge text color in active nav link
$badge-active-color: $link-color !default;
//** Badge background color in active nav link
$badge-active-bg: #fff !default;
$badge-font-weight: bold !default;
$badge-line-height: 1 !default;
$badge-border-radius: 10px !default;
//== Breadcrumbs
//
//##
$breadcrumb-padding-vertical: 8px !default;
$breadcrumb-padding-horizontal: 15px !default;
//** Breadcrumb background color
$breadcrumb-bg: #f5f5f5 !default;
//** Breadcrumb text color
$breadcrumb-color: #ccc !default;
//** Text color of current page in the breadcrumb
$breadcrumb-active-color: $gray-light !default;
//** Textual separator for between breadcrumb elements
$breadcrumb-separator: "/" !default;
//== Carousel
//
//##
$carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6) !default;
$carousel-control-color: #fff !default;
$carousel-control-width: 15% !default;
$carousel-control-opacity: .5 !default;
$carousel-control-font-size: 20px !default;
$carousel-indicator-active-bg: #fff !default;
$carousel-indicator-border-color: #fff !default;
$carousel-caption-color: #fff !default;
//== Close
//
//##
$close-font-weight: bold !default;
$close-color: #000 !default;
$close-text-shadow: 0 1px 0 #fff !default;
//== Code
//
//##
$code-color: #c7254e !default;
$code-bg: #f9f2f4 !default;
$kbd-color: #fff !default;
$kbd-bg: #333 !default;
$pre-bg: #f5f5f5 !default;
$pre-color: $gray-dark !default;
$pre-border-color: #ccc !default;
$pre-scrollable-max-height: 340px !default;
//== Type
//
//##
//** Horizontal offset for forms and lists.
$component-offset-horizontal: 180px !default;
//** Text muted color
$text-muted: $gray-light !default;
//** Abbreviations and acronyms border color
$abbr-border-color: $gray-light !default;
//** Headings small color
$headings-small-color: $gray-light !default;
//** Blockquote small color
$blockquote-small-color: $gray-light !default;
//** Blockquote font size
$blockquote-font-size: ($font-size-base * 1.25) !default;
//** Blockquote border color
$blockquote-border-color: $gray-lighter !default;
//** Page header border color
$page-header-border-color: $gray-lighter !default;
//** Width of horizontal description list titles
$dl-horizontal-offset: $component-offset-horizontal !default;
//** Horizontal line color.
$hr-border: $gray-lighter !default;