voluntary_ranking 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/voluntary_ranking/app.js +11 -0
- data/app/assets/javascripts/voluntary_ranking/application.js +4 -0
- data/app/assets/javascripts/voluntary_ranking/base.js.coffee +3 -0
- data/app/assets/javascripts/voluntary_ranking/components/modal_dialog_component.js.coffee +6 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/arguments/index_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/arguments/new_controller.js.coffee +16 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/compare_things/arguments_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/compare_things_controller.js.coffee +8 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/controller.js.coffee +1 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/index_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/profile/rankings_controller.js.coffee +3 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/ranking_item_controller.js.coffee +7 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/rankings/index_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/rankings/show_controller.js.coffee +6 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/thing_controller.js.coffee +10 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/user/rankings/show_controller.js.coffee +92 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/user_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/controllers/user_ranking_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_ranking/helpers/name_with_apostrophe_helper.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/helpers/stars_html_helper.js.coffee +29 -0
- data/app/assets/javascripts/voluntary_ranking/mixins/has_current_user.js.coffee +4 -0
- data/app/assets/javascripts/voluntary_ranking/mixins/pagination_controller.js.coffee +51 -0
- data/app/assets/javascripts/voluntary_ranking/mixins/ranking_controller.js.coffee +31 -0
- data/app/assets/javascripts/voluntary_ranking/mixins/singleton.js.coffee +17 -0
- data/app/assets/javascripts/voluntary_ranking/models/argument.js.coffee +7 -0
- data/app/assets/javascripts/voluntary_ranking/models/movie.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/models/ranking.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_ranking/models/ranking_item.js.coffee +26 -0
- data/app/assets/javascripts/voluntary_ranking/models/thing.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_ranking/models/user.js.coffee +18 -0
- data/app/assets/javascripts/voluntary_ranking/models/user/ranking_item.js.coffee +33 -0
- data/app/assets/javascripts/voluntary_ranking/router.js.coffee +30 -0
- data/app/assets/javascripts/voluntary_ranking/routes/arguments/index_route.js.coffee +24 -0
- data/app/assets/javascripts/voluntary_ranking/routes/compare_things/arguments_route.js.coffee +16 -0
- data/app/assets/javascripts/voluntary_ranking/routes/compare_things/compare_things_route.js.coffee +9 -0
- data/app/assets/javascripts/voluntary_ranking/routes/profile/rankings_route.js.coffee +29 -0
- data/app/assets/javascripts/voluntary_ranking/routes/ranking_item_route.js.coffee +25 -0
- data/app/assets/javascripts/voluntary_ranking/routes/rankings/index_route.js.coffee +10 -0
- data/app/assets/javascripts/voluntary_ranking/routes/rankings/show_route.js.coffee +19 -0
- data/app/assets/javascripts/voluntary_ranking/routes/thing_route.js.coffee +7 -0
- data/app/assets/javascripts/voluntary_ranking/routes/user_ranking_route.js.coffee +27 -0
- data/app/assets/javascripts/voluntary_ranking/routes/user_route.js.coffee +20 -0
- data/app/assets/javascripts/voluntary_ranking/templates/application.handlebars.erb +16 -0
- data/app/assets/javascripts/voluntary_ranking/templates/arguments.js.handlebars +1 -0
- data/app/assets/javascripts/voluntary_ranking/templates/arguments/index.js.handlebars +27 -0
- data/app/assets/javascripts/voluntary_ranking/templates/arguments/new.js.handlebars +17 -0
- data/app/assets/javascripts/voluntary_ranking/templates/compare_things.js.handlebars +22 -0
- data/app/assets/javascripts/voluntary_ranking/templates/compare_things/arguments.js.handlebars +26 -0
- data/app/assets/javascripts/voluntary_ranking/templates/components/modal-dialog.js.handlebars +9 -0
- data/app/assets/javascripts/voluntary_ranking/templates/components/rankings-component.handlebars +17 -0
- data/app/assets/javascripts/voluntary_ranking/templates/index.js.handlebars +1 -0
- data/app/assets/javascripts/voluntary_ranking/templates/navigation.js.handlebars +28 -0
- data/app/assets/javascripts/voluntary_ranking/templates/ranking_item.js.handlebars +31 -0
- data/app/assets/javascripts/voluntary_ranking/templates/ranking_items/_collection.js.handlebars +84 -0
- data/app/assets/javascripts/voluntary_ranking/templates/ranking_items/_form.js.handlebars +30 -0
- data/app/assets/javascripts/voluntary_ranking/templates/rankings/_form.js.handlebars +38 -0
- data/app/assets/javascripts/voluntary_ranking/templates/rankings/index.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_ranking/templates/rankings/show.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_ranking/templates/shared/_pagination.js.handlebars +23 -0
- data/app/assets/javascripts/voluntary_ranking/templates/shared/_stars.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_ranking/templates/thing.js.handlebars +13 -0
- data/app/assets/javascripts/voluntary_ranking/templates/thing/index.js.handlebars +0 -0
- data/app/assets/javascripts/voluntary_ranking/templates/things/show.arguments.js.handlebars +1 -0
- data/app/assets/javascripts/voluntary_ranking/templates/things/show.js.handlebars +1 -0
- data/app/assets/javascripts/voluntary_ranking/templates/user.js.handlebars +5 -0
- data/app/assets/javascripts/voluntary_ranking/templates/user/rankings/details.js.handlebars +7 -0
- data/app/assets/javascripts/voluntary_ranking/views/application/index_view.js.coffee +1 -0
- data/app/assets/javascripts/voluntary_ranking/views/arguments/new_view.js.coffee +9 -0
- data/app/assets/javascripts/voluntary_ranking/views/index_view.js.coffee +1 -0
- data/app/assets/javascripts/voluntary_ranking/views/ranking_items/colllection_view.js.coffee +25 -0
- data/app/assets/javascripts/voluntary_ranking/views/shared/pagination.js +4 -0
- data/app/assets/stylesheets/voluntary_ranking/application.css +17 -0
- data/app/assets/stylesheets/voluntary_ranking/base.css.sass +6 -0
- data/app/assets/stylesheets/voluntary_ranking/bootstrap_and_overrides.css.sass +0 -0
- data/app/assets/stylesheets/voluntary_ranking/stars.css.sass +31 -0
- data/app/assets/stylesheets/voluntary_ranking/twitter-typeahead.css.sass +29 -0
- data/app/controllers/api/v1/argument_topics_controller.rb +12 -0
- data/app/controllers/api/v1/arguments_controller.rb +32 -0
- data/app/controllers/api/v1/ranking_items_controller.rb +43 -0
- data/app/controllers/api/v1/rankings_controller.rb +29 -0
- data/app/controllers/api/v1/things/arguments_controller.rb +40 -0
- data/app/controllers/api/v1/things_controller.rb +26 -0
- data/app/controllers/api/v1/user_ranking_items_controller.rb +94 -0
- data/app/controllers/api/v1/users_controller.rb +9 -0
- data/app/controllers/product/ranking_controller.rb +16 -0
- data/app/models/argument.rb +48 -0
- data/app/models/argument_topic.rb +7 -0
- data/app/models/product/ranking.rb +2 -0
- data/app/models/ranking.rb +97 -0
- data/app/models/ranking_item.rb +30 -0
- data/app/models/user_ranking_item.rb +136 -0
- data/app/serializers/argument_serializer.rb +11 -0
- data/app/serializers/base_ranking_item_serializer.rb +23 -0
- data/app/serializers/ranking_item_serializer.rb +2 -0
- data/app/serializers/user_ranking_item_serializer.rb +7 -0
- data/app/views/product/ranking/index.html.erb +0 -0
- data/config/locales/en.yml +10 -0
- data/config/locales/resources/ranking/en.yml +10 -0
- data/config/routes.rb +41 -0
- data/db/migrate/20130817115303_add_ranking_product.rb +50 -0
- data/db/migrate/20140926102943_create_arguments.rb +20 -0
- data/lib/concerns/controller/base_ranking_items_controller.rb +10 -0
- data/lib/concerns/model/base_ranking_item.rb +29 -0
- data/lib/concerns/model/user/ranking.rb +48 -0
- data/lib/tasks/voluntary_ranking_tasks.rake +4 -0
- data/lib/voluntary_ranking.rb +12 -0
- data/lib/voluntary_ranking/ability.rb +11 -0
- data/lib/voluntary_ranking/engine.rb +16 -0
- data/lib/voluntary_ranking/version.rb +3 -0
- metadata +436 -0
data/app/assets/javascripts/voluntary_ranking/templates/components/rankings-component.handlebars
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
{{#if anyItems}}
|
2
|
+
<table class="table table-striped" style="margin-top:15px;">
|
3
|
+
<tbody>
|
4
|
+
{{#each collection as |ranking|}}
|
5
|
+
<tr>
|
6
|
+
<td>
|
7
|
+
{{#link-to 'rankings.show' ranking.adjective ranking.negativeAdjective ranking.topic ranking.scope 1}}
|
8
|
+
{{ranking.adjective}} and {{ranking.negativeAdjective}} {{ranking.topic}} {{ranking.scope}}
|
9
|
+
{{/link-to}}
|
10
|
+
</td>
|
11
|
+
</tr>
|
12
|
+
{{/each}}
|
13
|
+
</tbody>
|
14
|
+
</table>
|
15
|
+
{{else}}
|
16
|
+
No rankings found.
|
17
|
+
{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{partial 'rankings/form'}}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div class="navbar navbar-inverse navbar-fixed-top">
|
2
|
+
<div class="container">
|
3
|
+
<a id="plattform_brand" class="navbar-brand" href="/">Volontari.at /</a>
|
4
|
+
<a id="product_brand" class="navbar-brand" href="#">Ranking</a>
|
5
|
+
|
6
|
+
<ul class="navbar-nav nav">
|
7
|
+
{{#if currentUser}}
|
8
|
+
<li class="dropdown">
|
9
|
+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
10
|
+
Account
|
11
|
+
<b class="caret"></b>
|
12
|
+
</a>
|
13
|
+
<ul class="dropdown-menu">
|
14
|
+
{{#link-to 'user' currentUser.name 1 tagName='li'}}<a>Your rankings</a>{{/link-to}}
|
15
|
+
<li>
|
16
|
+
<a {{action 'signOut'}}>Sign out</a>
|
17
|
+
</li>
|
18
|
+
</ul>
|
19
|
+
</li>
|
20
|
+
{{else}}
|
21
|
+
<li>
|
22
|
+
<a href="/users/sign_in">Authentication</a>
|
23
|
+
</li>
|
24
|
+
{{/if}}
|
25
|
+
<li><a href="http://GitHub.com/Volontariat/voluntary_ranking/issues">Issues</a></li>
|
26
|
+
</ul>
|
27
|
+
</div>
|
28
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
{{partial 'rankings/form'}}
|
2
|
+
|
3
|
+
<h2>User votes</h2>
|
4
|
+
|
5
|
+
{{#if anyUserRankingItems}}
|
6
|
+
<table class="table table-striped" style="margin-top:15px;">
|
7
|
+
<tbody>
|
8
|
+
{{#each userRankingItems as |userRankingItem|}}
|
9
|
+
<tr>
|
10
|
+
<td style="width:50px;">
|
11
|
+
{{userRankingItem.position}}
|
12
|
+
</td>
|
13
|
+
<td>
|
14
|
+
{{#link-to 'user_ranking' userRankingItem.user_name userRankingItem.ranking_adjective userRankingItem.ranking_negative_adjective userRankingItem.ranking_topic userRankingItem.ranking_scope 1}}
|
15
|
+
{{userRankingItem.user_name}}
|
16
|
+
{{/link-to}}
|
17
|
+
</td>
|
18
|
+
<td>
|
19
|
+
<div class="stars">
|
20
|
+
{{stars-html userRankingItem.stars}}
|
21
|
+
</div>
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
{{/each}}
|
25
|
+
</tbody>
|
26
|
+
</table>
|
27
|
+
{{else}}
|
28
|
+
<span style="position:relative; top:10px;">No user votes found.</span>
|
29
|
+
{{/if}}
|
30
|
+
|
31
|
+
{{partial 'shared/pagination'}}
|
data/app/assets/javascripts/voluntary_ranking/templates/ranking_items/_collection.js.handlebars
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
{{#if anyItems}}
|
2
|
+
<table class="table" style="margin-bottom: 0px">
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
{{#if controller.yourRanking}}
|
6
|
+
<th width="2%"></th>
|
7
|
+
{{/if}}
|
8
|
+
<th width="5%" style="vertical-align:top;">Position</th>
|
9
|
+
{{#if controller.yourRanking}}
|
10
|
+
<th width="5%" style="vertical-align:top; text-align:center;">Move</th>
|
11
|
+
<th width="70%" style="vertical-align:top;">Name</th>
|
12
|
+
{{else}}
|
13
|
+
<th width="80%" style="vertical-align:top;">Name</th>
|
14
|
+
{{/if}}
|
15
|
+
<th width="15%" style="vertical-align:top; text-align:center;">Stars</th>
|
16
|
+
{{#if controller.yourRanking}}
|
17
|
+
<th width="5%"></th>
|
18
|
+
{{/if}}
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
</table>
|
22
|
+
{{/if}}
|
23
|
+
|
24
|
+
<ul class="nav nav-tabs nav-stacked list-striped" id="ranking">
|
25
|
+
{{#each model as |rankingItem|}}
|
26
|
+
<li class="ranking_item_{{unbound rankingItem.id}}" data-id="{{unbound rankingItem.id}}" data-position="{{unbound rankingItem.position}}">
|
27
|
+
<table class="table">
|
28
|
+
<tr>
|
29
|
+
{{#if controller.yourRanking}}
|
30
|
+
<td width="2%" style="text-align:center">
|
31
|
+
<span class="ranking_item_sortable glyphicon glyphicon-move"></span>
|
32
|
+
</td>
|
33
|
+
{{/if}}
|
34
|
+
<td class="list-element-striped" width="5%" style="text-align:right">
|
35
|
+
{{#link-to 'ranking_item' rankingItem.thingName rankingItem.positiveOrNegativeAdjective rankingItem.rankingTopic rankingItem.rankingScope 1 class="ranking_item_position"}}
|
36
|
+
{{rankingItem.position}}
|
37
|
+
{{/link-to}}
|
38
|
+
</td>
|
39
|
+
{{#if controller.yourRanking}}
|
40
|
+
<td class="list-element-striped" width="5%" style="text-align:center">
|
41
|
+
<a {{action 'moveToPreviousPage' rankingItem.id}} title="move to previous page"><span class="glyphicon glyphicon-chevron-left"></span></a>
|
42
|
+
<a {{action 'moveToNextPage' rankingItem.id}} title="move to next page"><span class="glyphicon glyphicon-chevron-right"></span></a>
|
43
|
+
</td>
|
44
|
+
<td class="list-element-striped" width="70%" style="padding-left:10px;">
|
45
|
+
{{#link-to 'thing' rankingItem.thingName}}{{rankingItem.thingName}}{{/link-to}}
|
46
|
+
</td>
|
47
|
+
{{else}}
|
48
|
+
<td class="list-element-striped" width="80%" style="padding-left:10px;">
|
49
|
+
{{#link-to 'thing' rankingItem.thingName}}{{rankingItem.thingName}}{{/link-to}}
|
50
|
+
</td>
|
51
|
+
{{/if}}
|
52
|
+
<td class="list-element-striped" width="15%" style="text-align:center;">
|
53
|
+
<div class="stars" style="white-space:nowrap;">
|
54
|
+
{{#if controller.yourRanking}}
|
55
|
+
<span class="5stars {{if rankingItem.is5StarClass 'active'}}" {{action 'updateStars' rankingItem.id rankingItem.stars 5}}></span>
|
56
|
+
<span class="4stars {{if rankingItem.is4StarClass 'active'}}" {{action 'updateStars' rankingItem.id rankingItem.stars 4}}></span>
|
57
|
+
<span class="3stars {{if rankingItem.is3StarClass 'active'}}" {{action 'updateStars' rankingItem.id rankingItem.stars 3}}></span>
|
58
|
+
<span class="2stars {{if rankingItem.is2StarClass 'active'}}" {{action 'updateStars' rankingItem.id rankingItem.stars 2}}></span>
|
59
|
+
<span class="1stars {{if rankingItem.is1StarClass 'active'}}" {{action 'updateStars' rankingItem.id rankingItem.stars 1}}></span>
|
60
|
+
{{else}}
|
61
|
+
<span class="{{if rankingItem.is5StarClass 'active'}}"></span>
|
62
|
+
<span class="{{if rankingItem.is4StarClass 'active'}}"></span>
|
63
|
+
<span class="{{if rankingItem.is3StarClass 'active'}}"></span>
|
64
|
+
<span class="{{if rankingItem.is2StarClass 'active'}}"></span>
|
65
|
+
<span class="{{if rankingItem.is1StarClass 'active'}}"></span>
|
66
|
+
{{/if}}
|
67
|
+
</div>
|
68
|
+
</td>
|
69
|
+
{{#if controller.yourRanking}}
|
70
|
+
<td width="3%" style="text-align:center;">
|
71
|
+
<span class="glyphicon glyphicon-remove" {{action 'destroy' rankingItem.id}}></span>
|
72
|
+
</td>
|
73
|
+
{{/if}}
|
74
|
+
</tr>
|
75
|
+
</table>
|
76
|
+
</li>
|
77
|
+
{{/each}}
|
78
|
+
</ul>
|
79
|
+
|
80
|
+
{{#if anyItems}}
|
81
|
+
{{partial 'shared/pagination'}}
|
82
|
+
{{else}}
|
83
|
+
<p style="padding-top:10px;">No items found.</p>
|
84
|
+
{{/if}}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<form id="new_ranking_item_form">
|
2
|
+
<div>
|
3
|
+
<button class="add_user_ranking_item_button btn btn-default" type="button" {{action 'addItem'}}>Add</button>
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
{{input value=thingName placeholder="Thing" class="thing_name" style="margin-bottom: 0px;" data-autocomplete="/api/v1/things/suggest"}}
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
to
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
<span class="btn-group" data-toggle-name="ranking_item_best" data-toggle="buttons-radio">
|
16
|
+
<button class="{{isBestClass}}" type="button" data-toggle-value="1" {{action 'setBest'}}>Best?</button>
|
17
|
+
<button class="{{isWorstClass}}" type="button" data-toggle-value="0" {{action 'setWorst'}}>Worst?</button>
|
18
|
+
</span>
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<div class="stars" style="display: inline; position: relative; top: 5px;">
|
23
|
+
<span class="{{is5Star}}" {{action 'set5Star'}}></span>
|
24
|
+
<span class="{{is4Star}}" {{action 'set4Star'}}></span>
|
25
|
+
<span class="{{is3Star}}" {{action 'set3Star'}}></span>
|
26
|
+
<span class="{{is2Star}}" {{action 'set2Star'}}></span>
|
27
|
+
<span class="{{is1Star}}" {{action 'set1Star'}}></span>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</form>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<form class="form-inline" id="new_ranking_form">
|
2
|
+
<p>
|
3
|
+
{{#if rankingItemThingName}}
|
4
|
+
{{#link-to 'thing' rankingItemThingName}}{{rankingItemThingName}}{{/link-to}}
|
5
|
+
is
|
6
|
+
{{/if}}
|
7
|
+
|
8
|
+
{{#if userName}}
|
9
|
+
{{#link-to 'user' userName 1}}{{name-with-apostrophe userName}}{{/link-to}}
|
10
|
+
|
11
|
+
{{else}}
|
12
|
+
{{#if currentUser}}
|
13
|
+
<span class="btn-group" data-toggle-name="ranking_form_your_ranking" data-toggle="buttons-radio">
|
14
|
+
<button class="{{globalRankingClass}}" type="button" data-toggle-value="1" {{action 'setGlobalRanking'}}>Global</button>
|
15
|
+
<button class="{{yourRankingClass}}" type="button" data-toggle-value="0" {{action 'setYourRanking'}}>Your</button>
|
16
|
+
</span>
|
17
|
+
|
18
|
+
{{/if}}
|
19
|
+
{{/if}}
|
20
|
+
|
21
|
+
{{#if position}}
|
22
|
+
#{{position}}
|
23
|
+
|
24
|
+
{{/if}}
|
25
|
+
|
26
|
+
{{input size="10" value=adjective placeholder="Adjective" class="adjective" data-autocomplete="/api/v1/rankings/attributes/adjective/autocomplete"}}
|
27
|
+
|
28
|
+
and
|
29
|
+
|
30
|
+
{{input size="10" value=negativeAdjective placeholder="Negative adjective" class="negative_adjective" data-autocomplete="/api/v1/rankings/attributes/negative_adjective/autocomplete"}}
|
31
|
+
|
32
|
+
{{input value=topic placeholder="Topic" class="topic" data-autocomplete="/api/v1/rankings/attributes/topic/autocomplete"}}
|
33
|
+
|
34
|
+
{{input size="10" value=scope placeholder="Scope" class="scope" data-autocomplete="/api/v1/rankings/attributes/scope/autocomplete"}}
|
35
|
+
|
36
|
+
<button class="get_ranking_button btn btn-default" type="button" {{action 'getRanking'}}>Get</button>
|
37
|
+
</p>
|
38
|
+
</form>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<nav>
|
2
|
+
<ul class="pagination">
|
3
|
+
{{#if controller.showFirstPageLink}}
|
4
|
+
<li class="first"><a {{action 'goToPage' 1}}>« First</a></li>
|
5
|
+
{{/if}}
|
6
|
+
|
7
|
+
{{#if controller.showPreviousPageLink}}
|
8
|
+
<li class="prev"><a {{action 'goToPage' controller.previousPage}}>« Previous</a></li>
|
9
|
+
{{/if}}
|
10
|
+
|
11
|
+
{{#each controller.pages as |currentPage|}}
|
12
|
+
<li class="{{if currentPage.isCurrent 'active'}}"><a href="#" {{action 'goToPage' currentPage.number}}>{{currentPage.number}}</a></li>
|
13
|
+
{{/each}}
|
14
|
+
|
15
|
+
{{#if controller.showNextPageLink}}
|
16
|
+
<li class="next_page"><a {{action 'goToPage' controller.nextPage}}>Next »</a></li>
|
17
|
+
{{/if}}
|
18
|
+
|
19
|
+
{{#if controller.showLastPageLink}}
|
20
|
+
<li class="last next"><a {{action 'goToPage' controller.totalPages}}>Last »</a></li>
|
21
|
+
{{/if}}
|
22
|
+
</ul>
|
23
|
+
</nav>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h1>
|
2
|
+
{{name}}
|
3
|
+
vs.
|
4
|
+
{{input type="text" value=otherThingName placeholder="Other thing" data-autocomplete="/api/v1/things/autocomplete"}}
|
5
|
+
<button class="compare_button" {{action 'compare'}}>Compare</button>
|
6
|
+
</h1>
|
7
|
+
|
8
|
+
<ul class="nav nav-pills">
|
9
|
+
{{#link-to 'rankings.index' name 1 tagName="li"}}<a href="{{view.href}}">Rankings</a>{{/link-to}}
|
10
|
+
{{#link-to 'arguments.index' name 1 tagName="li"}}<a href="{{view.href}}">Arguments</a>{{/link-to}}
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
{{outlet}}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
Arguments
|
@@ -0,0 +1 @@
|
|
1
|
+
ThingsShow
|
@@ -0,0 +1 @@
|
|
1
|
+
Volontariat.ApplicationIndexView = Ember.View.extend()
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Volontariat.ArgumentsNewView = Ember.View.extend
|
2
|
+
didInsertElement: ->
|
3
|
+
$('input[data-append-autocomplete]').each (k, v) ->
|
4
|
+
$(v).autocomplete
|
5
|
+
source: $(this).attr('data-append-autocomplete'),
|
6
|
+
appendTo: '#topic_suggestions'
|
7
|
+
select: (event, ui) ->
|
8
|
+
$(this).val(ui.item.value)
|
9
|
+
false
|
@@ -0,0 +1 @@
|
|
1
|
+
Volontariat.IndexView = Ember.View.extend()
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Volontariat.RankingItemsCollectionView = Ember.View.extend
|
2
|
+
templateName: 'ranking_items/_collection'
|
3
|
+
|
4
|
+
didInsertElement: ->
|
5
|
+
first_position = $('#ranking li:first').data('position')
|
6
|
+
last_position = $('#ranking li:last').data('position')
|
7
|
+
|
8
|
+
@$( '#ranking' ).sortable
|
9
|
+
handle: '.ranking_item_sortable'
|
10
|
+
start: (event, ui) =>
|
11
|
+
first_position = $('#ranking li:first').data('position')
|
12
|
+
last_position = $('#ranking li:last').data('position')
|
13
|
+
|
14
|
+
update: (event, ui) =>
|
15
|
+
source_item = $(ui.item).closest('li')
|
16
|
+
Volontariat.current_position = first_position
|
17
|
+
|
18
|
+
$.each $('#ranking li'), (index, element) ->
|
19
|
+
$(element).data('position', Volontariat.current_position)
|
20
|
+
$(element).find('.ranking_item_position').text(Volontariat.current_position)
|
21
|
+
|
22
|
+
if $(element).data('id') == $(source_item).data('id')
|
23
|
+
$.post '/api/v1/user_ranking_items/' + $(element).data('id') + '/move', { _method: 'put', position: Volontariat.current_position }
|
24
|
+
|
25
|
+
Volontariat.current_position += 1
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require voluntary/ember_js/application
|
12
|
+
*= require ./base
|
13
|
+
*= require ./bootstrap_and_overrides
|
14
|
+
*= require ./stars
|
15
|
+
*= require ./twitter-typeahead
|
16
|
+
*= require_self
|
17
|
+
*/
|
File without changes
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.stars
|
2
|
+
direction: rtl
|
3
|
+
font-size: 20px
|
4
|
+
margin: auto
|
5
|
+
unicode-bidi: bidi-override
|
6
|
+
width: 120px
|
7
|
+
|
8
|
+
span
|
9
|
+
display: inline-block
|
10
|
+
font-family: FontAwesome
|
11
|
+
font-style: normal
|
12
|
+
font-weight: normal
|
13
|
+
|
14
|
+
&:hover
|
15
|
+
cursor: pointer
|
16
|
+
|
17
|
+
&.active
|
18
|
+
&:before, ~ span:before
|
19
|
+
content: ""
|
20
|
+
|
21
|
+
&:before
|
22
|
+
content: ""
|
23
|
+
padding-right: 5px
|
24
|
+
&:hover span.active
|
25
|
+
&:before, ~ span:before
|
26
|
+
content: ""
|
27
|
+
padding-right: 5px
|
28
|
+
|
29
|
+
span:hover
|
30
|
+
&:before, ~ span:before
|
31
|
+
content: "" !important
|