diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1f7d786c..227b7714 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -389,7 +389,9 @@ module ApplicationHelper end def page_header_title - if @project.nil? || @project.new_record? + if @page_header_title.present? + h(@page_header_title) + elsif @project.nil? || @project.new_record? h(Setting.app_title) else b = [] @@ -935,6 +937,32 @@ module ApplicationHelper end end + # Expands the current menu item using JavaScript based on the params + def expand_current_menu + current_menu_class = + case + when params[:controller] == "timelog" + "reports" + when params[:controller] == 'projects' && params[:action] == 'changelog' + "reports" + when params[:controller] == 'issues' && ['calendar','gantt'].include?(params[:action]) + "reports" + when params[:controller] == 'projects' && params[:action] == 'roadmap' + 'roadmap' + when params[:controller] == 'versions' && params[:action] == 'show' + 'roadmap' + when params[:controller] == 'projects' && params[:action] == 'settings' + 'settings' + when params[:controller] == 'contracts' || params[:controller] == 'deliverables' + 'contracts' + else + params[:controller] + end + + + javascript_tag("jQuery.menu_expand({ menuItem: '.#{current_menu_class}' });") + end + private def wiki_helper diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index dabac782..c270dc52 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -52,13 +52,14 @@ module IssuesHelper "#{@cached_label_priority}: #{h(issue.priority.name)}" end + # TODO: deprecate and/or remove def render_issue_subject_with_tree(issue) s = '' ancestors = issue.root? ? [] : issue.ancestors.all ancestors.each do |ancestor| - s << '
' + content_tag('p', link_to_issue(ancestor)) + s << '
' + content_tag('h2', link_to_issue(ancestor)) end - s << '
' + content_tag('h3', h(issue.subject)) + s << '
' + content_tag('h2', h(issue.subject)) s << '
' * (ancestors.size + 1) s end diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index 34a2f51d..cba54d3e 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -27,24 +27,29 @@ module JournalsHelper def render_journal(model, journal, options = {}) return "" if journal.initial? - journal_content = render_journal_details(journal, :label_updated_time_by) - journal_content += render_notes(model, journal, options) unless journal.notes.blank? + journal_content = render_journal_details(journal, :label_updated_time_by, model, options) content_tag "div", journal_content, { :id => "change-#{journal.id}", :class => journal.css_classes } end - # This renders a journal entry wiht a header and details - def render_journal_details(journal, header_label = :label_updated_time_by) + # This renders a journal entry with a header and details + def render_journal_details(journal, header_label = :label_updated_time_by, model=nil, options={}) header = <<-HTML

-
#{link_to "##{journal.anchor}", :anchor => "note-#{journal.anchor}"}
- #{avatar(journal.user, :size => "24")} - #{content_tag('a', '', :name => "note-#{journal.anchor}")} + #{authoring journal.created_at, journal.user, :label => header_label} + #{content_tag('a', '', :name => "note-#{journal.anchor}")}

+ +
+ #{avatar(journal.user, :size => "40")} +
+ + #{render_notes(model, journal, options) unless journal.notes.blank?} + HTML if journal.details.any? - details = content_tag "ul", :class => "details" do + details = content_tag "ul", :class => "details journal-attributes" do journal.details.collect do |detail| if d = journal.render_detail(detail) content_tag("li", d) diff --git a/app/views/admin/_menu.rhtml b/app/views/admin/_menu.rhtml index bd3abebe..2ac62c2f 100644 --- a/app/views/admin/_menu.rhtml +++ b/app/views/admin/_menu.rhtml @@ -1,5 +1,3 @@
-
    - <%= render_menu :admin_menu %> -
+ <%= render_menu :admin_menu %>
diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml index f7e72313..3015907a 100644 --- a/app/views/admin/index.rhtml +++ b/app/views/admin/index.rhtml @@ -1,5 +1,3 @@ -

<%=l(:label_administration)%>

