Skip to content

Commit 2fcc757

Browse files
danielvijgepixyda-furukawa
authored andcommitted
HolonGlobe fixes
Back ported from https://github.com/HolonGlobe/redmine_backlogs
1 parent 5792fc1 commit 2fcc757

4 files changed

Lines changed: 35 additions & 18 deletions

File tree

app/helpers/rb_common_helper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def mark_if_closed(story)
7979
end
8080

8181
def story_points_or_empty(story)
82-
story.story_points.blank? ? "" : story.story_points
82+
story.story_points.blank? ? "" : ("%g" % story.story_points)
8383
end
8484

8585
def record_id_or_empty(story)
@@ -148,7 +148,9 @@ def custom_fields_or_empty(story)
148148
return '' if story.new_record?
149149
res = ''
150150
story.custom_field_values.each{|value|
151-
res += "<p><b>#{h(value.custom_field.name)}</b>: #{simple_format_without_paragraph(h(show_value(value)))}</p>"
151+
if value.value.present?
152+
res += "<p class=\"issue-field\"><label>#{h(value.custom_field.name)}:</label> #{simple_format_without_paragraph(h(show_value(value)))}</p>"
153+
end
152154
}
153155
res.html_safe
154156
end

app/views/backlogs/view_issues_sidebar.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
:key => key }) %>"><%= l(:label_webcal) %></a><br>
3636
<% end %>
3737

38-
<% releases = project.shared_releases
38+
<% releases = project.shared_releases.open
3939
if releases && releases.size > 0 && User.current.allowed_to?(:view_releases, project) %>
4040
<h3><%= l(:label_release_plural) %></h3>
41-
<% project.shared_releases.each{|r| %>
41+
<% releases.each{|r| %>
4242
<%= link_to(r, {
4343
:controller => 'rb_queries',
4444
:action => 'show',

app/views/rb_stories/_helpers.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<%- unless Backlogs.setting[:story_points].blank? -%>
99
<select class="story_points helper" id="story_points_options">
10-
<%- (['']+Backlogs.setting[:story_points].split(/,/).collect(&:to_f)).each do |point| %>
10+
<%- (['']+Backlogs.setting[:story_points].split(/,/).collect(&:to_s)).each do |point| %>
1111
<option value="<%=h point %>"><%=h point %></option>
1212
<%- end %>
1313
</select>
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
<b><%= I18n.t :field_subject %></b>: <%=h tooltip.subject %><br />
2-
<b><%= I18n.t :field_tracker_id %></b>: <%=h tooltip.tracker %><br />
3-
<b><%= I18n.t :story_status %></b>: <%=h status_label_or_default(tooltip) %><br />
4-
<b><%= I18n.t :field_category %></b>: <%=h tooltip.category %><br />
5-
<b><%= I18n.t :story_points %></b>: <%=h story_points_or_empty(tooltip) %><br />
6-
<b><%= I18n.t :story_estimation_hours %></b>: <%=h tooltip.estimated_hours %><br />
7-
<b><%= I18n.t :story_spent_time %></b>: <%= tooltip.total_spent_hours.round(2) %><br />
8-
<b><%= I18n.t :story_remaining_hours %></b>: <%=h remaining_hours_or_empty(tooltip) %><br />
9-
<b><%= I18n.t :field_assigned_to %></b>: <%=h assignee_name_or_empty(tooltip) %><br />
10-
<b><%= I18n.t :field_project %></b>: <%=h project_name_or_empty(tooltip) %><br />
11-
<b><%= I18n.t :field_release %></b>: <%=h release_or_empty(tooltip) %><br />
12-
<div><%= textilizable tooltip, :description, :attachments => tooltip.attachments%></div>
13-
1+
<p class="issue-field"><label><%= I18n.t :field_subject %>:</label> <%=h tooltip.subject %></p>
2+
<p class="issue-field"><label><%= I18n.t :field_tracker_id %>:</label> <%=h tooltip.tracker %></p>
3+
<p class="issue-field"><label><%= I18n.t :story_status %>:</label> <%=h status_label_or_default(tooltip) %></p>
4+
<% unless tooltip.category.blank? %>
5+
<p class="issue-field"><label><%= I18n.t :field_category %>:</label> <%=h tooltip.category %></p>
6+
<% end %>
7+
<% unless tooltip.story_points.blank? %>
8+
<p class="issue-field"><label><%= I18n.t :story_points %>:</label> <%=h story_points_or_empty(tooltip) %></p>
9+
<% end %>
10+
<% unless tooltip.estimated_hours.blank? %>
11+
<p class="issue-field"><label><%= I18n.t :story_estimation_hours %>:</label> <%=h tooltip.estimated_hours %></p>
12+
<% end %>
13+
<% unless tooltip.total_spent_hours.blank? %>
14+
<p class="issue-field"><label><%= I18n.t :story_spent_time %>:</label> <%= tooltip.total_spent_hours.round(2) %></p>
15+
<% end %>
16+
<% unless tooltip.remaining_hours.blank? %>
17+
<p class="issue-field"><label><%= I18n.t :story_remaining_hours %>:</label> <%=h remaining_hours_or_empty(tooltip) %></p>
18+
<% end %>
19+
<% unless tooltip.assigned_to.blank? %>
20+
<p class="issue-field"><label><%= I18n.t :field_assigned_to %>:</label> <%=h assignee_name_or_empty(tooltip) %></p>
21+
<% end %>
22+
<p class="issue-field"><label><%= I18n.t :field_project %>:</label> <%=h project_name_or_empty(tooltip) %></p>
23+
<% unless tooltip.release_id.blank? %>
24+
<p class="issue-field"><label><%= I18n.t :field_release %>:</label> <%=h release_or_empty(tooltip) %></p>
25+
<% end %>
1426
<%=h custom_fields_or_empty(tooltip) %>
27+
<% unless tooltip.description.blank? %>
28+
<div class="issue-description"><%= textilizable tooltip, :description, :attachments => tooltip.attachments %></div>
29+
<% end %>

0 commit comments

Comments
 (0)