Patch #2457 » new_issue-timelog_design-r2245.diff
app/views/issues/index.rhtml (working copy) | ||
---|---|---|
1 | 1 |
<% if @query.new_record? %> |
2 |
<% if Setting.main_new_links_enabled? %> |
|
3 |
<div class="contextual"> |
|
4 |
<%= link_to_if_authorized l(:label_issue_new), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-add' %> |
|
5 |
</div> |
|
6 |
<% end %> |
|
2 | 7 |
<h2><%=l(:label_issue_plural)%></h2> |
3 | 8 |
<% html_title(l(:label_issue_plural)) %> |
4 | 9 |
|
app/views/layouts/_new_issue_menu.rhtml (revision 0) | ||
---|---|---|
1 |
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %> |
|
2 |
<div> |
|
3 |
<ul> |
|
4 |
<% user_projects_by_root.keys.sort.each do |root| %> |
|
5 |
<li><%= link_to h(root.name),:controller => :issues, :action => :new, :project_id => root %></li> |
|
6 |
<% user_projects_by_root[root].sort.each do |project| %> |
|
7 |
<% next if project == root %> |
|
8 |
<li><%= link_to '» '+h(project.name), :controller => :issues, :action => :new, :project_id => project %></li> |
|
9 |
<% end %> |
|
10 |
<% end %> |
|
11 |
</ul> |
|
12 |
</div> |
app/views/layouts/_new_timelog_menu.rhtml (revision 0) | ||
---|---|---|
1 |
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %> |
|
2 |
<div> |
|
3 |
<ul> |
|
4 |
<% user_projects_by_root.keys.sort.each do |root| %> |
|
5 |
<li><%= link_to h(root.name),:controller => :timelog, :action => :edit, :project_id => root %></li> |
|
6 |
<% user_projects_by_root[root].sort.each do |project| %> |
|
7 |
<% next if project == root %> |
|
8 |
<li><%= link_to '» '+h(project.name), :controller => :timelog, :action => :edit, :project_id => project %></li> |
|
9 |
<% end %> |
|
10 |
<% end %> |
|
11 |
</ul> |
|
12 |
</div> |
app/views/layouts/base.rhtml (working copy) | ||
---|---|---|
56 | 56 |
</div> |
57 | 57 | |
58 | 58 |
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div> |
59 |
|
|
59 |
<div id="new-issue-menu" style="display:none;"><%= render :partial => "layouts/new_issue_menu" if User.current.memberships.any? %></div> |
|
60 |
<div id="new-timelog-menu" style="display:none;"><%= render :partial => "layouts/new_timelog_menu" if User.current.memberships.any? %></div> |
|
61 | ||
60 | 62 |
<div id="footer"> |
61 | 63 |
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> © 2006-2008 Jean-Philippe Lang |
62 | 64 |
</div> |
app/views/settings/_general.rhtml (working copy) | ||
---|---|---|
53 | 53 | |
54 | 54 |
<p><label><%= l(:setting_gravatar_enabled) %></label> |
55 | 55 |
<%= check_box_tag 'settings[gravatar_enabled]', 1, Setting.gravatar_enabled? %><%= hidden_field_tag 'settings[gravatar_enabled]', 0 %></p> |
56 | ||
57 |
<p><label><%= l(:setting_main_new_links_enabled) %></label> |
|
58 |
<%= check_box_tag 'settings[main_new_links_enabled]', 1, Setting.main_new_links_enabled? %><%= hidden_field_tag 'settings[main_new_links_enabled]', 0 %></p> |
|
56 | 59 |
</div> |
57 | 60 | |
58 | 61 |
<%= submit_tag l(:button_save) %> |
config/settings.yml (working copy) | ||
---|---|---|
140 | 140 |
To change your notification preferences, please click here: http://hostname/my/account |
141 | 141 |
gravatar_enabled: |
142 | 142 |
default: 0 |
143 |
main_new_links_enabled: |
|
144 |
default: 0 |
lang/en.yml (working copy) | ||
---|---|---|
226 | 226 |
setting_sequential_project_identifiers: Generate sequential project identifiers |
227 | 227 |
setting_gravatar_enabled: Use Gravatar user icons |
228 | 228 |
setting_diff_max_lines_displayed: Max number of diff lines displayed |
229 |
setting_main_new_links_enabled: Display global "New issue/timelog"-links in the top-menu |
|
229 | 230 | |
230 | 231 |
permission_edit_project: Edit project |
231 | 232 |
permission_select_project_modules: Select project modules |
... | ... | |
584 | 585 |
label_generate_key: Generate a key |
585 | 586 |
label_issue_watchers: Watchers |
586 | 587 |
label_example: Example |
588 |
label_timelog_new: New timelog |
|
587 | 589 | |
588 | 590 |
button_login: Login |
589 | 591 |
button_submit: Submit |
lib/redmine.rb (working copy) | ||
---|---|---|
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 |
menu.push :new_issue, '#', :caption => :label_issue_new, :html => {:onclick => "toggleNewIssueMenu(event);"}, :if => Proc.new { User.current.logged? && User.current.memberships.any? && Setting.main_new_links_enabled? } |
|
112 |
menu.push :new_timelog, '#', :caption => :label_timelog_new, :html => {:onclick => "toggleNewTimelogMenu(event);"}, :if => Proc.new { User.current.logged? && User.current.memberships.any? && Setting.main_new_links_enabled? } |
|
111 | 113 |
menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural |
112 | 114 |
menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true |
113 | 115 |
menu.push :help, Redmine::Info.help_url, :last => true |
... | ... | |
135 | 137 |
:if => Proc.new { |p| p.versions.any? } |
136 | 138 |
menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |
137 | 139 |
menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, |
138 |
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } |
|
140 |
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, |
|
141 |
:if => Proc.new { !Setting.main_new_links_enabled? } |
|
139 | 142 |
menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural |
140 | 143 |
menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural |
141 | 144 |
menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil }, |
public/javascripts/application.js (working copy) | ||
---|---|---|
142 | 142 |
} |
143 | 143 |
} |
144 | 144 |
}); |
145 | ||
146 |
/* global new issue menu */ |
|
147 |
function toggleNewIssueMenu(e) { |
|
148 |
if($('new-issue-menu').style.display == 'none') { |
|
149 |
Element.show('new-issue-menu'); |
|
150 |
$('new-issue-menu').style.left = Event.pointerX(e)+'px'; |
|
151 |
$('new-issue-menu').style.top = Event.pointerY(e)+'px'; |
|
152 |
} else { |
|
153 |
Element.hide('new-issue-menu'); |
|
154 |
} |
|
155 |
} |
|
156 | ||
157 |
/* global new timelog menu */ |
|
158 |
function toggleNewTimelogMenu(e) { |
|
159 |
if($('new-timelog-menu').style.display == 'none') { |
|
160 |
Element.show('new-timelog-menu'); |
|
161 |
$('new-timelog-menu').style.left = Event.pointerX(e)+'px'; |
|
162 |
$('new-timelog-menu').style.top = Event.pointerY(e)+'px'; |
|
163 |
} else { |
|
164 |
Element.hide('new-timelog-menu'); |
|
165 |
} |
|
166 |
} |
public/stylesheets/application.css (working copy) | ||
---|---|---|
566 | 566 |
.task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } |
567 | 567 |
.milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; } |
568 | 568 | |
569 |
/***** Global New Issue Menu *****/ |
|
570 |
#new-issue-menu { position: absolute; } |
|
571 |
#new-issue-menu ul { |
|
572 |
list-style: none; |
|
573 |
background-color: white; |
|
574 |
border-top: 1px solid #ddd; |
|
575 |
border-left: 1px solid #ddd; |
|
576 |
border-bottom: 1px solid #777; |
|
577 |
border-right: 1px solid #777; |
|
578 |
} |
|
579 | ||
580 |
#new-issue-menu ul, #new-issue-menu li { |
|
581 |
margin: 0; |
|
582 |
padding: 0; |
|
583 |
border: 0; |
|
584 |
} |
|
585 | ||
586 |
#new-issue-menu li { padding: 1px; } |
|
587 |
#new-issue-menu a { |
|
588 |
text-decoration: none; |
|
589 |
background-repeat: no-repeat; |
|
590 |
background-position: 1px 50%; |
|
591 |
padding: 2px 14px 2px 14px; |
|
592 |
width: 100%; /* IE */ |
|
593 |
} |
|
594 | ||
595 |
/***** Global New Timelog Menu *****/ |
|
596 |
#new-timelog-menu { position: absolute; } |
|
597 |
#new-timelog-menu ul { |
|
598 |
list-style: none; |
|
599 |
background-color: white; |
|
600 |
border-top: 1px solid #ddd; |
|
601 |
border-left: 1px solid #ddd; |
|
602 |
border-bottom: 1px solid #777; |
|
603 |
border-right: 1px solid #777; |
|
604 |
} |
|
605 | ||
606 |
#new-timelog-menu ul, #new-timelog-menu li { |
|
607 |
margin: 0; |
|
608 |
padding: 0; |
|
609 |
border: 0; |
|
610 |
} |
|
611 | ||
612 |
#new-timelog-menu li { padding: 1px; } |
|
613 |
#new-timelog-menu a { |
|
614 |
text-decoration: none; |
|
615 |
background-repeat: no-repeat; |
|
616 |
background-position: 1px 50%; |
|
617 |
padding: 2px 14px 2px 14px; |
|
618 |
width: 100%; /* IE */ |
|
619 |
} |
|
620 | ||
569 | 621 |
/***** Icons *****/ |
570 | 622 |
.icon { |
571 | 623 |
background-position: 0% 40%; |