Skip to content

Commit

Permalink
Merge pull request #1060 from mlibrary/issue-draft-list
Browse files Browse the repository at this point in the history
show dates for drafts and also only drafts belonging to depositor
  • Loading branch information
fritzfreiheit authored Aug 18, 2021
2 parents 075430e + 193e4dc commit 403bd94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/views/hyrax/dashboard/_draft_works.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<div style="font-weight: 700;">Your Draft Works</div>

<div style="font-weight: 700;"><%= t('show.labels.your_draft_works') %></div>
</div>
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Action</th>
<th><%= t("hyrax.dashboard.my.heading.title") %></th>
<th><%= t("hyrax.dashboard.my.heading.date_uploaded") %></th>
<th><%= t("hyrax.dashboard.my.heading.date_modified") %></th>
<th><%= t("hyrax.dashboard.my.heading.action") %></th>
</tr>
</thead>
<tbody>
<% works.each do |work| %>
<% if current_ability.can?(:edit, work) %>
<% if work.depositor.eql? current_ability.current_user.email %>
<tr>
<td>
<%= link_to work.title.first,
edit_polymorphic_path([main_app, work]),
{ title: t('.edit_title', file_set: work) } %></td>

<td ><%= work.creator.first %></td>
<td><%= work.date_uploaded.strftime('%Y-%m-%d')%></td>
<td><%= work.date_modified.strftime('%Y-%m-%d') %></td>
<td>
<%= link_to [main_app, work],
method: :delete,
Expand Down
1 change: 1 addition & 0 deletions config/locales/data_set.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ en:
tab_user_activity_log: "User Activity Log"
total_file_size: "Total file size"
total_file_size_human_readable: "Total file size"
your_draft_works: "Your Draft Works"
simple_form:
actions:
data_set:
Expand Down

0 comments on commit 403bd94

Please sign in to comment.