]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'master' into moderation
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 11 Apr 2018 01:54:04 +0000 (09:54 +0800)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 11 Apr 2018 01:54:04 +0000 (09:54 +0800)
1  2 
Gemfile.lock
app/assets/stylesheets/common.scss
app/models/user.rb
app/views/diary_entry/_diary_comment.html.erb
app/views/diary_entry/_diary_entry.html.erb
app/views/user/view.html.erb
config/locales/en.yml
config/routes.rb
db/structure.sql
test/test_helper.rb

diff --cc Gemfile.lock
Simple merge
Simple merge
Simple merge
index 708bdd49d2024eb63e6b8aa7aa4b28c8eaca831b,43f8cbbc1b8ecd0e836ff95660724bbebdd2d140..8e17b095422a86c0681511c87fce68c97e5eaa14
@@@ -1,11 -1,6 +1,11 @@@
  <div class="clearfix diary-comment">
    <%= user_thumbnail diary_comment.user %>
-   <p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= 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}"))) %>
 -  <p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %></p>
++  <p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %>
 +    <% if current_user and diary_comment.user.id != current_user.id %>
 +      | <%= report_link(t(".report"), diary_comment) %>
 +    <% end %>
 +  </p>
 +
    <div class="richtext"><%= diary_comment.body.to_html %></div>
    <%= if_administrator(:span) do %>
      <%= link_to t('diary_entry.diary_comment.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('diary_entry.diary_comment.confirm') } %>
Simple merge
Simple merge
index 8160c878c6304172a4df5c4ac39312ac66b91788,1016a89de4c937fdc27fce2f8d551398e8cfa1fd..0c250b0cc34691d937b5b576e77b30d5b1f209aa
@@@ -213,26 -214,26 +214,26 @@@ OpenStreetMap::Application.routes.draw 
  
    # diary pages
    match "/diary/new" => "diary_entry#new", :via => [:get, :post]
-   match "/diary/friends" => "diary_entry#list", :friends => true, :via => :get, :as => "friend_diaries"
-   match "/diary/nearby" => "diary_entry#list", :nearby => true, :via => :get, :as => "nearby_diaries"
-   match "/user/:display_name/diary/rss" => "diary_entry#rss", :via => :get, :defaults => { :format => :rss }
-   match "/diary/:language/rss" => "diary_entry#rss", :via => :get, :defaults => { :format => :rss }
-   match "/diary/rss" => "diary_entry#rss", :via => :get, :defaults => { :format => :rss }
-   match "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :via => :get, :page => /[1-9][0-9]*/
-   match "/user/:display_name/diary/comments/" => "diary_entry#comments", :via => :get
-   match "/user/:display_name/diary" => "diary_entry#list", :via => :get
-   match "/diary/:language" => "diary_entry#list", :via => :get
-   match "/diary" => "diary_entry#list", :via => :get
-   match "/user/:display_name/diary/:id" => "diary_entry#view", :via => :get, :id => /\d+/, :as => :diary_entry
-   match "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :via => :post, :id => /\d+/
+   get "/diary/friends" => "diary_entry#list", :friends => true, :as => "friend_diaries"
+   get "/diary/nearby" => "diary_entry#list", :nearby => true, :as => "nearby_diaries"
+   get "/user/:display_name/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
+   get "/diary/:language/rss" => "diary_entry#rss", :defaults => { :format => :rss }
+   get "/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
+   get "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :page => /[1-9][0-9]*/
+   get "/user/:display_name/diary/comments/" => "diary_entry#comments"
+   get "/user/:display_name/diary" => "diary_entry#list"
+   get "/diary/:language" => "diary_entry#list"
+   get "/diary" => "diary_entry#list"
 -  get "/user/:display_name/diary/:id" => "diary_entry#view", :id => /\d+/
++  get "/user/:display_name/diary/:id" => "diary_entry#view", :id => /\d+/, :as => :diary_entry
+   post "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :id => /\d+/
    match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/
-   match "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :via => :post, :id => /\d+/, :as => :hide_diary_entry
-   match "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :via => :post, :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
-   match "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :via => :post, :as => :diary_entry_subscribe, :id => /\d+/
-   match "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :via => :post, :as => :diary_entry_unsubscribe, :id => /\d+/
+   post "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :id => /\d+/, :as => :hide_diary_entry
+   post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
+   post "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
+   post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
  
    # user pages
-   match "/user/:display_name" => "user#view", :via => :get, :as => "user"
+   get "/user/:display_name" => "user#view", :as => "user"
    match "/user/:display_name/make_friend" => "user#make_friend", :via => [:get, :post], :as => "make_friend"
    match "/user/:display_name/remove_friend" => "user#remove_friend", :via => [:get, :post], :as => "remove_friend"
    match "/user/:display_name/account" => "user#account", :via => [:get, :post]
index 73cb543e7688c3133825caf98232bfd4ed3ff34d,8803c0c02a41088209668ab15854a679a44332e0..077faffad1faef8125de386aadd5add0675bb16b
@@@ -1406,23 -1284,9 +1401,23 @@@ ALTER TABLE ONLY gpx_files ALTER COLUM
  
  
  --
- -- Name: id; Type: DEFAULT; Schema: public; Owner: -
+ -- Name: messages id; Type: DEFAULT; Schema: public; Owner: -
  --
  
 +ALTER TABLE ONLY issue_comments ALTER COLUMN id SET DEFAULT nextval('issue_comments_id_seq'::regclass);
 +
 +
 +--
 +-- Name: id; Type: DEFAULT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);
 +
 +
 +--
 +-- Name: id; Type: DEFAULT; Schema: public; Owner: -
 +--
 +
  ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
  
  
