Commit a0aa0212a9286b26457a5b44674f81b26f6bc097

Authored by Dmitriy Zaporozhets
1 parent df03275e

Removed feature: comments on wiki

app/contexts/notes/load_context.rb
@@ -19,8 +19,6 @@ module Notes @@ -19,8 +19,6 @@ module Notes
19 when "wall" 19 when "wall"
20 # this is the only case, where the order is DESC 20 # this is the only case, where the order is DESC
21 project.common_notes.order("created_at DESC, id DESC").limit(50) 21 project.common_notes.order("created_at DESC, id DESC").limit(50)
22 - when "wiki"  
23 - project.wiki_notes.limit(20)  
24 end 22 end
25 23
26 @notes = if after_id 24 @notes = if after_id
app/mailers/notify.rb
@@ -89,14 +89,6 @@ class Notify < ActionMailer::Base @@ -89,14 +89,6 @@ class Notify < ActionMailer::Base
89 mail(to: recipient(recipient_id), subject: subject) 89 mail(to: recipient(recipient_id), subject: subject)
90 end 90 end
91 91
92 - def note_wiki_email(recipient_id, note_id)  
93 - @note = Note.find(note_id)  
94 - @wiki = @note.noteable  
95 - @project = @note.project  
96 - mail(to: recipient(recipient_id), subject: subject("note for wiki"))  
97 - end  
98 -  
99 -  
100 92
101 # 93 #
102 # Project 94 # Project
@@ -105,7 +97,7 @@ class Notify < ActionMailer::Base @@ -105,7 +97,7 @@ class Notify < ActionMailer::Base
105 def project_access_granted_email(user_project_id) 97 def project_access_granted_email(user_project_id)
106 @users_project = UsersProject.find user_project_id 98 @users_project = UsersProject.find user_project_id
107 @project = @users_project.project 99 @project = @users_project.project
108 - mail(to: @users_project.user.email, 100 + mail(to: @users_project.user.email,
109 subject: subject("access to project was granted")) 101 subject: subject("access to project was granted"))
110 end 102 end
111 103
app/models/project.rb
@@ -216,10 +216,6 @@ class Project < ActiveRecord::Base @@ -216,10 +216,6 @@ class Project < ActiveRecord::Base
216 last_event.try(:created_at) || updated_at 216 last_event.try(:created_at) || updated_at
217 end 217 end
218 218
219 - def wiki_notes  
220 - Note.where(noteable_id: wikis.pluck(:id), noteable_type: 'Wiki', project_id: self.id)  
221 - end  
222 -  
223 def project_id 219 def project_id
224 self.id 220 self.id
225 end 221 end
app/views/notify/note_wiki_email.html.haml
@@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
1 -%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}  
2 - %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}  
3 - %tr  
4 - %td{style: "font-size: 1px; line-height: 1px;", width: "21"}  
5 - %td{align: "left", style: "padding: 20px 0 0;"}  
6 - %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}  
7 - New comment for Wiki page  
8 - = link_to_gfm @wiki.title, project_wiki_url(@wiki.project, @wiki, anchor: "note_#{@note.id}")  
9 - %td{style: "font-size: 1px; line-height: 1px;", width: "21"}  
10 - %tr  
11 - %td{style: "font-size: 1px; line-height: 1px;", width: "21"}  
12 - %td{style: "padding: 15px 0 15px;", valign: "top"}  
13 - %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}  
14 - %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}  
15 - commented on Wiki page:  
16 - %br  
17 - %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}  
18 - %tr  
19 - %td{valign: "top"}  
20 - %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }  
21 - = markdown(@note.note)  
22 - %td{style: "font-size: 1px; line-height: 1px;", width: "21"}  
23 -  
app/views/wikis/show.html.haml
@@ -19,6 +19,3 @@ @@ -19,6 +19,3 @@
19 - if can? current_user, :admin_wiki, @project 19 - if can? current_user, :admin_wiki, @project
20 = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do 20 = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do
21 Delete this page 21 Delete this page
22 -  
23 -%hr  
24 -.wiki_notes#notes= render "notes/notes_with_form", tid: @wiki.id, tt: "wiki"  
features/project/wiki.feature
@@ -7,9 +7,3 @@ Feature: Project Wiki @@ -7,9 +7,3 @@ Feature: Project Wiki
7 Scenario: Add new page 7 Scenario: Add new page
8 Given I create Wiki page 8 Given I create Wiki page
9 Then I should see newly created wiki page 9 Then I should see newly created wiki page
10 -  
11 - @javascript  
12 - Scenario: I comment wiki page  
13 - Given I create Wiki page  
14 - And I leave a comment like "XML attached"  
15 - Then I should see comment "XML attached"  
spec/requests/gitlab_flavored_markdown_spec.rb
@@ -197,18 +197,6 @@ describe "Gitlab Flavored Markdown" do @@ -197,18 +197,6 @@ describe "Gitlab Flavored Markdown" do
197 197
198 page.should have_link("##{issue.id}") 198 page.should have_link("##{issue.id}")
199 end 199 end
200 -  
201 - it "should render in wikis#index", js: true do  
202 - visit project_wiki_path(project, :index)  
203 - fill_in "Title", with: 'Test title'  
204 - fill_in "Content", with: '[link test](test)'  
205 - click_on "Save"  
206 -  
207 - fill_in "note_note", with: "see ##{issue.id}"  
208 - click_button "Add Comment"  
209 -  
210 - page.should have_link("##{issue.id}")  
211 - end  
212 end 200 end
213 201
214 202