@@ -0,0 +1,5 | |||
|
1 | <ul> | |
|
2 | <% @users.each do |user| -%> | |
|
3 | <li><%= h user.login %><span class="informal"> (<%= h(user.name(:lastname_coma_firstname)) %>)</span></li> | |
|
4 | <% end -%> | |
|
5 | </ul> |
@@ -1,77 +1,84 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | class MembersController < ApplicationController |
|
19 | before_filter :find_member, :except => :new | |
|
20 | before_filter :find_project, :only => :new | |
|
19 | before_filter :find_member, :except => [:new, :autocomplete_for_member_login] | |
|
20 | before_filter :find_project, :only => [:new, :autocomplete_for_member_login] | |
|
21 | 21 | before_filter :authorize |
|
22 | 22 | |
|
23 | 23 | def new |
|
24 | 24 | members = [] |
|
25 | 25 | if params[:member] && request.post? |
|
26 | 26 | attrs = params[:member].dup |
|
27 | 27 | if (user_ids = attrs.delete(:user_ids)) |
|
28 | 28 | user_ids.each do |user_id| |
|
29 | 29 | members << Member.new(attrs.merge(:user_id => user_id)) |
|
30 | 30 | end |
|
31 | 31 | else |
|
32 | 32 | members << Member.new(attrs) |
|
33 | 33 | end |
|
34 | 34 | @project.members << members |
|
35 | 35 | end |
|
36 | 36 | respond_to do |format| |
|
37 | 37 | format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project } |
|
38 | 38 | format.js { |
|
39 | 39 | render(:update) {|page| |
|
40 | 40 | page.replace_html "tab-content-members", :partial => 'projects/settings/members' |
|
41 | 41 | members.each {|member| page.visual_effect(:highlight, "member-#{member.id}") } |
|
42 | 42 | } |
|
43 | 43 | } |
|
44 | 44 | end |
|
45 | 45 | end |
|
46 | 46 | |
|
47 | 47 | def edit |
|
48 | 48 | if request.post? and @member.update_attributes(params[:member]) |
|
49 | 49 | respond_to do |format| |
|
50 | 50 | format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project } |
|
51 | 51 | format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members'} } |
|
52 | 52 | end |
|
53 | 53 | end |
|
54 | 54 | end |
|
55 | 55 | |
|
56 | 56 | def destroy |
|
57 | 57 | @member.destroy |
|
58 | 58 | respond_to do |format| |
|
59 | 59 | format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project } |
|
60 | 60 | format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members'} } |
|
61 | 61 | end |
|
62 | 62 | end |
|
63 | ||
|
64 | def autocomplete_for_member_login | |
|
65 | @users = User.active.find(:all, :conditions => ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ?", "#{params[:user]}%", "#{params[:user]}%", "#{params[:user]}%"], | |
|
66 | :limit => 10, | |
|
67 | :order => 'login ASC') - @project.users | |
|
68 | render :layout => false | |
|
69 | end | |
|
63 | 70 | |
|
64 | 71 | private |
|
65 | 72 | def find_project |
|
66 | 73 | @project = Project.find(params[:id]) |
|
67 | 74 | rescue ActiveRecord::RecordNotFound |
|
68 | 75 | render_404 |
|
69 | 76 | end |
|
70 | 77 | |
|
71 | 78 | def find_member |
|
72 | 79 | @member = Member.find(params[:id]) |
|
73 | 80 | @project = @member.project |
|
74 | 81 | rescue ActiveRecord::RecordNotFound |
|
75 | 82 | render_404 |
|
76 | 83 | end |
|
77 | 84 | end |
@@ -1,42 +1,52 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | class Member < ActiveRecord::Base |
|
19 | 19 | belongs_to :user |
|
20 | 20 | belongs_to :role |
|
21 | 21 | belongs_to :project |
|
22 | 22 | |
|
23 | 23 | validates_presence_of :role, :user, :project |
|
24 | 24 | validates_uniqueness_of :user_id, :scope => :project_id |
|
25 | 25 | |
|
26 | 26 | def validate |
|
27 | 27 | errors.add :role_id, :invalid if role && !role.member? |
|
28 | 28 | end |
|
29 | 29 | |
|
30 | 30 | def name |
|
31 | 31 | self.user.name |
|
32 | 32 | end |
|
33 | 33 | |
|
34 | # Sets user by login | |
|
35 | def user_login=(login) | |
|
36 | login = login.to_s | |
|
37 | unless login.blank? | |
|
38 | if (u = User.find_by_login(login)) | |
|
39 | self.user = u | |
|
40 | end | |
|
41 | end | |
|
42 | end | |
|
43 | ||
|
34 | 44 | def <=>(member) |
|
35 | 45 | role == member.role ? (user <=> member.user) : (role <=> member.role) |
|
36 | 46 | end |
|
37 | 47 | |
|
38 | 48 | def before_destroy |
|
39 | 49 | # remove category based auto assignments for this member |
|
40 | 50 | IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id] |
|
41 | 51 | end |
|
42 | 52 | end |
@@ -1,59 +1,66 | |||
|
1 | 1 | <%= error_messages_for 'member' %> |
|
2 |
<% roles = Role.find_all_givable |
|
|
3 | <% users = User.active.find(:all).sort - @project.users %> | |
|
4 | <% # members sorted by role position | |
|
2 | <% roles = Role.find_all_givable | |
|
5 | 3 | members = @project.members.find(:all, :include => [:role, :user]).sort %> |
|
6 | 4 | |
|
7 | 5 | <div class="splitcontentleft"> |
|
8 | 6 | <% if members.any? %> |
|
9 | 7 | <table class="list"> |
|
10 | 8 | <thead> |
|
11 | 9 | <th><%= l(:label_user) %></th> |
|
12 | 10 | <th><%= l(:label_role) %></th> |
|
13 | 11 | <th style="width:15%"></th> |
|
14 | 12 | <%= call_hook(:view_projects_settings_members_table_header, :project => @project) %> |
|
15 | 13 | </thead> |
|
16 | 14 | <tbody> |
|
17 | 15 | <% members.each do |member| %> |
|
18 | 16 | <% next if member.new_record? %> |
|
19 | 17 | <tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %>"> |
|
20 | 18 | <td><%=h member.name %></td> |
|
21 | 19 | <td align="center"> |
|
22 | 20 | <% if authorize_for('members', 'edit') %> |
|
23 | 21 | <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, :method => :post) do |f| %> |
|
24 | 22 | <%= f.select :role_id, roles.collect{|role| [role.name, role.id]}, {}, :class => "small" %> |
|
25 | 23 | <%= submit_tag l(:button_change), :class => "small" %> |
|
26 | 24 | <% end %> |
|
27 | 25 | <% end %> |
|
28 | 26 | </td> |
|
29 | 27 | <td align="center"> |
|
30 | 28 | <%= link_to_remote l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member}, |
|
31 | 29 | :method => :post |
|
32 | 30 | }, :title => l(:button_delete), |
|
33 | 31 | :class => 'icon icon-del' %> |
|
34 | 32 | </td> |
|
35 | 33 | <%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %> |
|
36 | 34 | </tr> |
|
37 | 35 | </tbody> |
|
38 | 36 | <% end; reset_cycle %> |
|
39 | 37 | </table> |
|
40 | 38 | <% else %> |
|
41 | 39 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
42 | 40 | <% end %> |
|
43 | 41 | </div> |
|
44 | 42 | |
|
43 | ||
|
44 | <% users_count = User.active.count - @project.users.count | |
|
45 | users = (users_count < 300) ? User.active.find(:all, :limit => 200).sort - @project.users : [] %> | |
|
46 | ||
|
45 | 47 | <div class="splitcontentright"> |
|
46 | <% if !users.empty? %> | |
|
48 | <% if roles.any? && users_count > 0 %> | |
|
47 | 49 | <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post) do |f| %> |
|
48 | 50 | <fieldset><legend><%=l(:label_member_new)%></legend> |
|
49 | <div> | |
|
50 | <% users.each do |user| -%> | |
|
51 | <label><%= check_box_tag 'member[user_ids][]', user.id, false %> <%= user %></label> | |
|
52 | <% end -%> | |
|
53 |
< |
|
|
51 | <p><%= text_field_tag 'member[user_login]', nil, :size => "40" %></p> | |
|
52 | <div id="member_user_login_choices" class="autocomplete">sqd</div> | |
|
53 | <%= javascript_tag "new Ajax.Autocompleter('member_user_login', 'member_user_login_choices', '#{ url_for(:controller => 'members', :action => 'autocomplete_for_member_login', :id => @project) }', { minChars: 1, frequency: 0.5, paramName: 'user' });" %> | |
|
54 | <% unless users.empty? %> | |
|
55 | <div> | |
|
56 | <% users.each do |user| -%> | |
|
57 | <label><%= check_box_tag 'member[user_ids][]', user.id, false %> <%= user %></label> | |
|
58 | <% end -%> | |
|
59 | </div> | |
|
60 | <% end %> | |
|
54 | 61 | <p><%= l(:label_role) %>: <%= f.select :role_id, roles.collect{|role| [role.name, role.id]}, :selected => nil %> |
|
55 | 62 | <%= submit_tag l(:button_add) %></p> |
|
56 | 63 | </fieldset> |
|
57 | 64 | <% end %> |
|
58 | 65 | <% end %> |
|
59 | 66 | </div> |
@@ -1,163 +1,163 | |||
|
1 | 1 | require 'redmine/access_control' |
|
2 | 2 | require 'redmine/menu_manager' |
|
3 | 3 | require 'redmine/activity' |
|
4 | 4 | require 'redmine/mime_type' |
|
5 | 5 | require 'redmine/core_ext' |
|
6 | 6 | require 'redmine/themes' |
|
7 | 7 | require 'redmine/hook' |
|
8 | 8 | require 'redmine/plugin' |
|
9 | 9 | require 'redmine/wiki_formatting' |
|
10 | 10 | |
|
11 | 11 | begin |
|
12 | 12 | require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick) |
|
13 | 13 | rescue LoadError |
|
14 | 14 | # RMagick is not available |
|
15 | 15 | end |
|
16 | 16 | |
|
17 | 17 | REDMINE_SUPPORTED_SCM = %w( Subversion Darcs Mercurial Cvs Bazaar Git Filesystem ) |
|
18 | 18 | |
|
19 | 19 | # Permissions |
|
20 | 20 | Redmine::AccessControl.map do |map| |
|
21 | 21 | map.permission :view_project, {:projects => [:show, :activity]}, :public => true |
|
22 | 22 | map.permission :search_project, {:search => :index}, :public => true |
|
23 | 23 | map.permission :edit_project, {:projects => [:settings, :edit]}, :require => :member |
|
24 | 24 | map.permission :select_project_modules, {:projects => :modules}, :require => :member |
|
25 | map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy]}, :require => :member | |
|
25 | map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member_login]}, :require => :member | |
|
26 | 26 | map.permission :manage_versions, {:projects => [:settings, :add_version], :versions => [:edit, :destroy]}, :require => :member |
|
27 | 27 | |
|
28 | 28 | map.project_module :issue_tracking do |map| |
|
29 | 29 | # Issue categories |
|
30 | 30 | map.permission :manage_categories, {:projects => [:settings, :add_issue_category], :issue_categories => [:edit, :destroy]}, :require => :member |
|
31 | 31 | # Issues |
|
32 | 32 | map.permission :view_issues, {:projects => [:changelog, :roadmap], |
|
33 | 33 | :issues => [:index, :changes, :show, :context_menu], |
|
34 | 34 | :versions => [:show, :status_by], |
|
35 | 35 | :queries => :index, |
|
36 | 36 | :reports => :issue_report}, :public => true |
|
37 | 37 | map.permission :add_issues, {:issues => :new} |
|
38 | 38 | map.permission :edit_issues, {:issues => [:edit, :reply, :bulk_edit]} |
|
39 | 39 | map.permission :manage_issue_relations, {:issue_relations => [:new, :destroy]} |
|
40 | 40 | map.permission :add_issue_notes, {:issues => [:edit, :reply]} |
|
41 | 41 | map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin |
|
42 | 42 | map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin |
|
43 | 43 | map.permission :move_issues, {:issues => :move}, :require => :loggedin |
|
44 | 44 | map.permission :delete_issues, {:issues => :destroy}, :require => :member |
|
45 | 45 | # Queries |
|
46 | 46 | map.permission :manage_public_queries, {:queries => [:new, :edit, :destroy]}, :require => :member |
|
47 | 47 | map.permission :save_queries, {:queries => [:new, :edit, :destroy]}, :require => :loggedin |
|
48 | 48 | # Gantt & calendar |
|
49 | 49 | map.permission :view_gantt, :issues => :gantt |
|
50 | 50 | map.permission :view_calendar, :issues => :calendar |
|
51 | 51 | # Watchers |
|
52 | 52 | map.permission :view_issue_watchers, {} |
|
53 | 53 | map.permission :add_issue_watchers, {:watchers => :new} |
|
54 | 54 | end |
|
55 | 55 | |
|
56 | 56 | map.project_module :time_tracking do |map| |
|
57 | 57 | map.permission :log_time, {:timelog => :edit}, :require => :loggedin |
|
58 | 58 | map.permission :view_time_entries, :timelog => [:details, :report] |
|
59 | 59 | map.permission :edit_time_entries, {:timelog => [:edit, :destroy]}, :require => :member |
|
60 | 60 | map.permission :edit_own_time_entries, {:timelog => [:edit, :destroy]}, :require => :loggedin |
|
61 | 61 | end |
|
62 | 62 | |
|
63 | 63 | map.project_module :news do |map| |
|
64 | 64 | map.permission :manage_news, {:news => [:new, :edit, :destroy, :destroy_comment]}, :require => :member |
|
65 | 65 | map.permission :view_news, {:news => [:index, :show]}, :public => true |
|
66 | 66 | map.permission :comment_news, {:news => :add_comment} |
|
67 | 67 | end |
|
68 | 68 | |
|
69 | 69 | map.project_module :documents do |map| |
|
70 | 70 | map.permission :manage_documents, {:documents => [:new, :edit, :destroy, :add_attachment]}, :require => :loggedin |
|
71 | 71 | map.permission :view_documents, :documents => [:index, :show, :download] |
|
72 | 72 | end |
|
73 | 73 | |
|
74 | 74 | map.project_module :files do |map| |
|
75 | 75 | map.permission :manage_files, {:projects => :add_file}, :require => :loggedin |
|
76 | 76 | map.permission :view_files, :projects => :list_files, :versions => :download |
|
77 | 77 | end |
|
78 | 78 | |
|
79 | 79 | map.project_module :wiki do |map| |
|
80 | 80 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member |
|
81 | 81 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member |
|
82 | 82 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member |
|
83 | 83 | map.permission :view_wiki_pages, :wiki => [:index, :special] |
|
84 | 84 | map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate] |
|
85 | 85 | map.permission :edit_wiki_pages, :wiki => [:edit, :preview, :add_attachment] |
|
86 | 86 | map.permission :delete_wiki_pages_attachments, {} |
|
87 | 87 | map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member |
|
88 | 88 | end |
|
89 | 89 | |
|
90 | 90 | map.project_module :repository do |map| |
|
91 | 91 | map.permission :manage_repository, {:repositories => [:edit, :committers, :destroy]}, :require => :member |
|
92 | 92 | map.permission :browse_repository, :repositories => [:show, :browse, :entry, :annotate, :changes, :diff, :stats, :graph] |
|
93 | 93 | map.permission :view_changesets, :repositories => [:show, :revisions, :revision] |
|
94 | 94 | map.permission :commit_access, {} |
|
95 | 95 | end |
|
96 | 96 | |
|
97 | 97 | map.project_module :boards do |map| |
|
98 | 98 | map.permission :manage_boards, {:boards => [:new, :edit, :destroy]}, :require => :member |
|
99 | 99 | map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true |
|
100 | 100 | map.permission :add_messages, {:messages => [:new, :reply, :quote]} |
|
101 | 101 | map.permission :edit_messages, {:messages => :edit}, :require => :member |
|
102 | 102 | map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin |
|
103 | 103 | map.permission :delete_messages, {:messages => :destroy}, :require => :member |
|
104 | 104 | map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin |
|
105 | 105 | end |
|
106 | 106 | end |
|
107 | 107 | |
|
108 | 108 | Redmine::MenuManager.map :top_menu do |menu| |
|
109 | 109 | menu.push :home, :home_path |
|
110 | 110 | menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } |
|
111 | 111 | menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural |
|
112 | 112 | menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true |
|
113 | 113 | menu.push :help, Redmine::Info.help_url, :last => true |
|
114 | 114 | end |
|
115 | 115 | |
|
116 | 116 | Redmine::MenuManager.map :account_menu do |menu| |
|
117 | 117 | menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } |
|
118 | 118 | menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? } |
|
119 | 119 | menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } |
|
120 | 120 | menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? } |
|
121 | 121 | end |
|
122 | 122 | |
|
123 | 123 | Redmine::MenuManager.map :application_menu do |menu| |
|
124 | 124 | # Empty |
|
125 | 125 | end |
|
126 | 126 | |
|
127 | 127 | Redmine::MenuManager.map :admin_menu do |menu| |
|
128 | 128 | # Empty |
|
129 | 129 | end |
|
130 | 130 | |
|
131 | 131 | Redmine::MenuManager.map :project_menu do |menu| |
|
132 | 132 | menu.push :overview, { :controller => 'projects', :action => 'show' } |
|
133 | 133 | menu.push :activity, { :controller => 'projects', :action => 'activity' } |
|
134 | 134 | menu.push :roadmap, { :controller => 'projects', :action => 'roadmap' }, |
|
135 | 135 | :if => Proc.new { |p| p.versions.any? } |
|
136 | 136 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |
|
137 | 137 | menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, |
|
138 | 138 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } |
|
139 | 139 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural |
|
140 | 140 | menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural |
|
141 | 141 | menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil }, |
|
142 | 142 | :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } |
|
143 | 143 | menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, |
|
144 | 144 | :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural |
|
145 | 145 | menu.push :files, { :controller => 'projects', :action => 'list_files' }, :caption => :label_attachment_plural |
|
146 | 146 | menu.push :repository, { :controller => 'repositories', :action => 'show' }, |
|
147 | 147 | :if => Proc.new { |p| p.repository && !p.repository.new_record? } |
|
148 | 148 | menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true |
|
149 | 149 | end |
|
150 | 150 | |
|
151 | 151 | Redmine::Activity.map do |activity| |
|
152 | 152 | activity.register :issues, :class_name => %w(Issue Journal) |
|
153 | 153 | activity.register :changesets |
|
154 | 154 | activity.register :news |
|
155 | 155 | activity.register :documents, :class_name => %w(Document Attachment) |
|
156 | 156 | activity.register :files, :class_name => 'Attachment' |
|
157 | 157 | activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false |
|
158 | 158 | activity.register :messages, :default => false |
|
159 | 159 | end |
|
160 | 160 | |
|
161 | 161 | Redmine::WikiFormatting.map do |format| |
|
162 | 162 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper |
|
163 | 163 | end |
@@ -1,729 +1,759 | |||
|
1 | 1 | body { font-family: Verdana, sans-serif; font-size: 12px; color:#484848; margin: 0; padding: 0; min-width: 900px; } |
|
2 | 2 | |
|
3 | 3 | h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, sans-serif;} |
|
4 | 4 | h1 {margin:0; padding:0; font-size: 24px;} |
|
5 | 5 | h2, .wiki h1 {font-size: 20px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;} |
|
6 | 6 | h3, .wiki h2 {font-size: 16px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;} |
|
7 | 7 | h4, .wiki h3 {font-size: 13px;padding: 2px 10px 1px 0px;margin-bottom: 5px; border-bottom: 1px dotted #bbbbbb; color: #444;} |
|
8 | 8 | |
|
9 | 9 | /***** Layout *****/ |
|
10 | 10 | #wrapper {background: white;} |
|
11 | 11 | |
|
12 | 12 | #top-menu {background: #2C4056; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 2px 0px 6px;} |
|
13 | 13 | #top-menu ul {margin: 0; padding: 0;} |
|
14 | 14 | #top-menu li { |
|
15 | 15 | float:left; |
|
16 | 16 | list-style-type:none; |
|
17 | 17 | margin: 0px 0px 0px 0px; |
|
18 | 18 | padding: 0px 0px 0px 0px; |
|
19 | 19 | white-space:nowrap; |
|
20 | 20 | } |
|
21 | 21 | #top-menu a {color: #fff; margin-right: 8px; font-weight: bold;} |
|
22 | 22 | #top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; } |
|
23 | 23 | |
|
24 | 24 | #account {float:right;} |
|
25 | 25 | |
|
26 | 26 | #header {height:5.3em;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;} |
|
27 | 27 | #header a {color:#f8f8f8;} |
|
28 | 28 | #header h1 a.ancestor { font-size: 80%; } |
|
29 | 29 | #quick-search {float:right;} |
|
30 | 30 | |
|
31 | 31 | #main-menu {position: absolute; bottom: 0px; left:6px; margin-right: -500px;} |
|
32 | 32 | #main-menu ul {margin: 0; padding: 0;} |
|
33 | 33 | #main-menu li { |
|
34 | 34 | float:left; |
|
35 | 35 | list-style-type:none; |
|
36 | 36 | margin: 0px 2px 0px 0px; |
|
37 | 37 | padding: 0px 0px 0px 0px; |
|
38 | 38 | white-space:nowrap; |
|
39 | 39 | } |
|
40 | 40 | #main-menu li a { |
|
41 | 41 | display: block; |
|
42 | 42 | color: #fff; |
|
43 | 43 | text-decoration: none; |
|
44 | 44 | font-weight: bold; |
|
45 | 45 | margin: 0; |
|
46 | 46 | padding: 4px 10px 4px 10px; |
|
47 | 47 | } |
|
48 | 48 | #main-menu li a:hover {background:#759FCF; color:#fff;} |
|
49 | 49 | #main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;} |
|
50 | 50 | |
|
51 | 51 | #main {background-color:#EEEEEE;} |
|
52 | 52 | |
|
53 | 53 | #sidebar{ float: right; width: 17%; position: relative; z-index: 9; min-height: 600px; padding: 0; margin: 0;} |
|
54 | 54 | * html #sidebar{ width: 17%; } |
|
55 | 55 | #sidebar h3{ font-size: 14px; margin-top:14px; color: #666; } |
|
56 | 56 | #sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; } |
|
57 | 57 | * html #sidebar hr{ width: 95%; position: relative; left: -6px; color: #ccc; } |
|
58 | 58 | |
|
59 | 59 | #content { width: 80%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; } |
|
60 | 60 | * html #content{ width: 80%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;} |
|
61 | 61 | html>body #content { min-height: 600px; } |
|
62 | 62 | * html body #content { height: 600px; } /* IE */ |
|
63 | 63 | |
|
64 | 64 | #main.nosidebar #sidebar{ display: none; } |
|
65 | 65 | #main.nosidebar #content{ width: auto; border-right: 0; } |
|
66 | 66 | |
|
67 | 67 | #footer {clear: both; border-top: 1px solid #bbb; font-size: 0.9em; color: #aaa; padding: 5px; text-align:center; background:#fff;} |
|
68 | 68 | |
|
69 | 69 | #login-form table {margin-top:5em; padding:1em; margin-left: auto; margin-right: auto; border: 2px solid #FDBF3B; background-color:#FFEBC1; } |
|
70 | 70 | #login-form table td {padding: 6px;} |
|
71 | 71 | #login-form label {font-weight: bold;} |
|
72 | 72 | |
|
73 | 73 | input#openid_url { background: url(../images/openid-bg.gif) no-repeat; background-color: #fff; background-position: 0 50%; padding-left: 18px; } |
|
74 | 74 | |
|
75 | 75 | .clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; } |
|
76 | 76 | |
|
77 | 77 | /***** Links *****/ |
|
78 | 78 | a, a:link, a:visited{ color: #2A5685; text-decoration: none; } |
|
79 | 79 | a:hover, a:active{ color: #c61a1a; text-decoration: underline;} |
|
80 | 80 | a img{ border: 0; } |
|
81 | 81 | |
|
82 | 82 | a.issue.closed, a.issue.closed:link, a.issue.closed:visited { text-decoration: line-through; } |
|
83 | 83 | |
|
84 | 84 | /***** Tables *****/ |
|
85 | 85 | table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; } |
|
86 | 86 | table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; } |
|
87 | 87 | table.list td { vertical-align: top; } |
|
88 | 88 | table.list td.id { width: 2%; text-align: center;} |
|
89 | 89 | table.list td.checkbox { width: 15px; padding: 0px;} |
|
90 | 90 | |
|
91 | 91 | tr.project td.name a { padding-left: 16px; white-space:nowrap; } |
|
92 | 92 | tr.project.parent td.name a { background: url('../images/bullet_toggle_minus.png') no-repeat; } |
|
93 | 93 | |
|
94 | 94 | tr.issue { text-align: center; white-space: nowrap; } |
|
95 | 95 | tr.issue td.subject, tr.issue td.category, td.assigned_to { white-space: normal; } |
|
96 | 96 | tr.issue td.subject { text-align: left; } |
|
97 | 97 | tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;} |
|
98 | 98 | |
|
99 | 99 | tr.entry { border: 1px solid #f8f8f8; } |
|
100 | 100 | tr.entry td { white-space: nowrap; } |
|
101 | 101 | tr.entry td.filename { width: 30%; } |
|
102 | 102 | tr.entry td.size { text-align: right; font-size: 90%; } |
|
103 | 103 | tr.entry td.revision, tr.entry td.author { text-align: center; } |
|
104 | 104 | tr.entry td.age { text-align: right; } |
|
105 | 105 | |
|
106 | 106 | tr.entry span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} |
|
107 | 107 | tr.entry.open span.expander {background-image: url(../images/bullet_toggle_minus.png);} |
|
108 | 108 | tr.entry.file td.filename a { margin-left: 16px; } |
|
109 | 109 | |
|
110 | 110 | tr.changeset td.author { text-align: center; width: 15%; } |
|
111 | 111 | tr.changeset td.committed_on { text-align: center; width: 15%; } |
|
112 | 112 | |
|
113 | 113 | table.files tr.file td { text-align: center; } |
|
114 | 114 | table.files tr.file td.filename { text-align: left; padding-left: 24px; } |
|
115 | 115 | table.files tr.file td.digest { font-size: 80%; } |
|
116 | 116 | |
|
117 | 117 | tr.message { height: 2.6em; } |
|
118 | 118 | tr.message td.last_message { font-size: 80%; } |
|
119 | 119 | tr.message.locked td.subject a { background-image: url(../images/locked.png); } |
|
120 | 120 | tr.message.sticky td.subject a { background-image: url(../images/sticky.png); font-weight: bold; } |
|
121 | 121 | |
|
122 | 122 | tr.user td { width:13%; } |
|
123 | 123 | tr.user td.email { width:18%; } |
|
124 | 124 | tr.user td { white-space: nowrap; } |
|
125 | 125 | tr.user.locked, tr.user.registered { color: #aaa; } |
|
126 | 126 | tr.user.locked a, tr.user.registered a { color: #aaa; } |
|
127 | 127 | |
|
128 | 128 | tr.time-entry { text-align: center; white-space: nowrap; } |
|
129 | 129 | tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; white-space: normal; } |
|
130 | 130 | td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; } |
|
131 | 131 | td.hours .hours-dec { font-size: 0.9em; } |
|
132 | 132 | |
|
133 | 133 | table.plugins td { vertical-align: middle; } |
|
134 | 134 | table.plugins td.configure { text-align: right; padding-right: 1em; } |
|
135 | 135 | table.plugins span.name { font-weight: bold; display: block; margin-bottom: 6px; } |
|
136 | 136 | table.plugins span.description { display: block; font-size: 0.9em; } |
|
137 | 137 | table.plugins span.url { display: block; font-size: 0.9em; } |
|
138 | 138 | |
|
139 | 139 | table.list tbody tr:hover { background-color:#ffffdd; } |
|
140 | 140 | table td {padding:2px;} |
|
141 | 141 | table p {margin:0;} |
|
142 | 142 | .odd {background-color:#f6f7f8;} |
|
143 | 143 | .even {background-color: #fff;} |
|
144 | 144 | |
|
145 | 145 | a.sort { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; } |
|
146 | 146 | a.sort.asc { background-image: url(../images/sort_asc.png); } |
|
147 | 147 | a.sort.desc { background-image: url(../images/sort_desc.png); } |
|
148 | 148 | |
|
149 | 149 | .highlight { background-color: #FCFD8D;} |
|
150 | 150 | .highlight.token-1 { background-color: #faa;} |
|
151 | 151 | .highlight.token-2 { background-color: #afa;} |
|
152 | 152 | .highlight.token-3 { background-color: #aaf;} |
|
153 | 153 | |
|
154 | 154 | .box{ |
|
155 | 155 | padding:6px; |
|
156 | 156 | margin-bottom: 10px; |
|
157 | 157 | background-color:#f6f6f6; |
|
158 | 158 | color:#505050; |
|
159 | 159 | line-height:1.5em; |
|
160 | 160 | border: 1px solid #e4e4e4; |
|
161 | 161 | } |
|
162 | 162 | |
|
163 | 163 | div.square { |
|
164 | 164 | border: 1px solid #999; |
|
165 | 165 | float: left; |
|
166 | 166 | margin: .3em .4em 0 .4em; |
|
167 | 167 | overflow: hidden; |
|
168 | 168 | width: .6em; height: .6em; |
|
169 | 169 | } |
|
170 | 170 | .contextual {float:right; white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;} |
|
171 | 171 | .contextual input {font-size:0.9em;} |
|
172 | 172 | .message .contextual { margin-top: 0; } |
|
173 | 173 | |
|
174 | 174 | .splitcontentleft{float:left; width:49%;} |
|
175 | 175 | .splitcontentright{float:right; width:49%;} |
|
176 | 176 | form {display: inline;} |
|
177 | 177 | input, select {vertical-align: middle; margin-top: 1px; margin-bottom: 1px;} |
|
178 | 178 | fieldset {border: 1px solid #e4e4e4; margin:0;} |
|
179 | 179 | legend {color: #484848;} |
|
180 | 180 | hr { width: 100%; height: 1px; background: #ccc; border: 0;} |
|
181 | 181 | blockquote { font-style: italic; border-left: 3px solid #e0e0e0; padding-left: 0.6em; margin-left: 2.4em;} |
|
182 | 182 | blockquote blockquote { margin-left: 0;} |
|
183 | 183 | textarea.wiki-edit { width: 99%; } |
|
184 | 184 | li p {margin-top: 0;} |
|
185 | 185 | div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} |
|
186 | 186 | p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;} |
|
187 | 187 | p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; } |
|
188 | 188 | p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; } |
|
189 | 189 | |
|
190 | 190 | fieldset#filters, fieldset#date-range { padding: 0.7em; margin-bottom: 8px; } |
|
191 | 191 | fieldset#filters p { margin: 1.2em 0 0.8em 2px; } |
|
192 | 192 | fieldset#filters table { border-collapse: collapse; } |
|
193 | 193 | fieldset#filters table td { padding: 0; vertical-align: middle; } |
|
194 | 194 | fieldset#filters tr.filter { height: 2em; } |
|
195 | 195 | fieldset#filters td.add-filter { text-align: right; vertical-align: top; } |
|
196 | 196 | .buttons { font-size: 0.9em; } |
|
197 | 197 | |
|
198 | 198 | div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;} |
|
199 | 199 | div#issue-changesets .changeset { padding: 4px;} |
|
200 | 200 | div#issue-changesets .changeset { border-bottom: 1px solid #ddd; } |
|
201 | 201 | div#issue-changesets p { margin-top: 0; margin-bottom: 1em;} |
|
202 | 202 | |
|
203 | 203 | div#activity dl, #search-results { margin-left: 2em; } |
|
204 | 204 | div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; } |
|
205 | 205 | div#activity dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; } |
|
206 | 206 | div#activity dt.me .time { border-bottom: 1px solid #999; } |
|
207 | 207 | div#activity dt .time { color: #777; font-size: 80%; } |
|
208 | 208 | div#activity dd .description, #search-results dd .description { font-style: italic; } |
|
209 | 209 | div#activity span.project:after, #search-results span.project:after { content: " -"; } |
|
210 | 210 | div#activity dd span.description, #search-results dd span.description { display:block; color: #808080; } |
|
211 | 211 | |
|
212 | 212 | #search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; } |
|
213 | 213 | |
|
214 | 214 | div#search-results-counts {float:right;} |
|
215 | 215 | div#search-results-counts ul { margin-top: 0.5em; } |
|
216 | 216 | div#search-results-counts li { list-style-type:none; float: left; margin-left: 1em; } |
|
217 | 217 | |
|
218 | 218 | dt.issue { background-image: url(../images/ticket.png); } |
|
219 | 219 | dt.issue-edit { background-image: url(../images/ticket_edit.png); } |
|
220 | 220 | dt.issue-closed { background-image: url(../images/ticket_checked.png); } |
|
221 | 221 | dt.issue-note { background-image: url(../images/ticket_note.png); } |
|
222 | 222 | dt.changeset { background-image: url(../images/changeset.png); } |
|
223 | 223 | dt.news { background-image: url(../images/news.png); } |
|
224 | 224 | dt.message { background-image: url(../images/message.png); } |
|
225 | 225 | dt.reply { background-image: url(../images/comments.png); } |
|
226 | 226 | dt.wiki-page { background-image: url(../images/wiki_edit.png); } |
|
227 | 227 | dt.attachment { background-image: url(../images/attachment.png); } |
|
228 | 228 | dt.document { background-image: url(../images/document.png); } |
|
229 | 229 | dt.project { background-image: url(../images/projects.png); } |
|
230 | 230 | |
|
231 | 231 | #search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); } |
|
232 | 232 | |
|
233 | 233 | div#roadmap fieldset.related-issues { margin-bottom: 1em; } |
|
234 | 234 | div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; } |
|
235 | 235 | div#roadmap .wiki h1:first-child { display: none; } |
|
236 | 236 | div#roadmap .wiki h1 { font-size: 120%; } |
|
237 | 237 | div#roadmap .wiki h2 { font-size: 110%; } |
|
238 | 238 | |
|
239 | 239 | div#version-summary { float:right; width:380px; margin-left: 16px; margin-bottom: 16px; background-color: #fff; } |
|
240 | 240 | div#version-summary fieldset { margin-bottom: 1em; } |
|
241 | 241 | div#version-summary .total-hours { text-align: right; } |
|
242 | 242 | |
|
243 | 243 | table#time-report td.hours, table#time-report th.period, table#time-report th.total { text-align: right; padding-right: 0.5em; } |
|
244 | 244 | table#time-report tbody tr { font-style: italic; color: #777; } |
|
245 | 245 | table#time-report tbody tr.last-level { font-style: normal; color: #555; } |
|
246 | 246 | table#time-report tbody tr.total { font-style: normal; font-weight: bold; color: #555; background-color:#EEEEEE; } |
|
247 | 247 | table#time-report .hours-dec { font-size: 0.9em; } |
|
248 | 248 | |
|
249 | 249 | form#issue-form .attributes { margin-bottom: 8px; } |
|
250 | 250 | form#issue-form .attributes p { padding-top: 1px; padding-bottom: 2px; } |
|
251 | 251 | form#issue-form .attributes select { min-width: 30%; } |
|
252 | 252 | |
|
253 | 253 | ul.projects { margin: 0; padding-left: 1em; } |
|
254 | 254 | ul.projects.root { margin: 0; padding: 0; } |
|
255 | 255 | ul.projects ul { border-left: 3px solid #e0e0e0; } |
|
256 | 256 | ul.projects li { list-style-type:none; } |
|
257 | 257 | ul.projects li.root { margin-bottom: 1em; } |
|
258 | 258 | ul.projects li.child { margin-top: 1em;} |
|
259 | 259 | ul.projects div.root a.project { font-family: "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 16px; margin: 0 0 10px 0; } |
|
260 | 260 | .my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; } |
|
261 | 261 | |
|
262 | 262 | #tracker_project_ids ul { margin: 0; padding-left: 1em; } |
|
263 | 263 | #tracker_project_ids li { list-style-type:none; } |
|
264 | 264 | |
|
265 | 265 | ul.properties {padding:0; font-size: 0.9em; color: #777;} |
|
266 | 266 | ul.properties li {list-style-type:none;} |
|
267 | 267 | ul.properties li span {font-style:italic;} |
|
268 | 268 | |
|
269 | 269 | .total-hours { font-size: 110%; font-weight: bold; } |
|
270 | 270 | .total-hours span.hours-int { font-size: 120%; } |
|
271 | 271 | |
|
272 | 272 | .autoscroll {overflow-x: auto; padding:1px; margin-bottom: 1.2em;} |
|
273 | 273 | #user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; } |
|
274 | 274 | |
|
275 | 275 | .pagination {font-size: 90%} |
|
276 | 276 | p.pagination {margin-top:8px;} |
|
277 | 277 | |
|
278 | 278 | /***** Tabular forms ******/ |
|
279 | 279 | .tabular p{ |
|
280 | 280 | margin: 0; |
|
281 | 281 | padding: 5px 0 8px 0; |
|
282 | 282 | padding-left: 180px; /*width of left column containing the label elements*/ |
|
283 | 283 | height: 1%; |
|
284 | 284 | clear:left; |
|
285 | 285 | } |
|
286 | 286 | |
|
287 | 287 | html>body .tabular p {overflow:hidden;} |
|
288 | 288 | |
|
289 | 289 | .tabular label{ |
|
290 | 290 | font-weight: bold; |
|
291 | 291 | float: left; |
|
292 | 292 | text-align: right; |
|
293 | 293 | margin-left: -180px; /*width of left column*/ |
|
294 | 294 | width: 175px; /*width of labels. Should be smaller than left column to create some right |
|
295 | 295 | margin*/ |
|
296 | 296 | } |
|
297 | 297 | |
|
298 | 298 | .tabular label.floating{ |
|
299 | 299 | font-weight: normal; |
|
300 | 300 | margin-left: 0px; |
|
301 | 301 | text-align: left; |
|
302 | 302 | width: 270px; |
|
303 | 303 | } |
|
304 | 304 | |
|
305 | 305 | input#time_entry_comments { width: 90%;} |
|
306 | 306 | |
|
307 | 307 | #preview fieldset {margin-top: 1em; background: url(../images/draft.png)} |
|
308 | 308 | |
|
309 | 309 | .tabular.settings p{ padding-left: 300px; } |
|
310 | 310 | .tabular.settings label{ margin-left: -300px; width: 295px; } |
|
311 | 311 | |
|
312 | 312 | .required {color: #bb0000;} |
|
313 | 313 | .summary {font-style: italic;} |
|
314 | 314 | |
|
315 | 315 | #attachments_fields input[type=text] {margin-left: 8px; } |
|
316 | 316 | |
|
317 | 317 | div.attachments { margin-top: 12px; } |
|
318 | 318 | div.attachments p { margin:4px 0 2px 0; } |
|
319 | 319 | div.attachments img { vertical-align: middle; } |
|
320 | 320 | div.attachments span.author { font-size: 0.9em; color: #888; } |
|
321 | 321 | |
|
322 | 322 | p.other-formats { text-align: right; font-size:0.9em; color: #666; } |
|
323 | 323 | .other-formats span + span:before { content: "| "; } |
|
324 | 324 | |
|
325 | 325 | a.atom { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; } |
|
326 | 326 | |
|
327 | 327 | /* Project members tab */ |
|
328 | 328 | div#tab-content-members .splitcontentleft { width: 64% } |
|
329 | 329 | div#tab-content-members .splitcontentright { width: 34% } |
|
330 |
div#tab-content-members fieldset { |
|
|
330 | div#tab-content-members fieldset { padding:1em; margin-bottom: 1em; } | |
|
331 | 331 | div#tab-content-members fieldset legend { font-weight: bold; } |
|
332 | 332 | div#tab-content-members fieldset label { display: block; } |
|
333 | 333 | div#tab-content-members fieldset div { max-height: 400px; overflow:auto; } |
|
334 | 334 | |
|
335 | 335 | * html div#tab-content-members fieldset div { height: 450px; } |
|
336 | 336 | |
|
337 | 337 | /***** Flash & error messages ****/ |
|
338 | 338 | #errorExplanation, div.flash, .nodata, .warning { |
|
339 | 339 | padding: 4px 4px 4px 30px; |
|
340 | 340 | margin-bottom: 12px; |
|
341 | 341 | font-size: 1.1em; |
|
342 | 342 | border: 2px solid; |
|
343 | 343 | } |
|
344 | 344 | |
|
345 | 345 | div.flash {margin-top: 8px;} |
|
346 | 346 | |
|
347 | 347 | div.flash.error, #errorExplanation { |
|
348 | 348 | background: url(../images/false.png) 8px 5px no-repeat; |
|
349 | 349 | background-color: #ffe3e3; |
|
350 | 350 | border-color: #dd0000; |
|
351 | 351 | color: #550000; |
|
352 | 352 | } |
|
353 | 353 | |
|
354 | 354 | div.flash.notice { |
|
355 | 355 | background: url(../images/true.png) 8px 5px no-repeat; |
|
356 | 356 | background-color: #dfffdf; |
|
357 | 357 | border-color: #9fcf9f; |
|
358 | 358 | color: #005f00; |
|
359 | 359 | } |
|
360 | 360 | |
|
361 | 361 | div.flash.warning { |
|
362 | 362 | background: url(../images/warning.png) 8px 5px no-repeat; |
|
363 | 363 | background-color: #FFEBC1; |
|
364 | 364 | border-color: #FDBF3B; |
|
365 | 365 | color: #A6750C; |
|
366 | 366 | text-align: left; |
|
367 | 367 | } |
|
368 | 368 | |
|
369 | 369 | .nodata, .warning { |
|
370 | 370 | text-align: center; |
|
371 | 371 | background-color: #FFEBC1; |
|
372 | 372 | border-color: #FDBF3B; |
|
373 | 373 | color: #A6750C; |
|
374 | 374 | } |
|
375 | 375 | |
|
376 | 376 | #errorExplanation ul { font-size: 0.9em;} |
|
377 | 377 | #errorExplanation h2, #errorExplanation p { display: none; } |
|
378 | 378 | |
|
379 | 379 | /***** Ajax indicator ******/ |
|
380 | 380 | #ajax-indicator { |
|
381 | 381 | position: absolute; /* fixed not supported by IE */ |
|
382 | 382 | background-color:#eee; |
|
383 | 383 | border: 1px solid #bbb; |
|
384 | 384 | top:35%; |
|
385 | 385 | left:40%; |
|
386 | 386 | width:20%; |
|
387 | 387 | font-weight:bold; |
|
388 | 388 | text-align:center; |
|
389 | 389 | padding:0.6em; |
|
390 | 390 | z-index:100; |
|
391 | 391 | filter:alpha(opacity=50); |
|
392 | 392 | opacity: 0.5; |
|
393 | 393 | } |
|
394 | 394 | |
|
395 | 395 | html>body #ajax-indicator { position: fixed; } |
|
396 | 396 | |
|
397 | 397 | #ajax-indicator span { |
|
398 | 398 | background-position: 0% 40%; |
|
399 | 399 | background-repeat: no-repeat; |
|
400 | 400 | background-image: url(../images/loading.gif); |
|
401 | 401 | padding-left: 26px; |
|
402 | 402 | vertical-align: bottom; |
|
403 | 403 | } |
|
404 | 404 | |
|
405 | 405 | /***** Calendar *****/ |
|
406 | 406 | table.cal {border-collapse: collapse; width: 100%; margin: 0px 0 6px 0;border: 1px solid #d7d7d7;} |
|
407 | 407 | table.cal thead th {width: 14%;} |
|
408 | 408 | table.cal tbody tr {height: 100px;} |
|
409 | 409 | table.cal th { background-color:#EEEEEE; padding: 4px; } |
|
410 | 410 | table.cal td {border: 1px solid #d7d7d7; vertical-align: top; font-size: 0.9em;} |
|
411 | 411 | table.cal td p.day-num {font-size: 1.1em; text-align:right;} |
|
412 | 412 | table.cal td.odd p.day-num {color: #bbb;} |
|
413 | 413 | table.cal td.today {background:#ffffdd;} |
|
414 | 414 | table.cal td.today p.day-num {font-weight: bold;} |
|
415 | 415 | |
|
416 | 416 | /***** Tooltips ******/ |
|
417 | 417 | .tooltip{position:relative;z-index:24;} |
|
418 | 418 | .tooltip:hover{z-index:25;color:#000;} |
|
419 | 419 | .tooltip span.tip{display: none; text-align:left;} |
|
420 | 420 | |
|
421 | 421 | div.tooltip:hover span.tip{ |
|
422 | 422 | display:block; |
|
423 | 423 | position:absolute; |
|
424 | 424 | top:12px; left:24px; width:270px; |
|
425 | 425 | border:1px solid #555; |
|
426 | 426 | background-color:#fff; |
|
427 | 427 | padding: 4px; |
|
428 | 428 | font-size: 0.8em; |
|
429 | 429 | color:#505050; |
|
430 | 430 | } |
|
431 | 431 | |
|
432 | 432 | /***** Progress bar *****/ |
|
433 | 433 | table.progress { |
|
434 | 434 | border: 1px solid #D7D7D7; |
|
435 | 435 | border-collapse: collapse; |
|
436 | 436 | border-spacing: 0pt; |
|
437 | 437 | empty-cells: show; |
|
438 | 438 | text-align: center; |
|
439 | 439 | float:left; |
|
440 | 440 | margin: 1px 6px 1px 0px; |
|
441 | 441 | } |
|
442 | 442 | |
|
443 | 443 | table.progress td { height: 0.9em; } |
|
444 | 444 | table.progress td.closed { background: #BAE0BA none repeat scroll 0%; } |
|
445 | 445 | table.progress td.done { background: #DEF0DE none repeat scroll 0%; } |
|
446 | 446 | table.progress td.open { background: #FFF none repeat scroll 0%; } |
|
447 | 447 | p.pourcent {font-size: 80%;} |
|
448 | 448 | p.progress-info {clear: left; font-style: italic; font-size: 80%;} |
|
449 | 449 | |
|
450 | 450 | /***** Tabs *****/ |
|
451 | 451 | #content .tabs {height: 2.6em; border-bottom: 1px solid #bbbbbb; margin-bottom:1.2em; position:relative;} |
|
452 | 452 | #content .tabs ul {margin:0; position:absolute; bottom:-2px; padding-left:1em;} |
|
453 | 453 | #content .tabs>ul { bottom:-1px; } /* others */ |
|
454 | 454 | #content .tabs ul li { |
|
455 | 455 | float:left; |
|
456 | 456 | list-style-type:none; |
|
457 | 457 | white-space:nowrap; |
|
458 | 458 | margin-right:8px; |
|
459 | 459 | background:#fff; |
|
460 | 460 | } |
|
461 | 461 | #content .tabs ul li a{ |
|
462 | 462 | display:block; |
|
463 | 463 | font-size: 0.9em; |
|
464 | 464 | text-decoration:none; |
|
465 | 465 | line-height:1.3em; |
|
466 | 466 | padding:4px 6px 4px 6px; |
|
467 | 467 | border: 1px solid #ccc; |
|
468 | 468 | border-bottom: 1px solid #bbbbbb; |
|
469 | 469 | background-color: #eeeeee; |
|
470 | 470 | color:#777; |
|
471 | 471 | font-weight:bold; |
|
472 | 472 | } |
|
473 | 473 | |
|
474 | 474 | #content .tabs ul li a:hover { |
|
475 | 475 | background-color: #ffffdd; |
|
476 | 476 | text-decoration:none; |
|
477 | 477 | } |
|
478 | 478 | |
|
479 | 479 | #content .tabs ul li a.selected { |
|
480 | 480 | background-color: #fff; |
|
481 | 481 | border: 1px solid #bbbbbb; |
|
482 | 482 | border-bottom: 1px solid #fff; |
|
483 | 483 | } |
|
484 | 484 | |
|
485 | 485 | #content .tabs ul li a.selected:hover { |
|
486 | 486 | background-color: #fff; |
|
487 | 487 | } |
|
488 | 488 | |
|
489 | /***** Auto-complete *****/ | |
|
490 | div.autocomplete { | |
|
491 | position:absolute; | |
|
492 | width:250px; | |
|
493 | background-color:white; | |
|
494 | margin:0; | |
|
495 | padding:0; | |
|
496 | } | |
|
497 | div.autocomplete ul { | |
|
498 | list-style-type:none; | |
|
499 | margin:0; | |
|
500 | padding:0; | |
|
501 | } | |
|
502 | div.autocomplete ul li.selected { background-color: #ffb;} | |
|
503 | div.autocomplete ul li { | |
|
504 | list-style-type:none; | |
|
505 | display:block; | |
|
506 | margin:0; | |
|
507 | padding:2px; | |
|
508 | cursor:pointer; | |
|
509 | font-size: 90%; | |
|
510 | border-bottom: 1px solid #ccc; | |
|
511 | border-left: 1px solid #ccc; | |
|
512 | border-right: 1px solid #ccc; | |
|
513 | } | |
|
514 | div.autocomplete ul li span.informal { | |
|
515 | font-size: 80%; | |
|
516 | color: #aaa; | |
|
517 | } | |
|
518 | ||
|
489 | 519 | /***** Diff *****/ |
|
490 | 520 | .diff_out { background: #fcc; } |
|
491 | 521 | .diff_in { background: #cfc; } |
|
492 | 522 | |
|
493 | 523 | /***** Wiki *****/ |
|
494 | 524 | div.wiki table { |
|
495 | 525 | border: 1px solid #505050; |
|
496 | 526 | border-collapse: collapse; |
|
497 | 527 | margin-bottom: 1em; |
|
498 | 528 | } |
|
499 | 529 | |
|
500 | 530 | div.wiki table, div.wiki td, div.wiki th { |
|
501 | 531 | border: 1px solid #bbb; |
|
502 | 532 | padding: 4px; |
|
503 | 533 | } |
|
504 | 534 | |
|
505 | 535 | div.wiki .external { |
|
506 | 536 | background-position: 0% 60%; |
|
507 | 537 | background-repeat: no-repeat; |
|
508 | 538 | padding-left: 12px; |
|
509 | 539 | background-image: url(../images/external.png); |
|
510 | 540 | } |
|
511 | 541 | |
|
512 | 542 | div.wiki a.new { |
|
513 | 543 | color: #b73535; |
|
514 | 544 | } |
|
515 | 545 | |
|
516 | 546 | div.wiki pre { |
|
517 | 547 | margin: 1em 1em 1em 1.6em; |
|
518 | 548 | padding: 2px; |
|
519 | 549 | background-color: #fafafa; |
|
520 | 550 | border: 1px solid #dadada; |
|
521 | 551 | width:95%; |
|
522 | 552 | overflow-x: auto; |
|
523 | 553 | } |
|
524 | 554 | |
|
525 | 555 | div.wiki ul.toc { |
|
526 | 556 | background-color: #ffffdd; |
|
527 | 557 | border: 1px solid #e4e4e4; |
|
528 | 558 | padding: 4px; |
|
529 | 559 | line-height: 1.2em; |
|
530 | 560 | margin-bottom: 12px; |
|
531 | 561 | margin-right: 12px; |
|
532 | 562 | margin-left: 0; |
|
533 | 563 | display: table |
|
534 | 564 | } |
|
535 | 565 | * html div.wiki ul.toc { width: 50%; } /* IE6 doesn't autosize div */ |
|
536 | 566 | |
|
537 | 567 | div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; } |
|
538 | 568 | div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; } |
|
539 | 569 | div.wiki ul.toc li { list-style-type:none;} |
|
540 | 570 | div.wiki ul.toc li.heading2 { margin-left: 6px; } |
|
541 | 571 | div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; } |
|
542 | 572 | |
|
543 | 573 | div.wiki ul.toc a { |
|
544 | 574 | font-size: 0.9em; |
|
545 | 575 | font-weight: normal; |
|
546 | 576 | text-decoration: none; |
|
547 | 577 | color: #606060; |
|
548 | 578 | } |
|
549 | 579 | div.wiki ul.toc a:hover { color: #c61a1a; text-decoration: underline;} |
|
550 | 580 | |
|
551 | 581 | a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; } |
|
552 | 582 | a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; } |
|
553 | 583 | h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; } |
|
554 | 584 | |
|
555 | 585 | /***** My page layout *****/ |
|
556 | 586 | .block-receiver { |
|
557 | 587 | border:1px dashed #c0c0c0; |
|
558 | 588 | margin-bottom: 20px; |
|
559 | 589 | padding: 15px 0 15px 0; |
|
560 | 590 | } |
|
561 | 591 | |
|
562 | 592 | .mypage-box { |
|
563 | 593 | margin:0 0 20px 0; |
|
564 | 594 | color:#505050; |
|
565 | 595 | line-height:1.5em; |
|
566 | 596 | } |
|
567 | 597 | |
|
568 | 598 | .handle { |
|
569 | 599 | cursor: move; |
|
570 | 600 | } |
|
571 | 601 | |
|
572 | 602 | a.close-icon { |
|
573 | 603 | display:block; |
|
574 | 604 | margin-top:3px; |
|
575 | 605 | overflow:hidden; |
|
576 | 606 | width:12px; |
|
577 | 607 | height:12px; |
|
578 | 608 | background-repeat: no-repeat; |
|
579 | 609 | cursor:pointer; |
|
580 | 610 | background-image:url('../images/close.png'); |
|
581 | 611 | } |
|
582 | 612 | |
|
583 | 613 | a.close-icon:hover { |
|
584 | 614 | background-image:url('../images/close_hl.png'); |
|
585 | 615 | } |
|
586 | 616 | |
|
587 | 617 | /***** Gantt chart *****/ |
|
588 | 618 | .gantt_hdr { |
|
589 | 619 | position:absolute; |
|
590 | 620 | top:0; |
|
591 | 621 | height:16px; |
|
592 | 622 | border-top: 1px solid #c0c0c0; |
|
593 | 623 | border-bottom: 1px solid #c0c0c0; |
|
594 | 624 | border-right: 1px solid #c0c0c0; |
|
595 | 625 | text-align: center; |
|
596 | 626 | overflow: hidden; |
|
597 | 627 | } |
|
598 | 628 | |
|
599 | 629 | .task { |
|
600 | 630 | position: absolute; |
|
601 | 631 | height:8px; |
|
602 | 632 | font-size:0.8em; |
|
603 | 633 | color:#888; |
|
604 | 634 | padding:0; |
|
605 | 635 | margin:0; |
|
606 | 636 | line-height:0.8em; |
|
607 | 637 | } |
|
608 | 638 | |
|
609 | 639 | .task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; } |
|
610 | 640 | .task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; } |
|
611 | 641 | .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } |
|
612 | 642 | .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; } |
|
613 | 643 | |
|
614 | 644 | /***** Icons *****/ |
|
615 | 645 | .icon { |
|
616 | 646 | background-position: 0% 40%; |
|
617 | 647 | background-repeat: no-repeat; |
|
618 | 648 | padding-left: 20px; |
|
619 | 649 | padding-top: 2px; |
|
620 | 650 | padding-bottom: 3px; |
|
621 | 651 | } |
|
622 | 652 | |
|
623 | 653 | .icon22 { |
|
624 | 654 | background-position: 0% 40%; |
|
625 | 655 | background-repeat: no-repeat; |
|
626 | 656 | padding-left: 26px; |
|
627 | 657 | line-height: 22px; |
|
628 | 658 | vertical-align: middle; |
|
629 | 659 | } |
|
630 | 660 | |
|
631 | 661 | .icon-add { background-image: url(../images/add.png); } |
|
632 | 662 | .icon-edit { background-image: url(../images/edit.png); } |
|
633 | 663 | .icon-copy { background-image: url(../images/copy.png); } |
|
634 | 664 | .icon-del { background-image: url(../images/delete.png); } |
|
635 | 665 | .icon-move { background-image: url(../images/move.png); } |
|
636 | 666 | .icon-save { background-image: url(../images/save.png); } |
|
637 | 667 | .icon-cancel { background-image: url(../images/cancel.png); } |
|
638 | 668 | .icon-file { background-image: url(../images/file.png); } |
|
639 | 669 | .icon-folder { background-image: url(../images/folder.png); } |
|
640 | 670 | .open .icon-folder { background-image: url(../images/folder_open.png); } |
|
641 | 671 | .icon-package { background-image: url(../images/package.png); } |
|
642 | 672 | .icon-home { background-image: url(../images/home.png); } |
|
643 | 673 | .icon-user { background-image: url(../images/user.png); } |
|
644 | 674 | .icon-mypage { background-image: url(../images/user_page.png); } |
|
645 | 675 | .icon-admin { background-image: url(../images/admin.png); } |
|
646 | 676 | .icon-projects { background-image: url(../images/projects.png); } |
|
647 | 677 | .icon-help { background-image: url(../images/help.png); } |
|
648 | 678 | .icon-attachment { background-image: url(../images/attachment.png); } |
|
649 | 679 | .icon-index { background-image: url(../images/index.png); } |
|
650 | 680 | .icon-history { background-image: url(../images/history.png); } |
|
651 | 681 | .icon-time { background-image: url(../images/time.png); } |
|
652 | 682 | .icon-time-add { background-image: url(../images/time_add.png); } |
|
653 | 683 | .icon-stats { background-image: url(../images/stats.png); } |
|
654 | 684 | .icon-warning { background-image: url(../images/warning.png); } |
|
655 | 685 | .icon-fav { background-image: url(../images/fav.png); } |
|
656 | 686 | .icon-fav-off { background-image: url(../images/fav_off.png); } |
|
657 | 687 | .icon-reload { background-image: url(../images/reload.png); } |
|
658 | 688 | .icon-lock { background-image: url(../images/locked.png); } |
|
659 | 689 | .icon-unlock { background-image: url(../images/unlock.png); } |
|
660 | 690 | .icon-checked { background-image: url(../images/true.png); } |
|
661 | 691 | .icon-details { background-image: url(../images/zoom_in.png); } |
|
662 | 692 | .icon-report { background-image: url(../images/report.png); } |
|
663 | 693 | .icon-comment { background-image: url(../images/comment.png); } |
|
664 | 694 | |
|
665 | 695 | .icon22-projects { background-image: url(../images/22x22/projects.png); } |
|
666 | 696 | .icon22-users { background-image: url(../images/22x22/users.png); } |
|
667 | 697 | .icon22-tracker { background-image: url(../images/22x22/tracker.png); } |
|
668 | 698 | .icon22-role { background-image: url(../images/22x22/role.png); } |
|
669 | 699 | .icon22-workflow { background-image: url(../images/22x22/workflow.png); } |
|
670 | 700 | .icon22-options { background-image: url(../images/22x22/options.png); } |
|
671 | 701 | .icon22-notifications { background-image: url(../images/22x22/notifications.png); } |
|
672 | 702 | .icon22-authent { background-image: url(../images/22x22/authent.png); } |
|
673 | 703 | .icon22-info { background-image: url(../images/22x22/info.png); } |
|
674 | 704 | .icon22-comment { background-image: url(../images/22x22/comment.png); } |
|
675 | 705 | .icon22-package { background-image: url(../images/22x22/package.png); } |
|
676 | 706 | .icon22-settings { background-image: url(../images/22x22/settings.png); } |
|
677 | 707 | .icon22-plugin { background-image: url(../images/22x22/plugin.png); } |
|
678 | 708 | |
|
679 | 709 | img.gravatar { |
|
680 | 710 | padding: 2px; |
|
681 | 711 | border: solid 1px #d5d5d5; |
|
682 | 712 | background: #fff; |
|
683 | 713 | } |
|
684 | 714 | |
|
685 | 715 | div.issue img.gravatar { |
|
686 | 716 | float: right; |
|
687 | 717 | margin: 0 0 0 1em; |
|
688 | 718 | padding: 5px; |
|
689 | 719 | } |
|
690 | 720 | |
|
691 | 721 | div.issue table img.gravatar { |
|
692 | 722 | height: 14px; |
|
693 | 723 | width: 14px; |
|
694 | 724 | padding: 2px; |
|
695 | 725 | float: left; |
|
696 | 726 | margin: 0 0.5em 0 0; |
|
697 | 727 | } |
|
698 | 728 | |
|
699 | 729 | #history img.gravatar { |
|
700 | 730 | padding: 3px; |
|
701 | 731 | margin: 0 1.5em 1em 0; |
|
702 | 732 | float: left; |
|
703 | 733 | } |
|
704 | 734 | |
|
705 | 735 | td.username img.gravatar { |
|
706 | 736 | float: left; |
|
707 | 737 | margin: 0 1em 0 0; |
|
708 | 738 | } |
|
709 | 739 | |
|
710 | 740 | #activity dt img.gravatar { |
|
711 | 741 | float: left; |
|
712 | 742 | margin: 0 1em 1em 0; |
|
713 | 743 | } |
|
714 | 744 | |
|
715 | 745 | #activity dt, |
|
716 | 746 | .journal { |
|
717 | 747 | clear: left; |
|
718 | 748 | } |
|
719 | 749 | |
|
720 | 750 | h2 img { vertical-align:middle; } |
|
721 | 751 | |
|
722 | 752 | |
|
723 | 753 | /***** Media print specific styles *****/ |
|
724 | 754 | @media print { |
|
725 | 755 | #top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; } |
|
726 | 756 | #main { background: #fff; } |
|
727 | 757 | #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;} |
|
728 | 758 | #wiki_add_attachment { display:none; } |
|
729 | 759 | } |
@@ -1,73 +1,89 | |||
|
1 | 1 | # Redmine - project management software |
|
2 | 2 | # Copyright (C) 2006-2009 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | require File.dirname(__FILE__) + '/../test_helper' |
|
19 | 19 | require 'members_controller' |
|
20 | 20 | |
|
21 | 21 | # Re-raise errors caught by the controller. |
|
22 | 22 | class MembersController; def rescue_action(e) raise e end; end |
|
23 | 23 | |
|
24 | 24 | |
|
25 | 25 | class MembersControllerTest < Test::Unit::TestCase |
|
26 | 26 | fixtures :projects, :members, :roles, :users |
|
27 | 27 | |
|
28 | 28 | def setup |
|
29 | 29 | @controller = MembersController.new |
|
30 | 30 | @request = ActionController::TestRequest.new |
|
31 | 31 | @response = ActionController::TestResponse.new |
|
32 | 32 | User.current = nil |
|
33 | 33 | @request.session[:user_id] = 2 |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | 36 | def test_members_routing |
|
37 | 37 | assert_routing( |
|
38 | 38 | {:method => :post, :path => 'projects/5234/members/new'}, |
|
39 | 39 | :controller => 'members', :action => 'new', :id => '5234' |
|
40 | 40 | ) |
|
41 | 41 | end |
|
42 | 42 | |
|
43 | 43 | def test_create |
|
44 | 44 | assert_difference 'Member.count' do |
|
45 | 45 | post :new, :id => 1, :member => {:role_id => 1, :user_id => 7} |
|
46 | 46 | end |
|
47 | 47 | assert_redirected_to '/projects/ecookbook/settings/members' |
|
48 | 48 | assert User.find(7).member_of?(Project.find(1)) |
|
49 | 49 | end |
|
50 | 50 | |
|
51 | def test_create_by_user_login | |
|
52 | assert_difference 'Member.count' do | |
|
53 | post :new, :id => 1, :member => {:role_id => 1, :user_login => 'someone'} | |
|
54 | end | |
|
55 | assert_redirected_to '/projects/ecookbook/settings/members' | |
|
56 | assert User.find(7).member_of?(Project.find(1)) | |
|
57 | end | |
|
58 | ||
|
51 | 59 | def test_create_multiple |
|
52 | 60 | assert_difference 'Member.count', 3 do |
|
53 | 61 | post :new, :id => 1, :member => {:role_id => 1, :user_ids => [7, 8, 9]} |
|
54 | 62 | end |
|
55 | 63 | assert_redirected_to '/projects/ecookbook/settings/members' |
|
56 | 64 | assert User.find(7).member_of?(Project.find(1)) |
|
57 | 65 | end |
|
58 | 66 | |
|
59 | 67 | def test_edit |
|
60 | 68 | assert_no_difference 'Member.count' do |
|
61 | 69 | post :edit, :id => 2, :member => {:role_id => 1, :user_id => 3} |
|
62 | 70 | end |
|
63 | 71 | assert_redirected_to '/projects/ecookbook/settings/members' |
|
64 | 72 | end |
|
65 | 73 | |
|
66 | 74 | def test_destroy |
|
67 | 75 | assert_difference 'Member.count', -1 do |
|
68 | 76 | post :destroy, :id => 2 |
|
69 | 77 | end |
|
70 | 78 | assert_redirected_to '/projects/ecookbook/settings/members' |
|
71 | 79 | assert !User.find(3).member_of?(Project.find(1)) |
|
72 | 80 | end |
|
81 | ||
|
82 | def test_autocomplete_for_member_login | |
|
83 | get :autocomplete_for_member_login, :id => 1, :user => 'mis' | |
|
84 | assert_response :success | |
|
85 | assert_template 'autocomplete_for_member_login' | |
|
86 | ||
|
87 | assert_tag :ul, :child => {:tag => 'li', :content => /miscuser8/} | |
|
88 | end | |
|
73 | 89 | end |
General Comments 0
You need to be logged in to leave comments.
Login now