-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
79 lines (50 loc) · 2.77 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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? %>