OSDN Git Service

Removed feature: comments on wiki
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 29 Nov 2012 03:14:05 +0000 (06:14 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 29 Nov 2012 03:14:05 +0000 (06:14 +0300)
app/contexts/notes/load_context.rb
app/mailers/notify.rb
app/models/project.rb
app/views/notify/note_wiki_email.html.haml [deleted file]
app/views/wikis/show.html.haml
features/project/wiki.feature
spec/requests/gitlab_flavored_markdown_spec.rb

index f394914..9f8299f 100644 (file)
@@ -19,8 +19,6 @@ module Notes
                when "wall"
                  # this is the only case, where the order is DESC
                  project.common_notes.order("created_at DESC, id DESC").limit(50)
-               when "wiki"
-                 project.wiki_notes.limit(20)
                end
 
       @notes = if after_id
index 7f3862a..29cebad 100644 (file)
@@ -89,14 +89,6 @@ class Notify < ActionMailer::Base
     mail(to: recipient(recipient_id), subject: subject)
   end
 
-  def note_wiki_email(recipient_id, note_id)
-    @note = Note.find(note_id)
-    @wiki = @note.noteable
-    @project = @note.project
-    mail(to: recipient(recipient_id), subject: subject("note for wiki"))
-  end
-
-
 
   #
   # Project
@@ -105,7 +97,7 @@ class Notify < ActionMailer::Base
   def project_access_granted_email(user_project_id)
     @users_project = UsersProject.find user_project_id
     @project = @users_project.project
-    mail(to: @users_project.user.email, 
+    mail(to: @users_project.user.email,
          subject: subject("access to project was granted"))
   end
 
index 176c731..0c74c0b 100644 (file)
@@ -216,10 +216,6 @@ class Project < ActiveRecord::Base
     last_event.try(:created_at) || updated_at
   end
 
-  def wiki_notes
-    Note.where(noteable_id: wikis.pluck(:id), noteable_type: 'Wiki', project_id: self.id)
-  end
-
   def project_id
     self.id
   end
diff --git a/app/views/notify/note_wiki_email.html.haml b/app/views/notify/note_wiki_email.html.haml
deleted file mode 100644 (file)
index 41a237f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
-  %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
-    %tr
-      %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
-      %td{align: "left", style: "padding: 20px 0 0;"}
-        %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
-          New comment for Wiki page
-          = link_to_gfm @wiki.title, project_wiki_url(@wiki.project, @wiki, anchor: "note_#{@note.id}")
-      %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
-    %tr
-      %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
-      %td{style: "padding: 15px 0 15px;", valign: "top"}
-        %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
-          %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
-          commented on Wiki page:
-        %br
-          %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
-            %tr
-              %td{valign: "top"}
-                %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
-                  = markdown(@note.note)
-      %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
-
index 579ea1b..c307453 100644 (file)
@@ -19,6 +19,3 @@
 - if can? current_user, :admin_wiki, @project
   = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do
     Delete this page
-
-%hr
-.wiki_notes#notes= render "notes/notes_with_form", tid: @wiki.id, tt: "wiki"
index 5137056..f052e2f 100644 (file)
@@ -7,9 +7,3 @@ Feature: Project Wiki
   Scenario: Add new page
     Given I create Wiki page
     Then I should see newly created wiki page
-
-  @javascript
-  Scenario: I comment wiki page
-    Given I create Wiki page
-    And I leave a comment like "XML attached"
-    Then I should see comment "XML attached"
index aedd435..ad5d7cd 100644 (file)
@@ -197,18 +197,6 @@ describe "Gitlab Flavored Markdown" do
 
       page.should have_link("##{issue.id}")
     end
-
-    it "should render in wikis#index", js: true do
-      visit project_wiki_path(project, :index)
-      fill_in "Title", with: 'Test title'
-      fill_in "Content", with: '[link test](test)'
-      click_on "Save"
-
-      fill_in "note_note", with: "see ##{issue.id}"
-      click_button "Add Comment"
-
-      page.should have_link("##{issue.id}")
-    end
   end