1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-15 06:32:34 +01:00

change point-system

This commit is contained in:
devfake 2015-07-30 11:53:48 +02:00
parent 95d92fe2c7
commit 36d6d87577
8 changed files with 29 additions and 20 deletions

View File

@ -6,7 +6,7 @@ Flox is a self hosted Movies, Series and Anime watch list. It's build on top of
**The current status miss some important features. See Todo.**
The rating based on an 5-Point system.
The rating based on an 5-Point system with 0.5 steps.
### Requirements

View File

@ -3,22 +3,30 @@ import React from 'react';
class FloxItem extends React.Component {
render() {
let title = this.props.data.title;
return (
<div className={'item ' + this.props.loadClass}>
<a href={"https://www.youtube.com/results?search_query=" + this.props.data.title + " Trailer"} target="_blank" className="item-image" style={this.props.bgStyle}>
<a href={"https://www.youtube.com/results?search_query=" + title + " Trailer"} target="_blank" className="item-image" style={this.props.bgStyle}>
{this.props.bgStyle.backgroundImage ? '' : <i className="icon-no-image"></i>}
<div className={"rating rating-" + this.props.data.rating}></div>
<div className={"rating rating-" + this.formatRating()} title={this.props.data.rating + " / 5 Points"}></div>
</a>
<div className="item-content">
<span className="item-date" title={"Released on " + this.props.released().full}>{this.props.released().year}</span>
<a href={"https://www.youtube.com/results?search_query=" + this.props.data.title + " Trailer"} target="_blank" className="item-title" title={this.props.data.title}>{this.props.data.title}</a>
<a href={"https://www.youtube.com/results?search_query=" + title + " Trailer"} target="_blank" className="item-title" title={title}>{title}</a>
</div>
</div>
);
}
formatRating() {
let rating = this.props.data.rating;
return rating.replace('.', '-');
}
}
export default FloxItem;

View File

@ -7,7 +7,6 @@ class TMDBItem extends React.Component {
return (
<div className={'item ' + this.props.loadClass}>
<div className="item-image" style={this.props.bgStyle} onClick={this.addNewItem.bind(this)}>
{this.props.bgStyle.backgroundImage ? '' : <i className="icon-no-image"></i>}
</div>

View File

@ -28,9 +28,13 @@
}
.rating-1 { background: #ac1b1b; }
.rating-1-5 { background: linear-gradient(#c15e33 20%, #ac1b1b 25%); }
.rating-2 { background: #c15e33; }
.rating-2-5 { background: linear-gradient(#dea621 20%, #c15e33 25%); }
.rating-3 { background: #dea621; }
.rating-3-5 { background: linear-gradient(#73a01c 20%, #dea621 25%); }
.rating-4 { background: #73a01c; }
.rating-4-5 { background: linear-gradient($main 20%, #73a01c 25%); }
.rating-5 { background: $main; }
.item-image {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,7 +20,7 @@ class CreateItemsTable extends Migration
$table->string('poster');
$table->integer('category_id')->unsigned();
$table->foreign('category_id')->references('id')->on('categories');
$table->integer('rating');
$table->string('rating');
$table->integer('released');
$table->integer('seen');
$table->integer('created_at');

View File

@ -30,7 +30,7 @@
'slug' => Str::slug('Jurassic World'),
'poster' => '/uXZYawqUsChGSj54wcuBtEdUJbh.jpg',
'category_id' => 1,
'rating' => 4,
'rating' => 4.5,
'released' => '1429912800',
'seen' => '1429912800',
'created_at' => '1429912800',
@ -42,7 +42,7 @@
'slug' => Str::slug('Pacific Rim'),
'poster' => '/sCJEwEShZvruTpQ2a4yiX3Q9EyZ.jpg',
'category_id' => 1,
'rating' => 3,
'rating' => 3.5,
'released' => '1429912800',
'seen' => '1429912800',
'created_at' => '1429912800',
@ -104,7 +104,7 @@
'slug' => Str::slug('Lost'),
'poster' => '/jyGspygDXJMydTOJj7iWNx9Elyd.jpg',
'category_id' => 2,
'rating' => 4,
'rating' => 3.5,
'released' => '1429912800',
'seen' => '1429912800',
'created_at' => '1429912800',