From b598979374985b8c62fac14588d685e29eac20a4 Mon Sep 17 00:00:00 2001 From: Shrey Date: Wed, 22 Jul 2015 00:10:41 +0530 Subject: [PATCH 1/1] Changed report button + Added disclaimer on report page + Added search filter --- app/assets/stylesheets/common.scss | 7 +++++++ app/controllers/issues_controller.rb | 7 +++++++ app/views/browse/changeset.html.erb | 10 ++++------ app/views/browse/note.html.erb | 10 ++++------ app/views/diary_entry/_diary_comment.html.erb | 16 +++++++--------- app/views/diary_entry/_diary_entry.html.erb | 6 ++---- app/views/issues/index.html.erb | 7 ++++--- app/views/issues/new.html.erb | 9 +++++++++ app/views/user/view.html.erb | 2 +- config/locales/en-GB.yml | 5 +++++ config/locales/en.yml | 5 +++++ 11 files changed, 55 insertions(+), 29 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index b77311307..95c21c901 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -2781,4 +2781,11 @@ input.richtext_title[type="text"] { .report-button { float:right; +} + +.disclaimer { + width: 600px; + background: #fff1f0; + color: #d85030; + border-color: rgba(216, 80, 48, 0.3); } \ No newline at end of file diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index ecac5bd16..a499dad9d 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -13,8 +13,10 @@ class IssuesController < ApplicationController def index if @user.moderator? @issue_types = @moderator_issues + @users = User.joins(:roles).where(user_roles: {role: 'moderator'}) else @issue_types = @admin_issues + @users = User.joins(:roles).where(user_roles: {role: 'administrator'}) end @issues = Issue.where(issue_type: @user_role).order(sort_column + " " + sort_direction) @@ -42,6 +44,11 @@ class IssuesController < ApplicationController notice = t('issues.index.search.issues_not_found') end + if params[:last_reported_by] and !params[:last_reported_by][0].blank? + last_reported_by = params[:last_reported_by][0].to_s == "nil" ? nil : params[:last_reported_by][0].to_i + @issues = @issues.where(updated_by: last_reported_by) + end + if notice redirect_to issues_path, notice: notice end diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 86b17aba1..465bb2c4d 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -2,14 +2,12 @@

+ <%= t('browse.changeset.title', :id => @changeset.id) %> <% if @user and @user.id != @changeset.user.id %> -
- <%= link_to new_issue_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name, reported_user_id: @changeset.user.id), :title => t('browse.changeset.report') do %> - <%= image_tag('notice.png', size: '10x10') %> - <% end %> -
+ <%= link_to new_issue_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name, reported_user_id: @changeset.user.id), :title => t('browse.changeset.report') do %> +  ⚐ + <% end %> <% end %> - <%= t('browse.changeset.title', :id => @changeset.id) %>

diff --git a/app/views/browse/note.html.erb b/app/views/browse/note.html.erb index c6a1f86ca..2c7de0331 100644 --- a/app/views/browse/note.html.erb +++ b/app/views/browse/note.html.erb @@ -2,14 +2,12 @@

+ <%= t "browse.note.#{@note.status}_title", :note_name => @note.id %> <% if @user and @user.id!=@note.author.id %> -
- <%= link_to new_issue_url(reportable_id: @note.id, reportable_type: @note.class.name, reported_user_id: @note.author.id), :title => t('browse.note.report') do %> - <%= image_tag('notice.png', size: '10x10') %> - <% end %> -
+ <%= link_to new_issue_url(reportable_id: @note.id, reportable_type: @note.class.name, reported_user_id: @note.author.id), :title => t('browse.note.report') do %> +  ⚐ + <% end %> <% end %> - <%= t "browse.note.#{@note.status}_title", :note_name => @note.id %>

diff --git a/app/views/diary_entry/_diary_comment.html.erb b/app/views/diary_entry/_diary_comment.html.erb index 8f98285d0..b355c91ac 100644 --- a/app/views/diary_entry/_diary_comment.html.erb +++ b/app/views/diary_entry/_diary_comment.html.erb @@ -1,14 +1,12 @@
<%= user_thumbnail diary_comment.user %> -

<%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %>

- - <% if @user and diary_comment.user.id != @user.id %> -
- <%= link_to new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id), :title => t('diary_entry.diary_comment.report') do %> - <%= image_tag('notice.png', size: '10x10') %> - <% end %> -
- <% end %> +

