Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changes

  • Loading branch information...
commit 7e3b30c18700d64daabbab4452c9ffe5d72e6ff1 1 parent 064839f
@timothyf timothyf authored
Showing with 688 additions and 316 deletions.
  1. +35 −3 app/controllers/admin_controller.rb
  2. +2 −2 app/controllers/pages_controller.rb
  3. +1 −1  app/controllers/users_controller.rb
  4. +10 −0 app/helpers/application_helper.rb
  5. +43 −0 app/models/theme.rb
  6. +10 −0 app/views/admin/_header_nav.html.erb
  7. +36 −0 app/views/admin/contents.html.erb
  8. +78 −0 app/views/admin/modules.html.erb
  9. +0 −84 app/views/admin/pages.html.erb
  10. +13 −29 app/views/admin/themes/_theme.html.erb
  11. +22 −20 app/views/admin/themes/edit.html.erb
  12. +6 −0 app/views/admin/widget_form.html.erb
  13. +80 −0 app/views/layouts/1_col_layout.html.erb
  14. +83 −0 app/views/layouts/2_col_layout.html.erb
  15. +85 −0 app/views/layouts/3_col_layout.html.erb
  16. +1 −1  app/views/layouts/application.html.erb
  17. +0 −17 app/views/layouts/blog_post_topics.html.erb
  18. +0 −17 app/views/layouts/ey_modules.html.erb
  19. +4 −4 app/views/pages/_page_form.html.erb
  20. +34 −29 app/views/shared/_nav_menu.html.erb
  21. +29 −0 app/views/widgets/_widget_form.html.erb
  22. +1 −1  config/routes.rb
  23. +36 −36 lib/tasks/ruby_mi_populate.rake
  24. 0  public/images/{twitter_clone → themes/cms_site_sample}/preview.gif
  25. 0  public/images/{ → themes}/enginey.com/enginey_hdr.jpg
  26. 0  public/images/{ → themes}/enginey.com/preview.jpg
  27. 0  public/images/{ → themes/mycompany}/mycompany_header.jpg
  28. 0  public/images/{ → themes}/mycompany/preview.jpg
  29. BIN  public/images/themes/personal_blog/preview.gif
  30. 0  public/images/{ → themes}/rubymi/preview.jpg
  31. 0  public/images/{ → themes/rubymi}/rubymi_header2.jpg
  32. 0  public/images/{simple → themes/simple-jquery}/preview.jpg
  33. 0  public/images/{personal_blog → themes/simple}/preview.jpg
  34. BIN  public/images/themes/twitter_clone/preview.gif
  35. +34 −2 public/stylesheets/new_admin.css
  36. +1 −1  public/stylesheets/themes/enginey.com/style.css
  37. +1 −1  public/stylesheets/themes/mycompany/mycompany.css
  38. +1 −1  public/stylesheets/themes/rubymi/rubymi.css
  39. +34 −29 themes/mycompany/views/shared/_nav_menu.html.erb
  40. +4 −2 themes/simple-jquery/views/layouts/application.html.erb
  41. +0 −17 themes/simple-jquery/views/layouts/ideas.html.erb
  42. +4 −2 themes/simple/views/layouts/application.html.erb
  43. +0 −17 themes/simple/views/layouts/ideas.html.erb
