aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-09-27 14:21:12 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-11 16:17:32 +0100
commitb86c2142d2f82fb503807feae0a8df4b8af39571 (patch)
tree5bf1a9d25d2707a70c023a8aa53cf01cbe2f8d71
parent662b96c2539ec4f61d7ae84b07bb8cebdae02741 (diff)
Show shortlist owner on report page.
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm12
-rw-r--r--templates/web/base/report/_main.html7
-rw-r--r--web/cobrands/fixmystreet/images/shortlist.pngbin0 -> 343 bytes
-rw-r--r--web/cobrands/fixmystreet/images/shortlist.svg1
-rw-r--r--web/cobrands/fixmystreet/images/shortlist@2.pngbin0 -> 619 bytes
-rw-r--r--web/cobrands/sass/_base.scss28
6 files changed, 48 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 27648ddad..855732f83 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -1020,4 +1020,16 @@ sub static_map {
};
}
+has shortlisted_user => (
+ is => 'ro',
+ lazy => 1,
+ default => sub {
+ my $self = shift;
+ my $user = $self->result_source->schema->resultset('User')->search(
+ { 'user_planned_reports.report_id' => $self->id },
+ { join => 'user_planned_reports' })->first;
+ return $user;
+ },
+);
+
1;
diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html
index 469ee5bc5..0a4056da7 100644
--- a/templates/web/base/report/_main.html
+++ b/templates/web/base/report/_main.html
@@ -147,5 +147,12 @@
</div>
[% END %]
+ [% IF permissions.planned_reports AND problem.shortlisted_user AND NOT c.user.is_planned_report(problem) %]
+ <div class="moderate-display shortlisted-status">
+ <h3>[% tprintf(loc('Shortlisted by %s'), problem.shortlisted_user.name) %]</h3>
+ <p>[% tprintf(loc('Adding this report to your shortlist will remove it from %s’s shortlist.'), problem.shortlisted_user.name) %]</p>
+ </div>
+ [% END %]
+
[% TRY %][% PROCESS 'report/_main_after.html' %][% CATCH file %][% END %]
</div>
diff --git a/web/cobrands/fixmystreet/images/shortlist.png b/web/cobrands/fixmystreet/images/shortlist.png
new file mode 100644
index 000000000..d992f267f
--- /dev/null
+++ b/web/cobrands/fixmystreet/images/shortlist.png
Binary files differ
diff --git a/web/cobrands/fixmystreet/images/shortlist.svg b/web/cobrands/fixmystreet/images/shortlist.svg
new file mode 100644
index 000000000..dc38d5893
--- /dev/null
+++ b/web/cobrands/fixmystreet/images/shortlist.svg
@@ -0,0 +1 @@
+<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>Artboard</title><g fill="#000" fill-rule="evenodd"><path d="M17.4 8H32v4h-7.3l-.152-1.527L18 10l-.6-2zm3.1 12H32v4H21.03l-.53-4zm4.4-6H32v4h-9.7l2.7-3-.1-1z"/><path d="M4.914 26.995L11.56 23.5l6.646 3.495c.276-.185.545-.38.805-.587l-1.268-7.4 5.378-5.24c-.09-.322-.192-.637-.307-.946l-7.432-1.08-3.32-6.732c-.167-.007-.333-.01-.5-.01-.167 0-.333.003-.5.01l-3.32 6.732-7.433 1.08c-.115.31-.217.624-.307.945l5.378 5.242-1.27 7.398c.26.207.53.402.806.587z"/></g></svg> \ No newline at end of file
diff --git a/web/cobrands/fixmystreet/images/shortlist@2.png b/web/cobrands/fixmystreet/images/shortlist@2.png
new file mode 100644
index 000000000..d786b33d3
--- /dev/null
+++ b/web/cobrands/fixmystreet/images/shortlist@2.png
Binary files differ
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 612d8cf55..3c76a3990 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -1086,6 +1086,34 @@ input.final-submit {
}
}
+.shortlisted-status {
+ margin-top: 1em;
+ padding: 1em 1em 1em 4em; // Icon is always displayed on left, even in RtL mode
+ border-radius: 0.25em;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ background: rgba(255, 255, 255, 0.5) url(/cobrands/fixmystreet/images/shortlist.png) 1em 50% no-repeat;
+ background-size: 2em 2em;
+
+ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
+ background-image: url(/cobrands/fixmystreet/images/shortlist@2.png);
+ }
+
+ @media all {
+ background-image: url(/cobrands/fixmystreet/images/shortlist.svg), none;
+ }
+
+ h3 {
+ margin: 0;
+ font-size: 1em;
+ font-weight: bold;
+ }
+
+ p {
+ margin: 0.5em 0 0 0;
+ font-size: 0.875em;
+ }
+}
+
// map stuff
#map_box {
margin: 0 -1em 1em;