Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 158
- Log:
Reconfigured all applications for use in the ROOL account with its
new layout. All files are set up for the development branch of the
filesystem. Caught up in this changeset is an unrelated modification
to the directory listing routine in Radiant, which now sorts the
entries alphabetically.
- Author:
- rool
- Date:
- Sun Dec 10 19:28:59 +0000 2006
- Size:
- 1644 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 and @user.can_post? |
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 | # With Hub, we expect the templates to not offer direct links for |
32 | # logging in and out; they don't in other applications so it would |
33 | # look rather inconsistent. However, should someone want to use |
34 | # these functions they should at least do something sane. |
35 | |
36 | def user_settings |
37 | Item.new(@user.guest? ? l(:nav_register) : l(:nav_settings), '/hub/tasks') |
38 | end |
39 | |
40 | def user_list |
41 | if (@user.admin?) |
42 | Item.new(l(:nav_user_list), '/hub/account/list') |
43 | end |
44 | end |
45 | |
46 | def login_info |
47 | if @user.guest? |
48 | Item.new(l(:nav_log_in), '/hub/account/login_hop') |
49 | else |
50 | link_text = l(:nav_log_out, @user.firstname) # Actually the Hub unique name |
51 | link_text << " (#{@user.role})" unless @user.class == User |
52 | Item.new(link_text, '/hub/account/logout') |
53 | end |
54 | end |
55 | end # class NavBar |
56 | |
57 | end |