Skip to content

Commit 347c087

Browse files
committed
add test for downloads disabled
1 parent 19e6989 commit 347c087

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

apps/dashboard/app/views/files/turbo_frames/_files.html.erb

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
%>
4949
</td>
5050
<td></td>
51-
<%- elsif readable -%>
51+
<%- elsif readable && file[:downloadable] -%>
5252
<td>
5353
<%=
5454
link_to(
@@ -78,28 +78,24 @@
7878
View
7979
<% end %>
8080
</li>
81-
82-
<% if file[:downloadable] %>
83-
<li>
84-
<% if writable %>
81+
<% if writable %>
82+
<li>
8583
<%= link_to OodAppkit.editor.edit(path: full_path).to_s,
8684
target: '_top',
8785
class: 'edit-file dropdown-item' do %>
8886
<i class="fas fa-edit" aria-hidden="true"></i>
8987
Edit
9088
<% end %>
91-
<% end %>
9289
</li>
93-
94-
<li>
95-
<%= link_to files_path(full_path, download: '1'),
96-
target: '_top',
97-
class: 'download-file dropdown-item' do %>
98-
<i class="fas fa-download" aria-hidden="true"></i>
99-
Download
100-
<% end %>
101-
</li>
102-
<% end %>
90+
<% end %>
91+
<li>
92+
<%= link_to files_path(full_path, download: '1'),
93+
target: '_top',
94+
class: 'download-file dropdown-item' do %>
95+
<i class="fas fa-download" aria-hidden="true"></i>
96+
Download
97+
<% end %>
98+
</li>
10399
</ul>
104100
</div>
105101
</td>

0 commit comments

Comments
 (0)