Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 7
- Log:
Initial import of RForum 0.2 sources from a downloaded Tarball.
RForum is a Ruby On Rails based forum and mail gateway service.
- Author:
- adh
- Date:
- Sat Jul 22 18:43:13 +0100 2006
- Size:
- 1465 Bytes
1 | module RForum |
2 | # Navbar is the application's "main menu" displayed somewhere in the layout |
3 | class NavigationBar |
4 | include RForum::Localization |
5 | |
6 | Item = Struct.new(:prompt, :target, :confirmation_message) |
7 | |
8 | def initialize(forum, user) |
9 | @forum, @user = forum, user |
10 | end |
11 | |
12 | def forums_list |
13 | Item.new(l(:nav_forum_list), {:controller => 'forum', :action => 'list'}) |
14 | end |
15 | |
16 | def new_topic |
17 | if @forum |
18 | Item.new(l(:nav_create_topic), |
19 | {:controller => 'topic', :action => 'new', :params => {'forum_id' => @forum.id}}) |
20 | else |
21 | nil |
22 | end |
23 | end |
24 | |
25 | def search |
26 | if RForum::CONFIG[:search] != :disabled |
27 | Item.new(l(:nav_search), {:controller => 'forum', :action => 'search'}) |
28 | end |
29 | end |
30 | |
31 | def user_settings |
32 | if @user.guest? |
33 | Item.new(l(:nav_register), :controller => 'user', :action => 'register') |
34 | else |
35 | Item.new(l(:nav_settings), :controller => 'user', :action => 'edit') |
36 | end |
37 | end |
38 | |
39 | def user_list |
40 | Item.new(l(:nav_user_list), :controller => 'user', :action => 'list') |
41 | end |
42 | |
43 | |
44 | def login_info |
45 | if @user.guest? |
46 | Item.new(l(:nav_log_in), {:controller => 'user', :action => 'login'}) |
47 | else |
48 | link_text = l(:nav_log_out, @user.name) |
49 | link_text << " (#{@user.role})" unless @user.class == User |
50 | Item.new(link_text, :controller => 'user', :action => 'logout') |
51 | end |
52 | end |
53 | end # class NavBar |
54 | |
55 | end |