Skip to content

Commit a5118fd

Browse files
author
Christopher Talib
authored
Merge pull request #287 from tosdr/prod-fixes
[fix & mod] Prod fixes
2 parents 9a58e4d + 7583245 commit a5118fd

File tree

8 files changed

+97
-68
lines changed

8 files changed

+97
-68
lines changed

app/views/points/_table.html.erb

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,32 @@
9797
<% if current_user %>
9898
<% if current_user.curator? %>
9999

100-
<%= link_to(point_path(p), :class => 'btn') do %>
100+
<%= link_to(point_path(p), class: 'btn') do %>
101101
<i class="fa fa-eye" aria-hidden="true"></i>
102-
<% end %>
103-
<%= link_to(edit_point_path(p), :class => 'btn') do %>
102+
<% end %>
103+
<%= link_to(edit_point_path(p), class: 'btn') do %>
104104
<i class="fa fa-pencil" aria-hidden="true"></i>
105-
<% end %>
105+
<% end %>
106106

107107
<% elsif current_user.id == p.user_id %>
108108

109-
<%= link_to(point_path(p), :class => 'btn') do %>
109+
<%= link_to(point_path(p), class: 'btn') do %>
110110
<i class="fa fa-eye" aria-hidden="true"></i>
111-
<% end %>
112-
<%= link_to(edit_point_path(p), :class => 'btn') do %>
111+
<% end %>
112+
<%= link_to(edit_point_path(p), class: 'btn') do %>
113113
<i class="fa fa-pencil" aria-hidden="true"></i>
114-
<% end %>
114+
<% end %>
115+
<% else %>
116+
117+
<%= link_to(point_path(p), class: 'btn') do %>
118+
<i class="fa fa-eye" aria-hidden="true"></i>
119+
<% end %>
115120

116121
<% end %>
117122

118-
<% else %>
123+
<% else %>
119124

120-
<%= link_to(point_path(p), :class => 'btn') do %>
125+
<%= link_to(point_path(p), class: 'btn') do %>
121126
<i class="fa fa-eye" aria-hidden="true"></i>
122127
<% end %>
123128

app/views/points/show.html.erb

Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -42,42 +42,61 @@
4242
<div class="m15 mw6">
4343
<ul class="point-info">
4444
<li class="point-items">
45-
<% unless current_user.nil? %>
46-
<% if current_user.id == @point.user_id %>
47-
<div>
48-
<%= link_to 'Edit', edit_point_path(@point), class: 'btn btn-primary' %>
49-
</div>
50-
<% end %>
51-
<% end %>
52-
<div class="pl15">
53-
<%= link_to 'All', points_path, class: 'btn btn-primary' %>
54-
</div>
5545

5646
<% unless current_user.nil? %>
57-
<% if current_user.curator? %>
58-
<div class="pl15">
59-
<%= link_to 'Update Status', new_point_reason_path(@point), class: 'btn btn-primary' %>
60-
</div>
61-
<div class="pl15">
62-
<%= link_to 'Edit Point', edit_point_path(@point), class: 'btn btn-primary' %>
63-
</div>
64-
<div class="pl15">
65-
<% if @point.status == "approved" %>
66-
<% if !@point.is_featured? %>
67-
<%= link_to 'Feature', featured_point_path(@point), method: :put, class: 'btn btn-primary' %>
47+
48+
<% if current_user.curator? %>
49+
50+
<div class="pl15">
51+
<%= link_to 'Update Status', new_point_reason_path(@point), class: 'btn btn-primary' %>
52+
</div>
53+
<div class="pl15">
54+
<%= link_to 'Edit Point', edit_point_path(@point), class: 'btn btn-primary' %>
55+
</div>
56+
<div class="pl15">
57+
<% if @point.status == "approved" %>
58+
<% if !@point.is_featured? %>
59+
<%= link_to 'Feature', featured_point_path(@point), method: :put, class: 'btn btn-primary' %>
60+
<% else %>
61+
<%= link_to 'Un-Feature', featured_point_path(@point), method: :put, class: 'btn btn-warning' %>
62+
<% end %>
63+
<% end %>
64+
</div>
65+
<div class="pl15">
66+
<%= link_to 'Delete', @point, method: :delete, class: 'btn btn-danger' %>
67+
</div>
68+
69+
<% elsif current_user.id == @point.user_id %>
70+
71+
<div class="pl15">
72+
<%= link_to 'All points', points_path, class: 'btn btn-primary' %>
73+
</div>
74+
<div class="pl15">
75+
<%= link_to 'Edit', edit_point_path(@point), class: 'btn btn-primary' %>
76+
</div>
77+
<div class="pl15">
78+
<%= link_to 'Back', :back, class: 'btn btn-primary' %>
79+
</div>
80+
6881
<% else %>
69-
<%= link_to 'Un-Feature', featured_point_path(@point), method: :put, class: 'btn btn-warning' %>
70-
<% end %>
71-
<% end %>
72-
</div>
73-
<div class="pl15">
74-
<%= link_to 'Delete', @point, method: :delete, class: 'btn btn-danger' %>
75-
</div>
76-
<% end %>
77-
<% end %>
78-
</li>
79-
</ul>
80-
</div>
82+
83+
<div class="pl15">
84+
<%= link_to 'All points', points_path, class: 'btn btn-primary' %>
85+
</div>
86+
<div class="pl15">
87+
<%= link_to 'Back', :back, class: 'btn btn-primary' %>
88+
</div>
89+
<% end %>
90+
91+
<% else %>
92+
<div class="pl15">
93+
<%= link_to 'Back', :back, class:'btn btn-primary' %>
94+
</div>
95+
96+
<% end %>
97+
</li>
98+
</ul>
99+
</div>
81100

