Permalink
Browse files

changes

  • Loading branch information...
timothyf committed Jun 9, 2010
1 parent 6f7cb2f commit de8492718322f258457f9178292f146f9e060f01
@@ -452,8 +452,8 @@ def save_privacy
# Used to display the current Analytics code
def analytics_code
- if HtmlContent.find_by_content_id('analytics')
- @analytics = HtmlContent.find_by_content_id('analytics')
+ if HtmlContent.find_by_title('?analytics?')
+ @analytics = HtmlContent.find_by_title('?analytics?')
else
@analytics = HtmlContent.new
end
@@ -468,7 +468,7 @@ def save_analytics
else
analytics = HtmlContent.new
analytics.body = params[:analytics_text]
- analytics.content_id = 'analytics'
+ analytics.title = '?analytics?'
analytics.save
end
redirect_to :action => 'settings'
@@ -0,0 +1,85 @@
+class EyModulesController < ApplicationController
+ # GET /ey_modules
+ # GET /ey_modules.xml
+ def index
+ @ey_modules = EyModule.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @ey_modules }
+ end
+ end
+
+ # GET /ey_modules/1
+ # GET /ey_modules/1.xml
+ def show
+ @ey_module = EyModule.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @ey_module }
+ end
+ end
+
+ # GET /ey_modules/new
+ # GET /ey_modules/new.xml
+ def new
+ @ey_module = EyModule.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @ey_module }
+ end
+ end
+
+ # GET /ey_modules/1/edit
+ def edit
+ @ey_module = EyModule.find(params[:id])
+ end
+
+ # POST /ey_modules
+ # POST /ey_modules.xml
+ def create
+ @ey_module = EyModule.new(params[:ey_module])
+
+ respond_to do |format|
+ if @ey_module.save
+ flash[:notice] = 'EyModule was successfully created.'
+ format.html { redirect_to(@ey_module) }
+ format.xml { render :xml => @ey_module, :status => :created, :location => @ey_module }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @ey_module.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /ey_modules/1
+ # PUT /ey_modules/1.xml
+ def update
+ @ey_module = EyModule.find(params[:id])
+
+ respond_to do |format|
+ if @ey_module.update_attributes(params[:ey_module])
+ flash[:notice] = 'EyModule was successfully updated.'
+ format.html { redirect_to(@ey_module) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @ey_module.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /ey_modules/1
+ # DELETE /ey_modules/1.xml
+ def destroy
+ @ey_module = EyModule.find(params[:id])
+ @ey_module.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(ey_modules_url) }
+ format.xml { head :ok }
+ end
+ end
+end
@@ -76,8 +76,7 @@ def index
redirect_to :action => 'install'
else
@section = 'MAIN'
- @page_name = 'home'
- @page = Page.find_by_title('home')
+ @page = Page.find_by_name('home')
@photos = Photo.find(:all, :limit=>6,
:select=>'id, parent_id, filename',
:order => Photo.connection.adapter_name == 'PostgreSQL' ? 'RANDOM()' : 'RAND()',
@@ -192,7 +192,7 @@ def show
else
@section = 'MEMBERS'
end
- @page_name = 'profile'
+ @page = Page.find_by_name('profile')
if @user.twitter_id && @user.display_tweets
@tweets = @user.fetch_tweets
end
@@ -0,0 +1,2 @@
+module EyModulesHelper
+end
@@ -18,16 +18,16 @@ class Configuration
# The self.get method is not used yet..
- def self.get
- {
- :use_proxy => false,
- :proxy_host => '10.0.6.251',
- :proxy_port => '3128',
- :enable_self_registration => true,
- :max_tweets => 5,
- :enable_facebook_connect => false
- }
- end
+# def self.get
+# {
+# :use_proxy => false,
+# :proxy_host => '10.0.6.251',
+# :proxy_port => '3128',
+# :enable_self_registration => true,
+# :max_tweets => 5,
+# :enable_facebook_connect => false
+# }
+# end
# Sets the configuration (not used yet)
View
@@ -35,5 +35,6 @@
class Widget < ActiveRecord::Base
has_many :widget_layouts
+ belongs_to :ey_module
end
@@ -16,13 +16,15 @@
<thead>
<th width="50px">ID</th>
<th width="140px">Title</th>
+ <th width="140px">Name</th>
<th width="300px">Actions</th>
</thead>
<tbody>
<% @pages.each do |page| %>
<tr>
<td><%= page.id %></td>
<td><%= page.title %></td>
+ <td><%= page.name %></td>
<td>
<%= link_to 'Edit', '/admin/page_edit?id=' + page.id.to_s %> |
<%= link_to 'Delete', '/admin/page_delete?id=' + page.id.to_s, :confirm => 'Are you sure you want to delete this page?' %> |
@@ -65,7 +67,7 @@ page will determine the content for that page.<br/><br/>
<table id="layouts">
<thead>
<th width="50px">ID</th>
- <th width="100px">Page Title</th>
+ <th width="100px">Page Name</th>
<th width="140px">Widget Name</th>
<th width="70px">Col Num</th>
<th width="70px">Row Num</th>
@@ -77,7 +79,7 @@ page will determine the content for that page.<br/><br/>
<tr>
<td><%= layout.id %></td>
<% if layout.page %>
- <td><%= layout.page.title %></td>
+ <td><%= layout.page.name %></td>
<% else %>
<td>null</td>
<% end %>
@@ -1,46 +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 right_side_widget">
- <div class="module_head">
- <div class="head_left">
- <%= image_tag('calendar.png', :alt=>'events', :align=>'absmiddle')%>&nbsp;&nbsp;My Events
- </div>
- <div class="head_right">
- <div id="expand_collapse_btn">
- <a href="javascript:widget_change_display('my_events')">
- <img id="my_events_collapse_img" src="/images/collapse.png"/>
- </a>
- </div>
- </div>
- <div style="clear:both;"></div>
- </div>
- <div class="module_body" id="my_events_body">
- <% @user.events.each do |event| %>
- <div>
- <span class="event_name">
- <%= link_to event.name, event_url(event) %>
- </span><br/>
- <%= event.start_time.to_s(:event_brief) %><br/>
- <%= event.location %>
- </div>
- <% end %>
- <% if @user.events.length == 0 %>
- You have no events scheduled.<br/>
- <%= link_to 'View all events...', events_url() %>
- <% end %>
- <div style="clear:both;"></div>
- </div>
-</div>
@@ -1,52 +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 right_side_widget">
- <div class="module_head">
- <div class="head_left">
- <%= image_tag('user_comment.png', :alt=>'events', :align=>'absmiddle')%>&nbsp;&nbsp;My Forum Posts
- </div>
- <div class="head_right">
- <div id="expand_collapse_btn">
- <a href="javascript:widget_change_display('my_forum_posts')">
- <img id="my_forum_posts_collapse_img" src="/images/collapse.png"/>
- </a>
- </div>
- </div>
- <div style="clear:both;"></div>
- </div>
- <div class="module_body" id="my_forum_posts_body">
- <% if @user.forum_posts && @user.forum_posts.length > 0 %>
- <% @user.forum_posts[0..5].each do |post| %>
- <div class="blog_post_brief">
- <%= link_to post.title, forum_post_url(post) %><br/>
- by <%= post.user.name %><br/>
- on <%= post.created_at.to_s(:basic) %>
- </div>
- <% end %>
- <% else %>
- You have not made any posts.<br/>
- <%= link_to 'View forums...', events_url() %>
- <% end %>
- <div style="clear:both;"></div>
- </div>
- <div class="module_foot">
- <div class="foot_left"></div>
- <div class="foot_right">
- <%= link_to 'View All', user_forum_posts_url(@user) %>
- </div>
- <div style="clear:both;"></div>
- </div>
-</div>
@@ -36,5 +36,9 @@ limitations under the License.
<% end %>
<% else %>
- You have not added any friends. <%= link_to 'Find some now.', '/users' %>
+ <% if @user == current_user %>
+ You have not added any friends. <%= link_to 'Find some now.', '/users' %>
+ <% else %>
+ User has not added any friends.
+ <% end %>
<% end %>
@@ -1,60 +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">
- <%= render :partial=>'widgets/widget_header', :locals=>{:widget_title=>'Groups'} %>
- </div>
- <div class="module_body">
- <% count = 0 %>
- <% @groups.each do |group | %>
- <% count = count + 1 %>
- <% if (count == @groups.size) %>
- <div class="groups_widget_group last_child">
- <% else %>
- <div class="groups_widget_group">
- <% end %>
- <div class="groups_widget_photo">
- <% if group.profile_photo %>
- <%= link_to image_tag(group.profile_photo.public_filename(:small), :alt=>group.name), group_url(group) %>
- <% else %>
- <%= link_to 'No Photo', group_url(group) %>
- <% end %>
- </div>
- <div class="groups_widget_text">
- <span class="group_name">
- <%= link_to group.name, group_url(group) %>
- </span><br/>
- <%= group.users.size %> members
- </div>
- </div>
- <% end %>
- <% if @groups.length == 0 %>
- No groups exist!
- <% end %>
- <div style="clear:both;"></div>
- </div>
- <div class="module_foot">
- <div class="foot_left">
- <% if logged_in? %>
- <%= link_to 'Add Group', new_group_path %>
- <% end %>
- </div>
- <div class="foot_right">
- <%= link_to 'View All', groups_url %>
- </div>
- <div style="clear:both;"></div>
- </div>
-</div>
Oops, something went wrong.

0 comments on commit de84927

Please sign in to comment.