Skip to content

Commit

Permalink
Merge pull request #1240 from openjournals/accepted_at_on_toc
Browse files Browse the repository at this point in the history
Fixing timestamp on TOC
  • Loading branch information
arfon committed Jun 23, 2023
2 parents ed63cbc + 6737fd2 commit 939d108
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/toc_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def volume_for_issue(i)
def filter_papers(param, field)
redirect_to(action: :index) and return if param.blank?

@papers = Paper.search(param.to_i, fields: [{field.to_sym => :exact}], order: { page: :asc },
@papers = Paper.search(param.to_i, fields: [{field.to_sym => :exact}], order: { accepted_at: :asc },
page: params[:page], per_page: 50)
@pagy = Pagy.new_from_searchkick(@papers)
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/toc/_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= link_to paper.title, paper.seo_url, title: paper.title, class: "d-inline-block text-truncate", style: "max-width: 450px;" %>
</td>
<td>
<div class="time">Published <%= paper.created_at.strftime("%d-%m-%Y") %> </div>
<div class="time">Published <%= paper.accepted_at.strftime("%d-%m-%Y") %> </div>
</td>
<td>
<%= image_tag 'doi.svg' %><%= link_to paper.doi, paper.seo_url %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/toc/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<td>
<strong><%= link_to "Volume #{v} (#{@years[@volumes.index(v)]})", toc_volume_path(volume: v), title: "Papers from volume #{v}", class: "d-inline-block text-truncate", style: "max-width: 450px;" %></strong>
</td>
<td>
<td class="issue-paper">
<% issues_in_v.each do |i| %>
<%= link_to("Issue #{i}".html_safe, toc_issue_path(issue: i), title: "Papers in issue #{i}", class: "d-inline-block text-truncate px-2", style: "max-width: 450px;") if i.present? %>
<%= link_to("Issue #{i.to_s.rjust(3, "0")}".html_safe, toc_issue_path(issue: i), title: "Papers in issue #{i}", class: "d-inline-block text-truncate px-2", style: "max-width: 450px;") if i.present? %>
<% end %>
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion spec/system/toc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
end

@issues.each do |issue|
expect(page).to have_link("Issue #{issue}", href: toc_issue_path(issue: issue))
expect(page).to have_link("Issue #{issue.to_s.rjust(3, "0")}", href: toc_issue_path(issue: issue))
end

expect(page).to have_link("Current issue", href: toc_current_issue_path)
Expand Down

0 comments on commit 939d108

Please sign in to comment.