-
<%= render :partial => 'no_data' if @no_configuration_data %> <%= render :partial => 'menu' %> diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb index 71bac63b..ca549998 100644 --- a/app/views/context_menus/issues.html.erb +++ b/app/views/context_menus/issues.html.erb @@ -1,52 +1,55 @@ -
    + diff --git a/app/views/issues/_action_menu.rhtml b/app/views/issues/_action_menu.rhtml index b1af5785..9f38bf06 100644 --- a/app/views/issues/_action_menu.rhtml +++ b/app/views/issues/_action_menu.rhtml @@ -1,9 +1,11 @@
    -<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'new', :issue_id => @issue}, :class => 'icon icon-time-add' %> <%= watcher_link(@issue, User.current, {:class => 'watcher_link', :replace => ['#watchers', '.watcher_link']}) %> <%= link_to_if_authorized l(:button_duplicate), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-duplicate' %> <%= link_to_if_authorized l(:button_copy), {:controller => 'issue_moves', :action => 'new', :id => @issue, :copy_options => {:copy => 't'}}, :class => 'icon icon-copy' %> <%= link_to_if_authorized l(:button_move), {:controller => 'issue_moves', :action => 'new', :id => @issue}, :class => 'icon icon-move' %> <%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => (@issue.leaf? ? l(:text_are_you_sure) : l(:text_are_you_sure_with_children)), :method => :post, :class => 'icon icon-del' %> +
    +<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => '', :accesskey => accesskey(:edit)) %> +
    diff --git a/app/views/issues/_relations.rhtml b/app/views/issues/_relations.rhtml index 3dab155f..362133de 100644 --- a/app/views/issues/_relations.rhtml +++ b/app/views/issues/_relations.rhtml @@ -1,10 +1,9 @@ -
    -<% if authorize_for('issue_relations', 'new') %> - <%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'relation_issue_to_id'} %> -<% end %> -
    - -

    <%=l(:label_related_issues)%>

    +

    + <%=l(:label_related_issues)%> + <% if authorize_for('issue_relations', 'new') %> + (<%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>) + <% end %> +

    <% if @relations.present? %> diff --git a/app/views/issues/index.rhtml b/app/views/issues/index.rhtml index 122b0c06..a4974771 100644 --- a/app/views/issues/index.rhtml +++ b/app/views/issues/index.rhtml @@ -1,19 +1,24 @@ +
    + +

    <%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %>

    +<% html_title(@query.new_record? ? l(:label_issue_plural) : h(@query.name)) %> + +
    +
    <% if !@query.new_record? && @query.editable_by?(User.current) %> <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %> <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> <% end %> +<%= render :partial => 'queries/new_issue_button' %>
    -

    <%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %>

    -<% html_title(@query.new_record? ? l(:label_issue_plural) : h(@query.name)) %> - <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %> <%= hidden_field_tag('project_id', @project.to_param) if @project %>
    "> <%= l(:label_filter_plural) %> -
    "> +
    "> <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
    @@ -55,6 +60,9 @@

    <% end %> +
    +
    + <%= error_messages_for 'query' %> <% if @query.valid? %> <% if @issues.empty? %> diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index eddc7da0..16f6b68a 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -1,63 +1,91 @@ -<%= render :partial => 'action_menu' %> +
    +
    <%= content_tag('h2', h(@issue.subject)) %>
    -

    <%= h(@issue.tracker.name) %> #<%= h(@issue.id) %><%= call_hook(:view_issues_show_identifier, :issue => @issue) %>

    +
    + <%= render :partial => 'action_menu' %> +
    +
    - <%= avatar(@issue.author, :size => "50") %> +
    + <%= avatar(@issue.author, :size => "40") %> +
    +

    + <%= h(@issue.tracker.name) %> #<%= @issue.id %> +

    -
    -<%= render_issue_subject_with_tree(@issue) %> -
    -

    - <%= authoring @issue.created_on, @issue.author %>. - <% if @issue.created_on != @issue.updated_on %> - <%= l(:label_updated_time, time_tag(@issue.updated_on)) %>. +

    + <%= authoring @issue.created_on, @issue.author %>. + <% if @issue.created_on != @issue.updated_on %> + <%= l(:label_updated_time, time_tag(@issue.updated_on)) %>. + <% end %> +

    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% if User.current.allowed_to?(:view_time_entries, @project) %> + + <% end %> -

    + + <% if @issue.estimated_hours %> + + + <% end %> + -
    <%=l(:field_status)%>:<%= h(@issue.status.name) %><%=l(:field_category)%>:<%=h(@issue.category ? @issue.category.name : "-") %><%=l(:field_start_date)%>:<%= format_date(@issue.start_date) %>
    <%=l(:field_priority)%>:<%= h(@issue.priority.name) %><%=l(:field_fixed_version)%>:<%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %><%=l(:field_due_date)%>:<%= format_date(@issue.due_date) %>
    <%=l(:field_assigned_to)%>:<%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %><%=l(:field_done_ratio)%>:<%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %><%=l(:label_spent_time)%>:<%= @issue.spent_hours > 0 ? (link_to l_hours(@issue.spent_hours), {:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue}) : "-" %><%=l(:field_estimated_hours)%>:<%= l_hours(@issue.estimated_hours) %>
    - - - - - - - - - - - - - - - <% if User.current.allowed_to?(:view_time_entries, @project) %> - - - <% end %> - - - - <% if @issue.estimated_hours %> - - <% end %> - -<%= render_custom_fields_rows(@issue) %> -<%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %> -
    <%=l(:field_status)%>:<%= h(@issue.status.name) %><%=l(:field_start_date)%>:<%= format_date(@issue.start_date) %>
    <%=l(:field_priority)%>:<%= h(@issue.priority.name) %><%=l(:field_due_date)%>:<%= format_date(@issue.due_date) %>
    <%=l(:field_assigned_to)%>:<%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %><%=l(:field_done_ratio)%>:<%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %>
    <%=l(:field_category)%>:<%=h(@issue.category ? @issue.category.name : "-") %><%=l(:label_spent_time)%>:<%= @issue.spent_hours > 0 ? (link_to l_hours(@issue.spent_hours), {:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue}) : "-" %>
    <%=l(:field_fixed_version)%>:<%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %><%=l(:field_estimated_hours)%>:<%= l_hours(@issue.estimated_hours) %>
    + <%= render_custom_fields_rows(@issue) %> + + <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %> + +
