]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'master' into moderation
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Aug 2017 11:12:57 +0000 (12:12 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Aug 2017 11:12:57 +0000 (12:12 +0100)
1  2 
Gemfile
Gemfile.lock
app/controllers/diary_entry_controller.rb
app/views/browse/changeset.html.erb
app/views/diary_entry/view.html.erb
app/views/layouts/_header.html.erb
app/views/user/view.html.erb

diff --combined Gemfile
index 0fd68e4e223d962615d3d70de304e9f34813adc7,48658f65d371f1097f440d0dee50e35baa8dc6d3..262a11d03ada33f8d6beeffdeb63697b74a39c1c
+++ b/Gemfile
@@@ -1,7 -1,7 +1,7 @@@
  source "https://rubygems.org"
  
  # Require rails
- gem "rails", "5.0.4"
+ gem "rails", "5.0.5"
  
  # Require things which have moved to gems in ruby 1.9
  gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19
@@@ -70,9 -70,6 +70,9 @@@ gem "omniauth-windowslive
  # Markdown formatting support
  gem "redcarpet"
  
 +# For status transitions of Issues
 +gem "aasm"
 +
  # Load libxml support for XML parsing and generation
  gem "libxml-ruby", ">= 2.0.5", :require => "libxml"
  
diff --combined Gemfile.lock
index f25e2e7f0623ae134fdcb97fc61c21685da4847d,f73d4a5d8b578ba4ce393d4ff5e8a8a05c3433e5..0dcd5bd24b3ddd1021821dd0c1e1f427d402b98f
@@@ -2,42 -2,41 +2,42 @@@ GE
    remote: https://rubygems.org/
    specs:
      SystemTimer (1.2.3)
-     actioncable (5.0.4)
-       actionpack (= 5.0.4)
 +    aasm (4.1.0)
+     actioncable (5.0.5)
+       actionpack (= 5.0.5)
        nio4r (>= 1.2, < 3.0)
        websocket-driver (~> 0.6.1)
-     actionmailer (5.0.4)
-       actionpack (= 5.0.4)
-       actionview (= 5.0.4)
-       activejob (= 5.0.4)
+     actionmailer (5.0.5)
+       actionpack (= 5.0.5)
+       actionview (= 5.0.5)
+       activejob (= 5.0.5)
        mail (~> 2.5, >= 2.5.4)
        rails-dom-testing (~> 2.0)
-     actionpack (5.0.4)
-       actionview (= 5.0.4)
-       activesupport (= 5.0.4)
+     actionpack (5.0.5)
+       actionview (= 5.0.5)
+       activesupport (= 5.0.5)
        rack (~> 2.0)
        rack-test (~> 0.6.3)
        rails-dom-testing (~> 2.0)
        rails-html-sanitizer (~> 1.0, >= 1.0.2)
      actionpack-page_caching (1.1.0)
        actionpack (>= 4.0.0, < 6)
-     actionview (5.0.4)
-       activesupport (= 5.0.4)
+     actionview (5.0.5)
+       activesupport (= 5.0.5)
        builder (~> 3.1)
        erubis (~> 2.7.0)
        rails-dom-testing (~> 2.0)
        rails-html-sanitizer (~> 1.0, >= 1.0.3)
-     activejob (5.0.4)
-       activesupport (= 5.0.4)
+     activejob (5.0.5)
+       activesupport (= 5.0.5)
        globalid (>= 0.3.6)
-     activemodel (5.0.4)
-       activesupport (= 5.0.4)
-     activerecord (5.0.4)
-       activemodel (= 5.0.4)
-       activesupport (= 5.0.4)
+     activemodel (5.0.5)
+       activesupport (= 5.0.5)
+     activerecord (5.0.5)
+       activemodel (= 5.0.5)
+       activesupport (= 5.0.5)
        arel (~> 7.0)
-     activesupport (5.0.4)
+     activesupport (5.0.5)
        concurrent-ruby (~> 1.0, >= 1.0.2)
        i18n (~> 0.7)
        minitest (~> 5.1)
        public_suffix (~> 2.0, >= 2.0.2)
      arel (7.1.4)
      ast (2.3.0)
-     autoprefixer-rails (7.1.1.2)
+     autoprefixer-rails (7.1.2.3)
        execjs
      bigdecimal (1.1.0)
      builder (3.2.3)
-     canonical-rails (0.2.0)
+     canonical-rails (0.2.1)
        rails (>= 4.1, < 5.2)
-     capybara (2.14.3)
+     capybara (2.14.4)
        addressable
        mime-types (>= 1.16)
        nokogiri (>= 1.3.3)
      dynamic_form (1.1.4)
      erubis (2.7.0)
      execjs (2.7.0)
-     exifr (1.2.5)
+     exifr (1.3.1)
      factory_girl (4.8.0)
        activesupport (>= 3.0.0)
      factory_girl_rails (4.8.0)
        factory_girl (~> 4.8.0)
        railties (>= 3.0.0)
-     faraday (0.12.1)
+     faraday (0.12.2)
        multipart-post (>= 1.2, < 3)
      ffi (1.9.18)
      fspath (3.1.0)
      globalid (0.4.0)
        activesupport (>= 4.2.0)
      hashdiff (0.3.4)
-     hashie (3.5.5)
+     hashie (3.5.6)
      htmlentities (4.3.4)
      http_accept_language (2.0.5)
-     i18n (0.8.4)
+     i18n (0.8.6)
      i18n-js (3.0.0)
        i18n (~> 0.6, >= 0.6.6)
-     image_optim (0.24.3)
+     image_optim (0.25.0)
        exifr (~> 1.2, >= 1.2.2)
        fspath (~> 3.0)
        image_size (~> 1.5)
        in_threads (~> 1.3)
        progress (~> 3.0, >= 3.0.1)
-     image_optim_rails (0.4.0)
-       image_optim (~> 0.24.0)
+     image_optim_rails (0.4.1)
+       image_optim (~> 0.24)
        rails
        sprockets
      image_size (1.5.0)
      mime-types-data (3.2016.0521)
      mimemagic (0.3.0)
      mini_portile2 (2.2.0)
-     minitest (5.10.2)
+     minitest (5.10.3)
      multi_json (1.12.1)
      multi_xml (0.6.0)
      multipart-post (2.0.0)
      omniauth-github (1.3.0)
        omniauth (~> 1.5)
        omniauth-oauth2 (>= 1.4.0, < 2.0)
-     omniauth-google-oauth2 (0.5.0)
+     omniauth-google-oauth2 (0.5.2)
        jwt (~> 1.5)
        multi_json (~> 1.3)
        omniauth (>= 1.1.1)
        cocaine (~> 0.5.5)
        mime-types
        mimemagic (= 0.3.0)
-     parallel (1.11.2)
+     parallel (1.12.0)
      parser (2.4.0.0)
        ast (~> 2.2)
      pg (0.21.0)
      progress (3.3.1)
      psych (2.2.4)
      public_suffix (2.0.5)
-     r2 (0.2.6)
+     r2 (0.2.7)
      rack (2.0.3)
-     rack-cors (0.4.1)
+     rack-cors (1.0.1)
      rack-openid (1.3.1)
        rack (>= 1.1.0)
        ruby-openid (>= 2.1.8)
      rack-test (0.6.3)
        rack (>= 1.0)
      rack-uri_sanitizer (0.0.2)
-     rails (5.0.4)
-       actioncable (= 5.0.4)
-       actionmailer (= 5.0.4)
-       actionpack (= 5.0.4)
-       actionview (= 5.0.4)
-       activejob (= 5.0.4)
-       activemodel (= 5.0.4)
-       activerecord (= 5.0.4)
-       activesupport (= 5.0.4)
-       bundler (>= 1.3.0, < 2.0)
-       railties (= 5.0.4)
+     rails (5.0.5)
+       actioncable (= 5.0.5)
+       actionmailer (= 5.0.5)
+       actionpack (= 5.0.5)
+       actionview (= 5.0.5)
+       activejob (= 5.0.5)
+       activemodel (= 5.0.5)
+       activerecord (= 5.0.5)
+       activesupport (= 5.0.5)
+       bundler (>= 1.3.0)
+       railties (= 5.0.5)
        sprockets-rails (>= 2.0.0)
      rails-controller-testing (1.0.2)
        actionpack (~> 5.x, >= 5.0.1)
      rails-i18n (4.0.2)
        i18n (~> 0.6)
        rails (>= 4.0)
-     railties (5.0.4)
-       actionpack (= 5.0.4)
-       activesupport (= 5.0.4)
+     railties (5.0.5)
+       actionpack (= 5.0.5)
+       activesupport (= 5.0.5)
        method_source
        rake (>= 0.8.7)
        thor (>= 0.18.1, < 2.0)
      rainbow (2.2.2)
        rake
      rake (12.0.0)
-     rb-fsevent (0.9.8)
+     rb-fsevent (0.10.2)
      rb-inotify (0.9.10)
        ffi (>= 0.5.0, < 2)
      record_tag_helper (1.0.0)
        crass (~> 1.0.2)
        nokogiri (>= 1.4.4)
        nokogumbo (~> 1.4.1)
-     sass (3.4.24)
+     sass (3.5.1)
+       sass-listen (~> 4.0.0)
+     sass-listen (4.0.0)
+       rb-fsevent (~> 0.9, >= 0.9.4)
+       rb-inotify (~> 0.9, >= 0.9.7)
      sass-rails (5.0.6)
        railties (>= 4.0.0, < 6)
        sass (~> 3.1)
        sprockets (>= 2.8, < 4.0)
        sprockets-rails (>= 2.0, < 4.0)
        tilt (>= 1.1, < 3)
-     secure_headers (3.6.5)
+     secure_headers (3.6.7)
        useragent
      simplecov (0.14.1)
        docile (~> 1.1.0)
        ref
      thor (0.19.4)
      thread_safe (0.3.6)
-     tilt (2.0.7)
-     tins (1.14.0)
+     tilt (2.0.8)
+     tins (1.15.0)
      tzinfo (1.2.3)
        thread_safe (~> 0.1)
      uglifier (3.2.0)
@@@ -345,7 -348,6 +349,7 @@@ PLATFORM
  
  DEPENDENCIES
    SystemTimer (>= 1.1.3)
 +  aasm
    actionpack-page_caching
    autoprefixer-rails
    bigdecimal (~> 1.1.0)
    r2
    rack-cors
    rack-uri_sanitizer
-   rails (= 5.0.4)
+   rails (= 5.0.5)
    rails-controller-testing
    rails-i18n (~> 4.0.0)
    record_tag_helper
index 89107ab1ac2f1c22f01398bd67086afbc6f2b62a,b3518872c5aa067cbd2fdab073862affcd54979e..1b57fa59b19f4b6948385ff4d06461fa702c94a5
@@@ -14,27 -14,27 +14,27 @@@ class DiaryEntryController < Applicatio
  
      if request.post?
        @diary_entry = DiaryEntry.new(entry_params)
-       @diary_entry.user = @user
+       @diary_entry.user = current_user
  
        if @diary_entry.save
-         default_lang = @user.preferences.where(:k => "diary.default_language").first
+         default_lang = current_user.preferences.where(:k => "diary.default_language").first
          if default_lang
            default_lang.v = @diary_entry.language_code
            default_lang.save!
          else
-           @user.preferences.create(:k => "diary.default_language", :v => @diary_entry.language_code)
+           current_user.preferences.create(:k => "diary.default_language", :v => @diary_entry.language_code)
          end
  
          # Subscribe user to diary comments
-         @diary_entry.subscriptions.create(:user => @user)
+         @diary_entry.subscriptions.create(:user => current_user)
  
-         redirect_to :action => "list", :display_name => @user.display_name
+         redirect_to :action => "list", :display_name => current_user.display_name
        else
          render :action => "edit"
        end
      else
-       default_lang = @user.preferences.where(:k => "diary.default_language").first
-       lang_code = default_lang ? default_lang.v : @user.preferred_language
+       default_lang = current_user.preferences.where(:k => "diary.default_language").first
+       lang_code = default_lang ? default_lang.v : current_user.preferred_language
        @diary_entry = DiaryEntry.new(entry_params.merge(:language_code => lang_code))
        set_map_location
        render :action => "edit"
@@@ -45,7 -45,7 +45,7 @@@
      @title = t "diary_entry.edit.title"
      @diary_entry = DiaryEntry.find(params[:id])
  
-     if @user != @diary_entry.user
+     if current_user != @diary_entry.user
        redirect_to :action => "view", :id => params[:id]
      elsif params[:diary_entry] && @diary_entry.update_attributes(entry_params)
        redirect_to :action => "view", :id => params[:id]
    def comment
      @entry = DiaryEntry.find(params[:id])
      @diary_comment = @entry.comments.build(comment_params)
-     @diary_comment.user = @user
+     @diary_comment.user = current_user
      if @diary_comment.save
  
        # Notify current subscribers of the new comment
        @entry.subscribers.visible.each do |user|
-         if @user != user
+         if current_user != user
            Notifier.diary_comment_notification(@diary_comment, user).deliver_now
          end
        end
  
        # Add the commenter to the subscribers if necessary
-       @entry.subscriptions.create(:user => @user) unless @entry.subscribers.exists?(@user.id)
+       @entry.subscriptions.create(:user => current_user) unless @entry.subscribers.exists?(current_user.id)
  
        redirect_to :action => "view", :display_name => @entry.user.display_name, :id => @entry.id
      else
@@@ -83,7 -83,7 +83,7 @@@
    def subscribe
      diary_entry = DiaryEntry.find(params[:id])
  
-     diary_entry.subscriptions.create(:user => @user) unless diary_entry.subscribers.exists?(@user.id)
+     diary_entry.subscriptions.create(:user => current_user) unless diary_entry.subscribers.exists?(current_user.id)
  
      redirect_to :action => "view", :display_name => diary_entry.user.display_name, :id => diary_entry.id
    rescue ActiveRecord::RecordNotFound
@@@ -93,7 -93,7 +93,7 @@@
    def unsubscribe
      diary_entry = DiaryEntry.find(params[:id])
  
-     diary_entry.subscriptions.where(:user => @user).delete_all if diary_entry.subscribers.exists?(@user.id)
+     diary_entry.subscriptions.where(:user => current_user).delete_all if diary_entry.subscribers.exists?(current_user.id)
  
      redirect_to :action => "view", :display_name => diary_entry.user.display_name, :id => diary_entry.id
    rescue ActiveRecord::RecordNotFound
          return
        end
      elsif params[:friends]
-       if @user
+       if current_user
          @title = t "diary_entry.list.title_friends"
-         @entries = DiaryEntry.where(:user_id => @user.friend_users)
+         @entries = DiaryEntry.where(:user_id => current_user.friend_users)
        else
          require_user
          return
        end
      elsif params[:nearby]
-       if @user
+       if current_user
          @title = t "diary_entry.list.title_nearby"
-         @entries = DiaryEntry.where(:user_id => @user.nearby)
+         @entries = DiaryEntry.where(:user_id => current_user.nearby)
        else
          require_user
          return
      @entry = @this_user.diary_entries.visible.where(:id => params[:id]).first
      if @entry
        @title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title
 +      if params[:comment_id]
 +        @reported_comment = DiaryComment.where(:id => params[:comment_id])
 +      end
      else
        @title = t "diary_entry.no_such_entry.title", :id => params[:id]
        render :action => "no_such_entry", :status => :not_found
    # require that the user is a administrator, or fill out a helpful error message
    # and return them to the user page.
    def require_administrator
-     unless @user.administrator?
+     unless current_user.administrator?
        flash[:error] = t("user.filter.not_an_administrator")
        redirect_to :action => "view"
      end
        @lon = @diary_entry.longitude
        @lat = @diary_entry.latitude
        @zoom = 12
-     elsif @user.home_lat.nil? || @user.home_lon.nil?
+     elsif current_user.home_lat.nil? || current_user.home_lon.nil?
        @lon = params[:lon] || -0.1
        @lat = params[:lat] || 51.5
        @zoom = params[:zoom] || 4
      else
-       @lon = @user.home_lon
-       @lat = @user.home_lat
+       @lon = current_user.home_lon
+       @lat = current_user.home_lat
        @zoom = 12
      end
    end
index 46d68c5d2d663ff896d8eb72fee59dc294818df0,86d190680c4a5bb29ba27667c658e273ab2fd724..be00868632d58eb125cf961975a839456a6bdd86
@@@ -3,11 -3,6 +3,11 @@@
  <h2>
    <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
    <%= 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, referer: request.fullpath), :title => t('browse.changeset.report') do %>
 +        &nbsp;&#9872;
 +    <% end %>
 +  <% end %>
  </h2>
  
  <div class="browse-section">
