Skip to content

Commit a79fd99

Browse files
show disabled indicators (#218)
* fix errors * test * upgrade rails * adjust css * show disabled indicators
1 parent 23e146b commit a79fd99

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

app/views/documents/show.html.erb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
<%= render partial: 'shared/breadcrumb', locals: { breadcrumbs: [['Home', root_path], [@document.library.name, library_path(@document.library)], ["Document", document_path(@document)]] } %>
44

5+
<% unless @document.enabled %>
6+
<div class="bg-amber-50 border-l-4 border-amber-400 p-4 mb-4">
7+
<div class="flex">
8+
<div class="flex-shrink-0">
9+
<svg class="h-5 w-5 text-amber-400" viewBox="0 0 20 20" fill="currentColor">
10+
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
11+
</svg>
12+
</div>
13+
<div class="ml-3">
14+
<p class="text-sm text-amber-700">
15+
<strong>Document is disabled.</strong> This document will not appear in question results or searches.
16+
</p>
17+
</div>
18+
</div>
19+
</div>
20+
<% end %>
21+
522
<%= render @document %>
623

724
<h2 class="text-2xl text-stone-500 mt-5">Related Questions (<%= @document.questions_count %>)

app/views/shared/_doc_list.html.erb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
</svg>
3232
<%= document.questions_count %> references
3333
</div>
34+
<% unless document.enabled %>
35+
<div class="flex items-center text-amber-600">
36+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3 mr-1">
37+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" />
38+
</svg>
39+
Disabled
40+
</div>
41+
<% end %>
3442
<% if document.embedding.nil? %>
3543
<div class="flex items-center text-purple-500">
3644
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3 mr-1">
@@ -39,6 +47,7 @@
3947
Processing
4048
</div>
4149
<% end %>
50+
4251
</div>
4352
</div>
4453
<a href="<%= url_for(document) %>" class="inline-flex items-center text-sky-700 hover:text-white hover:bg-sky-500 px-4 py-2 rounded-full transition-all">

0 commit comments

Comments
 (0)