82101
</div>
83102

app/views/services/_table.html.erb

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -128,29 +128,35 @@
128128
<% if current_user %>
129129
<% if current_user.curator? %>
130130

131-
<%= link_to(point_path(p), :class => 'btn') do %>
132-
<i class="fa fa-eye" aria-hidden="true"></i>
133-
<% end %>
134-
<%= link_to(edit_point_path(p), :class => 'btn') do %>
135-
<i class="fa fa-pencil" aria-hidden="true"></i>
136-
<% end %>
131+
<%= link_to(point_path(p), class: 'btn') do %>
132+
<i class="fa fa-eye" aria-hidden="true"></i>
133+
<% end %>
134+
<%= link_to(edit_point_path(p), class: 'btn') do %>
135+
<i class="fa fa-pencil" aria-hidden="true"></i>
136+
<% end %>
137137

138-
<% elsif current_user.id == p.user_id %>
138+
<% elsif current_user.id == p.user_id %>
139139

140-
<%= link_to(point_path(p), :class => 'btn') do %>
141-
<i class="fa fa-eye" aria-hidden="true"></i>
142-
<% end %>
143-
<%= link_to(edit_point_path(p), :class => 'btn') do %>
144-
<i class="fa fa-pencil" aria-hidden="true"></i>
145-
<% end %>
140+
<%= link_to(point_path(p), class: 'btn') do %>
141+
<i class="fa fa-eye" aria-hidden="true"></i>
142+
<% end %>
143+
<%= link_to(edit_point_path(p), class: 'btn') do %>
144+
<i class="fa fa-pencil" aria-hidden="true"></i>
145+
<% end %>
146146

147-
<% end %>
147+
<% else %>
148+
149+
<%= link_to(point_path(p), class: 'btn') do %>
150+
<li class="fa fa-eye" aria-hidden="true"></li>
151+
<% end %>
152+
153+
<% end %>
148154

149155
<% else %>
150156

151-
<%= link_to(point_path(p), :class => 'btn') do %>
152-
<i class="fa fa-eye" aria-hidden="true"></i>
153-
<% end %>
157+
<%= link_to(point_path(p), class: 'btn') do %>
158+
<i class="fa fa-eye" aria-hidden="true"></i>
159+
<% end %>
154160

155161
<% end %>
156162

app/views/services/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</div>
6666
</div>
6767
<div class="card-inline-item card-inline-options">
68-
<%= link_to(service_path(s), :class => 'btn') do %>
68+
<%= link_to(service_path(s), class: 'btn') do %>
6969
<i class="fa fa-eye" aria-hidden="true"></i>
7070
<% end %>
7171
</div>

app/views/shared/_navbar.html.erb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<div class="navbar-tosdr-group">
3232
<%= link_to "About", about_path, class: "navbar-tosdr-item navbar-tosdr-link" %>
3333
</div>
34-
<!-- Avatar with dropdown menu -->
3534
<div class="navbar-tosdr-item">
3635
<!-- todo make the data toggle when user is logged in -->
3736
<div class="dropdown">
@@ -49,7 +48,7 @@
4948
<% end %>
5049
</li>
5150
<li>
52-
<%= link_to destroy_user_session_path, method: :delete do %>
51+
<%= link_to destroy_user_session_path, method: :get do %>
5352
<i class="fa fa-sign-out"></i> <%= t(".profile", default: "Log out") %>
5453
<% end %>
5554
</li>
@@ -71,7 +70,7 @@
7170
<li><%= link_to "Topics", topics_path %></li>
7271
<li><%= link_to "Services", services_path %></li>
7372
<li><%= link_to "Setting", edit_user_registration_path %></li>
74-
<li><%= link_to "Log out", destroy_user_session_path, method: :delete %></li>
73+
<li><%= link_to "Log out", destroy_user_session_path, method: :get %></li>
7574
<% else %>
7675
<li><%= link_to "About", about_path, class: "navbar-tosdr-item navbar-tosdr-link" %></li>
7776
<li><%= link_to t(".sign_in", default: "Login"), new_user_session_path, class: "navbar-tosdr-item navbar-tosdr-link dropdown-toggle", id: "navbar-tosdr-menu" %></li>

app/views/topics/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@
5454
<% end %>
5555
</div>
5656
<div class="card-inline-item card-inline-options">
57-
<%= link_to(topic_path(t), :class => 'btn') do %>
57+
<%= link_to(topic_path(t), class: 'btn') do %>
5858
<i class="fa fa-eye" aria-hidden="true"></i>
5959
<% end %>
6060

6161
<% if current_user.curator? %>
6262

63-
<%= link_to(edit_topic_path(t), :class => 'btn') do %>
63+
<%= link_to(edit_topic_path(t), class: 'btn') do %>
6464
<i class="fa fa-pencil" aria-hidden="true"></i>
6565
<% end %>
6666

app/views/topics/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
<% end %>
105105
</div>
106106
<div class="card-inline-item card-inline-options">
107-
<%= link_to(point_path(p), :class => 'btn') do %>
107+
<%= link_to(point_path(p), class: 'btn') do %>
108108
<i class="fa fa-eye" aria-hidden="true"></i>
109109
<% end %>
110110
</div>

config/initializers/devise.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
# config.navigational_formats = ['*/*', :html]
246246

247247
# The default HTTP method used to sign out a resource. Default is :delete.
248-
config.sign_out_via = :delete
248+
config.sign_out_via = :get
249249

250250
# ==> OmniAuth
251251
# Add a new OmniAuth provider. Check the wiki for more information on setting

0 commit comments

Comments
 (0)