diff --git a/plugins/community_block/lib/community_block.rb b/plugins/community_block/lib/community_block.rb index 95ce15d..235f8b1 100644 --- a/plugins/community_block/lib/community_block.rb +++ b/plugins/community_block/lib/community_block.rb @@ -11,7 +11,7 @@ class CommunityBlock < Block def content(arg={}) block = self - lambda do + proc do render :file => 'community_block', :locals => { :block => block } end end diff --git a/plugins/community_block/test/functional/commmunity_block_plugin_profile_design_controller_test.rb b/plugins/community_block/test/functional/commmunity_block_plugin_profile_design_controller_test.rb index d10aa84..c0c9fc9 100644 --- a/plugins/community_block/test/functional/commmunity_block_plugin_profile_design_controller_test.rb +++ b/plugins/community_block/test/functional/commmunity_block_plugin_profile_design_controller_test.rb @@ -27,7 +27,7 @@ class ProfileControllerTest < ActionController::TestCase @environment.save! CommunityBlock.delete_all - @box1 = Box.create!(:owner => @community) + @box1 = create(Box, :owner => @community) @community.boxes = [@box1] @block = CommunityBlock.new diff --git a/plugins/community_block/views/community_block.html.erb b/plugins/community_block/views/community_block.html.erb new file mode 100644 index 0000000..b2d319b --- /dev/null +++ b/plugins/community_block/views/community_block.html.erb @@ -0,0 +1,52 @@ +
+ +
+
+ + <% + links = [] + + if logged_in? + + if profile.enable_contact? + links.push(_('Send an e-mail') => {:href => url_for({:controller => 'contact', :action => 'new', :profile => profile.identifier})}) + end + + links.push(_('Report abuse') => {:href => url_for({:controller => 'profile', :action => 'report_abuse', :profile => profile.identifier})}) + + if !user.nil? && user.has_permission?('edit_profile', profile) + links.push(_('Control panel') => {:href => url_for({:controller => 'profile_editor', :profile => profile.identifier})}) + end %> + + <%= link_to( + content_tag('span','',:class => 'community-block-button icon-arrow'), + '#', + :onclick => "toggleSubmenu(this,'',#{j links.to_json}); return false;", + :class => 'simplemenu-trigger') %> + + <% end %> + + <% if logged_in? %> + <% if profile.members.include?(user) || profile.already_request_membership?(user) %> + <%= link_to( + content_tag('span', '', :class => 'community-block-button icon-remove'), + profile.leave_url) %> + <% else %> + <%= link_to( + content_tag('span', '', :class => 'community-block-button icon-add'), + profile.join_url) %> + <% end %> + <% else %> + <%= link_to( + content_tag('span', '', :class => 'community-block-button icon-add'), + profile.join_not_logged_url) %> + <% end %> + +

<%=profile.name%>

+
+
<%= profile.description %>
+
+
+
diff --git a/plugins/community_block/views/community_block.rhtml b/plugins/community_block/views/community_block.rhtml deleted file mode 100644 index 21ab18f..0000000 --- a/plugins/community_block/views/community_block.rhtml +++ /dev/null @@ -1,52 +0,0 @@ -
- -
-
- - <% - links = [] - - if logged_in? - - if profile.enable_contact? - links.push(_('Send an e-mail') => {:href => url_for({:controller => 'contact', :action => 'new', :profile => profile.identifier})}) - end - - links.push(_('Report abuse') => {:href => url_for({:controller => 'profile', :action => 'report_abuse', :profile => profile.identifier})}) - - if !user.nil? && user.has_permission?('edit_profile', profile) - links.push(_('Control panel') => {:href => url_for({:controller => 'profile_editor', :profile => profile.identifier})}) - end %> - - <%= link_to( - content_tag('span','',:class => 'community-block-button icon-arrow'), - '#', - :onclick => "toggleSubmenu(this,'',#{links.to_json}); return false;", - :class => 'simplemenu-trigger') %> - - <% end %> - - <% if logged_in? %> - <% if profile.members.include?(user) || profile.already_request_membership?(user) %> - <%= link_to( - content_tag('span', '', :class => 'community-block-button icon-remove'), - profile.leave_url) %> - <% else %> - <%= link_to( - content_tag('span', '', :class => 'community-block-button icon-add'), - profile.join_url) %> - <% end %> - <% else %> - <%= link_to( - content_tag('span', '', :class => 'community-block-button icon-add'), - profile.join_not_logged_url) %> - <% end %> - -

<%=profile.name%>

-
-
<%= profile.description %>
-
-
-
-- libgit2 0.21.2