@@@ -20,7 -15,7 +20,7 @@@
  
    <div class="buttons clearfix subscribe-buttons">
      <form action="#" class="hide_unless_logged_in">
-       <% if @user and @changeset.subscribers.exists?(@user.id) %>
+       <% if current_user and @changeset.subscribers.exists?(current_user.id) %>
          <input class="action-button" type="submit" name="unsubscribe" value="<%= t('javascripts.changesets.show.unsubscribe') %>" data-method="POST" data-url="<%= changeset_unsubscribe_url(@changeset) %>" />
        <% else %>
          <input class="action-button" type="submit" name="subscribe" value="<%= t('javascripts.changesets.show.subscribe') %>" data-method="POST" data-url="<%= changeset_subscribe_url(@changeset) %>" />
                      :when => friendly_date(comment.created_at), :exact_time => l(comment.created_at),
                      :user => link_to(h(comment.author.display_name), {:controller => "user", :action => "view",
                      :display_name => comment.author.display_name})).html_safe %>
-                   <% if @user and @user.moderator? %>
+                   <% if current_user and current_user.moderator? %>
                      — <span class="action-button deemphasize" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_hide_url(comment.id) %>"><%= t('javascripts.changesets.show.hide_comment') %></span>
                    <% end %>
                  </small>
                  <%= comment.body.to_html %>
                </li>