<%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %> + <% if @user and diary_comment.user.id != @user.id %> + <%= link_to new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id), :title => t('diary_entry.diary_comment.report') do %> +  ⚐ + <% end %> + <% end %> +

<%= diary_comment.body.to_html %>
<%= if_administrator(:span) do %> diff --git a/app/views/diary_entry/_diary_entry.html.erb b/app/views/diary_entry/_diary_entry.html.erb index 9af5586d3..f9c094f2b 100644 --- a/app/views/diary_entry/_diary_entry.html.erb +++ b/app/views/diary_entry/_diary_entry.html.erb @@ -7,11 +7,9 @@

<%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>

<% if @user and diary_entry.user.id != @user.id %> -
- <%= link_to new_issue_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name, reported_user_id: diary_entry.user.id), :title => t('diary_entry.diary_entry.report') do %> - <%= image_tag('notice.png', size: '10x10') %> + <%= link_to new_issue_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name, reported_user_id: diary_entry.user.id), :title => t('diary_entry.diary_entry.report') do %> +  ⚐ <% end %> -
<% end %> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index be0a448ed..374502c38 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,14 +1,15 @@

<%= notice %>

<% content_for :heading do %> -

List of <%= @user_role %> issues:

+

List of <%= @user_role %> issues:

<% end %> <%= form_tag(issues_path, :method => :get) do %> - Search for a particular issue(s): + Search for a particular issue(s):
<%= select :status, nil, [['open', 0],['resolved',2],['ignored',1]],{:include_blank => "Select status"},data: { behavior: 'category_dropdown' } %> - <%= select :issue_type, nil, @issue_types,{:include_blank => "Select type"},data: { behavior: 'category_dropdown' } %> + <%= select :issue_type, nil, @issue_types,{:include_blank => "Select type"}, data: { behavior: 'category_dropdown' } %> <%= text_field_tag :search_by_user, params[:search_by_user], placeholder: "Reported User" %> + <%= select :last_reported_by, nil, @users.all.collect {|f| [f.display_name, f.id]} << ['Not updated',"nil"], {:include_blank => "Select last updated by"}, data: { behavior: 'category_dropdown' } %> <%= submit_tag "Search" %> <% end %>
diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index ea01890cf..4252b354f 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -2,6 +2,15 @@

Report <%= reportable_url(@issue.reportable) %>

<% end %> +
+
    + <%= t('issues.new.disclaimer.placeholder') %>: +
  • --> <%= t('issues.new.disclaimer.placeholder1') %>
  • +
  • --> <%= t('issues.new.disclaimer.placeholder2') %>
  • +
  • --> <%= t('issues.new.disclaimer.placeholder3') %>
  • +
+
+ <%= form_for(@issue) do |f| %> <%= f.error_messages %>
diff --git a/app/views/user/view.html.erb b/app/views/user/view.html.erb index c85ca5fd9..1628e2364 100644 --- a/app/views/user/view.html.erb +++ b/app/views/user/view.html.erb @@ -156,7 +156,7 @@ <% if @user and @this_user.id != @user.id %>
<%= link_to new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, reported_user_id: @this_user.id), :title => t('user.view.report') do%> - <%= image_tag('notice.png', size: '10x10') %> +  ⚐ <% end %>
<% end %> diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 9fb92714b..1c85d677f 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -958,6 +958,11 @@ en-GB: new: details: Please provide some more details into the problem. (This field cannot be left blank!) select: Select a reason for your report + disclaimer: + placeholder: Please make sure you have done the below before submitting a report + placeholder1: Placeholder 1 + placeholder2: Placeholder 2 + placeholder3: Placeholder 3 show: comments: reassign: The Issue was reassigned diff --git a/config/locales/en.yml b/config/locales/en.yml index 1d6aacba2..dd8815329 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -928,6 +928,11 @@ en: new: details: Please provide some more details into the problem. (This field cannot be left blank!) select: Select a reason for your report + disclaimer: + placeholder: Please make sure you have done the below before submitting a report + placeholder1: Placeholder 1 + placeholder2: Placeholder 2 + placeholder3: Placeholder 3 show: comments: reassign: The Issue was reassigned -- 2.43.2