##// END OF EJS Templates
git-svn-id: http://redmine.rubyforge.org/svn/trunk@31 e93f8b46-1217-0410-a6f0-8f06a7374b81
Jean-Philippe Lang -
r29:4a1cfb3df94b
parent child
Show More
@@ -0,0 +1,1
1 default directory for uploaded files No newline at end of file
@@ -1,68 +1,70
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module CustomFieldsHelper
18 module CustomFieldsHelper
19
19
20 # Return custom field html tag corresponding to its format
20 # Return custom field html tag corresponding to its format
21 def custom_field_tag(custom_value)
21 def custom_field_tag(custom_value)
22 custom_field = custom_value.custom_field
22 custom_field = custom_value.custom_field
23 field_name = "custom_fields[#{custom_field.id}]"
23 field_name = "custom_fields[#{custom_field.id}]"
24 field_id = "custom_fields_#{custom_field.id}"
24 field_id = "custom_fields_#{custom_field.id}"
25
25
26 case custom_field.field_format
26 case custom_field.field_format
27 when "string", "int"
27 when "string", "int"
28 text_field 'custom_value', 'value', :name => field_name, :id => field_id
28 text_field 'custom_value', 'value', :name => field_name, :id => field_id
29 when "date"
29 when "date"
30 text_field('custom_value', 'value', :name => field_name, :id => field_id, :size => 10) +
30 text_field('custom_value', 'value', :name => field_name, :id => field_id, :size => 10) +
31 calendar_for(field_id)
31 calendar_for(field_id)
32 when "text"
32 when "text"
33 text_area 'custom_value', 'value', :name => field_name, :id => field_id, :cols => 60, :rows => 3
33 text_area 'custom_value', 'value', :name => field_name, :id => field_id, :cols => 60, :rows => 3
34 when "bool"
34 when "bool"
35 check_box 'custom_value', 'value', :name => field_name, :id => field_id
35 check_box 'custom_value', 'value', :name => field_name, :id => field_id
36 when "list"
36 when "list"
37 select 'custom_value', 'value', custom_field.possible_values.split('|'), { :include_blank => true }, :name => field_name, :id => field_id
37 select 'custom_value', 'value', custom_field.possible_values.split('|'), { :include_blank => true }, :name => field_name, :id => field_id
38 end
38 end
39 end
39 end
40
40
41 # Return custom field label tag
41 # Return custom field label tag
42 def custom_field_label_tag(custom_value)
42 def custom_field_label_tag(custom_value)
43 content_tag "label", custom_value.custom_field.name +
43 content_tag "label", custom_value.custom_field.name +
44 (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),
44 (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),
45 :for => "custom_fields_#{custom_value.custom_field.id}",
45 :for => "custom_fields_#{custom_value.custom_field.id}",
46 :class => (custom_value.errors.empty? ? nil : "error" )
46 :class => (custom_value.errors.empty? ? nil : "error" )
47 end
47 end
48
48
49 # Return custom field tag with its label tag
49 # Return custom field tag with its label tag
50 def custom_field_tag_with_label(custom_value)
50 def custom_field_tag_with_label(custom_value)
51 custom_field_label_tag(custom_value) + custom_field_tag(custom_value)
51 custom_field_label_tag(custom_value) + custom_field_tag(custom_value)
52 end
52 end
53
53
54 # Return a string used to display a custom value
54 # Return a string used to display a custom value
55 def show_value(custom_value)
55 def show_value(custom_value)
56 case custom_value.custom_field.field_format
56 case custom_value.custom_field.field_format
57 when "date"
58 format_date(custom_value.value.to_date)
57 when "bool"
59 when "bool"
58 l_YesNo(custom_value.value == "1")
60 l_YesNo(custom_value.value == "1")
59 else
61 else
60 custom_value.value
62 custom_value.value
61 end
63 end
62 end
64 end
63
65
64 # Return an array of custom field formats which can be used in select_tag
66 # Return an array of custom field formats which can be used in select_tag
65 def custom_field_formats_for_select
67 def custom_field_formats_for_select
66 CustomField::FIELD_FORMATS.keys.collect { |k| [ l(CustomField::FIELD_FORMATS[k]), k ] }
68 CustomField::FIELD_FORMATS.keys.collect { |k| [ l(CustomField::FIELD_FORMATS[k]), k ] }
67 end
69 end
68 end
70 end
@@ -1,115 +1,119
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require "digest/sha1"
18 require "digest/sha1"
19
19
20 class User < ActiveRecord::Base
20 class User < ActiveRecord::Base
21 has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :dependent => true
21 has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :dependent => true
22 has_many :custom_values, :dependent => true, :as => :customized
22 has_many :custom_values, :dependent => true, :as => :customized
23 belongs_to :auth_source
23 belongs_to :auth_source
24
24
25 attr_accessor :password, :password_confirmation
25 attr_accessor :password, :password_confirmation
26 attr_accessor :last_before_login_on
26 attr_accessor :last_before_login_on
27 # Prevents unauthorized assignments
27 # Prevents unauthorized assignments
28 attr_protected :login, :admin, :password, :password_confirmation, :hashed_password
28 attr_protected :login, :admin, :password, :password_confirmation, :hashed_password
29
29
30 validates_presence_of :login, :firstname, :lastname, :mail
30 validates_presence_of :login, :firstname, :lastname, :mail
31 validates_uniqueness_of :login, :mail
31 validates_uniqueness_of :login, :mail
32 # Login must contain lettres, numbers, underscores only
32 # Login must contain lettres, numbers, underscores only
33 validates_format_of :login, :with => /^[a-z0-9_]+$/i
33 validates_format_of :login, :with => /^[a-z0-9_]+$/i
34 validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
34 validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
35 # Password length between 4 and 12
35 # Password length between 4 and 12
36 validates_length_of :password, :in => 4..12, :allow_nil => true
36 validates_length_of :password, :in => 4..12, :allow_nil => true
37 validates_confirmation_of :password, :allow_nil => true
37 validates_confirmation_of :password, :allow_nil => true
38 validates_associated :custom_values, :on => :update
38 validates_associated :custom_values, :on => :update
39
39
40 # Account statuses
40 # Account statuses
41 STATUS_ACTIVE = 1
41 STATUS_ACTIVE = 1
42 STATUS_REGISTERED = 2
42 STATUS_REGISTERED = 2
43 STATUS_LOCKED = 3
43 STATUS_LOCKED = 3
44
44
45 def before_save
45 def before_save
46 # update hashed_password if password was set
46 # update hashed_password if password was set
47 self.hashed_password = User.hash_password(self.password) if self.password
47 self.hashed_password = User.hash_password(self.password) if self.password
48 end
48 end
49
49
50 # Returns the user that matches provided login and password, or nil
50 # Returns the user that matches provided login and password, or nil
51 def self.try_to_login(login, password)
51 def self.try_to_login(login, password)
52 user = find(:first, :conditions => ["login=?", login])
52 user = find(:first, :conditions => ["login=?", login])
53 if user
53 if user
54 # user is already in local database
54 # user is already in local database
55 return nil if !user.active?
55 return nil if !user.active?
56 if user.auth_source
56 if user.auth_source
57 # user has an external authentication method
57 # user has an external authentication method
58 return nil unless user.auth_source.authenticate(login, password)
58 return nil unless user.auth_source.authenticate(login, password)
59 else
59 else
60 # authentication with local password
60 # authentication with local password
61 return nil unless User.hash_password(password) == user.hashed_password
61 return nil unless User.hash_password(password) == user.hashed_password
62 end
62 end
63 else
63 else
64 # user is not yet registered, try to authenticate with available sources
64 # user is not yet registered, try to authenticate with available sources
65 attrs = AuthSource.authenticate(login, password)
65 attrs = AuthSource.authenticate(login, password)
66 if attrs
66 if attrs
67 onthefly = new(*attrs)
67 onthefly = new(*attrs)
68 onthefly.login = login
68 onthefly.login = login
69 onthefly.language = $RDM_DEFAULT_LANG
69 onthefly.language = $RDM_DEFAULT_LANG
70 if onthefly.save
70 if onthefly.save
71 user = find(:first, :conditions => ["login=?", login])
71 user = find(:first, :conditions => ["login=?", login])
72 logger.info("User '#{user.login}' created on the fly.") if logger
72 logger.info("User '#{user.login}' created on the fly.") if logger
73 end
73 end
74 end
74 end
75 end
75 end
76 user.update_attribute(:last_login_on, Time.now) if user
76 user.update_attribute(:last_login_on, Time.now) if user
77 user
77 user
78
78
79 rescue => text
79 rescue => text
80 raise text
80 raise text
81 end
81 end
82
82
83 # Return user's full name for display
83 # Return user's full name for display
84 def display_name
84 def display_name
85 firstname + " " + lastname
85 firstname + " " + lastname
86 end
86 end
87
87
88 def active?
88 def active?
89 self.status == STATUS_ACTIVE
89 self.status == STATUS_ACTIVE
90 end
90 end
91
91
92 def registered?
93 self.status == STATUS_REGISTERED
94 end
95
92 def locked?
96 def locked?
93 self.status == STATUS_LOCKED
97 self.status == STATUS_LOCKED
94 end
98 end
95
99
96 def check_password?(clear_password)
100 def check_password?(clear_password)
97 User.hash_password(clear_password) == self.hashed_password
101 User.hash_password(clear_password) == self.hashed_password
98 end
102 end
99
103
100 def role_for_project(project_id)
104 def role_for_project(project_id)
101 @role_for_projects ||=
105 @role_for_projects ||=
102 begin
106 begin
103 roles = {}
107 roles = {}
104 self.memberships.each { |m| roles.store m.project_id, m.role_id }
108 self.memberships.each { |m| roles.store m.project_id, m.role_id }
105 roles
109 roles
106 end
110 end
107 @role_for_projects[project_id]
111 @role_for_projects[project_id]
108 end
112 end
109
113
110 private
114 private
111 # Return password digest
115 # Return password digest
112 def self.hash_password(clear_password)
116 def self.hash_password(clear_password)
113 Digest::SHA1.hexdigest(clear_password || "")
117 Digest::SHA1.hexdigest(clear_password || "")
114 end
118 end
115 end
119 end
@@ -1,137 +1,137
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3 <head>
3 <head>
4 <title><%= $RDM_HEADER_TITLE %></title>
4 <title><%= $RDM_HEADER_TITLE %></title>
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <meta name="description" content="redMine" />
6 <meta name="description" content="redMine" />
7 <meta name="keywords" content="issue,bug,tracker" />
7 <meta name="keywords" content="issue,bug,tracker" />
8 <%= stylesheet_link_tag "application" %>
8 <%= stylesheet_link_tag "application" %>
9 <%= stylesheet_link_tag "menu" %>
9 <%= stylesheet_link_tag "menu" %>
10 <%= stylesheet_link_tag "rails" %>
10 <%= stylesheet_link_tag "rails" %>
11 <%= javascript_include_tag :defaults %>
11 <%= javascript_include_tag :defaults %>
12 <%= javascript_include_tag 'menu' %>
12 <%= javascript_include_tag 'menu' %>
13 <%= javascript_include_tag 'calendar/calendar' %>
13 <%= javascript_include_tag 'calendar/calendar' %>
14 <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
14 <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
15 <%= javascript_include_tag 'calendar/calendar-setup' %>
15 <%= javascript_include_tag 'calendar/calendar-setup' %>
16 <%= stylesheet_link_tag 'calendar/calendar-blue' %>
16 <%= stylesheet_link_tag 'calendar' %>
17 <script type='text/javascript'>
17 <script type='text/javascript'>
18 var menu_contenu=' \
18 var menu_contenu=' \
19 <div id="menuAdmin" class="menu" onmouseover="menuMouseover(event)"> \
19 <div id="menuAdmin" class="menu" onmouseover="menuMouseover(event)"> \
20 <a class="menuItem" href="\/admin\/projects" onmouseover="menuItemMouseover(event,\'menuProjects\');"><span class="menuItemText"><%=l(:label_project_plural)%><\/span><span class="menuItemArrow">&#9654;<\/span><\/a> \
20 <a class="menuItem" href="\/admin\/projects" onmouseover="menuItemMouseover(event,\'menuProjects\');"><span class="menuItemText"><%=l(:label_project_plural)%><\/span><span class="menuItemArrow">&#9654;<\/span><\/a> \
21 <a class="menuItem" href="\/users" onmouseover="menuItemMouseover(event,\'menuUsers\');"><span class="menuItemText"><%=l(:label_user_plural)%><\/span><span class="menuItemArrow">&#9654;<\/span><\/a> \
21 <a class="menuItem" href="\/users" onmouseover="menuItemMouseover(event,\'menuUsers\');"><span class="menuItemText"><%=l(:label_user_plural)%><\/span><span class="menuItemArrow">&#9654;<\/span><\/a> \
22 <a class="menuItem" href="\/roles"><%=l(:label_role_and_permissions)%><\/a> \
22 <a class="menuItem" href="\/roles"><%=l(:label_role_and_permissions)%><\/a> \
23 <a class="menuItem" href="\/trackers" onmouseover="menuItemMouseover(event,\'menuTrackers\');"><span class="menuItemText"><%=l(:label_tracker_plural)%><\/span><span class="menuItemArrow">&#9654;<\/span><\/a> \
23 <a class="menuItem" href="\/trackers" onmouseover="menuItemMouseover(event,\'menuTrackers\');"><span class="menuItemText"><%=l(:label_tracker_plural)%><\/span><span class="menuItemArrow">&#9654;<\/span><\/a> \
24 <a class="menuItem" href="\/custom_fields"><%=l(:label_custom_field_plural)%><\/a> \
24 <a class="menuItem" href="\/custom_fields"><%=l(:label_custom_field_plural)%><\/a> \
25 <a class="menuItem" href="\/enumerations"><%=l(:label_enumerations)%><\/a> \
25 <a class="menuItem" href="\/enumerations"><%=l(:label_enumerations)%><\/a> \
26 <a class="menuItem" href="\/admin\/mail_options"><%=l(:field_mail_notification)%><\/a> \
26 <a class="menuItem" href="\/admin\/mail_options"><%=l(:field_mail_notification)%><\/a> \
27 <a class="menuItem" href="\/auth_sources"><%=l(:label_authentication)%><\/a> \
27 <a class="menuItem" href="\/auth_sources"><%=l(:label_authentication)%><\/a> \
28 <a class="menuItem" href="\/admin\/info"><%=l(:label_information_plural)%><\/a> \
28 <a class="menuItem" href="\/admin\/info"><%=l(:label_information_plural)%><\/a> \
29 <\/div> \
29 <\/div> \
30 <div id="menuTrackers" class="menu"> \
30 <div id="menuTrackers" class="menu"> \
31 <a class="menuItem" href="\/issue_statuses"><%=l(:label_issue_status_plural)%><\/a> \
31 <a class="menuItem" href="\/issue_statuses"><%=l(:label_issue_status_plural)%><\/a> \
32 <a class="menuItem" href="\/roles\/workflow"><%=l(:label_workflow)%><\/a> \
32 <a class="menuItem" href="\/roles\/workflow"><%=l(:label_workflow)%><\/a> \
33 <\/div> \
33 <\/div> \
34 <div id="menuProjects" class="menu"><a class="menuItem" href="\/projects\/add"><%=l(:label_new)%><\/a><\/div> \
34 <div id="menuProjects" class="menu"><a class="menuItem" href="\/projects\/add"><%=l(:label_new)%><\/a><\/div> \
35 <div id="menuUsers" class="menu"><a class="menuItem" href="\/users\/add"><%=l(:label_new)%><\/a><\/div> \
35 <div id="menuUsers" class="menu"><a class="menuItem" href="\/users\/add"><%=l(:label_new)%><\/a><\/div> \
36 \
36 \
37 <% unless @project.nil? || @project.id.nil? %> \
37 <% unless @project.nil? || @project.id.nil? %> \
38 <div id="menuProject" class="menu" onmouseover="menuMouseover(event)"> \
38 <div id="menuProject" class="menu" onmouseover="menuMouseover(event)"> \
39 <%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project }, :class => "menuItem" %> \
39 <%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project }, :class => "menuItem" %> \
40 <%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %> \
40 <%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %> \
41 <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %> \
41 <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %> \
42 <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %> \
42 <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %> \
43 <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %> \
43 <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %> \
44 <%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %> \
44 <%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %> \
45 <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %> \
45 <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %> \
46 <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %> \
46 <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %> \
47 <\/div> \
47 <\/div> \
48 <% end %> \
48 <% end %> \
49 ';
49 ';
50 </script>
50 </script>
51
51
52 </head>
52 </head>
53
53
54 <body>
54 <body>
55 <div id="container" >
55 <div id="container" >
56
56
57 <div id="header">
57 <div id="header">
58 <div style="float: left;">
58 <div style="float: left;">
59 <h1><%= $RDM_HEADER_TITLE %></h1>
59 <h1><%= $RDM_HEADER_TITLE %></h1>
60 <h2><%= $RDM_HEADER_SUBTITLE %></h2>
60 <h2><%= $RDM_HEADER_SUBTITLE %></h2>
61 </div>
61 </div>
62 <div style="float: right; padding-right: 1em; padding-top: 0.2em;">
62 <div style="float: right; padding-right: 1em; padding-top: 0.2em;">
63 <% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %>
63 <% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %>
64 </div>
64 </div>
65 </div>
65 </div>
66
66
67 <div id="navigation">
67 <div id="navigation">
68 <ul>
68 <ul>
69 <li class="selected"><%= link_to l(:label_home), { :controller => '' }, :class => "picHome" %></li>
69 <li class="selected"><%= link_to l(:label_home), { :controller => '' }, :class => "picHome" %></li>
70 <li><%= link_to l(:label_my_page), { :controller => 'account', :action => 'my_page'}, :class => "picUserPage" %></li>
70 <li><%= link_to l(:label_my_page), { :controller => 'account', :action => 'my_page'}, :class => "picUserPage" %></li>
71 <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "picProject" %></li>
71 <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "picProject" %></li>
72
72
73 <% unless @project.nil? || @project.id.nil? %>
73 <% unless @project.nil? || @project.id.nil? %>
74 <li><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "picProject", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
74 <li><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "picProject", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
75 <% end %>
75 <% end %>
76
76
77 <% if loggedin? %>
77 <% if loggedin? %>
78 <li><%= link_to l(:label_my_account), { :controller => 'account', :action => 'my_account' }, :class => "picUser" %></li>
78 <li><%= link_to l(:label_my_account), { :controller => 'account', :action => 'my_account' }, :class => "picUser" %></li>
79 <% end %>
79 <% end %>
80
80
81 <% if admin_loggedin? %>
81 <% if admin_loggedin? %>
82 <li><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "picAdmin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
82 <li><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "picAdmin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
83 <% end %>
83 <% end %>
84
84
85 <li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => @params[:controller], :page => @params[:action] }, :target => "new", :class => "picHelp" %></li>
85 <li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => @params[:controller], :page => @params[:action] }, :target => "new", :class => "picHelp" %></li>
86
86
87 <% if loggedin? %>
87 <% if loggedin? %>
88 <li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "picUser" %></li>
88 <li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "picUser" %></li>
89 <% else %>
89 <% else %>
90 <li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "picUser" %></li>
90 <li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "picUser" %></li>
91 <% end %>
91 <% end %>
92 </ul>
92 </ul>
93 </div>
93 </div>
94 <script type='text/javascript'>if(document.getElementById) {document.write(menu_contenu);}</script>
94 <script type='text/javascript'>if(document.getElementById) {document.write(menu_contenu);}</script>
95
95
96 <div id="subcontent">
96 <div id="subcontent">
97
97
98 <% unless @project.nil? || @project.id.nil? %>
98 <% unless @project.nil? || @project.id.nil? %>
99 <h2><%= @project.name %></h2>
99 <h2><%= @project.name %></h2>
100 <ul class="menublock">
100 <ul class="menublock">
101 <li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li>
101 <li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li>
102 <li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project %></li>
102 <li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project %></li>
103 <li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
103 <li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
104 <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
104 <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
105 <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
105 <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
106 <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
106 <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
107 <li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li>
107 <li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li>
108 <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
108 <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
109 <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li>
109 <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li>
110 </ul>
110 </ul>
111 <% end %>
111 <% end %>
112
112
113 <% if loggedin? and @logged_in_user.memberships.length > 0 %>
113 <% if loggedin? and @logged_in_user.memberships.length > 0 %>
114 <h2><%=l(:label_my_projects) %></h2>
114 <h2><%=l(:label_my_projects) %></h2>
115 <ul class="menublock">
115 <ul class="menublock">
116 <% for membership in @logged_in_user.memberships %>
116 <% for membership in @logged_in_user.memberships %>
117 <li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %></li>
117 <li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %></li>
118 <% end %>
118 <% end %>
119 </ul>
119 </ul>
120 <% end %>
120 <% end %>
121 </div>
121 </div>
122
122
123 <div id="content">
123 <div id="content">
124 <% if flash[:notice] %><p style="color: green"><%= flash[:notice] %></p><% end %>
124 <% if flash[:notice] %><p style="color: green"><%= flash[:notice] %></p><% end %>
125 <%= @content_for_layout %>
125 <%= @content_for_layout %>
126 </div>
126 </div>
127
127
128 <div id="footer">
128 <div id="footer">
129 <p>
129 <p>
130 <%= auto_link $RDM_FOOTER_SIG %> |
130 <%= auto_link $RDM_FOOTER_SIG %> |
131 <a href="http://redmine.org/" target="_new"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %>
131 <a href="http://redmine.org/" target="_new"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %>
132 </p>
132 </p>
133 </div>
133 </div>
134
134
135 </div>
135 </div>
136 </body>
136 </body>
137 </html> No newline at end of file
137 </html>
@@ -1,72 +1,72
1 <h2><%=l(:label_overview)%></h2>
1 <h2><%=l(:label_overview)%></h2>
2
2
3 <div class="splitcontentleft">
3 <div class="splitcontentleft">
4 <%= simple_format(auto_link(@project.description)) %>
4 <%= simple_format(auto_link(@project.description)) %>
5 <ul>
5 <ul>
6 <li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li>
6 <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li><% end %>
7 <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
7 <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
8 <% for custom_value in @custom_values %>
8 <% for custom_value in @custom_values %>
9 <% if !custom_value.value.empty? %>
9 <% if !custom_value.value.empty? %>
10 <li><%= custom_value.custom_field.name%>: <%= custom_value.value%></li>
10 <li><%= custom_value.custom_field.name%>: <%= show_value(custom_value) %></li>
11 <% end %>
11 <% end %>
12 <% end %>
12 <% end %>
13 </ul>
13 </ul>
14
14
15 <div class="box">
15 <div class="box">
16 <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3>
16 <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3>
17 <ul>
17 <ul>
18 <% for tracker in @trackers %>
18 <% for tracker in @trackers %>
19 <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project,
19 <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project,
20 :set_filter => 1,
20 :set_filter => 1,
21 "tracker_id" => tracker.id %>:
21 "tracker_id" => tracker.id %>:
22 <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %>
22 <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %>
23 <%= lwr(:label_open_issues, issue_count) %>
23 <%= lwr(:label_open_issues, issue_count) %>
24 </li>
24 </li>
25 <% end %>
25 <% end %>
26 </ul>
26 </ul>
27 <% if authorize_for 'projects', 'add_issue' %>
27 <% if authorize_for 'projects', 'add_issue' %>
28 &#187; <%=l(:label_issue_new)%>:
28 &#187; <%=l(:label_issue_new)%>:
29 <ul>
29 <ul>
30 <% @trackers.each do |tracker| %>
30 <% @trackers.each do |tracker| %>
31 <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li>
31 <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li>
32 <% end %>
32 <% end %>
33 </ul>
33 </ul>
34 <% end %>
34 <% end %>
35 <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center>
35 <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center>
36 </div>
36 </div>
37 </div>
37 </div>
38
38
39 <div class="splitcontentright">
39 <div class="splitcontentright">
40 <div class="box">
40 <div class="box">
41 <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3>
41 <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3>
42 <% for member in @members %>
42 <% for member in @members %>
43 <%= link_to_user member.user %> (<%= member.role.name %>)<br />
43 <%= link_to_user member.user %> (<%= member.role.name %>)<br />
44 <% end %>
44 <% end %>
45 </div>
45 </div>
46
46
47 <% if @subprojects %>
47 <% if @subprojects %>
48 <div class="box">
48 <div class="box">
49 <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3>
49 <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3>
50 <% for subproject in @subprojects %>
50 <% for subproject in @subprojects %>
51 <%= link_to subproject.name, :action => 'show', :id => subproject %><br />
51 <%= link_to subproject.name, :action => 'show', :id => subproject %><br />
52 <% end %>
52 <% end %>
53 </div>
53 </div>
54 <% end %>
54 <% end %>
55
55
56 <div class="box">
56 <div class="box">
57 <h3><%=l(:label_news_latest)%></h3>
57 <h3><%=l(:label_news_latest)%></h3>
58 <% for news in @news %>
58 <% for news in @news %>
59 <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
59 <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
60 <%= news.summary %>
60 <%= news.summary %>
61 <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p>
61 <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p>
62 <hr />
62 <hr />
63 <% end %>
63 <% end %>
64 <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center>
64 <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center>
65 </div>
65 </div>
66 </div>
66 </div>
67
67
68
68
69
69
70
70
71
71
72
72
@@ -1,46 +1,47
1 <% if @statuses.empty? or rows.empty? %>
1 <% if @statuses.empty? or rows.empty? %>
2 <p><i><%=l(:label_no_data)%></i></p>
2 <p><i><%=l(:label_no_data)%></i></p>
3 <% else %>
3 <% else %>
4 <% col_width = 70 / (@statuses.length+3) %>
4 <% col_width = 70 / (@statuses.length+3) %>
5 <table border="0" cellspacing="1" cellpadding="2" width="100%">
5 <table border="0" cellspacing="1" cellpadding="2" width="100%">
6 <tr>
6 <tr>
7 <td width="25%"></td>
7 <td width="25%"></td>
8 <% for status in @statuses %>
8 <% for status in @statuses %>
9 <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td>
9 <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td>
10 <% end %>
10 <% end %>
11 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td>
11 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td>
12 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td>
12 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td>
13 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td>
13 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td>
14 </tr>
14 </tr>
15
15
16 <% for row in rows %>
16 <% for row in rows %>
17 <tr style="background-color:#CEE1ED">
17 <tr class="<%= cycle("odd", "even") %>">
18 <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
18 <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
19 :set_filter => 1,
19 :set_filter => 1,
20 "#{field_name}" => row.id %></td>
20 "#{field_name}" => row.id %></td>
21 <% for status in @statuses %>
21 <% for status in @statuses %>
22 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }),
22 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }),
23 :controller => 'projects', :action => 'list_issues', :id => @project,
23 :controller => 'projects', :action => 'list_issues', :id => @project,
24 :set_filter => 1,
24 :set_filter => 1,
25 "status_id" => status.id,
25 "status_id" => status.id,
26 "#{field_name}" => row.id %></td>
26 "#{field_name}" => row.id %></td>
27 <% end %>
27 <% end %>
28 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }),
28 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }),
29 :controller => 'projects', :action => 'list_issues', :id => @project,
29 :controller => 'projects', :action => 'list_issues', :id => @project,
30 :set_filter => 1,
30 :set_filter => 1,
31 "#{field_name}" => row.id,
31 "#{field_name}" => row.id,
32 "status_id" => "O" %></td>
32 "status_id" => "O" %></td>
33 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 1 }),
33 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 1 }),
34 :controller => 'projects', :action => 'list_issues', :id => @project,
34 :controller => 'projects', :action => 'list_issues', :id => @project,
35 :set_filter => 1,
35 :set_filter => 1,
36 "#{field_name}" => row.id,
36 "#{field_name}" => row.id,
37 "status_id" => "C" %></td>
37 "status_id" => "C" %></td>
38 <td align="center"><%= link_to (aggregate data, { field_name => row.id }),
38 <td align="center"><%= link_to (aggregate data, { field_name => row.id }),
39 :controller => 'projects', :action => 'list_issues', :id => @project,
39 :controller => 'projects', :action => 'list_issues', :id => @project,
40 :set_filter => 1,
40 :set_filter => 1,
41 "#{field_name}" => row.id,
41 "#{field_name}" => row.id,
42 "status_id" => "A" %></td>
42 "status_id" => "A" %></td>
43 <% end %>
43 <% end %>
44 </tr>
44 </tr>
45 </table>
45 </table>
46 <% end %> No newline at end of file
46 <% end
47 reset_cycle %> No newline at end of file
@@ -1,70 +1,71
1 <h2><%=l(:label_workflow)%></h2>
1 <h2><%=l(:label_workflow)%></h2>
2
2
3 <p><%=l(:text_workflow_edit)%>:</p>
3 <p><%=l(:text_workflow_edit)%>:</p>
4
4
5 <%= start_form_tag ({:action => 'workflow'}, :method => 'get') %>
5 <%= start_form_tag ({:action => 'workflow'}, :method => 'get') %>
6 <div style="float:left;margin-right:10px;">
6 <div style="float:left;margin-right:10px;">
7 <p><label for="role_id"><%=l(:label_role)%></label><br/>
7 <p><label for="role_id"><%=l(:label_role)%></label><br/>
8 <select id="role_id" name="role_id">
8 <select id="role_id" name="role_id">
9 <%= options_from_collection_for_select @roles, "id", "name", (@role.id unless @role.nil?) %>
9 <%= options_from_collection_for_select @roles, "id", "name", (@role.id unless @role.nil?) %>
10 </select></p>
10 </select></p>
11 </div>
11 </div>
12
12
13 <div>
13 <div>
14 <p><label for="tracker_id"><%=l(:label_tracker)%></label><br/>
14 <p><label for="tracker_id"><%=l(:label_tracker)%></label><br/>
15 <select id="tracker_id" name="tracker_id">
15 <select id="tracker_id" name="tracker_id">
16 <%= options_from_collection_for_select @trackers, "id", "name", (@tracker.id unless @tracker.nil?) %>
16 <%= options_from_collection_for_select @trackers, "id", "name", (@tracker.id unless @tracker.nil?) %>
17 </select>
17 </select>
18
18
19 <%= submit_tag l(:button_edit) %>
19 <%= submit_tag l(:button_edit) %>
20 </p>
20 </p>
21 </div>
21 </div>
22 <%= end_form_tag %>
22 <%= end_form_tag %>
23
23
24
24
25
25
26 <% unless @tracker.nil? or @role.nil? %>
26 <% unless @tracker.nil? or @role.nil? %>
27 <div class="box">
27 <div class="box">
28 <%= form_tag ({:action => 'workflow', :role_id => @role, :tracker_id => @tracker }, :id => 'workflow_form' ) %>
28 <%= form_tag ({:action => 'workflow', :role_id => @role, :tracker_id => @tracker }, :id => 'workflow_form' ) %>
29 <table>
29 <table>
30 <tr>
30 <tr>
31 <td align="center"><strong><%=l(:label_current_status)%></strong></td>
31 <td align="center" colspan="2"><strong><%=l(:label_current_status)%></strong></td>
32 <td align="center" colspan="<%= @statuses.length %>"><strong><%=l(:label_new_statuses_allowed)%></strong></td>
32 <td align="center" colspan="<%= @statuses.length %>"><strong><%=l(:label_new_statuses_allowed)%></strong></td>
33 </tr>
33 </tr>
34 <tr>
34 <tr>
35 <td></td>
35 <td colspan="2"></td>
36 <% for new_status in @statuses %>
36 <% for new_status in @statuses %>
37 <td width="60" align="center"><%= new_status.name %></td>
37 <td width="80" align="center"><%= new_status.name %></td>
38 <% end %>
38 <% end %>
39 </tr>
39 </tr>
40
40
41 <% for old_status in @statuses %>
41 <% for old_status in @statuses %>
42 <tr>
42 <tr>
43 <td width="20" align="center"><div style="background-color:#<%= old_status.html_color %>">&nbsp</div></td>
43 <td><%= old_status.name %></td>
44 <td><%= old_status.name %></td>
44
45
45 <% for new_status in @statuses %>
46 <% for new_status in @statuses %>
46 <td align="center">
47 <td align="center">
47
48
48 <input type="checkbox"
49 <input type="checkbox"
49 name="issue_status[<%= old_status.id %>][]"
50 name="issue_status[<%= old_status.id %>][]"
50 value="<%= new_status.id %>"
51 value="<%= new_status.id %>"
51 <%if old_status.new_statuses_allowed_to(@role, @tracker).include? new_status%>checked="checked"<%end%>
52 <%if old_status.new_statuses_allowed_to(@role, @tracker).include? new_status%>checked="checked"<%end%>
52 <%if old_status==new_status%>disabled<%end%>
53 <%if old_status==new_status%>disabled<%end%>
53 >
54 >
54 </td>
55 </td>
55 <% end %>
56 <% end %>
56
57
57 </tr>
58 </tr>
58 <% end %>
59 <% end %>
59 </table>
60 </table>
60 <br />
61 <br />
61 <p>
62 <p>
62 <a href="javascript:checkAll('workflow_form', true)"><%=l(:button_check_all)%></a> |
63 <a href="javascript:checkAll('workflow_form', true)"><%=l(:button_check_all)%></a> |
63 <a href="javascript:checkAll('workflow_form', false)"><%=l(:button_uncheck_all)%></a>
64 <a href="javascript:checkAll('workflow_form', false)"><%=l(:button_uncheck_all)%></a>
64 </p>
65 </p>
65 <br />
66 <br />
66 <%= submit_tag l(:button_save) %>
67 <%= submit_tag l(:button_save) %>
67 <%= end_form_tag %>
68 <%= end_form_tag %>
68
69
69 <% end %>
70 <% end %>
70 </div> No newline at end of file
71 </div>
@@ -1,46 +1,46
1 <h2><%=l(:label_user_plural)%></h2>
1 <h2><%=l(:label_user_plural)%></h2>
2
2
3 <table class="listTableContent">
3 <table class="listTableContent">
4 <tr class="ListHead">
4 <tr class="ListHead">
5 <%= sort_header_tag('login', :caption => l(:field_login)) %>
5 <%= sort_header_tag('login', :caption => l(:field_login)) %>
6 <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
6 <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
7 <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
7 <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
8 <th><%=l(:field_mail)%></th>
8 <th><%=l(:field_mail)%></th>
9 <%= sort_header_tag('admin', :caption => l(:field_admin)) %>
9 <%= sort_header_tag('admin', :caption => l(:field_admin)) %>
10 <%= sort_header_tag('status', :caption => l(:field_status)) %>
10 <%= sort_header_tag('status', :caption => l(:field_status)) %>
11 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
11 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
12 <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on)) %>
12 <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on)) %>
13 <th></th>
13 <th></th>
14 </tr>
14 </tr>
15 <% for user in @users %>
15 <% for user in @users %>
16 <tr class="<%= cycle("odd", "even") %>">
16 <tr class="<%= cycle("odd", "even") %>">
17 <td><%= link_to user.login, :action => 'edit', :id => user %></td>
17 <td><%= link_to user.login, :action => 'edit', :id => user %></td>
18 <td><%= user.firstname %></td>
18 <td><%= user.firstname %></td>
19 <td><%= user.lastname %></td>
19 <td><%= user.lastname %></td>
20 <td><%= user.mail %></td>
20 <td><%= user.mail %></td>
21 <td align="center"><%= image_tag 'true' if user.admin? %></td>
21 <td align="center"><%= image_tag 'true' if user.admin? %></td>
22 <td align="center"><%= image_tag 'locked' if user.locked? %></td>
22 <td align="center"><%= image_tag 'locked' if user.locked? %><%= image_tag 'user_new' if user.registered? %></td>
23 <td align="center"><%= format_time(user.created_on) %></td>
23 <td align="center"><%= format_time(user.created_on) %></td>
24 <td align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
24 <td align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
25 <td align="center">
25 <td align="center">
26 <%= start_form_tag :action => 'edit', :id => user %>
26 <%= start_form_tag :action => 'edit', :id => user %>
27 <% if user.locked? %>
27 <% if user.locked? %>
28 <%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %>
28 <%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %>
29 <%= submit_tag l(:button_unlock), :class => "button-small" %>
29 <%= submit_tag l(:button_unlock), :class => "button-small" %>
30 <% else %>
30 <% else %>
31 <%= hidden_field_tag 'user[status]', User::STATUS_LOCKED %>
31 <%= hidden_field_tag 'user[status]', User::STATUS_LOCKED %>
32 <%= submit_tag l(:button_lock), :class => "button-small" %>
32 <%= submit_tag l(:button_lock), :class => "button-small" %>
33 <% end %>
33 <% end %>
34 <%= end_form_tag %>
34 <%= end_form_tag %>
35 </td>
35 </td>
36 </tr>
36 </tr>
37 <% end %>
37 <% end %>
38 </table>
38 </table>
39
39
40 <p><%= pagination_links_full @user_pages %>
40 <p><%= pagination_links_full @user_pages %>
41 [ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ]
41 [ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ]
42 </p>
42 </p>
43
43
44 <p>
44 <p>
45 <%= link_to '&#187; ' + l(:label_user_new), :action => 'add' %>
45 <%= link_to '&#187; ' + l(:label_user_new), :action => 'add' %>
46 </p> No newline at end of file
46 </p>
@@ -1,232 +1,231
1 /* The main calendar widget. DIV containing a table. */
1 /* The main calendar widget. DIV containing a table. */
2
2
3 div.calendar { position: relative; }
3 div.calendar { position: relative; }
4
4
5 .calendar, .calendar table {
5 .calendar, .calendar table {
6 border: 1px solid #556;
6 border: 1px solid #556;
7 font-size: 11px;
7 font-size: 11px;
8 color: #000;
8 color: #000;
9 cursor: default;
9 cursor: default;
10 background: #eef;
10 background: #fafbfc;
11 font-family: tahoma,verdana,sans-serif;
11 font-family: tahoma,verdana,sans-serif;
12 }
12 }
13
13
14 /* Header part -- contains navigation buttons and day names. */
14 /* Header part -- contains navigation buttons and day names. */
15
15
16 .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
16 .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
17 text-align: center; /* They are the navigation buttons */
17 text-align: center; /* They are the navigation buttons */
18 padding: 2px; /* Make the buttons seem like they're pressing */
18 padding: 2px; /* Make the buttons seem like they're pressing */
19 }
19 }
20
20
21 .calendar .nav {
21 .calendar .nav {
22 background: #778 url(menuarrow.gif) no-repeat 100% 100%;
22 background: #467aa7 url(menuarrow.gif) no-repeat 100% 100%;
23 }
23 }
24
24
25 .calendar thead .title { /* This holds the current "month, year" */
25 .calendar thead .title { /* This holds the current "month, year" */
26 font-weight: bold; /* Pressing it will take you to the current date */
26 font-weight: bold; /* Pressing it will take you to the current date */
27 text-align: center;
27 text-align: center;
28 background: #fff;
28 background: #fff;
29 color: #000;
29 color: #000;
30 padding: 2px;
30 padding: 2px;
31 }
31 }
32
32
33 .calendar thead .headrow { /* Row <TR> containing navigation buttons */
33 .calendar thead .headrow { /* Row <TR> containing navigation buttons */
34 background: #778;
34 background: #467aa7;
35 color: #fff;
35 color: #fff;
36 }
36 }
37
37
38 .calendar thead .daynames { /* Row <TR> containing the day names */
38 .calendar thead .daynames { /* Row <TR> containing the day names */
39 background: #bdf;
39 background: #bdf;
40 }
40 }
41
41
42 .calendar thead .name { /* Cells <TD> containing the day names */
42 .calendar thead .name { /* Cells <TD> containing the day names */
43 border-bottom: 1px solid #556;
43 border-bottom: 1px solid #556;
44 padding: 2px;
44 padding: 2px;
45 text-align: center;
45 text-align: center;
46 color: #000;
46 color: #000;
47 }
47 }
48
48
49 .calendar thead .weekend { /* How a weekend day name shows in header */
49 .calendar thead .weekend { /* How a weekend day name shows in header */
50 color: #a66;
50 color: #a66;
51 }
51 }
52
52
53 .calendar thead .hilite { /* How do the buttons in header appear when hover */
53 .calendar thead .hilite { /* How do the buttons in header appear when hover */
54 background-color: #aaf;
54 background-color: #80b0da;
55 color: #000;
55 color: #000;
56 border: 1px solid #04f;
57 padding: 1px;
56 padding: 1px;
58 }
57 }
59
58
60 .calendar thead .active { /* Active (pressed) buttons in header */
59 .calendar thead .active { /* Active (pressed) buttons in header */
61 background-color: #77c;
60 background-color: #77c;
62 padding: 2px 0px 0px 2px;
61 padding: 2px 0px 0px 2px;
63 }
62 }
64
63
65 /* The body part -- contains all the days in month. */
64 /* The body part -- contains all the days in month. */
66
65
67 .calendar tbody .day { /* Cells <TD> containing month days dates */
66 .calendar tbody .day { /* Cells <TD> containing month days dates */
68 width: 2em;
67 width: 2em;
69 color: #456;
68 color: #456;
70 text-align: right;
69 text-align: right;
71 padding: 2px 4px 2px 2px;
70 padding: 2px 4px 2px 2px;
72 }
71 }
73 .calendar tbody .day.othermonth {
72 .calendar tbody .day.othermonth {
74 font-size: 80%;
73 font-size: 80%;
75 color: #bbb;
74 color: #bbb;
76 }
75 }
77 .calendar tbody .day.othermonth.oweekend {
76 .calendar tbody .day.othermonth.oweekend {
78 color: #fbb;
77 color: #fbb;
79 }
78 }
80
79
81 .calendar table .wn {
80 .calendar table .wn {
82 padding: 2px 3px 2px 2px;
81 padding: 2px 3px 2px 2px;
83 border-right: 1px solid #000;
82 border-right: 1px solid #000;
84 background: #bdf;
83 background: #bdf;
85 }
84 }
86
85
87 .calendar tbody .rowhilite td {
86 .calendar tbody .rowhilite td {
88 background: #def;
87 background: #def;
89 }
88 }
90
89
91 .calendar tbody .rowhilite td.wn {
90 .calendar tbody .rowhilite td.wn {
92 background: #eef;
91 background: #80b0da;
93 }
92 }
94
93
95 .calendar tbody td.hilite { /* Hovered cells <TD> */
94 .calendar tbody td.hilite { /* Hovered cells <TD> */
96 background: #def;
95 background: #80b0da;
97 padding: 1px 3px 1px 1px;
96 padding: 1px 3px 1px 1px;
98 border: 1px solid #bbb;
97 border: 1px solid #bbb;
99 }
98 }
100
99
101 .calendar tbody td.active { /* Active (pressed) cells <TD> */
100 .calendar tbody td.active { /* Active (pressed) cells <TD> */
102 background: #cde;
101 background: #cde;
103 padding: 2px 2px 0px 2px;
102 padding: 2px 2px 0px 2px;
104 }
103 }
105
104
106 .calendar tbody td.selected { /* Cell showing today date */
105 .calendar tbody td.selected { /* Cell showing today date */
107 font-weight: bold;
106 font-weight: bold;
108 border: 1px solid #000;
107 border: 1px solid #000;
109 padding: 1px 3px 1px 1px;
108 padding: 1px 3px 1px 1px;
110 background: #fff;
109 background: #fff;
111 color: #000;
110 color: #000;
112 }
111 }
113
112
114 .calendar tbody td.weekend { /* Cells showing weekend days */
113 .calendar tbody td.weekend { /* Cells showing weekend days */
115 color: #a66;
114 color: #a66;
116 }
115 }
117
116
118 .calendar tbody td.today { /* Cell showing selected date */
117 .calendar tbody td.today { /* Cell showing selected date */
119 font-weight: bold;
118 font-weight: bold;
120 color: #f00;
119 color: #f00;
121 }
120 }
122
121
123 .calendar tbody .disabled { color: #999; }
122 .calendar tbody .disabled { color: #999; }
124
123
125 .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
124 .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
126 visibility: hidden;
125 visibility: hidden;
127 }
126 }
128
127
129 .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
128 .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
130 display: none;
129 display: none;
131 }
130 }
132
131
133 /* The footer part -- status bar and "Close" button */
132 /* The footer part -- status bar and "Close" button */
134
133
135 .calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
134 .calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
136 text-align: center;
135 text-align: center;
137 background: #556;
136 background: #556;
138 color: #fff;
137 color: #fff;
139 }
138 }
140
139
141 .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
140 .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
142 background: #fff;
141 background: #fff;
143 color: #445;
142 color: #445;
144 border-top: 1px solid #556;
143 border-top: 1px solid #556;
145 padding: 1px;
144 padding: 1px;
146 }
145 }
147
146
148 .calendar tfoot .hilite { /* Hover style for buttons in footer */
147 .calendar tfoot .hilite { /* Hover style for buttons in footer */
149 background: #aaf;
148 background: #aaf;
150 border: 1px solid #04f;
149 border: 1px solid #04f;
151 color: #000;
150 color: #000;
152 padding: 1px;
151 padding: 1px;
153 }
152 }
154
153
155 .calendar tfoot .active { /* Active (pressed) style for buttons in footer */
154 .calendar tfoot .active { /* Active (pressed) style for buttons in footer */
156 background: #77c;
155 background: #77c;
157 padding: 2px 0px 0px 2px;
156 padding: 2px 0px 0px 2px;
158 }
157 }
159
158
160 /* Combo boxes (menus that display months/years for direct selection) */
159 /* Combo boxes (menus that display months/years for direct selection) */
161
160
162 .calendar .combo {
161 .calendar .combo {
163 position: absolute;
162 position: absolute;
164 display: none;
163 display: none;
165 top: 0px;
164 top: 0px;
166 left: 0px;
165 left: 0px;
167 width: 4em;
166 width: 4em;
168 cursor: default;
167 cursor: default;
169 border: 1px solid #655;
168 border: 1px solid #655;
170 background: #def;
169 background: #def;
171 color: #000;
170 color: #000;
172 font-size: 90%;
171 font-size: 90%;
173 z-index: 100;
172 z-index: 100;
174 }
173 }
175
174
176 .calendar .combo .label,
175 .calendar .combo .label,
177 .calendar .combo .label-IEfix {
176 .calendar .combo .label-IEfix {
178 text-align: center;
177 text-align: center;
179 padding: 1px;
178 padding: 1px;
180 }
179 }
181
180
182 .calendar .combo .label-IEfix {
181 .calendar .combo .label-IEfix {
183 width: 4em;
182 width: 4em;
184 }
183 }
185
184
186 .calendar .combo .hilite {
185 .calendar .combo .hilite {
187 background: #acf;
186 background: #acf;
188 }
187 }
189
188
190 .calendar .combo .active {
189 .calendar .combo .active {
191 border-top: 1px solid #46a;
190 border-top: 1px solid #46a;
192 border-bottom: 1px solid #46a;
191 border-bottom: 1px solid #46a;
193 background: #eef;
192 background: #eef;
194 font-weight: bold;
193 font-weight: bold;
195 }
194 }
196
195
197 .calendar td.time {
196 .calendar td.time {
198 border-top: 1px solid #000;
197 border-top: 1px solid #000;
199 padding: 1px 0px;
198 padding: 1px 0px;
200 text-align: center;
199 text-align: center;
201 background-color: #f4f0e8;
200 background-color: #f4f0e8;
202 }
201 }
203
202
204 .calendar td.time .hour,
203 .calendar td.time .hour,
205 .calendar td.time .minute,
204 .calendar td.time .minute,
206 .calendar td.time .ampm {
205 .calendar td.time .ampm {
207 padding: 0px 3px 0px 4px;
206 padding: 0px 3px 0px 4px;
208 border: 1px solid #889;
207 border: 1px solid #889;
209 font-weight: bold;
208 font-weight: bold;
210 background-color: #fff;
209 background-color: #fff;
211 }
210 }
212
211
213 .calendar td.time .ampm {
212 .calendar td.time .ampm {
214 text-align: center;
213 text-align: center;
215 }
214 }
216
215
217 .calendar td.time .colon {
216 .calendar td.time .colon {
218 padding: 0px 2px 0px 3px;
217 padding: 0px 2px 0px 3px;
219 font-weight: bold;
218 font-weight: bold;
220 }
219 }
221
220
222 .calendar td.time span.hilite {
221 .calendar td.time span.hilite {
223 border-color: #000;
222 border-color: #000;
224 background-color: #667;
223 background-color: #667;
225 color: #fff;
224 color: #fff;
226 }
225 }
227
226
228 .calendar td.time span.active {
227 .calendar td.time span.active {
229 border-color: #f00;
228 border-color: #f00;
230 background-color: #000;
229 background-color: #000;
231 color: #0f0;
230 color: #0f0;
232 }
231 }
General Comments 0
You need to be logged in to leave comments. Login now