-             <% elsif @user and @user.moderator? %>
+             <% elsif current_user and current_user.moderator? %>
                <li id="c<%= comment.id %>">
                  <small class='deemphasize'>
                    <%= t("browse.changeset.hidden_commented_by",
index 23a5230c1f86c54d5a0a92cec51c69128eef14e2,3c2264d3e58fb849a8793ef1e0aee9da806cd315..5079074e844fbc745a60304f15185af581fbe0bc
  
  <a id="comments"></a>
  <div class='comments'>
 -<%= render :partial => 'diary_comment', :collection => @entry.visible_comments %>
 +  <% if @reported_comment %>
 +    <%= render :partial => 'diary_comment', :collection => @reported_comment %>
 +  <% else %>
 +    <%= render :partial => 'diary_comment', :collection => @entry.visible_comments %>
 +  <% end %>
  </div>
  <%= if_logged_in(:div) do %>
    <h3 id="newcomment"><%= t 'diary_entry.view.leave_a_comment' %></h3>
@@@ -25,9 -21,9 +25,9 @@@
      <%= richtext_area :diary_comment, :body, :cols => 80, :rows => 15 %>
      <%= submit_tag t('diary_entry.view.save_button') %>
    <% end %>
-   <% if @user and @entry.subscribers.exists?(@user.id) %>
+   <% if current_user and @entry.subscribers.exists?(current_user.id) %>
      <div class="diary-subscribe-buttons"><%= link_to t('javascripts.changesets.show.unsubscribe'), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
-   <% elsif @user %>
+   <% elsif current_user %>
      <div class="diary-subscribe-buttons"><%= link_to t('javascripts.changesets.show.subscribe'), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %></div>
    <% end %>
  <% end %>
index cd18e79dfc22401f74b4c569f88fc28e76542fff,a5ab460ce67924f3d294639d179238535decf26d..a6bc4c6f7697691dcd029650510db133dbeeb5c2
@@@ -38,9 -38,6 +38,9 @@@
    </nav>
    <nav class='secondary'>
      <ul>
 +      <% if @user and ( @user.administrator? or @user.moderator? ) %>
 +        <li class="compact-hide <%= current_page_class(issues_path) %>"><b><%= link_to t('layouts.reports'), issues_path %></b></li>
 +      <% end %>
        <li class="compact-hide <%= current_page_class(traces_path) %>"><%= link_to t('layouts.gps_traces'), traces_path %></li>
        <li class="compact-hide <%= current_page_class(diary_path) %>"><%= link_to t('layouts.user_diaries'), diary_path %></li>
        <li class="compact-hide <%= current_page_class(copyright_path) %>"><%= link_to t('layouts.copyright'), copyright_path %></li>
          </ul>
        </li>
      </ul>
-     <% if @user && @user.id %>
+     <% if current_user && current_user.id %>
        <div class='dropdown user-menu logged-in'>
          <a class='dropdown-toggle' data-toggle='dropdown' href="#">
-           <%= user_thumbnail_tiny(@user, :width => 25, :height => 25)
+           <%= user_thumbnail_tiny(current_user, :width => 25, :height => 25)
            %><%= render :partial => 'layouts/inbox'
-         %><span class="user-button"><span class='username'><%= @user.display_name %></span>
+         %><span class="user-button"><span class='username'><%= current_user.display_name %></span>
            <b class="caret"></b></span>
          </a>
          <ul class='dropdown-menu'>
            <li>
-             <%= link_to inbox_path(:display_name => @user.display_name) do %>
-               <span class='count-number'><%= number_with_delimiter(@user.new_messages.size) %></span>
+             <%= link_to inbox_path(:display_name => current_user.display_name) do %>
+               <span class='count-number'><%= number_with_delimiter(current_user.new_messages.size) %></span>
                <%= t('user.view.my messages') %>
              <% end %>
            </li>
            <li>
-             <%= link_to t('user.view.my profile'), user_path(:display_name => @user.display_name) %>
+             <%= link_to t('user.view.my profile'), user_path(:display_name => current_user.display_name) %>
            </li>
            <li>
-             <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
+             <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => current_user.display_name %>
            </li>
            <li class="divider"></li>
            <li>
index a23f15e55a2a4590a81e122e01749b7722b3e054,137a390ba1fe6437b3280e7fafa1da6f21135eaf..777f16389b47b99a132f68d2b7a557e1b8e02bd0
@@@ -3,42 -3,42 +3,42 @@@
      <%= user_image @this_user %>
      <div class='userinformation-inner'>
        <h1><%= @this_user.display_name %><%= role_icons(@this_user) %></h1>
-       <% if @user and @this_user.id == @user.id %>
+       <% if current_user and @this_user.id == current_user.id %>
          <!-- Displaying user's own profile page to themself -->
          <ul class='secondary-actions clearfix'>
            <li>
-             <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
-             <span class='count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
+             <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => current_user.display_name %>
+             <span class='count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
            </li>
            <li>
              <%= link_to t('user.view.my notes'), :controller => 'notes', :action=> 'mine' %>
            </li>
            <li>
              <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
-             <span class='count-number'><%= number_with_delimiter(@user.traces.size) %></span>
+             <span class='count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
            </li>
            <li>
-             <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
-             <span class='count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
+             <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => current_user.display_name %>
+             <span class='count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
            </li>
            <li>
-             <%= link_to t('user.view.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => @user.display_name %>
+             <%= link_to t('user.view.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => current_user.display_name %>
            </li>
            <li>
-             <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
+             <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => current_user.display_name %>
            </li>
  
-           <% if @user.blocks.exists? %>
+           <% if current_user.blocks.exists? %>
              <li>
-               <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @user.display_name %>
-               <span class='count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
+               <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => current_user.display_name %>
+               <span class='count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
              </li>
            <% end %>
  
-           <% if @user and @user.moderator? and @user.blocks_created.exists? %>
+           <% if current_user and current_user.moderator? and current_user.blocks_created.exists? %>
              <li>
-               <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @user.display_name %>
-               <span class='count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
+               <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => current_user.display_name %>
+               <span class='count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
              </li>
            <% end %>
  
@@@ -73,9 -73,9 +73,9 @@@
              <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
            </li>
            <li>
-             <% if @user and @user.is_friends_with?(@this_user) %>
+             <% if current_user and current_user.is_friends_with?(@this_user) %>
                <%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @this_user.display_name), :method => :post %>
-             <% elsif @user %>
+             <% elsif current_user %>
                <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name), :method => :post %>
              <% else %>
                <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
@@@ -96,7 -96,7 +96,7 @@@
              </li>
            <% end %>
  
-           <% if @user and @user.moderator? %>
+           <% if current_user and current_user.moderator? %>
              <li>
              <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
              </li>
  
        <% end %>
  
-       <% if @user and @user.administrator? %>
+       <% if current_user and current_user.administrator? %>
  
          <ul class='secondary-actions clearfix'>
            <% if ["active", "confirmed"].include? @this_user.status %>
        </p>
      </div>
  
 +    <% if @user and @this_user.id != @user.id %>
 +      <div class="report-button">
 +         <%= link_to new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, referer: request.fullpath), :title => t('user.view.report') do%>
 +            &nbsp;&#9872;
 +         <% end %>
 +      </div>
 +    <% end %>
 +
      <div class="user-description richtext"><%= @this_user.description.to_html %></div>
  
    </div>
  
