Skip to content

cyu/beast_multi_site_plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MULTI-SITE PLUGIN
==============================

Run separate 'Sites' under the same rails instance, so that you can have a different set of forums per site.


INSTALLATION
==============================

1) First, install the beast_plugins plugin if you haven't already:

     script/plugin install http://svn.techno-weenie.net/projects/beast/plugins/beast_plugins

2) Install this plugin:

     cd vendor/beast
     svn export http://svn.codeeg.com/beast/multi_site

3) Run the following command:

     script/runner 'Beast::Plugins::MultiSite.install'

4) Add the plugin to the list of Beast plugins to be initialized.  If you this is
   the first Beast plugin you can initialize plugins by creating a plugins.rb file
   in config/initializers and add the following line(s):
   
     Beast::Plugin.initialize_plugins 'Beast::Plugins::MultiSite'
   
   In addition, this plugin requires additional initialization.  Add the following
   snippet to the end of plugins.rb:
   
     MultiSite::Initializer.run  

5) Update some of the beast views to include multi-site functionality:

   /views/users/show.html.erb:

     1) Update forums drop down to show only site forums:

         # around line 27
         <%= options_from_collection_for_select(site_forums - @user.forums, "id", "name") %>
    
     2) Update user's right side bar to allow site administrators to configure
        moderators or site administrators for their site:
   
         # around line 4
         <% if admin? || site_admin? %>
   
         # only allow administrators to set others as administrators
         # around line 30 & 32
         <% if admin? -%>
         ...
         <% end -%>
   
         # add check box for configuring site administration privileges
         # around line 24 (after administrator check box)
         <% unless @user.admin? -%>
         <p><label><%= check_box_tag 'site_admin', '1', @user.site_admin?(params[:site_id]) %> <%= 'User is an <b>site</b> administrator'[] %></label></p>
         <% end -%>
   
   /views/users/show.html.erb:

     1) Update user list page to highlight site administrators:
  
         # around line 28
         <td><%= link_to h(user.display_name), user_path(user), :class => ((user.admin? || site_admin?(user)) ? "admin" : nil) %>
   
         # around line 30
         <%= "(site admin)"[:site_admin_in_parens] if site_admin?(user) %>

   /views/forums/index.html.rb:
   
     1) Update forums list page to allow site administrators to create new forums:
     
         # around line 9
         <% if admin? || site_admin? %>
         
         # around line 53
         <%= link_to 'Edit'[:edit_title], edit_forum_path(forum), :class => "tiny", :rel => "directory", :style => "float:right" if admin? || site_admin? %>

About

Multi-Site Plugin for Beast

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages