From bfae888a152ede6483e11803e29fb93c3e78a763 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Tue, 29 Jan 2019 16:17:03 +0100 Subject: [PATCH] Display updated date for reviews. --- .../templates/funds/includes/review_table_row.html | 1 + .../apply/review/templates/review/review_detail.html | 2 +- .../src/sass/apply/abstracts/_functions.scss | 10 ++++++++++ .../src/sass/apply/components/_reviews-sidebar.scss | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/opentech/apply/funds/templates/funds/includes/review_table_row.html b/opentech/apply/funds/templates/funds/includes/review_table_row.html index 68892e861..56fb24d3d 100644 --- a/opentech/apply/funds/templates/funds/includes/review_table_row.html +++ b/opentech/apply/funds/templates/funds/includes/review_table_row.html @@ -10,6 +10,7 @@ <a href="{% url 'apply:submissions:reviews:review' submission_pk=review.submission.id pk=review.id %}"> <span>{{ review.author }}</span> </a> + <div class="reviews-sidebar__date">{{ review.updated_at|date:"Y-m-d" }}</div> {% else %} <span>{{ review.author }}</span> {% endif %} diff --git a/opentech/apply/review/templates/review/review_detail.html b/opentech/apply/review/templates/review/review_detail.html index 3280e7d1c..4a82a0732 100644 --- a/opentech/apply/review/templates/review/review_detail.html +++ b/opentech/apply/review/templates/review/review_detail.html @@ -5,7 +5,7 @@ <div class="admin-bar"> <div class="admin-bar__inner"> <h1 class="beta heading heading--no-margin heading--bold">Review</h1> - <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }}</h5> + <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }} at {{ review.updated_at|date:"Y-m-d" }}</h5> </div> </div> diff --git a/opentech/static_src/src/sass/apply/abstracts/_functions.scss b/opentech/static_src/src/sass/apply/abstracts/_functions.scss index 3377d83cc..604d90ef4 100644 --- a/opentech/static_src/src/sass/apply/abstracts/_functions.scss +++ b/opentech/static_src/src/sass/apply/abstracts/_functions.scss @@ -1,3 +1,13 @@ +// Strip the unit from the given value and return the value +@function strip-unit($value) { + @return $value / ($value * 0 + 1); +} + +// Return an em unit based on the pixel value and context +@function rem($px, $context: $base-font-size) { + @return #{strip-unit($px / strip-unit($context))}rem; +} + // Returns the opposite direction of each direction in a list // @param {List} $directions - List of initial directions // @return {List} - List of opposite directions diff --git a/opentech/static_src/src/sass/apply/components/_reviews-sidebar.scss b/opentech/static_src/src/sass/apply/components/_reviews-sidebar.scss index 0b19921b1..47fc232fe 100644 --- a/opentech/static_src/src/sass/apply/components/_reviews-sidebar.scss +++ b/opentech/static_src/src/sass/apply/components/_reviews-sidebar.scss @@ -62,6 +62,10 @@ } } + &__date { + @include font-size(milli); + } + &__no-reviews { color: $color--mid-grey; } -- GitLab