View
38 app/controllers/admin_controller.rb
@@ -46,12 +46,23 @@ def photos
end
- def pages
- @page = 'pages'
+ def contents
+ @page = 'contents'
+ @html_contents = HtmlContent.find(:all)
+ end
+
+
+ def modules
+ @page = 'modules'
@widgets = Widget.find(:all)
@layouts = WidgetLayout.find(:all)
@pages = Page.find(:all)
- @html_contents = HtmlContent.find(:all)
+ end
+
+
+ def pages
+ @page = 'pages'
+ @pages = Page.find(:all)
end
@@ -249,6 +260,27 @@ def content_edit
end
+ def content_delete
+
+ end
+
+
+ def widget_new
+ @widget = Widget.new
+ render 'widget_form'
+ end
+
+
+ def widget_edit
+
+ end
+
+
+ def widget_delete
+
+ end
+
+
def layout_new
@widget_layout = WidgetLayout.new
render 'widget_layout_form'
View
4 app/controllers/pages_controller.rb
@@ -15,8 +15,8 @@
class PagesController < ApplicationController
def show
- @page = Page.find_by_title(params[:title])
- @page_name = @page.title
+ @page = Page.find_by_name(params[:name])
+ @page_name = @page.name
if current_user
@user = current_user
end
View
2  app/controllers/users_controller.rb
@@ -188,7 +188,7 @@ def show
respond_to do |format|
format.html {
if (current_user && (current_user.id.to_s == params[:id].to_s))
- @section = 'profile'
+ @section = 'PROFILE'
else
@section = 'MEMBERS'
end
View
10 app/helpers/application_helper.rb
@@ -17,6 +17,16 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
+ # if the user is currently logged in as an admin or creator return true
+ def logged_in_as_admin?
+ if logged_in? && (current_user.roles.include?(Role.creator) || current_user.roles.include?(Role.admin))
+ return true
+ else
+ return false
+ end
+ end
+
+
def display_widget(widget)
if widget.protected == false || logged_in?
render :partial => widget.path, :locals => {:widget=>widget}
View
43 app/models/theme.rb
@@ -0,0 +1,43 @@
+class Theme < ActiveRecord::Base
+
+ def locales
+ Dir[ File.join(RAILS_ROOT, 'themes', self.name, 'locales', '*.{rb,yml}') ]
+ end
+
+ # This method will iterate through all available themes in the theme directory
+ # and then return an array of all themes as well as the currently selected theme
+ # as a hash in the format:
+ # {:name => theme_name, :preview_image => image, :description => description}
+ # This can then be used by the view layer to show the user a list of available themes
+ # along with a preview image.
+ def self.available_themes(selected_theme)
+ themes = []
+ theme_path = File.join(RAILS_ROOT, Disguise::Config.theme_path)
+ current_theme = nil
+
+ Dir.glob("#{theme_path}/*").each do |theme_directory|
+ if File.directory?(theme_directory)
+ theme_name = File.basename(theme_directory)
+
+ image = Dir.glob(File.join(RAILS_ROOT, 'public', 'images/themes', theme_name, 'preview.*')).first || File.join('/', 'images', 'no_preview.gif')
+ image = image.gsub(File.join(RAILS_ROOT, 'public'), '')
+
+ description = ''
+ description_file = File.join(theme_directory, 'description.txt')
+ if File.exist?(description_file)
+ f = File.new(description_file, "r")
+ description = f.read
+ f.close
+ end
+
+ theme = {:name => theme_name, :preview_image => image, :description => description}
+ themes << theme
+
+ current_theme = theme if selected_theme.name == theme_name
+ end
+ end
+
+ [current_theme, themes]
+ end
+
+end
View
10 app/views/admin/_header_nav.html.erb
@@ -29,6 +29,16 @@
<% else %>
<li><a href="/admin/forums">Forums</a></li>
<% end %>
+ <% if @page == 'contents' %>
+ <li><a href="/admin/contents" class="active">Content</a></li>
+ <% else %>
+ <li><a href="/admin/contents">Content</a></li>
+ <% end %>
+ <% if @page == 'modules' %>
+ <li><a href="/admin/modules" class="active">Modules</a></li>
+ <% else %>
+ <li><a href="/admin/modules">Modules</a></li>
+ <% end %>
<% if @page == 'pages' %>
<li><a href="/admin/pages" class="active">Pages</a></li>
<% else %>
View
36 app/views/admin/contents.html.erb
@@ -0,0 +1,36 @@
+<style>
+ table#pages th, table#pages td, table#widgets th, table#widgets td,
+ table#layouts th, table#layouts td,
+ table#contents th, table#contents td {
+ text-align: left;
+ }
+
+ #content {
+ width: 900px;
+ }
+</style>
+
+<h2 class="ic-db">Managed Content</h2>
+<%= link_to 'Add Content', '/admin/content_new' %>
+<table id="contents">
+ <thead>
+ <th width="50px">ID</th>
+ <th width="100px">Title</th>
+ <th width="300px">Actions</th>
+ </thead>
+ <tbody>
+ <% @html_contents.each do |content| %>
+ <tr>
+ <td><%= content.id %></td>
+ <td><%= content.title %></td>
+ <td>
+ <%= link_to 'Edit', '/admin/content_edit?id=' + content.id.to_s %> |
+ <%= link_to 'Delete', '/admin/content_delete?id=' + content.id.to_s, :confirm => 'Are you sure you want to delete this content?' %> |
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+<% if @html_contents.length == 0 %>
+ No HTML Contents have been created.
+<% end %>
View
78 app/views/admin/modules.html.erb
@@ -0,0 +1,78 @@
+<style>
+ table#pages th, table#pages td, table#widgets th, table#widgets td,
+ table#layouts th, table#layouts td,
+ table#contents th, table#contents td {
+ text-align: left;
+ }
+
+ #content {
+ width: 900px;
+ }
+</style>
+
+
+<h2 class="ic-db">Widgets</h2>
+<%= link_to 'Add Widget', '/admin/widget_new' %>
+<table id="widgets">
+ <thead>
+ <th width="50px">ID</th>
+ <th width="160px">Name</th>
+ <th width="100px">Title</th>
+ <th width="100px">Module</th>
+ <th width="300px">Actions</th>
+ </thead>
+ <tbody>
+ <% @widgets.each do |widget| %>
+ <tr>
+ <td><%= widget.id %></td>
+ <td><%= widget.name %></td>
+ <td><%= widget.title %></td>
+ <td><%= widget.ey_module.name %></td>
+ <td>
+ <%= link_to 'Edit', '/admin/widget_edit?id=' + widget.id.to_s %> |
+ <%= link_to 'Delete', '/admin/widget_delete?id=' + widget.id.to_s, :confirm => 'Are you sure you want to delete this widget?' %> |
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+
+<h2 class="ic-db">Layouts</h2>
+Layouts place widgets into specific positions on a page. Selecting all the layouts for a particular
+page will determine the content for that page.<br/><br/>
+<%= link_to 'Add Layout', '/admin/layout_new' %>
+<table id="layouts">
+ <thead>
+ <th width="50px">ID</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>
+ <th width="100px">HTML Content</th>
+ <th width="300px">Actions</th>
+ </thead>
+ <tbody>
+ <% @layouts.each do |layout| %>
+ <tr>
+ <td><%= layout.id %></td>
+ <% if layout.page %>
+ <td><%= layout.page.name %></td>
+ <% else %>
+ <td>null</td>
+ <% end %>
+ <td><%= layout.widget.name %></td>
+ <td><%= layout.col_num %></td>
+ <td><%= layout.row_num %></td>
+ <% if layout.html_content %>
+ <td><%= link_to layout.html_content.title, '' %></td>
+ <% else %>
+ <td></td>
+ <% end %>
+ <td>
+ <%= link_to 'Edit', '/admin/layout_edit?id=' + layout.id.to_s %> |
+ <%= link_to 'Delete', '/admin/layout_delete?id=' + layout.id.to_s, :confirm => 'Are you sure you want to delete this layout?' %> |
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
View
84 app/views/admin/pages.html.erb
@@ -36,87 +36,3 @@
</table>
-<h2 class="ic-db">Widgets</h2>
-<%= link_to 'Add Widget', '/admin/widget_new' %>
-<table id="widgets">
- <thead>
- <th width="50px">ID</th>
- <th width="160px">Name</th>
- <th width="100px">Title</th>
- <th width="300px">Actions</th>
- </thead>
- <tbody>
- <% @widgets.each do |widget| %>
- <tr>
- <td><%= widget.id %></td>
- <td><%= widget.name %></td>
- <td><%= widget.title %></td>
- <td>
- <%= link_to 'Edit', '/admin/widget_edit?id=' + widget.id.to_s %> |
- <%= link_to 'Delete', '/admin/widget_delete?id=' + widget.id.to_s, :confirm => 'Are you sure you want to delete this widget?' %> |
- </td>
- </tr>
- <% end %>
- </tbody>
-</table>
-
-<h2 class="ic-db">Layouts</h2>
-Layouts place widgets into specific positions on a page. Selecting all the layouts for a particular
-page will determine the content for that page.<br/><br/>
-<%= link_to 'Add Layout', '/admin/layout_new' %>
-<table id="layouts">
- <thead>
- <th width="50px">ID</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>
- <th width="75px">HTML Content ID</th>
- <th width="300px">Actions</th>
- </thead>
- <tbody>
- <% @layouts.each do |layout| %>
- <tr>
- <td><%= layout.id %></td>
- <% if layout.page %>
- <td><%= layout.page.name %></td>
- <% else %>
- <td>null</td>
- <% end %>
- <td><%= layout.widget.name %></td>
- <td><%= layout.col_num %></td>
- <td><%= layout.row_num %></td>
- <td><%= layout.html_content_id %></td>
- <td>
- <%= link_to 'Edit', '/admin/layout_edit?id=' + layout.id.to_s %> |
- <%= link_to 'Delete', '/admin/layout_delete?id=' + layout.id.to_s, :confirm => 'Are you sure you want to delete this layout?' %> |
- </td>
- </tr>
- <% end %>
- </tbody>
-</table>
-
-<h2 class="ic-db">Contents</h2>
-<%= link_to 'Add Content', '/admin/content_new' %>
-<table id="contents">
- <thead>
- <th width="50px">ID</th>
- <th width="100px">Title</th>
- <th width="300px">Actions</th>
- </thead>
- <tbody>
- <% @html_contents.each do |content| %>
- <tr>
- <td><%= content.id %></td>
- <td><%= content.title %></td>
- <td>
- <%= link_to 'Edit', '/admin/content_edit?id=' + content.id.to_s %> |
- <%= link_to 'Delete', '/admin/content_delete?id=' + content.id.to_s, :confirm => 'Are you sure you want to delete this content?' %> |
- </td>
- </tr>
- <% end %>
- </tbody>
-</table>
-<% if @html_contents.length == 0 %>
- No HTML Contents have been created.
-<% end %>
View
42 app/views/admin/themes/_theme.html.erb
@@ -1,31 +1,15 @@
-<div class="theme-block box">
- <h3><%= theme[:name] %></h3>
- <% form_for @theme, :url => admin_theme_path, :html => { :method => :put } do |f| -%>
- <%= f.hidden_field :name, :value => theme[:name] %>
- <%= image_submit_tag theme[:preview_image], :id => "#{theme[:name].parameterize}", :name => "#{theme[:name].parameterize}" %>
- <%= theme[:description] %>
- <% end -%>
- <% if DomainTheme.use_domain_themes? -%>
- <% domain_theme = DomainTheme.new(:name => theme[:name]) %>
- <% form_for [:admin, domain_theme] do |f| -%>
- <%= f.hidden_field :name %>
- <%= f.label t('disguise.theme_uri_label') %>
- <%= f.text_field :uri %>
- <%= submit_tag t('disguise.add_uri') %>
- <% end -%>
- <% end -%>
- <% if !@domain_themes[theme[:name]].blank? %>
- <p class="theme-information"><%= t('disguise.uris_title') %></p>
- <ul class="theme-list">
- <% @domain_themes[theme[:name]].each do |domain_theme| -%>
- <li>
- <% form_for [:admin, domain_theme], :html => { :method => :delete } do |f| -%>
- <%= domain_theme.uri %>
- <%= submit_tag t('disguise.delete_uri') %>
- <% end -%>
- </li>
- <% end -%>
- </ul>
- <% end -%>
+<div class="theme-block">
+ <% form_for @theme, :url => admin_theme_path, :html => { :method => :put } do |f| -%>
+ <%= f.hidden_field :name, :value => theme[:name] %>
+ <div class="theme_info">
+ <span class="theme_name"><%= theme[:name] %></span><br/>
+ <%= theme[:description] %>
+ </div>
+ <div class="theme_image">
+ <%= image_submit_tag theme[:preview_image],
+ :id => "#{theme[:name].parameterize}",
+ :name => "#{theme[:name].parameterize}" %>
+ </div>
+ <% end -%>
</div>
View
42 app/views/admin/themes/edit.html.erb
@@ -1,20 +1,22 @@
-<h1><%= t('disguise.set_theme') %></h1>
-<div id="current-theme">
- <% if DomainTheme.use_domain_themes? -%>
- <h2><%= t('disguise.use_domain_themes') %></h2>
- <% else -%>
- <h2><%= t('disguise.name_theme') %></h2>
- <% if @current_theme -%>
- <%= render :partial => 'admin/themes/theme', :object => @current_theme %>
- <% form_for @theme, :url => admin_theme_path, :html => { :method => :put } do |f| -%>
- <%= f.hidden_field :name, :value => '' %>
- <%= submit_tag t('disguise.remove_all_themes'), :id => 'remove_all_themes', :name => 'remove_all_themes' %>
- <% end -%>
- <% else -%>
- <%= t('disguise.no_current_theme') %>
- <% end -%>
- <h2><%= t('disguise.activate_theme_message') %></h2>
- <% end -%>
-</div>
-<%= error_messages_for :theme %>
-<%= render :partial => 'admin/themes/theme', :collection => @themes %>
+<div class="admin_tab_content">
+ <h1>Set Theme</h1>
+ <div id="current_theme">
+ <h2>Current Theme</h2>
+ <% if @current_theme -%>
+ <%= render :partial => 'admin/themes/theme', :object => @current_theme %>
+ <% form_for @theme, :url => admin_theme_path, :html => { :method => :put } do |f| -%>
+ <%= f.hidden_field :name, :value => '' %>
+ <%= submit_tag 'Remove theme and use default templates',
+ :id => 'remove_all_themes',
+ :name => 'remove_all_themes' %>
+ <% end -%>
+ <% else -%>
+ Currently no theme has been selected for this application and so the default application view will be used.
+ <% end -%>
+ </div>
+ <div id="select_theme">
+ <h2>Click on a theme to activate it</h2>
+ <%= error_messages_for :theme %>
+ <%= render :partial => 'admin/themes/theme', :collection => @themes %>
+ </div>
+</div>
View
6 app/views/admin/widget_form.html.erb
@@ -0,0 +1,6 @@
+
+
+<div id="add_widget">
+ <h1>Edit Widget</h1>
+ <%= render :partial=>'/widgets/widget_form', :locals => {:admin_page => true} %>
+</div>
View
80 app/views/layouts/1_col_layout.html.erb
@@ -0,0 +1,80 @@
+<%#
+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.
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><%= @network.name %></title>
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <%= stylesheet_link_tag 'style' %>
+
+ <%= stylesheet_link_tag '../javascripts/dojo/dijit/themes/tundra/tundra.css' %>
+ <%= stylesheet_link_tag '../javascripts/dojo/dojox/grid/resources/Grid.css' %>
+ <%= stylesheet_link_tag '../javascripts/dojo/dojox/grid/resources/tundraGrid.css' %>
+
+
+
+ <script type="text/javascript" src="/javascripts/dojo/release/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
+ <script type="text/javascript" src="/javascripts/dojo/release/dojo/dojo/mydojo.js"></script>
+
+ <%= javascript_include_tag "widget" %>
+
+ <%= render 'layouts/widgets' %>
+
+ <%= javascript_include_tag "slide_show" %>
+
+ <%= yield :script_content %>
+
+ <%= javascript_include_tag "application" %>
+
+ <script type="text/javascript">
+ var authenticity_token = "<%= form_authenticity_token %>";
+ </script>
+
+ <%= include_tiny_mce_if_needed %>
+
+ <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
+
+</head>
+
+<body>
+<% if Configuration.ENABLE_FACEBOOK_CONNECT %>
+ <%= fb_connect_javascript_tag %>
+ <%= init_fb_connect('XFBML', :js => :dojo) %>
+<% end %>
+ <div id="content">
+ <div id="header">
+ <div id="masthead"></div>
+ <%= render :partial => 'shared/nav_menu' %>
+ </div>
+ <div id="main">
+ <div class="col1">
+ <%= yield :col1_content %>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <div id="footer">
+ <%= render :partial => 'shared/footer' %>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <%= render '/layouts/analytics' %>
+</body>
+
+</html>
+
View
83 app/views/layouts/2_col_layout.html.erb
@@ -0,0 +1,83 @@
+<%#
+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.
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><%= @network.name %></title>
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <%= stylesheet_link_tag 'style' %>
+
+ <%= stylesheet_link_tag '../javascripts/dojo/dijit/themes/tundra/tundra.css' %>
+ <%= stylesheet_link_tag '../javascripts/dojo/dojox/grid/resources/Grid.css' %>
+ <%= stylesheet_link_tag '../javascripts/dojo/dojox/grid/resources/tundraGrid.css' %>
+
+
+
+ <script type="text/javascript" src="/javascripts/dojo/release/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
+ <script type="text/javascript" src="/javascripts/dojo/release/dojo/dojo/mydojo.js"></script>
+
+ <%= javascript_include_tag "widget" %>
+
+ <%= render 'layouts/widgets' %>
+
+ <%= javascript_include_tag "slide_show" %>
+
+ <%= yield :script_content %>
+
+ <%= javascript_include_tag "application" %>
+
+ <script type="text/javascript">
+ var authenticity_token = "<%= form_authenticity_token %>";
+ </script>
+
+ <%= include_tiny_mce_if_needed %>
+
+ <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
+
+</head>
+
+<body>
+<% if Configuration.ENABLE_FACEBOOK_CONNECT %>
+ <%= fb_connect_javascript_tag %>
+ <%= init_fb_connect('XFBML', :js => :dojo) %>
+<% end %>
+ <div id="content">
+ <div id="header">
+ <div id="masthead"></div>
+ <%= render :partial => 'shared/nav_menu' %>
+ </div>
+ <div id="main">
+ <div class="col1">
+ <%= yield :col1_content %>
+ </div>
+ <div class="col2">
+ <%= yield :col2_content %>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <div id="footer">
+ <%= render :partial => 'shared/footer' %>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <%= render '/layouts/analytics' %>
+</body>
+
+</html>
+
View
85 app/views/layouts/3_col_layout.html.erb
@@ -0,0 +1,85 @@
+<%#
+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.
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><%= @network.name %></title>
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <%= stylesheet_link_tag 'style' %>
+
+ <%= stylesheet_link_tag '../javascripts/dojo/dijit/themes/tundra/tundra.css' %>
+ <%= stylesheet_link_tag '../javascripts/dojo/dojox/grid/resources/Grid.css' %>
+ <%= stylesheet_link_tag '../javascripts/dojo/dojox/grid/resources/tundraGrid.css' %>
+
+
+
+ <script type="text/javascript" src="/javascripts/dojo/release/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
+ <script type="text/javascript" src="/javascripts/dojo/release/dojo/dojo/mydojo.js"></script>
+
+ <%= javascript_include_tag "widget" %>
+
+ <%= render 'layouts/widgets' %>
+
+ <%= javascript_include_tag "slide_show" %>
+
+ <%= yield :script_content %>
+
+ <%= javascript_include_tag "application" %>
+
+ <script type="text/javascript">
+ var authenticity_token = "<%= form_authenticity_token %>";
+ </script>
+
+ <%= include_tiny_mce_if_needed %>
+
+ <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
+
+</head>
+
+<body>
+<% if Configuration.ENABLE_FACEBOOK_CONNECT %>
+ <%= fb_connect_javascript_tag %>
+ <%= init_fb_connect('XFBML', :js => :dojo) %>
+<% end %>
+ <div id="content">
+ <div id="header">
+ <div id="masthead"></div>
+ <%= render :partial => 'shared/nav_menu' %>
+ </div>
+ <div id="main">
+ <div class="col1">
+ <%= yield :col1_content %>
+ </div>
+ <div class="col2">
+ <%= yield :col2_content %>
+ </div>
+ <div class="col3">
+ <%= yield :col3_content %>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <div id="footer">
+ <%= render :partial => 'shared/footer' %>
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+ <%= render '/layouts/analytics' %>
+</body>
+
+</html>
View
2  app/views/layouts/application.html.erb
@@ -63,7 +63,7 @@ limitations under the License.
<%= render :partial => 'shared/nav_menu' %>
</div>
<div id="main">
- <% if @section == 'MAIN' || @section == 'profile' || (@section == 'MEMBERS' && @user != nil)%>
+ <% if @section == 'MAIN' || @section == 'PROFILE' || (@section == 'MEMBERS' && @user != nil)%>
<%= yield %>
<% else %>
<div class="col1">
View
17 app/views/layouts/blog_post_topics.html.erb
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>BlogPostTopics: <%= controller.action_name %></title>
- <%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= yield %>
-
-</body>
-</html>
View
17 app/views/layouts/ey_modules.html.erb
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>EyModules: <%= controller.action_name %></title>
- <%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= yield %>
-
-</body>
-</html>
View
8 app/views/pages/_page_form.html.erb
@@ -4,6 +4,10 @@
<input type="hidden" name="admin_page" value="1" />
<% end %>
<div class="form_field">
+ <label for="name">Name:</label><br/>
+ <%= f.text_field :name, :class=>'input_field' %>
+ </div>
+ <div class="form_field">
<label for="title">Title:</label><br/>
<%= f.text_field :title, :class=>'input_field' %>
</div>
@@ -12,10 +16,6 @@
<%= f.text_field :permalink, :class=>'input_field' %>
</div>
<div class="form_field">
- <label for="name">Name:</label><br/>
- <%= f.text_field :name, :class=>'input_field' %>
- </div>
- <div class="form_field">
<%= f.submit "Save", :class=>'add_button' %>
</div>
<% end %>
View
63 app/views/shared/_nav_menu.html.erb
@@ -16,46 +16,49 @@ limitations under the License.
<%
# These are the items displayed in the top navigation bar
+# if restricted = true, this means that the item requires a logged in user
+# and the logged in user's id will be appended to the index_url
def nav_menu_items
[
- {'name'=>'members','title'=>'Members', 'index_url'=>'users'},
- {'name'=>'blogs','title'=>'Blogs', 'index_url'=>'blog_posts'},
- {'name'=>'groups','title'=>'Groups', 'index_url'=>'groups'},
- {'name'=>'events','title'=>'Events', 'index_url'=>'events'},
- {'name'=>'photos','title'=>'Photos', 'index_url'=>'photo_manager'},
- #{'name'=>'classifieds','title'=>'Classifieds', 'index_url'=>'classifieds'},
- {'name'=>'forum','title'=>'Forum', 'index_url'=>'forum_topics'}
+ {'name'=>'main','title'=>'Home', 'index_url'=>'/', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'profile','title'=>'My Page', 'index_url'=>"/users", 'restricted'=>'true', 'roles'=>''},
+ {'name'=>'members','title'=>'Members', 'index_url'=>'/users', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'blogs','title'=>'Blogs', 'index_url'=>'/blog_posts', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'groups','title'=>'Groups', 'index_url'=>'/groups', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'events','title'=>'Events', 'index_url'=>'/events', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'photos','title'=>'Photos', 'index_url'=>'/photo_manager', 'restricted'=>'false', 'roles'=>''},
+ #{'name'=>'classifieds','title'=>'Classifieds', 'index_url'=>'/classifieds', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'forum','title'=>'Forum', 'index_url'=>'/forum_topics', 'restricted'=>'false', 'roles'=>''}
]
end
%>
<div id="navigation">
- <ul id="nav_list">
- <% if @section == 'MAIN' %>
- <li id="current_menu" class="nav_list_item current_menu"><%= link_to 'Main', root_url, :class=>'nav_list_link' %></li>
- <% else %>
- <li class="nav_list_item"><%= link_to 'Main', root_url, :class=>'nav_list_link' %></li>
- <% end %>
- <% if logged_in? %>
- <% if @section == 'profile' %>
- <li id="current_menu" class="nav_list_item current_menu"><%= link_to 'My Page', user_path(current_user), :class=>'nav_list_link' %></li>
- <% else %>
- <% if (current_user) %>
- <li class="nav_list_item"><%= link_to 'My Page', user_path(current_user), :class=>'nav_list_link' %></li>
+ <ul id="nav_list">
+ <% nav_menu_items.each do |item| %>
+ <% if item['restricted'] == 'false' || logged_in? %>
+ <% if @section == item['name'].upcase %>
+ <li id="current_menu" class="nav_list_item current_menu">
+ <% if item['restricted'] == 'true' && logged_in? %>
+ <%= link_to item['title'], item['index_url'] + "/#{current_user.id}", :class=>'nav_list_link' %>
+ <% else %>
+ <%= link_to item['title'], item['index_url'], :class=>'nav_list_link' %>
+ <% end %>
+ </li>
<% else %>
- <li class="nav_list_item"><%= link_to 'My Page', root_url, :class=>'nav_list_link' %></li>
+ <% if item['restricted'] == 'true' && logged_in? %>
+ <li class="nav_list_item">
+ <%= link_to item['title'], item['index_url'] + "/#{current_user.id}", :class=>'nav_list_link' %>
+ </li>
+ <% else %>
+ <li class="nav_list_item">
+ <%= link_to item['title'], item['index_url'], :class=>'nav_list_link' %>
+ </li>
+ <% end %>
<% end %>
<% end %>
- <% end %>
-
- <% nav_menu_items.each do |item| %>
- <% if @section == item['name'].upcase %>
- <li id="current_menu" class="nav_list_item current_menu"><%= link_to item['title'], '/'+ item['index_url'], :class=>'nav_list_link' %></li>
- <% else %>
- <li class="nav_list_item"><%= link_to item['title'], '/'+ item['index_url'], :class=>'nav_list_link' %></li>
- <% end %>
<% end %>
- <% if logged_in? && current_user.roles.include?(Role.creator) %>
+ <% if logged_in_as_admin? %>
<% if @section == 'MANAGE' %>
<li id="current_menu" class="nav_list_item current_menu"><%= link_to 'Manage', { :controller=>'admin'}, :class=>'nav_list_link' %></li>
<% else %>
@@ -63,6 +66,7 @@ end
<% end %>
<% end %>
</ul>
+<!--
<ul id="nav_list_right" style="float:right;">
<% if @section == 'BUG' %>
<li class="nav_list_item current_menu" id="current_menu"><%= link_to 'Report a Bug', bug_reports_url, :class=>'nav_list_link' %></li>
@@ -70,5 +74,6 @@ end
<li class="nav_list_item"><%= link_to 'Report a Bug', bug_reports_url, :class=>'nav_list_link' %></li>
<% end %>
</ul>
+-->
<div style="clear:both;"></div>
</div>
View
29 app/views/widgets/_widget_form.html.erb
@@ -0,0 +1,29 @@
+<% form_for(@widget) do |f| -%>
+ <%= f.error_messages %>
+ <% if defined? admin_page %>
+ <input type="hidden" name="admin_page" value="1" />
+ <% end %>
+ <div class="form_field">
+ <label for="title">Name:</label><br/>
+ <%= f.text_field :title, :class=>'input_field' %>
+ </div>
+ <div class="form_field">
+ <label for="title">Title:</label><br/>
+ <%= f.text_field :title, :class=>'input_field' %>
+ </div>
+ <div class="form_field">
+ <label for="title">Module:</label><br/>
+ <%= f.text_field :title, :class=>'input_field' %>
+ </div>
+ <div class="form_field">
+ <label for="title">Description:</label><br/>
+ <%= f.text_field :title, :class=>'input_field' %>
+ </div>
+ <div class="form_field">
+ <label for="title">Profile:</label><br/>
+ <%= f.text_field :title, :class=>'input_field' %>
+ </div>
+ <div class="form_field">
+ <%= f.submit "Save", :class=>'add_button' %>
+ </div>
+<% end %>
View
2  config/routes.rb
@@ -110,7 +110,7 @@
a.resources :domain_themes
end
- map.connect 'pages/show/:title', :controller => 'pages', :action => 'show'
+ map.connect 'pages/show/:name', :controller => 'pages', :action => 'show'
map.resources :pages
View
72 lib/tasks/ruby_mi_populate.rake
@@ -350,55 +350,55 @@ namespace :railsnet do
##########################################################################
# Create Modules and widgets
puts 'Creating modules and widgets...'
- mod_id = EyModule.create(:name => 'blog_posts')
- Widget.create(:ey_module_id => mod_id, :name => 'blog_posts_home', :description => 'Display recent blog posts', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'blog_posts_profile', :description => 'Display users blog posts', :profile => true)
+ mod = EyModule.create(:name => 'blog_posts')
+ Widget.create(:ey_module_id => mod.id, :name => 'blog_posts_home', :description => 'Display recent blog posts', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'blog_posts_profile', :description => 'Display users blog posts', :profile => true)
- mod_id = EyModule.create(:name => 'members')
- Widget.create(:ey_module_id => mod_id, :name => 'members_home', :description => 'Display some members', :profile => false)
+ mod = EyModule.create(:name => 'members')
+ Widget.create(:ey_module_id => mod.id, :name => 'members_home', :description => 'Display some members', :profile => false)
- mod_id = EyModule.create(:name => 'groups')
- Widget.create(:ey_module_id => mod_id, :name => 'groups_home', :description => 'Display some groups', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'groups_profile', :description => 'Display users groups', :profile => true)
+ mod = EyModule.create(:name => 'groups')
+ Widget.create(:ey_module_id => mod.id, :name => 'groups_home', :description => 'Display some groups', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'groups_profile', :description => 'Display users groups', :profile => true)
- mod_id = EyModule.create(:name => 'events')
- Widget.create(:ey_module_id => mod_id, :name => 'events_home', :description => 'Display upcoming events', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'events_profile', :description => 'Display users events', :profile => true)
+ mod = EyModule.create(:name => 'events')
+ Widget.create(:ey_module_id => mod.id, :name => 'events_home', :description => 'Display upcoming events', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'events_profile', :description => 'Display users events', :profile => true)
- mod_id = EyModule.create(:name => 'announcements')
- Widget.create(:ey_module_id => mod_id, :name => 'announcements_home', :description => 'Display recent announcements', :profile => false)
+ mod = EyModule.create(:name => 'announcements')
+ Widget.create(:ey_module_id => mod.id, :name => 'announcements_home', :description => 'Display recent announcements', :profile => false)
- mod_id = EyModule.create(:name => 'activity_feed')
- Widget.create(:ey_module_id => mod_id, :name => 'activity_feed_home', :description => 'Display recent activities', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'activity_feed_profile', :description => 'Display users activities', :profile => true)
+ mod = EyModule.create(:name => 'activity_feed')
+ Widget.create(:ey_module_id => mod.id, :name => 'activity_feed_home', :description => 'Display recent activities', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'activity_feed_profile', :description => 'Display users activities', :profile => true)
- mod_id = EyModule.create(:name => 'links')
- Widget.create(:ey_module_id => mod_id, :name => 'links_home', :description => 'Display some links', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'links_profile', :description => 'Display users links', :profile => true)
+ mod = EyModule.create(:name => 'links')
+ Widget.create(:ey_module_id => mod.id, :name => 'links_home', :description => 'Display some links', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'links_profile', :description => 'Display users links', :profile => true)
- mod_id = EyModule.create(:name => 'projects')
- Widget.create(:ey_module_id => mod_id, :name => 'projects_home', :description => 'Display some projects', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'projects_profile', :description => 'Display users projects', :profile => true)
+ mod = EyModule.create(:name => 'projects')
+ Widget.create(:ey_module_id => mod.id, :name => 'projects_home', :description => 'Display some projects', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'projects_profile', :description => 'Display users projects', :profile => true)
- mod_id = EyModule.create(:name => 'job_posts')
- Widget.create(:ey_module_id => mod_id, :name => 'job_posts_home', :description => 'Display recent job posts', :profile => false)
+ mod = EyModule.create(:name => 'job_posts')
+ Widget.create(:ey_module_id => mod.id, :name => 'job_posts_home', :description => 'Display recent job posts', :profile => false)
- mod_id = EyModule.create(:name => 'forum_posts')
- Widget.create(:ey_module_id => mod_id, :name => 'forum_posts_home', :description => 'Display recent forum posts', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'forum_posts_profile', :description => 'Display users forum posts', :profile => true)
+ mod = EyModule.create(:name => 'forum_posts')
+ Widget.create(:ey_module_id => mod.id, :name => 'forum_posts_home', :description => 'Display recent forum posts', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'forum_posts_profile', :description => 'Display users forum posts', :profile => true)
- mod_id = EyModule.create(:name => 'photos')
- Widget.create(:ey_module_id => mod_id, :name => 'photos_home', :description => 'Slide show of photos', :profile => false)
- Widget.create(:ey_module_id => mod_id, :name => 'photos_profile', :description => 'Slide show of photos', :profile => true)
+ mod = EyModule.create(:name => 'photos')
+ Widget.create(:ey_module_id => mod.id, :name => 'photos_home', :description => 'Slide show of photos', :profile => false)
+ Widget.create(:ey_module_id => mod.id, :name => 'photos_profile', :description => 'Slide show of photos', :profile => true)
- mod_id = EyModule.create(:name => 'html_content')
- Widget.create(:ey_module_id => mod_id, :name => 'html_content_home', :description => 'Managed Content Widget', :profile => false)
+ mod = EyModule.create(:name => 'html_content')
+ Widget.create(:ey_module_id => mod.id, :name => 'html_content_home', :description => 'Managed Content Widget', :profile => false)
- mod_id = EyModule.create(:name => 'status_posts')
- Widget.create(:ey_module_id => mod_id, :name => 'status_posts_profile', :description => 'Display users status posts', :profile => true)
+ mod = EyModule.create(:name => 'status_posts')
+ Widget.create(:ey_module_id => mod.id, :name => 'status_posts_profile', :description => 'Display users status posts', :profile => true)
- mod_id = EyModule.create(:name => 'about_me')
- Widget.create(:ey_module_id => mod_id, :name => 'about_me_profile', :description => 'Display users bio', :profile => true)
+ mod = EyModule.create(:name => 'about_me')
+ Widget.create(:ey_module_id => mod.id, :name => 'about_me_profile', :description => 'Display users bio', :profile => true)
##########################################################################
View
0  public/images/twitter_clone/preview.gif → ...images/themes/cms_site_sample/preview.gif
File renamed without changes
View
0  public/images/enginey.com/enginey_hdr.jpg → ...images/themes/enginey.com/enginey_hdr.jpg
File renamed without changes
View
0  public/images/enginey.com/preview.jpg → public/images/themes/enginey.com/preview.jpg
File renamed without changes
View
0  public/images/mycompany_header.jpg → ...ges/themes/mycompany/mycompany_header.jpg
File renamed without changes
View
0  public/images/mycompany/preview.jpg → public/images/themes/mycompany/preview.jpg
File renamed without changes
View
BIN  public/images/themes/personal_blog/preview.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  public/images/rubymi/preview.jpg → public/images/themes/rubymi/preview.jpg
File renamed without changes
View
0  public/images/rubymi_header2.jpg → ...c/images/themes/rubymi/rubymi_header2.jpg
File renamed without changes
View
0  public/images/simple/preview.jpg → ...c/images/themes/simple-jquery/preview.jpg
File renamed without changes
View
0  public/images/personal_blog/preview.jpg → public/images/themes/simple/preview.jpg
File renamed without changes
View
BIN  public/images/themes/twitter_clone/preview.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
36 public/stylesheets/new_admin.css
@@ -113,9 +113,9 @@ ul#nav-menu {
ul#nav-menu li {
float:left;
- font-size:14px;
+ font-size:12px;
line-height:40px;
- margin:0 10px 0 0;
+ margin:0 4px 0 0;
padding:0;
}
@@ -456,9 +456,41 @@ input {
float: left;
}
+.admin_tab_content {
+ float: left;
+ margin-left: 20px;
+}
+
+#current_theme {
+ float: left;
+ margin-bottom: 40px;
+}
+
+#select_theme {
+ float: left;
+ clear: both;
+}
+
.theme-block {
float: left;
clear: both;
+ margin-bottom: 40px;
+}
+
+.theme_info {
+ float: left;
+ width: 260px;
+}
+
+.theme_image {
+ float: left;
+ width: 200px;
+ margin-left: 30px;
+}
+
+.theme_name {
+ font-weight: bold;
+ font-size: 12pt;
}
#blog_post_topic_list ul {
View
2  public/stylesheets/themes/enginey.com/style.css
@@ -154,7 +154,7 @@ body {
#logo {
height: 165px;
- background: url(../../../images/enginey.com/enginey_hdr.jpg);
+ background: url(../../../images/themes/enginey.com/enginey_hdr.jpg);
}
View
2  public/stylesheets/themes/mycompany/mycompany.css
@@ -10,7 +10,7 @@ body {
}
#header {
- background-image: url(/images/mycompany_header.jpg);
+ background-image: url(/images/themes/mycompany/mycompany_header.jpg);
color: #283F4B;
height: 164px;
}
View
2  public/stylesheets/themes/rubymi/rubymi.css
@@ -7,7 +7,7 @@ body {
}
#header {
- background-image: url(/images/rubymi_header2.jpg);
+ background-image: url(/images/themes/rubymi/rubymi_header2.jpg);
height: 164px;
}
View
63 themes/mycompany/views/shared/_nav_menu.html.erb
@@ -16,46 +16,49 @@ limitations under the License.
<%
# These are the items displayed in the top navigation bar
+# if restricted = true, this means that the item requires a logged in user
+# and the logged in user's id will be appended to the index_url
def nav_menu_items
[
- {'name'=>'members','title'=>'Members', 'index_url'=>'users'},
- {'name'=>'blogs','title'=>'Blogs', 'index_url'=>'blog_posts'},
- {'name'=>'groups','title'=>'Groups', 'index_url'=>'groups'},
- {'name'=>'events','title'=>'Events', 'index_url'=>'events'},
- {'name'=>'photos','title'=>'Photos', 'index_url'=>'photo_manager'},
- {'name'=>'classifieds','title'=>'Classifieds', 'index_url'=>'classifieds'},
- {'name'=>'forum','title'=>'Forum', 'index_url'=>'forum_topics'}
+ {'name'=>'main','title'=>'Home', 'index_url'=>'/', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'profile','title'=>'My Page', 'index_url'=>"/users", 'restricted'=>'true', 'roles'=>''},
+ {'name'=>'members','title'=>'Members', 'index_url'=>'/users', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'blogs','title'=>'Blogs', 'index_url'=>'/blog_posts', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'groups','title'=>'Groups', 'index_url'=>'/groups', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'events','title'=>'Events', 'index_url'=>'/events', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'photos','title'=>'Photos', 'index_url'=>'/photo_manager', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'classifieds','title'=>'Classifieds', 'index_url'=>'/classifieds', 'restricted'=>'false', 'roles'=>''},
+ {'name'=>'forum','title'=>'Forum', 'index_url'=>'/forum_topics', 'restricted'=>'false', 'roles'=>''}
]
end
%>
<div id="navigation">
- <ul id="nav_list">
- <% if @section == 'MAIN' %>
- <li id="current_menu" class="nav_list_item current_menu"><%= link_to 'Main', root_url, :class=>'nav_list_link' %></li>
- <% else %>
- <li class="nav_list_item"><%= link_to 'Main', root_url, :class=>'nav_list_link' %></li>
- <% end %>
- <% if logged_in? %>
- <% if @section == 'MY PAGE' %>
- <li id="current_menu" class="nav_list_item current_menu"><%= link_to 'My Page', user_path(current_user), :class=>'nav_list_link' %></li>
- <% else %>
- <% if (current_user) %>
- <li class="nav_list_item"><%= link_to 'My Page', user_path(current_user), :class=>'nav_list_link' %></li>
+ <ul id="nav_list">
+ <% nav_menu_items.each do |item| %>
+ <% if item['restricted'] == 'false' || logged_in? %>
+ <% if @section == item['name'].upcase %>
+ <li id="current_menu" class="nav_list_item current_menu">
+ <% if item['restricted'] == 'true' && logged_in? %>
+ <%= link_to item['title'], item['index_url'] + "/#{current_user.id}", :class=>'nav_list_link' %>
+ <% else %>
+ <%= link_to item['title'], item['index_url'], :class=>'nav_list_link' %>
+ <% end %>
+ </li>
<% else %>
- <li class="nav_list_item"><%= link_to 'My Page', root_url, :class=>'nav_list_link' %></li>
+ <% if item['restricted'] == 'true' && logged_in? %>
+ <li class="nav_list_item">
+ <%= link_to item['title'], item['index_url'] + "/#{current_user.id}", :class=>'nav_list_link' %>
+ </li>
+ <% else %>
+ <li class="nav_list_item">
+ <%= link_to item['title'], item['index_url'], :class=>'nav_list_link' %>
+ </li>
+ <% end %>
<% end %>
<% end %>
- <% end %>
-
- <% nav_menu_items.each do |item| %>
- <% if @section == item['name'].upcase %>
- <li id="current_menu" class="nav_list_item current_menu"><%= link_to item['title'], '/'+ item['index_url'], :class=>'nav_list_link' %></li>
- <% else %>
- <li class="nav_list_item"><%= link_to item['title'], '/'+ item['index_url'], :class=>'nav_list_link' %></li>
- <% end %>
<% end %>
- <% if logged_in? && current_user.roles.include?(Role.creator) %>
+ <% if logged_in_as_admin? %>
<% if @section == 'MANAGE' %>
<li id="current_menu" class="nav_list_item current_menu"><%= link_to 'Manage', { :controller=>'admin'}, :class=>'nav_list_link' %></li>
<% else %>
@@ -63,6 +66,7 @@ end
<% end %>
<% end %>
</ul>
+<!--
<ul id="nav_list_right" style="float:right;">
<% if @section == 'BUG' %>
<li class="nav_list_item current_menu" id="current_menu"><%= link_to 'Report a Bug', bug_reports_url, :class=>'nav_list_link' %></li>
@@ -70,5 +74,6 @@ end
<li class="nav_list_item"><%= link_to 'Report a Bug', bug_reports_url, :class=>'nav_list_link' %></li>
<% end %>
</ul>
+-->
<div style="clear:both;"></div>
</div>
View
6 themes/simple-jquery/views/layouts/application.html.erb
@@ -47,8 +47,10 @@ limitations under the License.
</head>
<body>
- <%= fb_connect_javascript_tag %>
- <%= init_fb_connect('XFBML', :js => :jquery) %>
+ <% if Configuration.ENABLE_FACEBOOK_CONNECT %>
+ <%= fb_connect_javascript_tag %>
+ <%= init_fb_connect('XFBML', :js => :jquery) %>
+ <% end %>
<div id="content">
<div id="header">
<div id="masthead"></div>
View
17 themes/simple-jquery/views/layouts/ideas.html.erb
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>Ideas: <%= controller.action_name %></title>
- <%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= yield %>
-
-</body>
-</html>
View
6 themes/simple/views/layouts/application.html.erb
@@ -55,8 +55,10 @@ limitations under the License.
</head>
<body>
- <%= fb_connect_javascript_tag %>
- <%= init_fb_connect('XFBML', :js => :dojo) %>
+ <% if Configuration.ENABLE_FACEBOOK_CONNECT %>
+ <%= fb_connect_javascript_tag %>
+ <%= init_fb_connect('XFBML', :js => :dojo) %>
+ <% end %>
<div id="content">
<div id="header">
<div id="masthead"></div>
View
17 themes/simple/views/layouts/ideas.html.erb
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>Ideas: <%= controller.action_name %></title>
- <%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= yield %>
-
-</body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.