-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix order drop down, only orders by age or time, no tiebreaker based …
…on votes
- Loading branch information
1 parent
8728b4f
commit 1abf9a8
Showing
6 changed files
with
113 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="index-wrapper"> | ||
|
||
<% experiments.order(:age).each do |experiment| %> | ||
|
||
<div class="index-experiment-card"> | ||
<% if experiment.uploaded_file.blank? %> | ||
<a href="<%= url_for experiment %>" class="index-photo" style="background-image: url(<%= image_path "bubbles.jpg" %>)"> | ||
<% else %> | ||
<a href="<%= url_for experiment %>" class="index-photo" style="background-image: url('<%= experiment.uploaded_file %>')"> | ||
<% end %> | ||
<span class="index-exp-title-bar"><h3 class="index-exp-title"><%= experiment.name %></h3> | ||
<i class="fa fa-thumbs-up index-likes"> <%= pluralize experiment.votes, "like" %></i> | ||
</span> | ||
</a> | ||
|
||
<div class="index-info"> | ||
<div class="index-exp-ratings"> | ||
<span class="ratings-container"> | ||
<span class="index-concept-icon"> | ||
<% c = experiment.concepts.sample %> | ||
<%= image_tag "#{c.name}.png", class: "concept-img-small" %><br> | ||
<%= link_to c.name, concept_path(c) %> | ||
</span> | ||
|
||
<div class="index-time"> | ||
<%= image_tag "time.png", class: "icon-small" %><br> | ||
<%= experiment.complete_time %> hour(s) | ||
</div> | ||
|
||
<div class="index-age"> | ||
<%= image_tag "age.png", class: "icon-small" %><br> | ||
Ages <%= experiment.return_age %> | ||
</div> | ||
|
||
<div class="mess-rate-disable index-mess"> | ||
<%= rating_for experiment, "name", star_path: '/images/ratyrate', :disable_rate => true %><br> | ||
Mess | ||
</div> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="index-wrapper"> | ||
|
||
<% experiments.order(:complete_time).each do |experiment| %> | ||
|
||
<div class="index-experiment-card"> | ||
<% if experiment.uploaded_file.blank? %> | ||
<a href="<%= url_for experiment %>" class="index-photo" style="background-image: url(<%= image_path "bubbles.jpg" %>)"> | ||
<% else %> | ||
<a href="<%= url_for experiment %>" class="index-photo" style="background-image: url('<%= experiment.uploaded_file %>')"> | ||
<% end %> | ||
<span class="index-exp-title-bar"><h3 class="index-exp-title"><%= experiment.name %></h3> | ||
<i class="fa fa-thumbs-up index-likes"> <%= pluralize experiment.votes, "like" %></i> | ||
</span> | ||
</a> | ||
|
||
<div class="index-info"> | ||
<div class="index-exp-ratings"> | ||
<span class="ratings-container"> | ||
<span class="index-concept-icon"> | ||
<% c = experiment.concepts.sample %> | ||
<%= image_tag "#{c.name}.png", class: "concept-img-small" %><br> | ||
<%= link_to c.name, concept_path(c) %> | ||
</span> | ||
|
||
<div class="index-time"> | ||
<%= image_tag "time.png", class: "icon-small" %><br> | ||
<%= experiment.complete_time %> hour(s) | ||
</div> | ||
|
||
<div class="index-age"> | ||
<%= image_tag "age.png", class: "icon-small" %><br> | ||
Ages <%= experiment.return_age %> | ||
</div> | ||
|
||
<div class="mess-rate-disable index-mess"> | ||
<%= rating_for experiment, "name", star_path: '/images/ratyrate', :disable_rate => true %><br> | ||
Mess | ||
</div> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
$(".index-wrapper").replaceWith("<%= j(render partial: 'experiments/order_experiments', locals: { experiments: @sorted_experiments }) %>"); | ||
initStars(); | ||
<% if params[:selectValue] == "1" %> | ||
$(".index-wrapper").replaceWith("<%= j(render partial: 'experiments/age_ordered', locals: { experiments: @experiments }) %>"); | ||
<% elsif params[:selectValue] == "2" %> | ||
$(".index-wrapper").replaceWith("<%= j(render partial: 'experiments/time_ordered', locals: { experiments: @experiments }) %>"); | ||
<% end %> |