@@@ -1462,16 -1326,9 +1457,16 @@@ ALTER TABLE ONLY redactions ALTER COLUM
  
  
  --
- -- Name: id; Type: DEFAULT; Schema: public; Owner: -
+ -- Name: user_blocks id; Type: DEFAULT; Schema: public; Owner: -
  --
  
 +ALTER TABLE ONLY reports ALTER COLUMN id SET DEFAULT nextval('reports_id_seq'::regclass);
 +
 +
 +--
 +-- Name: id; Type: DEFAULT; Schema: public; Owner: -
 +--
 +
  ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass);
  
  
@@@ -1648,24 -1505,8 +1643,24 @@@ ALTER TABLE ONLY gpx_file
      ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id);
  
  
 +--
 +-- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issue_comments
 +    ADD CONSTRAINT issue_comments_pkey PRIMARY KEY (id);
 +
 +
 +--
 +-- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issues
 +    ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
 +
 +
  --
- -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+ -- Name: languages languages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY languages
@@@ -1760,16 -1601,8 +1755,16 @@@ ALTER TABLE ONLY relation
      ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version);
  
  
 +--
 +-- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY reports
 +    ADD CONSTRAINT reports_pkey PRIMARY KEY (id);
 +
 +
  --
- -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+ -- Name: user_blocks user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY user_blocks
@@@ -2538,48 -2329,8 +2540,48 @@@ ALTER TABLE ONLY gpx_file
      ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
  
  
 +--
 +-- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issue_comments
 +    ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
 +
 +
 +--
 +-- Name: issue_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issue_comments
 +    ADD CONSTRAINT issue_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
 +
 +
 +--
 +-- Name: issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issues
 +    ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id);
 +
 +
 +--
 +-- Name: issues_resolved_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issues
 +    ADD CONSTRAINT issues_resolved_by_fkey FOREIGN KEY (resolved_by) REFERENCES users(id);
 +
 +
 +--
 +-- Name: issues_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY issues
 +    ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id);
 +
 +
  --
- -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+ -- Name: messages messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY messages
@@@ -2690,24 -2441,8 +2692,24 @@@ ALTER TABLE ONLY relation
      ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id);
  
  
 +--
 +-- Name: reports_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY reports
 +    ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
 +
 +
 +--
 +-- Name: reports_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
 +--
 +
 +ALTER TABLE ONLY reports
 +    ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);
 +
 +
  --
- -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+ -- Name: user_blocks user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY user_blocks
@@@ -2897,5 -2632,5 +2900,3 @@@ INSERT INTO "schema_migrations" (versio
  ('7'),
  ('8'),
  ('9');
--
--
Simple merge