Browse Source

Minor UI fixes

pull/67/head
alexdbondoc17 4 years ago
parent
commit
fa204a9afc
  1. 2
      app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb
  2. 2
      app/components/document_index_table_component/document_index_table_component.html.erb
  3. 12
      app/views/documents/show.html.erb
  4. 30
      app/views/subject_indexes/show.html.erb

2
app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb

@ -7,7 +7,7 @@
<tbody> <tbody>
<% search_results.each do |search_result| %> <% search_results.each do |search_result| %>
<tr href="<%= jurisprudence(search_result).present? ? params[:is_index_table] === "true"? document_path(jurisprudence(search_result).id)+ "?is_index_table="+params[:is_index_table] : '#' : "#"%> " class="clickable-tr"> <tr href="<%= jurisprudence(search_result).present? ? params[:is_index_table] === "true"? document_path(jurisprudence(search_result).id)+ "?is_index_table="+params[:is_index_table] : '#' : "#"%> " class="clickable-link">
<td> <%= document_reference_number(jurisprudence(search_result)) %> </td> <td> <%= document_reference_number(jurisprudence(search_result)) %> </td>
<td> <%= document_title(jurisprudence(search_result)) %> </td> <td> <%= document_title(jurisprudence(search_result)) %> </td>
<td> <%= date_or_year(jurisprudence(search_result)) %> </td> <td> <%= date_or_year(jurisprudence(search_result)) %> </td>

2
app/components/document_index_table_component/document_index_table_component.html.erb

@ -1,4 +1,4 @@
<tr href="<%= document_path(search_result.id) %>" class="<%= opts.reject{ |k, v| v.blank? }.blank? ? 'clickable-tr' : ''%>" target="_blank"> <tr href="<%= document_path(search_result.id, is_citator_tab: true) %>" class="<%= opts.reject{ |k, v| v.blank? }.blank? ? 'clickable-link' : ''%>" target="_blank">
<td> <%= clean_reference_number %> </td> <td> <%= clean_reference_number %> </td>
<td> <%= short_title || title %> </td> <td> <%= short_title || title %> </td>
<td> <%= date_or_year %> </td> <td> <%= date_or_year %> </td>

12
app/views/documents/show.html.erb

@ -46,13 +46,13 @@
<div class="card-body p-0"> <div class="card-body p-0">
<ul class="doc-nav-body nav nav-tabs nav-justified" id="menuTab" role="tablist"> <ul class="doc-nav-body nav nav-tabs nav-justified" id="menuTab" role="tablist">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link active" id="analysisMenuTab" data-bs-toggle="tab" data-bs-target="#analysisTabContent" type="button" role="tab" aria-controls="analysisTab" aria-selected="true">Analysis</button> <button class="nav-link <%= params[:is_document_view].blank? && params[:is_citator_tab].blank? ? 'active' : '' %>" id="analysisMenuTab" data-bs-toggle="tab" data-bs-target="#analysisTabContent" type="button" role="tab" aria-controls="analysisTab" aria-selected="true">Analysis</button>
</li> </li>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" id="analysisMenuTab" data-bs-toggle="tab" data-bs-target="#documentTabContent" type="button" role="tab" aria-controls="analysisTab" aria-selected="true">Full Text</button> <button class="nav-link<%= params[:is_document_view].to_s.eql?("true") ? 'active' : '' %>" id="documentMenuTab" data-bs-toggle="tab" data-bs-target="#documentTabContent" type="button" role="tab" aria-controls="analysisTab" aria-selected="true">Full Text</button>
</li> </li>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" id="analysisMenuTab" data-bs-toggle="tab" data-bs-target="#ciatatonTabContent" type="button" role="tab" aria-controls="analysisTab" aria-selected="true">Citator</button> <button class="nav-link <%= params[:is_citator_tab].to_s.eql?("true") ? 'active' : '' %>" id="citatorMenuTab" data-bs-toggle="tab" data-bs-target="#citatonTabContent" type="button" role="tab" aria-controls="analysisTab" aria-selected="true">Citator</button>
</li> </li>
</ul> </ul>
@ -78,9 +78,9 @@
</div> </div>
</div> </div>
<div class="tab-pane fade cited-table-body" id="ciatatonTabContent" role="tabpanel"> <div class="tab-pane fade cited-table-body" id="citatonTabContent" role="tabpanel">
<div class="d-flex align-items-baseline"> <div class="d-flex align-items-baseline">
<div class="col-md-6 mt-3 ps-3"> <h4> Cited Ins Documents </h4> </div> <div class="col-md-6 mt-3 ps-3"> <h4> Cited In </h4> </div>
<div class="col-md-6"> <%= render PaginationComponent.new(data: @cited_in_documents, opts: { is_cited_in_doc: true}) %> </div> <div class="col-md-6"> <%= render PaginationComponent.new(data: @cited_in_documents, opts: { is_cited_in_doc: true}) %> </div>
</div> </div>
<table class="table table-hover mb-0 table-width"> <table class="table table-hover mb-0 table-width">
@ -91,7 +91,7 @@
</thead> </thead>
<tbody> <tbody>
<%= render(DocumentIndexTableComponent.with_collection(@cited_in_documents, current_user: current_user)) %> <%= render(DocumentIndexTableComponent.with_collection(Cdao::Jurisprudence.all, current_user: current_user)) %>
</tbody> </tbody>
</table> </table>
</div> </div>

30
app/views/subject_indexes/show.html.erb

@ -41,6 +41,36 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="accordion accordion-flush subject-index-body" id="mainPanelBody" >
<% @subject_index.children.order(name: :asc).each do |root| %>
<div class="accordion-item">
<div class="accordion-header d-flex justify-content-between">
<% if root.children.present? %>
<div class="accordion-button collapsed m-0 p-0" data-bs-toggle="collapse" data-bs-target="#<%= ["rootLevel", root.id].join %>"
data-controller="subjects" data-subject-parent-id="<%= root.id %>"
data-accordion-target="#<%= ['subjectsAccordionBody', root.id].join %>"
data-action="click->subjects#loadSubjectsAccordion">
<%= link_to root.name, subject_index_path(root.id), class: "accordion-link text-decoration-none text-dark d-block sub1 clickable-link" %>
<%= link_to '<i class="fas fa-folder-plus"></i>'.html_safe, new_subject_index_path(parent_id: root.id), class: "text-decoration-none d-block sub1 clickable-link position-absolute end-0 me-5" %>
</div>
<% else %>
<%= link_to root.name, subject_index_path(root.id), class: "accordion-link text-decoration-none text-dark d-block sub1 clickable-link" %>
<%= link_to '<i class="fas fa-folder-plus"></i>'.html_safe, new_subject_index_path(parent_id: root.id), class: "text-decoration-none d-block sub1 clickable-link position-absolute end-0 accordion-action-button-margin non-toggle" %>
<% end %>
</div>
<div class="accordion-collapse collapse" id="<%= ["rootLevel", root.id].join %>" data-bs-parent="#mainPanelBody">
<div class="accordion-body pt-1 pb-1 sub-body1" id="<%= ['subjectsAccordionBody', root.id].join %>">
<div class="text-center">
<div class="spinner-border text-danger" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save