Skip to content

Commit 111f599

Browse files
authored
Merge pull request #1886 from codidact/0valt/1885/flag-history
flag history view should indicate that you are viewing another user's…
2 parents b710355 + 0af49ba commit 111f599

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

app/views/flags/history.html.erb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
<h1>Flag History</h1>
2-
<p>
3-
Below is a list of all the flags you have cast and the outcome of each of them. Moderators handling your flags may also
4-
have left you feedback.
5-
</p>
1+
<%#
2+
"User's flag history view
3+
4+
Instance variables:
5+
@flags : ActiveRecord::Relation<Flag> collection of user's flags to display
6+
@statuses : Hash{String => Integer} flag counts grouped by status
7+
@user : User to display flag history for
8+
"%>
9+
10+
<%
11+
is_same_user = @user.same_as?(current_user)
12+
title_key = "history_#{is_same_user ? 'self' : 'other'}_prefix"
13+
description_key = "history_#{is_same_user ? 'self' : 'other'}"
14+
%>
15+
16+
<h1><%= t("flags.headers.#{title_key}") %> <%= user_link(@user) unless is_same_user %></h1>
17+
<p><%= t("flags.descriptions.#{description_key}") %></p>
618

719
<h3>
820
<%= pluralize(@flags.count, 'flag') %>

config/locales/strings/en.flags.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
en:
22
flags:
3+
headers:
4+
history_other_prefix: >
5+
Flag History for
6+
history_self_prefix: >
7+
My Flag History
8+
descriptions:
9+
history_other: >
10+
Below is a list of all the flags this user has cast with their outcomes and any moderator feedback.
11+
history_self: >
12+
Below is a list of all the flags you have cast with their outcomes and any moderator feedback.
313
errors:
414
create_generic: >
515
Failed to raise the flag.

0 commit comments

Comments
 (0)