|
| 1 | +<% content_for :title, "Topics" %> |
| 2 | + |
| 3 | +<section class="section"> |
| 4 | + <div class="row" id="table-striped"> |
| 5 | + <div class="col-12 cold-md-12"> |
| 6 | + <div class="card"> |
| 7 | + <div class="card-header d-flex justify-content-between align-items-center"> |
| 8 | + <h2 class="card-title">Topics</h2> |
| 9 | + <%= link_to new_topic_path, class: "btn btn-primary" do %> |
| 10 | + <i class="bi bi-plus"></i> Add New Topic |
| 11 | + <% end %> |
| 12 | + </div> |
| 13 | + <div class="card-content"> |
| 14 | + <div class="card-body"> |
| 15 | + <p class="card-text"> Some important information or instruction can be placed here.</p> |
| 16 | + <div class="table-responsive"> |
| 17 | + <table class="table table-lg table-striped mb-0"> |
| 18 | + <thead> |
| 19 | + <tr> |
| 20 | + <th>Title</th> |
| 21 | + <th>Description</th> |
| 22 | + <th>UID</th> |
| 23 | + <th>Language</th> |
| 24 | + <th>Provider</th> |
| 25 | + <th>State</th> |
| 26 | + <th class="text-end">Actions</th> |
| 27 | + </tr> |
| 28 | + </thead> |
| 29 | + <tbody> |
| 30 | + <% @topics.each do |topic| %> |
| 31 | + <tr> |
| 32 | + <td class="text-bold-500"><%= topic.title %></td> |
| 33 | + <td class="text-bold-500"><%= topic.description.truncate(25, omission: "...") %></td> |
| 34 | + <td class="text-bold-500"><%= topic.uid.truncate(10, omission: "...") %></td> |
| 35 | + <td class="text-bold-500"><%= topic.language.name %></td> |
| 36 | + <td class="text-bold-500"><%= topic.provider.name %></td> |
| 37 | + <td class="text-bold-500"><%= topic.state %></td> |
| 38 | + <td class="text-end"> |
| 39 | + <%= link_to topic, class: "btn btn-primary btn-sm" do %> |
| 40 | + <i class="bi bi-search"></i> View |
| 41 | + <% end %> |
| 42 | + <%= link_to edit_topic_path(topic), class: "btn btn-secondary btn-sm" do %> |
| 43 | + <i class="bi bi-pencil"></i> Edit |
| 44 | + <% end %> |
| 45 | + <%= link_to archive_topic_path(topic), method: :put, data: { confirm: "Are you sure?" }, class: "btn btn-danger btn-sm" do %> |
| 46 | + <i class="bi bi-archive"></i> Archive |
| 47 | + <% end %> |
| 48 | + <% if Current.user.is_admin? %> |
| 49 | + <%= link_to topic, method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger btn-sm" do %> |
| 50 | + <i class="bi bi-trash"></i> Delete |
| 51 | + <% end %> |
| 52 | + <% end %> |
| 53 | + </td> |
| 54 | + </tr> |
| 55 | + <% end %> |
| 56 | + </tbody> |
| 57 | + </table> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | +</section> |
0 commit comments