-<% if @issue.description? || @issue.attachments.any? -%> -
<% if @issue.description? %> -
- <%= link_to_remote_if_authorized(l(:button_quote), { :url => {:controller => 'journals', :action => 'new', :id => @issue} }, :class => 'icon icon-comment') %> -
+
-

<%=l(:field_description)%>

-
- <%= textilizable @issue, :description, :attachments => @issue.attachments %> -
+
+
+ <%= link_to_remote_if_authorized(l(:button_quote), { :url => {:controller => 'journals', :action => 'new', :id => @issue} }, :class => 'icon icon-comment') %> +
+ +

<%=l(:field_description)%>

+
+ <%= textilizable @issue, :description, :attachments => @issue.attachments %> +
+
<% end %> -<%= link_to_attachments @issue %> + +<% if @issue.attachments.any? -%> +
+ <%= link_to_attachments @issue %> <% end -%> <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> @@ -65,10 +93,11 @@ <% if !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>
-
- <%= link_to(l(:button_add), {:controller => 'issues', :action => 'new', :project_id => @project, :issue => {:parent_issue_id => @issue}}) if User.current.allowed_to?(:manage_subtasks, @project) %> -
-

<%=l(:label_subtask_plural)%>

+

+ <%=l(:label_subtask_plural)%> + (<%= link_to(l(:button_add), {:controller => 'issues', :action => 'new', :project_id => @project, :issue => {:parent_issue_id => @issue}}) if User.current.allowed_to?(:manage_subtasks, @project) %>) +

+ <%= render_descendants_tree(@issue) unless @issue.leaf? %>
<% end %> @@ -98,7 +127,13 @@
-<%= render :partial => 'action_menu' %> + +
+

<%= h @issue.subject %>

+
+ <%= render :partial => 'action_menu', :locals => {:replace_watcher => 'watcher2' } %> +
+
<% if authorize_for('issues', 'edit') %> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 197c32a8..93d35bf0 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -1,8 +1,6 @@ -<% unless controller_name == 'admin' && action_name == 'index' %> - <% content_for :sidebar do %> -

<%=l(:label_administration)%>

- <%= render :partial => 'admin/menu' %> - <% end %> +<% @page_header_title = l(:label_administration) %> +<% content_for :sidebar do %> + <%= render :partial => 'admin/menu' %> <% end %> <%= render :file => "layouts/base" %> diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 553d743d..eabf5974 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -7,76 +7,140 @@ <%= csrf_meta_tag %> <%= favicon %> +<%= stylesheet_link_tag 'reset', :media => 'all' %> <%= stylesheet_link_tag 'application', :media => 'all' %> +<%= stylesheet_link_tag 'print', :media => 'print' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + + + + +<%= javascript_include_tag 'jquery.1.3.2.min.js' %> +<%= javascript_include_tag 'jquery.menu_expand.js' %> +<%= javascript_tag('jQuery.noConflict();') %> <%= javascript_heads %> +<%= stylesheet_link_tag 'jstoolbar' %> <%= heads_for_theme %> - +<% heads_for_wiki_formatter %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%>
-
-
+
- <%= render_menu :account_menu -%> -
- <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => 'loggedas') if User.current.logged? %> - <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> -
+ <% account_items = menu_items_for(:account_menu) %> - + + <% main_menu = render_main_menu(@project) %> + <% if has_content?(:sidebar) || !main_menu.blank? %> + <% display_sidebar = true %> + <% else %> + <% display_sidebar = false %> + <% end %> +
"> + +

<%= page_header_title %>

+ <% if display_sidebar %> - <% end %> -
- -<%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %> - -
- <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
+ <%= expand_current_menu %> + <% end %> + +
" id="content"> + <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
 
+
-
- +
+ + + + - -
<%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml index 98fd2c1e..e6b18041 100644 --- a/app/views/projects/index.rhtml +++ b/app/views/projects/index.rhtml @@ -2,7 +2,7 @@ <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> <% end %> -
+