Skip to content

Commit

Permalink
make links in settings-content open in new window
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Oct 30, 2024
1 parent e823ddb commit db32211
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 55 deletions.
7 changes: 7 additions & 0 deletions app/assets/javascripts/theses.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ $(document).ready(function () {
source: committee_member_names_list
});
});

$('div.student-view div.settings-content a').each(function () {
var class_attr = $(this).attr('class');
if (typeof class_attr === typeof undefined || class_attr == '') {
$(this).attr('target', '_blank');
}
});
});
1 change: 1 addition & 0 deletions app/models/app_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AppSettings < RailsSettings::Base
field :student_upload_files
field :student_primary_upload_files
field :student_supplementary_upload_files
field :student_supplementary_licence_upload_files
field :student_supplementary_embargo_upload_files
field :student_review_license_info
field :student_review_license_lac
Expand Down
2 changes: 1 addition & 1 deletion app/views/documents/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ html: { multipart: true, class: "file-upload" } do |f| %>
<%= raw(AppSettings.student_supplementary_upload_files) %>
<% end %>
<% if @document.usage == 'licence' %>
<%= raw(AppSettings.student_supplementary_embargo_upload_files) %>
<%= raw(AppSettings.student_supplementary_licence_upload_files) %>
<% end %>
<% if @document.usage == 'embargo' %>
<%= raw(AppSettings.student_supplementary_embargo_upload_files) %>
Expand Down
7 changes: 4 additions & 3 deletions app/views/settings/_student_submission.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
<%= f.input :student_update_details_keywords, as: :rich_text_area, label: "Keywords", input_html: { rows: 5 } %>
</div>
<div class="tab-pane fade" id="nav-upload" role="tabpanel" aria-labelledby="nav-upload-tab" tabindex="0">
<%= f.input :student_upload_files, as: :rich_text_area, label: "Upload files message", input_html: { rows: 20 } %>
<%= f.input :student_supplementary_upload_files, as: :rich_text_area, label: "Supplementary Upload files message", input_html: { rows: 30 } %>
<%= f.input :student_supplementary_embargo_upload_files, as: :rich_text_area, label: "Supplementary Embargo Upload files message", input_html: { rows: 30 } %>
<%= f.input :student_upload_files, as: :rich_text_area, label: "Upload Primary Thesis File message", input_html: { rows: 20 } %>
<%= f.input :student_supplementary_upload_files, as: :rich_text_area, label: "Upload Supplementary Thesis Files message", input_html: { rows: 30 } %>
<%= f.input :student_supplementary_licence_upload_files, as: :rich_text_area, label: "Upload Licence Files message", input_html: { rows: 30 } %>
<%= f.input :student_supplementary_embargo_upload_files, as: :rich_text_area, label: "Upload Embargo Files message", input_html: { rows: 30 } %>
<%= f.input :primary_thesis_file_extensions, as: :text, label: "Primary Thesis File Extensions", input_html: { rows: 3 } %>
<%= f.input :supplemental_thesis_file_extensions, as: :text, label: "Supplementary Thesis File Extensions", input_html: { rows: 3 } %>
<%= f.input :licence_file_extensions, as: :text, label: "Licence File Extensions", input_html: { rows: 3 } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/students/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% if @student.blocked? %><i class="fa fa-ban text-danger" title="blocked"></i><% end %>
</h1>
<p class="trivial fw-light text-warning-emphasis mb-0">Created by <%= @student.created_by.name%>
<% if can?(:login_as, :student) && is_controller_and_action?("students", "show") %>
<% if current_user.role != User::STUDENT && can?(:login_as, :student) %>
- <%= link_to "Login as this student", login_as_student_path(id: @student.id) %>
<% end %>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/theses/_thesis.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-9 ">
<h2>
<% unless @student %>
<span class="fw-lighter text-secondary d-block lead" title="student id: <%= thesis.student.sisid %>">By <%= thesis.student.name %></span>
<span class="fw-lighter text-secondary d-block lead" title="student id: <%= thesis.student.sisid %>">By <%= link_to thesis.student.name, student_thesis_path(thesis.student, thesis) %></span>
<% end %>
<%= link_to thesis.title, student_thesis_path(thesis.student, thesis) %>
</h2>
Expand Down
48 changes: 0 additions & 48 deletions app/views/theses/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,48 +0,0 @@
<% title "Theses" %>

