Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
[#784] Set status of submitted entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed Oct 26, 2016
1 parent 8df648f commit c961d6e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
8 changes: 8 additions & 0 deletions census/controllers/census.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ var pending = function(req, res) {
isReview={true} />);
let reviewersData = {place: place, dataset: dataset};
let reviewers = utils.getReviewers(req, reviewersData);
let entryStatus = 'pending';
if (entry.isCurrent) {
entryStatus = 'accepted';
} else if (entry.reviewed && !entry.reviewResult) {
entryStatus = 'rejected';
}
res.render('create.html', {
places: places,
datasets: datasets,
Expand All @@ -299,6 +305,8 @@ var pending = function(req, res) {
submitInstructions: config.get('review_page'),
errors: _.get(data, 'errors'),
isReview: true,
entryStatus: entryStatus,
entry: entry,
canReview: utils.canReview(reviewers, req.user),
reviewClosed: entry.reviewResult ||
(entry.year !== req.app.get('year'))
Expand Down
32 changes: 18 additions & 14 deletions census/views/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ <h1>
{{ datasetContext.datasetDescription }}
</div>
{% if isReview -%}
<div class="secondary-meta">
<dl class="pending">
<dt class="status">Status</dt>
<dd>pending</dd>
<dt class="date">Submission date</dt>
<dd>
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> 1:17pm on 21st Feb 2016
</dd>
<dt class="submitter">Submitter</dt>
<dd>
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Артур Волков
</dd>
</dl>
</div>
<div class="secondary-meta">
<dl class="{{ entryStatus }}">
<dt class="status">Status</dt>
<dd>{{ entryStatus }}</dd>
<dt class="date">Submission date</dt>
<dd>
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> {{ entry.createdAt|dateformat }}
</dd>
<dt class="submitter">Submitter</dt>
<dd>
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> {% if entry.Submitter %}{% if entry.Submitter.isAnonymous() %}{{ entry.Submitter.firstName|title }}{% else %}{{ entry.Submitter.fullName() }}{% endif %}{% endif %}
</dd>
{% if entry.Reviewer %}
<dt>Reviewer</dt>
<dd><span class="glyphicon glyphicon-user" aria-hidden="true"></span> {% if entry.Reviewer %}{% if entry.Reviewer.isAnonymous() %}{{ entry.Reviewer.firstName|title }}{% else %}{{ entry.Reviewer.fullName() }}{% endif %}{% endif %}</dd>
{% endif %}
</dl>
</div>
{%- endif %}
</div>
</div>
Expand Down

0 comments on commit c961d6e

Please sign in to comment.