Permalink
Browse files

adding ideas to group

  • Loading branch information...
1 parent 21c371a commit e5da10de9159043ab2abfb9ce1d835824cf2d3ca @timothyf committed Nov 19, 2010
Showing with 62 additions and 0 deletions.
  1. +62 −0 app/views/widgets/ideas_group.html.erb
View
62 app/views/widgets/ideas_group.html.erb
@@ -0,0 +1,62 @@
+<%#
+Copyright 2009 Timothy Fisher
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+%>
+<%
+ widget_title = "Ideas"
+
+ @group = Group.find(@group_id)
+ @ideas = @group.ideas
+%>
+
+<% content_for :module_header do %>
+ <div class="head_left">
+ <%= image_tag('link.png', :alt=>'events', :align=>'absmiddle')%>&nbsp;&nbsp;<%= widget_title %>
+ </div>
+ <div class="head_right">
+ <div id="expand_collapse_btn">
+ <a href="javascript:widget_change_display('<%= @widget_name %>')">
+ <img id="<%= @widget_name %>_collapse_img" src="images/collapse.png"/>
+ </a>
+ </div>
+ </div>
+ <div style="clear:both;"></div>
+<% end %>
+
+<% content_for :module_body do %>
+ <% for idea in @ideas %>
+ <div class="idea_brief">
+ <div class="idea_title"><%= link_to idea.title, idea.url %></div>
+ <div class="idea_poster">
+ Posted by <%= link_to idea.user.name, user_path(idea.user) %> at <%= idea.created_at.to_s(:basic) %>
+ </div>
+ </div>
+ <% end %>
+ <% if @ideas.length == 0 %>
+ No Ideas Exist!
+ <% end %>
+ <div style="clear:both;"></div>
+<% end %>
+
+<% content_for :module_footer do %>
+ <div class="foot_left">
+ <% if logged_in? %>
+ <%= link_to 'Add Idea', new_idea_path %>
+ <% end %>
+ </div>
+ <div class="foot_right">
+ <%= link_to 'View All', ideas_url %>
+ </div>
+ <div style="clear:both;"></div>
+<% end %>

0 comments on commit e5da10d

Please sign in to comment.