Commits

Haru Iida committed f2109b6

fixes #1232 No toolbar for comments form.

Comments (0)

Files changed (4)

app/views/wiki_extensions/_comment_form.html.erb

 -%>
 <%
 
-num = rand(10000)
-area_id = "add_comment_area_#{num}"
-div_id = "add_comment_form_div#{num}"
-
 url = url_for(:controller => 'wiki_extensions', :action => 'add_comment', :id => @project)
 -%>
 
     <br/>
     <%= submit_tag(l(:label_comment_add)) if page %>
     <%= link_to_function(l(:button_cancel), "$('##{div_id}').hide();") %>
-    <%= wikitoolbar_for(area_id) %>
   </form>
 </div>

app/views/wiki_extensions/_comments.html.erb

-<% # Wiki Extensions plugin for Redmine
-# Copyright (C) 2012  Haruyuki Iida
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
--%>
-
-<%
-data = page.wiki_extension_data
-comments = WikiExtensionsComment.find(:all, :conditions => ['wiki_page_id = (?)', page.id])
--%>
-
-<%= raw display_comments_tree(comments,nil,page,data) %>

app/views/wiki_extensions/_comments.mobile.erb

-<%#
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-%>
-
-{{comments}} macro is not supported with mobile_face.

lib/wiki_extensions_comments.rb

       end
       page = obj.page if obj
 
-      o = @_controller.send(:render_to_string, {:partial => "wiki_extensions/comment_form", :locals =>{:page => page}})  
+      num = rand(10000)
+      area_id = "add_comment_area_#{num}"
+      div_id = "add_comment_form_div#{num}"
+
+      o = @_controller.send(:render_to_string, {:partial => "wiki_extensions/comment_form", :locals =>{:page => page, :area_id => area_id, :div_id => div_id}})
+      o << raw(wikitoolbar_for(area_id))
       raw o.html_safe
     end
   end
       end
       page = obj.page
       return unless page
-      o = @_controller.send(:render_to_string, {:partial => "wiki_extensions/comments", :locals =>{:page => page}})
-      raw o.html_safe
+
+      data = page.wiki_extension_data
+      comments = WikiExtensionsComment.find(:all, :conditions => ['wiki_page_id = (?)', page.id])
+
+      raw display_comments_tree(comments,nil,page,data)
+
     end
   end
 end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.