Skip to content

Commit

Permalink
Add new document view only partial and update 'submit' and 'theses/show'
Browse files Browse the repository at this point in the history
  • Loading branch information
asadaqain committed Aug 13, 2024
1 parent 206e4c7 commit acebbe2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
22 changes: 22 additions & 0 deletions app/views/documents/_document_view_only.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="row border rounded mx-auto my-2">
<div class="col-12 col-md-1 p-3">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<%= link_to_unless_current edit_student_thesis_document_path(@student, @thesis, document) do %>
<i class="fa fa-file fa-2x me-2 text-warning"></i>
<% end %>
</div>
</div>
</div>

<div class="col-12 col-md-6 p-3">
<span class="name text-wrap text-break <%= "supplemental" if document.supplemental? %>" title="<%= File.basename(document.file_url) %>">
<%= URI.decode_www_form_component(File.basename(document.file_url)) %>
</span>
<% if document.name %>
<%= document.name %>
&nbsp; &nbsp;
<% end %>
</div>
</div>

29 changes: 23 additions & 6 deletions app/views/student_view/process/submit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
<p><%= format @thesis.abstract, true %></p>
</div>
</div>
<div class="d-flex justify-content-end">

<a href="<%= student_view_thesis_process_path(@thesis, Thesis::PROCESS_REVIEW) %>" class="next-btn btn btn-link" title="Make Changes to Thesis Details">
<i class="fa fa-pencil"></i> Make Changes to Thesis Details
</a>
</div>

</div>
</div>
Expand All @@ -78,7 +84,7 @@
<div class="bg-light-subtle mt-3 p-3">
<h4>Primary</h4>
<% @primary_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @primary_documents.count == 0 %>
Expand All @@ -87,10 +93,15 @@
</div>

<div class="bg-light-subtle mt-3 p-3">
<h4>Supplementary Thesis Files</h4>
<div class="d-flex flex-column flex-md-row align-items-start">
<h4 class="me-md-auto mb-2 mb-md-0">Supplementary Thesis Files</h4>
<a href="<%= student_view_thesis_process_path(@thesis, Thesis::PROCESS_UPLOAD) %>" class="next-btn btn btn-link" title="Make Changes to Thesis Files">
<i class="fa fa-pencil"></i> Make Changes to Thesis Files
</a>
</div>
<% @supplemental_documents.each do | document | %>
<% if document.usage == 'thesis'%>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% end %>
<% if @supplemental_documents.count == 0 %>
Expand All @@ -99,9 +110,15 @@
</div>

<div class="bg-light-subtle mt-3 p-3">
<h4>License Agreements</h4>
<div class="d-flex flex-column flex-md-row align-items-start">
<h4 class="me-md-auto mb-2 mb-md-0">License Agreements</h4>
<a href="<%= student_view_thesis_process_path(@thesis, Thesis::PROCESS_REVIEW) %>" class="next-btn btn btn-link" title="Make Changes to Licence Files">
<i class="fa fa-pencil"></i> Make Changes to Licence Files
</a>
</div>

<% @licence_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @licence_documents.count == 0 %>
<p>There are no <strong>supplementary licence</strong> files or documents attached to this thesis/dissertation.</p>
Expand All @@ -111,7 +128,7 @@
<div class="bg-light-subtle mt-3 p-3">
<h4>Embargo Documents</h4>
<% @embargo_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @embargo_documents.count == 0 %>
<p>There are no <strong>embargo</strong> files or documents attached to this thesis/dissertation.</p>
Expand Down
8 changes: 4 additions & 4 deletions app/views/theses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<% else %>
<h4>Primary</h4>
<% @primary_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @primary_documents.count == 0 %>
Expand All @@ -171,7 +171,7 @@

<h4>Supplementary Thesis Files</h4>
<% @supplemental_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @supplemental_documents.count == 0 %>
Expand All @@ -180,7 +180,7 @@

<h4>License Agreements</h4>
<% @licence_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @licence_documents.count == 0 %>
Expand All @@ -189,7 +189,7 @@

<h4>Embargo Documents</h4>
<% @embargo_documents.each do | document | %>
<%= render partial: document %>
<%= render partial: 'documents/document_view_only', locals: {document: document} %>
<% end %>
<% if @embargo_documents.count == 0 %>
Expand Down

0 comments on commit acebbe2

Please sign in to comment.