Skip to content
Merged
27 changes: 18 additions & 9 deletions app/views/challenge_assignments/_assignment_blurb.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
</dt>
<dd>
<% # link to the work %>
<% if assignment.creation %>
<%= link_to (assignment.creation.try(:title) || assignment.creation.class.name), assignment.creation, :class => "work" %>
<% end %>
<% if assignment.creation %>
<% if !assignment.posted? %>
<%= t(".header_draft_html", title_link: (link_to (assignment.creation.try(:title) || assignment.creation.class.name), assignment.creation, class: "work")) %>
<% else %>
<%= link_to (assignment.creation.try(:title) || assignment.creation.class.name), assignment.creation, class: "work" %>
<% end %>
<% end %>

<% if @collection && @collection.user_is_maintainer?(current_user) %>
<% # for a mod: list recipient (and check in case there are some people without recipients) %>
Expand All @@ -26,21 +30,26 @@

<!--stats-->
<dl class="stats">
<dt><%= ts("Status:") %></dt>
<dt><%= t(".stats.status.header") %></dt>
<dd>
<% # status can be: unposted (no creation), unapproved (creation but it hasn't been approved), complete %>
<% if !assignment.posted? %>
<%= ts("Unposted") %>
<%= t(".stats.status.unposted") %>
<% elsif !assignment.fulfilled? %>
<strong><%= ts("Unapproved") %><!-- BACK END add approve button for mod --></strong>
<strong><%= t(".stats.status.unapproved") %><!-- BACK END add approve button for mod --></strong>
<% else %>
<%= ts("Complete!") %>
<%= t(".stats.status.fulfilled") %>
<% end %>
</dd>

<% if assignment.creation %>
<dt><%= ts("Posted:") %></dt>
<dd class="datetime"><%= assignment.creation.published_at %></dd>
<% if assignment.posted? %>
<dt> <%= t(".stats.creation.posted") %> </dt>
<dd class="datetime"><%= assignment.creation.published_at %></dd>
<% else %>
<dt> <%= t(".stats.creation.unposted") %> </dt>
<dd class="datetime"><%= assignment.creation.created_at %></dd>
<% end %>

<% if assignment.creation.respond_to?(:word_count) %>
<dt><%= ts("Words:") %></dt>
Expand Down
11 changes: 11 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,17 @@ en:
challenge_requests:
fandom: Fandom %{allowed_fandom_count}
challenge_assignments:
assignment_blurb:
header_draft_html: "%{title_link} (draft)"
stats:
creation:
posted: 'Posted:'
unposted: 'Created:'
status:
fulfilled: Complete!
header: 'Status:'
unapproved: Unapproved
unposted: Unposted
to_default:
button: Default
confirmation: Are you sure? This will mark you as having defaulted and notify the collection maintainer! It cannot be undone.
Expand Down
23 changes: 23 additions & 0 deletions features/gift_exchanges/challenge_giftexchange.feature
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,29 @@ Feature: Gift Exchange Challenge
Then I should see "My Assignments"
And I should not see "Awesome Gift Exchange"

Scenario: Draft Assignments are displayed as draft and use the creation date instead of the publication date
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the test to backdate the draft and check that the correct dates are used (as a draft and when posted)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done

Given everyone has their assignments for "Non Confusing Exchange"
And it is currently 4/13/2016
When I am logged in as "myname1"
And I go to the assignments page for "myname1"
Then I should see "My Assignments"
And I should see "Non Confusing Exchange"
When I follow "Fulfill"
And I fill in the basic work information for "InProgress"
And I set the publication date to 6 December 2012
And I press "Preview"
And I go to the assignments page for "myname1"
Then I should see "(draft)"
And I should see "Status: Unposted"
And I should see "Created: 2016-04-13"
When I post the work "InProgress"
And I go to the assignments page for "myname1"
And I follow "Completed Assignments"
Then I should see "InProgress"
And I should not see "(draft)"
And I should see "Status: Complete"
And I should see "Posted: 2012-12-06"

Scenario: A mod can purge assignments after they have been sent, but must
first confirm the action
Given everyone has their assignments for "Bad Gift Exchange"
Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/work_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@
end
end

# Format is "DD [Month, english] YYYY"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment for future use

When /^I set the publication date to (\d+) (.*) (\d+)$/ do |day, month, year|
if page.has_selector?("#backdate-options-show")
check("backdate-options-show") if page.find("#backdate-options-show")
Expand Down
Loading