Skip to content

Commit c571882

Browse files
display more recent changes (#508)
1 parent dd5c665 commit c571882

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class PagesController < ApplicationController
22
def home
33
@services = Service.includes(:points).with_points_featured.sample(3)
4-
@versions = Version.order("created_at DESC").limit(5) # .joins('INNER JOIN users ON "whodunnit"= cast(users."id" as text)')
4+
@versions = Version.order("created_at DESC").limit(50) # .joins('INNER JOIN users ON "whodunnit"= cast(users."id" as text)')
55
end
66
end

app/views/pages/home.html.erb

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,49 @@
2323
<p>Then you need to wait for a curator to approve your changes, after which your review will show up on <a href="https://tosdr.org">https://tosdr.org</a>, will be picked up by the ToS;DR browser extensions, and included in DuckDuckGo's Privacy Grade, for which our API is one of several input factors. For services whose terms and policies are tracked by <a href="https://tosback.org">ToSBack</a>, you can try out our experimental <a href="/services/331/annotate">annotate view</a>.</p>
2424
<p>This tool is still very much under construction, and has bugs. Please <a href="https://github.com/tosdr/phoenix/issues/new">open a github issue</a> for anything you think should be improved.</p>
2525

26+
27+
<h2>Examples (<%= link_to "see all", services_path %>):</h2>
28+
<div class="row" id="service-container">
29+
<% @services.each do |s| %>
30+
<div class="col-xs-12 col-sm-6 col-lg-4 serviceDiv" data-rating="<%= s.service_ratings %>">
31+
<!--CARD -->
32+
<div class="card">
33+
<h2 class="card-header card-service" title="<%= s.name %>">
34+
<%= s.name %>
35+
</h2>
36+
<div class="card-body card-block">
37+
<div class="card-text">
38+
<ul>
39+
<% s.points.each do |p| %>
40+
<% if p.is_featured? %>
41+
<% if p.rating.between?(7,10) %>
42+
<% point_icon = "point-good" %>
43+
<% elsif p.rating.between?(4,6) %>
44+
<% point_icon = "point-neutral" %>
45+
<% elsif p.rating.between?(2,3) %>
46+
<% point_icon = "point-bad" %>
47+
<% elsif p.rating.between?(0,2) %>
48+
<% point_icon = "point-blocker" %>
49+
<% end %>
50+
<li class="<%= point_icon %> xs-icon">
51+
<%= p.title %>
52+
</li>
53+
<% end %>
54+
<% end %>
55+
</ul>
56+
<div class="card-badge <%= s.rating_for_view %>">
57+
<%= s.service_ratings %>
58+
</div>
59+
</div>
60+
</div>
61+
<div class="card-footer">
62+
<%= link_to "More", service_path(s.id), class: "btn btn-primary box-shadow-for-button" %>
63+
</div>
64+
</div>
65+
</div>
66+
<% end %>
67+
</div>
68+
2669
<h2>Recent changes:</h2>
2770
<div class="panel-group" id="accordion">
2871
<% counter = 1 %>
@@ -38,7 +81,7 @@
3881
</div>
3982
<div class="col-sm-4">
4083
<h5>
41-
<%= version.event %>
84+
<%= version.event %>d <!-- FIXME for i18n: make this literal 'd' a function to_past_tense in app/helpers/ -->
4285
<a
4386
href="/<%= version.item_type.downcase %>s/<%= version.item_id %>" class="collapsed">
4487
<%= version.item_type %>
@@ -72,45 +115,3 @@
72115
</div>
73116
<% end %>
74117
</div>
75-
76-
<h2>Examples:</h2>
77-
<div class="row" id="service-container">
78-
<% @services.each do |s| %>
79-
<div class="col-xs-12 col-sm-6 col-lg-4 serviceDiv" data-rating="<%= s.service_ratings %>">
80-
<!--CARD -->
81-
<div class="card">
82-
<h2 class="card-header card-service" title="<%= s.name %>">
83-
<%= s.name %>
84-
</h2>
85-
<div class="card-body card-block">
86-
<div class="card-text">
87-
<ul>
88-
<% s.points.each do |p| %>
89-
<% if p.is_featured? %>
90-
<% if p.rating.between?(7,10) %>
91-
<% point_icon = "point-good" %>
92-
<% elsif p.rating.between?(4,6) %>
93-
<% point_icon = "point-neutral" %>
94-
<% elsif p.rating.between?(2,3) %>
95-
<% point_icon = "point-bad" %>
96-
<% elsif p.rating.between?(0,2) %>
97-
<% point_icon = "point-blocker" %>
98-
<% end %>
99-
<li class="<%= point_icon %> xs-icon">
100-
<%= p.title %>
101-
</li>
102-
<% end %>
103-
<% end %>
104-
</ul>
105-
<div class="card-badge <%= s.rating_for_view %>">
106-
<%= s.service_ratings %>
107-
</div>
108-
</div>
109-
</div>
110-
<div class="card-footer">
111-
<%= link_to "More", service_path(s.id), class: "btn btn-primary box-shadow-for-button" %>
112-
</div>
113-
</div>
114-
</div>
115-
<% end %>
116-
</div>

0 commit comments

Comments
 (0)