Project

General

Profile

Patch #2457 » new_issue-timelog_design-r2245.diff

Patch created against trunk @ r2245. - Mischa The Evil, 2009-01-07 14:49

View differences:

app/views/issues/index.rhtml (working copy)
<% if @query.new_record? %>
<% if Setting.main_new_links_enabled? %>
<div class="contextual">
<%= link_to_if_authorized l(:label_issue_new), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-add' %>
</div>
<% end %>
<h2><%=l(:label_issue_plural)%></h2>
<% html_title(l(:label_issue_plural)) %>
app/views/layouts/_new_issue_menu.rhtml (revision 0)
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
<div>
<ul>
<% user_projects_by_root.keys.sort.each do |root| %>
<li><%= link_to h(root.name),:controller => :issues, :action => :new, :project_id => root %></li>
<% user_projects_by_root[root].sort.each do |project| %>
<% next if project == root %>
<li><%= link_to '&#187; '+h(project.name), :controller => :issues, :action => :new, :project_id => project %></li>
<% end %>
<% end %>
</ul>
</div>
app/views/layouts/_new_timelog_menu.rhtml (revision 0)
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
<div>
<ul>
<% user_projects_by_root.keys.sort.each do |root| %>
<li><%= link_to h(root.name),:controller => :timelog, :action => :edit, :project_id => root %></li>
<% user_projects_by_root[root].sort.each do |project| %>
<% next if project == root %>
<li><%= link_to '&#187; '+h(project.name), :controller => :timelog, :action => :edit, :project_id => project %></li>
<% end %>
<% end %>
</ul>
</div>
app/views/layouts/base.rhtml (working copy)
</div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
<div id="new-issue-menu" style="display:none;"><%= render :partial => "layouts/new_issue_menu" if User.current.memberships.any? %></div>
<div id="new-timelog-menu" style="display:none;"><%= render :partial => "layouts/new_timelog_menu" if User.current.memberships.any? %></div>
<div id="footer">
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> &copy; 2006-2008 Jean-Philippe Lang
</div>
app/views/settings/_general.rhtml (working copy)
<p><label><%= l(:setting_gravatar_enabled) %></label>
<%= check_box_tag 'settings[gravatar_enabled]', 1, Setting.gravatar_enabled? %><%= hidden_field_tag 'settings[gravatar_enabled]', 0 %></p>
<p><label><%= l(:setting_main_new_links_enabled) %></label>
<%= check_box_tag 'settings[main_new_links_enabled]', 1, Setting.main_new_links_enabled? %><%= hidden_field_tag 'settings[main_new_links_enabled]', 0 %></p>
</div>
<%= submit_tag l(:button_save) %>
config/settings.yml (working copy)
To change your notification preferences, please click here: http://hostname/my/account
gravatar_enabled:
default: 0
main_new_links_enabled:
default: 0
lang/en.yml (working copy)
setting_sequential_project_identifiers: Generate sequential project identifiers
setting_gravatar_enabled: Use Gravatar user icons
setting_diff_max_lines_displayed: Max number of diff lines displayed
setting_main_new_links_enabled: Display global "New issue/timelog"-links in the top-menu
permission_edit_project: Edit project
permission_select_project_modules: Select project modules
......
label_generate_key: Generate a key
label_issue_watchers: Watchers
label_example: Example
label_timelog_new: New timelog
button_login: Login
button_submit: Submit
lib/redmine.rb (working copy)
Redmine::MenuManager.map :top_menu do |menu|
menu.push :home, :home_path
menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? }
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? }
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? }
menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural
menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true
menu.push :help, Redmine::Info.help_url, :last => true
......
:if => Proc.new { |p| p.versions.any? }
menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural
menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new,
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) },
:if => Proc.new { !Setting.main_new_links_enabled? }
menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural
menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil },
public/javascripts/application.js (working copy)
}
}
});
/* global new issue menu */
function toggleNewIssueMenu(e) {
if($('new-issue-menu').style.display == 'none') {
Element.show('new-issue-menu');
$('new-issue-menu').style.left = Event.pointerX(e)+'px';
$('new-issue-menu').style.top = Event.pointerY(e)+'px';
} else {
Element.hide('new-issue-menu');
}
}
/* global new timelog menu */
function toggleNewTimelogMenu(e) {
if($('new-timelog-menu').style.display == 'none') {
Element.show('new-timelog-menu');
$('new-timelog-menu').style.left = Event.pointerX(e)+'px';
$('new-timelog-menu').style.top = Event.pointerY(e)+'px';
} else {
Element.hide('new-timelog-menu');
}
}
public/stylesheets/application.css (working copy)
.task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
.milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; }
/***** Global New Issue Menu *****/
#new-issue-menu { position: absolute; }
#new-issue-menu ul {
list-style: none;
background-color: white;
border-top: 1px solid #ddd;
border-left: 1px solid #ddd;
border-bottom: 1px solid #777;
border-right: 1px solid #777;
}
#new-issue-menu ul, #new-issue-menu li {
margin: 0;
padding: 0;
border: 0;
}
#new-issue-menu li { padding: 1px; }
#new-issue-menu a {
text-decoration: none;
background-repeat: no-repeat;
background-position: 1px 50%;
padding: 2px 14px 2px 14px;
width: 100%; /* IE */
}
/***** Global New Timelog Menu *****/
#new-timelog-menu { position: absolute; }
#new-timelog-menu ul {
list-style: none;
background-color: white;
border-top: 1px solid #ddd;
border-left: 1px solid #ddd;
border-bottom: 1px solid #777;
border-right: 1px solid #777;
}
#new-timelog-menu ul, #new-timelog-menu li {
margin: 0;
padding: 0;
border: 0;
}
#new-timelog-menu li { padding: 1px; }
#new-timelog-menu a {
text-decoration: none;
background-repeat: no-repeat;
background-position: 1px 50%;
padding: 2px 14px 2px 14px;
width: 100%; /* IE */
}
/***** Icons *****/
.icon {
background-position: 0% 40%;
(1-1/2)