-   <% if @user and @user.administrator? -%>
+   <% if current_user and current_user.administrator? -%>
      <div class='admin-user-info deemphasize'>
        <small><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></small>
        <% unless @this_user.creation_ip.nil? -%>
  
  <% end %>
  
-   <% if @user and @this_user.id == @user.id %>
+   <% if current_user and @this_user.id == current_user.id %>
      <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
        <div id="map" class="content_map">
-         <p id="no_home_location"><%= raw(t 'user.view.if set location', :settings_link => (link_to t('user.view.settings_link_text'), :controller => 'user', :action => 'account', :display_name => @user.display_name)) %></p>
+         <p id="no_home_location"><%= raw(t 'user.view.if set location', :settings_link => (link_to t('user.view.settings_link_text'), :controller => 'user', :action => 'account', :display_name => current_user.display_name)) %></p>
        </div>
      <% else %>
        <% content_for :head do %>
        <% end %>
        <%
          user_data = {
-           :lon => @user.home_lon,
-           :lat => @user.home_lat,
+           :lon => current_user.home_lon,
+           :lat => current_user.home_lat,
            :icon => image_path("marker-red.png"),
-           :description => render(:partial => "popup", :object => @user, :locals => {:type => "your location"})
+           :description => render(:partial => "popup", :object => current_user, :locals => {:type => "your location"})
          }
        %>
        <%= content_tag "div", "", :id => "map", :class => "content_map", :data => {:user => user_data} %>