<table class="table table-striped">
<tr>
<th>Title</th>
<th>Author</th>
<th>Supervisor</th>
<th>Committee</th>
<th>Student</th>
<th>Subjects</th>
<th>Keywords</th>
<th>Abstract</th>
<th>Comments</th>
<th>Acknowledgements</th>
<th>Embargo</th>
<th>Language</th>
<th>Degree Name</th>
<th>Degree Level</th>
<th>Program</th>
<th>Exam Date</th>
<th>Published Date</th>
<th>Status</th>
</tr>
<% for thesis in @theses %>
<tr>
<td><%= thesis.title %></td>
<td><%= thesis.author %></td>
<td><%= thesis.supervisor %></td>
<td><%= thesis.committee %></td>
<td><%= thesis.student.name %></td>
<td><%= thesis.keywords %></td>
<td><%= thesis.abstract %></td>
<td><%= thesis.embargo %></td>
<td><%= thesis.language %></td>
<td><%= thesis.degree_name %></td>
<td><%= thesis.degree_level %></td>
<td><%= thesis.program %></td>
<td><%= thesis.exam_date %></td>
<td><%= thesis.published_date %></td>
<td><%= thesis.status %></td>
<td><%= link_to "Show", [@student, thesis] %></td>
<td><%= link_to "Edit", edit_student_thesis_path(@student, thesis) %></td>
<td><%= link_to "Destroy", [@student, thesis], :date => { :confirm => 'Are you sure?' }, :method => :delete %></td>
</tr>
<% end %>
</table>

<p><%= link_to "New Thesis", new_student_thesis_path(@student) %></p>
2 changes: 1 addition & 1 deletion app/views/theses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% if current_user.role == User::STUDENT %>
<div class="col">
<div id="status_menu">
<button id="" class="btn" title="Change Thesis Status">
<button id="" class="btn" title="Thesis Status">
Status: <span class="status status-<%= @thesis.status %>"><%= @thesis.status.humanize %></span>
</button>
</div>
Expand Down
4 changes: 4 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@
<ul><li><strong>Documents:</strong> Portable Document Format (.pdf), Text (.txt), Hypertext Markup Language (.html, .htm), Open Document Format (.odt, .odp, .ods).&nbsp;</li><li><strong>Images:</strong> Tagged Image File format (.tif)</li><li><strong>Data:</strong> Comma-separated values (.csv) or other delimited text, Extensible Markup Language (.xml)</li><li><strong>Video:</strong> MPEG-4 (.mp4) files are preferred, but we can also accept AVI (.avi) and MOV (.mov) file formats.</li><li><strong>Audio:</strong> MPEG-1 Audio Layer 3 (.mp3) file are preferred, but we can also accept Free Lossless Audio Codec (.flac) or WAVE (.wav) file formats.</li></ul><div>Please ensure that:&nbsp;</div><ul><li>You have permission from subjects appearing in media files.&nbsp;</li><li>The total size of your supplementary files does not exceed 4 gigabytes (4GB)</li><li>If you wish to upload a type of file that you do not see on this list, please email [email protected] for support.</li></ul>
HEREDOC

AppSettings.student_supplementary_licence_upload_files = <<HEREDOC
<p>Please upload PDF files only.</p>
HEREDOC

AppSettings.student_supplementary_embargo_upload_files = <<HEREDOC
<p>Please Upload the following documents:</p>
<ul><li><strong>Supervisor Letter</strong></li><li><strong>Other Embargo Supporting Documents</strong></li><li><strong>Portable Document Format:</strong> (.pdf), Text (.txt), Hypertext Markup Language (.html, .htm), Open Document Format (.odt, .odp, .ods).</li></ul>
Expand Down

0 comments on commit db32211

Please sign in to comment.