From fec751608a0619ab1d42ee0aae5ea188af1ae89b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 16 Apr 2015 03:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=87=8C=E7=A8=8B=E7=A2=91?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 24 +++++++- app/helpers/projects_helper.rb | 5 ++ app/views/versions/_overview.html.erb | 18 +++--- app/views/versions/index.html.erb | 82 ++++++++++++++++++++++++++- app/views/wiki/edit.html.erb | 20 +++---- public/stylesheets/public.css | 18 ++++++ 6 files changed, 145 insertions(+), 22 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 54b05b012..fad54f056 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -187,6 +187,28 @@ module ApplicationHelper s end + def link_to_issue_version(issue, options={}) + title = nil + subject = nil + text = options[:tracker] == false ? "##{issue.id}" : "#{issue.tracker} ##{issue.id}" + if options[:subject] == false + title = truncate(issue.subject, :length => 60) + else + subject = issue.subject + if options[:truncate] + subject = truncate(subject, :length => 60) + end + end + if issue.status_id == 5 + s = link_to text, issue_path(issue), :class => "text_line_s", :title => title + else + s = link_to text, issue_path(issue), :class => "c_blue", :title => title + end + s << h(": #{subject}") if subject + s = h("#{issue.project} - ") + s if options[:project] + s + end + # Generates a link to an attachment. # Options: # * :text - Link text (default to attachment filename) @@ -724,7 +746,7 @@ module ApplicationHelper def breadcrumb(*args) elements = args.flatten - elements.any? ? content_tag('p', (args.join(" \xc2\xbb ") + " \xc2\xbb ").html_safe, :class => 'breadcrumb') : nil + elements.any? ? content_tag('p', (args.join(" \xc2\xbb ") + " \xc2\xbb ").html_safe, :class => 'wiki_con_tit"') : nil end def other_formats_links(&block) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 1d47e8bcc..d8078aeb7 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -24,6 +24,11 @@ module ProjectsHelper link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => "c_blue02" end + def link_to_version_show(version, options = {}) + return '' unless version && version.is_a?(Version) + link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue " + end + def project_settings_tabs tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural}, {:name => 'modules', :action => :select_project_modules, :partial => 'projects/settings/modules', :label => :label_module_plural}, diff --git a/app/views/versions/_overview.html.erb b/app/views/versions/_overview.html.erb index fdb0bcd4a..47d65c34a 100644 --- a/app/views/versions/_overview.html.erb +++ b/app/views/versions/_overview.html.erb @@ -1,17 +1,17 @@ <% if version.issues_count > 0 %> -

»<%= l(:label_versions_progress)%>

- <%= progress_bar([version.closed_percent, version.completed_percent], :width => '40em', :legend => ('%0.0f%' % version.completed_percent)) %> +

»<%= l(:label_versions_progress)%>

+ <%= progress_bar([version.closed_percent, version.completed_percent], :width => '82%', :legend => ('%0.0f%' % version.completed_percent)) %>

- <%= link_to(l(:label_x_issues, :count => version.issues_count), - project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1)) %> + <%= link_to(l(:label_x_issues, :count => version.issues_count), + project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue",) %>   - (<%= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), - project_issues_path(version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1)) %> + (<%= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), + project_issues_path(version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %> — - <%= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), - project_issues_path(version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1)) %>) + <%= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), + project_issues_path(version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %>)

<% else %> -

<%= l(:label_roadmap_no_issues) %>

+

<%= l(:label_roadmap_no_issues) %>

<% end %> diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index ab4f77c5b..2e9004de3 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -1,3 +1,81 @@ +
+

<%= l(:label_roadmap) %>

+
+ + + +
+ + + +<% if @versions.empty? %> +

<%= l(:label_no_data) %>

+<% else %> + <% @versions.each do |version| %> + +
+

+ <%= link_to_version_show version, :name => version_anchor(version) %> + <% if version.completed? %> + <%= format_date(version.effective_date) %> + <% elsif version.effective_date %> + <%= due_date_distance_in_words(version.effective_date) %> (<%= format_date(version.effective_date) %>) + <% end %> + +

+
+ <%= render :partial => 'versions/overview', :locals => {:version => version} %> + <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> + +
+ <% if (issues = @issues_by_version[version]) && issues.size > 0 %> +
+ <%= form_tag({}) do -%> +

»<%= l(:label_related_issues) %>

+
    + <% issues.each do |issue| -%> +
  • + <%= link_to_issue_version(issue, :project => (@project != issue.project)) %> +
  • + <% end -%> +
+ <% end %> +
+ <% end %> +
+

»<%= l(:label_versions_description)%>

+

<%=h version.description %>

+
+
+ <% end %> + + +
+ <% end %> +
+ + + + + + +

<%= l(:label_roadmap) %>

@@ -25,11 +103,11 @@ <% if @completed_versions.present? %>

- <%= link_to_function l(:label_completed_versions), + <%= link_to_function l(:label_completed_versions), '$("#toggle-completed-versions").toggleClass("collapsed"); $("#completed-versions").toggle()', :id => 'toggle-completed-versions', :class => 'collapsible collapsed' %>

- <% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> - <%= fields_for @page do |fp| %> -

- - <%= fp.select :parent_id,content_tag('option', '', :value => '') + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent) %> -

- <% end %> - <% end %> + <%# if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> + <%#= fields_for @page do |fp| %> + + + + + + + <%# end %> + <%# end %>
  • <%= f.text_field :comments, :class => "w557" %> diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index e78141f11..f53e7f9d5 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -390,3 +390,21 @@ div.flash.warning, .conflict { .floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;} a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;} a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} + +/*里程碑进度条*/ +table.progress { + border-collapse: collapse; + border-spacing: 0pt; + empty-cells: show; + text-align: center; + float: left; + margin: 1px 6px 1px 0px;} +p.progress-info { + clear: left; + font-size: 80%; + margin-top: -4px; + color: #777; + color: #777;} +p.percent { + font-size: 80%; +} \ No newline at end of file