From: Andy Allan Date: Wed, 11 Apr 2018 01:54:04 +0000 (+0800) Subject: Merge branch 'master' into moderation X-Git-Tag: live~2976^2~11 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7dbf8d83369cb73929080c4ba23fdd7dcd0184df?ds=sidebyside Merge branch 'master' into moderation --- 7dbf8d83369cb73929080c4ba23fdd7dcd0184df diff --cc app/views/diary_entry/_diary_comment.html.erb index 708bdd49d,43f8cbbc1..8e17b0954 --- a/app/views/diary_entry/_diary_comment.html.erb +++ b/app/views/diary_entry/_diary_comment.html.erb @@@ -1,11 -1,6 +1,11 @@@
<%= 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}"))) %> -

<%= 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}"))) %>

++

<%= 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 %> +

+
<%= diary_comment.body.to_html %>
<%= 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') } %> diff --cc config/routes.rb index 8160c878c,1016a89de..0c250b0cc --- a/config/routes.rb +++ b/config/routes.rb @@@ -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] diff --cc db/structure.sql index 73cb543e7,8803c0c02..077faffad --- a/db/structure.sql +++ b/db/structure.sql @@@ -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'); -- --