Permalink
Browse files

updates

  • Loading branch information...
1 parent bca19a5 commit 1fafef22ef47532412d70fcae178d5b35af1792e @timothyf committed Nov 19, 2010
@@ -86,6 +86,7 @@ def index
def show
@group = Group.find(params[:id])
+ @page = Page.find_by_name('group')
if @group
respond_to do |format|
format.html # show.html.erb
@@ -32,6 +32,7 @@ class WidgetsController < ApplicationController
# @name = the name of a widget to load
def render_widget
user_id = params[:user_id]
+ @group_id = params[:group_id]
layout_id = params[:widget_id]
@layout = WidgetLayout.find(layout_id)
@widget_name = params[:name]
@@ -1,48 +0,0 @@
-<%#
-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.
-%>
-<div class="module">
- <div class="module_head">Members</div>
- <div class="module_body">
- <% count = 0 %>
- <div style="float:left;clear:both;width:100%;">
- <% unless @group.users.empty? %>
- <% @group.users.each do |u| %>
- <% count = count + 1 %>
- <div class="member_widget_user">
- <% if u.profile_photo %>
- <%= link_to image_tag(u.profile_photo.public_filename(:small), :alt=>u.name), user_path(u.id) %>
- <% else %>
- <%= link_to '<div class="no_photo_members_widget"></div>', user_url(u.id) %>
- <% end %>
- </div>
- <% if count > 11 %>
- <% break %>
- <% end %>
- <% if count%3 == 0%>
- </div><div style="float:left;clear:both;margin-top:5px;width:100%;">
- <% end %>
- <% end %>
- </div>
- <div style="clear:both;"></div>
- <% else %>
- </div>
- <% end %>
- <% if @group.users.length == 0 %>
- No members in this group.
- <% end %>
- </div>
- <div class="module_foot"><%= link_to "View All (#{@group.users.length})", group_users_url(@group) %></div>
-</div>
@@ -1,5 +1,5 @@
<%#
-Copyright 2009 Timothy Fisher
+Copyright 2009-2010 Timothy Fisher
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,50 +14,55 @@ See the License for the specific language governing permissions and
limitations under the License.
%>
<%= stylesheet_link_tag 'groups' %>
-<%= stylesheet_link_tag 'common' %>
+<%= stylesheet_link_tag 'profile' %>
<% content_for :script_content do %>
<%= javascript_include_tag 'wall_posts' %>
<% end %>
-<div class="column_1">
- <span class="group_title"><%= @group.name %></span>
- <div class="module">
- <div class="module_head">
- Information
- <div class="head_links">
+<div class="group_title"><%= @group.name %></div>
+<div class="col1">
+ <div class="profile">
+ <div class="column_1">
+ <div class="module">
+ <div class="module_head">
+ Information
+ <div class="head_links">
+ </div>
+ </div>
+ <div class="module_body">
+ <div id="group_photo">
+ <% if (@group.profile_photo) %>
+ <%= image_tag(@group.profile_photo.public_filename()) %>
+ <% else %>
+ No Photo
+ <% end %>
+ </div>
+ <div id="group_description">
+ <%= @group.description %>
+ </div>
+ <div style="clear:both"></div>
+ </div>
</div>
+ <% if logged_in? && current_user.is_group_admin(@group) %>
+ <%= render :partial => 'group_admin_widget' %>
+ <% end %>
+ <div id="col_1_widgets"></div>
</div>
- <div class="module_body">
- <div id="group_photo">
- <% if (@group.profile_photo) %>
- <%= image_tag(@group.profile_photo.public_filename()) %>
- <% else %>
- No Photo
- <% end %>
- </div>
- <div id="group_description">
- <%= @group.description %>
+ <div class="column_2">
+ <%= render :partial => 'groups/announcements_widget' %>
+ <div class="module">
+ <% if logged_in? %>
+ <% unless @group.users.include?(current_user) %>
+ <% form_for(:membership, :url => memberships_path(:user_id => current_user.id, :group_id => @group.id)) do |f| %>
+ <%= submit_tag "Join Group" %>
+ <% end %>
+ <% end %>
+ <% end %>
</div>
- <div style="clear:both"></div>
+ <%= render :partial => 'shared/wall_posts_widget', :locals=>{:parent=>@group} %>
+ <div id="col_2_widgets"></div>
</div>
</div>
- <%= render :partial => 'groups/announcements_widget' %>
- <%= render :partial => 'shared/wall_posts_widget', :locals=>{:parent=>@group} %>
-</div>
-<div class="column_2">
- <div class="module">
- <% if logged_in? %>
- <% unless @group.users.include?(current_user) %>
- <% form_for(:membership, :url => memberships_path(:user_id => current_user.id, :group_id => @group.id)) do |f| %>
- <%= submit_tag "Join Group" %>
- <% end %>
- <% end %>
- <% end %>
- </div>
- <%= render :partial => 'members_widget' %>
- <% if logged_in? && current_user.is_group_admin(@group) %>
- <%= render :partial => 'group_admin_widget' %>
- <% end %>
</div>
@@ -21,4 +21,10 @@
<% else %>
var user_id = null;
<% end %>
+
+ <% if @group %>
+ var group_id = <%= @group.id %>;
+ <% else %>
+ var group_id = null;
+ <% end %>
</script>
@@ -1,5 +1,5 @@
<%#
-Copyright 2009 Timothy Fisher
+Copyright 2009-2010 Timothy Fisher
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
@@ -1,4 +1,6 @@
ActionController::Routing::Routes.draw do |map|
+ map.resources :documents
+
map.resources :nav_items
map.resources :ey_modules
map.resources :modules
@@ -98,6 +98,7 @@ EyWidget = function(id, name, content_id, col_num, properties, loadable) {
widget_id: this.id,
name: this.widget_name,
user_id: user_id,
+ group_id: group_id,
authenticity_token: authenticity_token
};
for (attr in this.properties) { content[attr] = this.properties[attr]; }
@@ -35,10 +35,6 @@
color:#FFFFFF;
}
-.column_2 {
- padding:0 5px;
-}
-
.input_field {
width: 300px;
}
@@ -586,6 +586,8 @@ a, a:visited {
font-weight: bold;
font-size: 16pt;
line-height: 1.4em;
+ width: 100%;
+ margin-bottom: 20px;
}
#status_post {
@@ -44,9 +44,6 @@ limitations under the License.
</div>
<div class="col2">
<%= render :partial => 'users/add_friend_widget' %>
- <% if current_user == @user %>
- <%= render :partial => 'messages/unread_messages_widget' %>
- <% end %>
<div id="col_3_widgets"></div>
</div>
<div style="clear:both;"></div>
@@ -13,15 +13,23 @@ 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 = "Latest Activity" %>
-
-<% if logged_in? && include_friends %>
- <% @user = User.find(current_user.id) %>
- <% activities = @user.friends_activity_stream %>
-<% else %>
- <% activities = Activity.find(:all, :limit=>8, :order=>'created_at DESC', :include=>[:user, :item]) %>
-<% end %>
-<% @activities = activities[0...8] %>
+<%
+ widget_title = "Latest Activity"
+ if params[:include_friends] && params[:include_friends] == 'true'
+ include_friends = true
+ end
+ if params[:only_statuses] && params[:only_statuses] == 'true'
+ only_statuses = true
+ end
+
+ if logged_in? && include_friends
+ @user = User.find(current_user.id)
+ activities = @user.friends_activity_stream
+ else
+ activities = Activity.find(:all, :limit=>8, :order=>'created_at DESC', :include=>[:user, :item])
+ end
+ @activities = activities[0...8]
+%>
<% content_for :module_body do %>
@@ -13,19 +13,20 @@ 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 = "Latest Activity" %>
-
-<% @user = User.find(user_id) %>
-<% if only_statuses && include_friends %>
- <% activities = @user.friends_status_activity_stream %>
-<% elsif include_friends %>
- <% activities = @user.friends_activity_stream %>
-<% elsif only_statuses %>
- <% activities = @user.status_activity_stream %>
-<% else %>
- <% activities = @user.activities %>
-<% end %>
-<% @activities = activities[0...8] %>
+<%
+ widget_title = "Latest Activity"
+ if params[:include_friends] && params[:include_friends] == 'true'
+ include_friends = true
+ end
+ if params[:only_statuses] && params[:only_statuses] == 'true'
+ only_statuses = true
+ end
+
+ @user = User.find(user_id)
+
+ activities = @user.activity_stream(only_statuses, include_friends)
+ @activities = activities[0...8]
+%>
<% content_for :module_body do %>
@@ -17,7 +17,7 @@
<div id="container">
<div id="header">
<div id="logo">
- <%= link_to @network.name + ' Admin', '/admin', {:class=>'logo'} %>
+ <%= link_to 'EngineY Admin', '/admin', {:class=>'logo'} %>
</div>
<div id="admin-details">
<% if current_user.profile_photo %>

0 comments on commit 1fafef2

Please sign in to comment.