Skip to content

Commit

Permalink
HolonGlobe fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvijge committed Jun 24, 2016
1 parent 025f5d2 commit c520625
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
6 changes: 4 additions & 2 deletions app/helpers/rb_common_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def mark_if_closed(story)
end

def story_points_or_empty(story)
story.story_points.blank? ? "" : story.story_points
story.story_points.blank? ? "" : ("%g" % story.story_points)
end

def record_id_or_empty(story)
Expand Down Expand Up @@ -148,7 +148,9 @@ def custom_fields_or_empty(story)
return '' if story.new_record?
res = ''
story.custom_field_values.each{|value|
res += "<p><b>#{h(value.custom_field.name)}</b>: #{simple_format_without_paragraph(h(show_value(value)))}</p>"
if value.value.present?
res += "<p class=\"issue-field\"><label>#{h(value.custom_field.name)}:</label> #{simple_format_without_paragraph(h(show_value(value)))}</p>"
end
}
res.html_safe
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/backlogs/view_issues_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
:key => key }) %>"><%= l(:label_webcal) %></a><br>
<% end %>
<% releases = project.shared_releases
<% releases = project.shared_releases.open
if releases && releases.size > 0 && User.current.allowed_to?(:view_releases, project) %>
<h3><%= l(:label_release_plural) %></h3>
<% project.shared_releases.each{|r| %>
<% releases.each{|r| %>
<%= link_to(r, {
:controller => 'rb_queries',
:action => 'show',
Expand Down
2 changes: 1 addition & 1 deletion app/views/rb_stories/_helpers.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<%- unless Backlogs.setting[:story_points].blank? -%>
<select class="story_points helper" id="story_points_options">
<%- (['']+Backlogs.setting[:story_points].split(/,/).collect(&:to_f)).each do |point| %>
<%- (['']+Backlogs.setting[:story_points].split(/,/).collect(&:to_s)).each do |point| %>
<option value="<%=h point %>"><%=h point %></option>
<%- end %>
</select>
Expand Down
41 changes: 28 additions & 13 deletions app/views/rb_stories/_tooltip.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
<b><%= I18n.t :field_subject %></b>: <%=h tooltip.subject %><br />
<b><%= I18n.t :field_tracker_id %></b>: <%=h tooltip.tracker %><br />
<b><%= I18n.t :story_status %></b>: <%=h status_label_or_default(tooltip) %><br />
<b><%= I18n.t :field_category %></b>: <%=h tooltip.category %><br />
<b><%= I18n.t :story_points %></b>: <%=h story_points_or_empty(tooltip) %><br />
<b><%= I18n.t :story_estimation_hours %></b>: <%=h tooltip.estimated_hours %><br />
<b><%= I18n.t :story_spent_time %></b>: <%= tooltip.total_spent_hours.round(2) %><br />
<b><%= I18n.t :story_remaining_hours %></b>: <%=h remaining_hours_or_empty(tooltip) %><br />
<b><%= I18n.t :field_assigned_to %></b>: <%=h assignee_name_or_empty(tooltip) %><br />
<b><%= I18n.t :field_project %></b>: <%=h project_name_or_empty(tooltip) %><br />
<b><%= I18n.t :field_release %></b>: <%=h release_or_empty(tooltip) %><br />
<div><%= textilizable tooltip, :description, :attachments => tooltip.attachments%></div>
<p class="issue-field"><label><%= I18n.t :field_subject %>:</label> <%=h tooltip.subject %></p>
<p class="issue-field"><label><%= I18n.t :field_tracker_id %>:</label> <%=h tooltip.tracker %></p>
<p class="issue-field"><label><%= I18n.t :story_status %>:</label> <%=h status_label_or_default(tooltip) %></p>
<% unless tooltip.category.blank? %>
<p class="issue-field"><label><%= I18n.t :field_category %>:</label> <%=h tooltip.category %></p>
<% end %>
<% unless tooltip.story_points.blank? %>
<p class="issue-field"><label><%= I18n.t :story_points %>:</label> <%=h story_points_or_empty(tooltip) %></p>
<% end %>
<% unless tooltip.estimated_hours.blank? %>
<p class="issue-field"><label><%= I18n.t :story_estimation_hours %>:</label> <%=h tooltip.estimated_hours %></p>
<% end %>
<% unless tooltip.total_spent_hours.blank? %>
<p class="issue-field"><label><%= I18n.t :story_spent_time %>:</label> <%= tooltip.total_spent_hours.round(2) %></p>
<% end %>
<% unless tooltip.remaining_hours.blank? %>
<p class="issue-field"><label><%= I18n.t :story_remaining_hours %>:</label> <%=h remaining_hours_or_empty(tooltip) %></p>
<% end %>
<% unless tooltip.assigned_to.blank? %>
<p class="issue-field"><label><%= I18n.t :field_assigned_to %>:</label> <%=h assignee_name_or_empty(tooltip) %></p>
<% end %>
<p class="issue-field"><label><%= I18n.t :field_project %>:</label> <%=h project_name_or_empty(tooltip) %></p>
<% unless tooltip.release_id.blank? %>
<p class="issue-field"><label><%= I18n.t :field_release %>:</label> <%=h release_or_empty(tooltip) %></p>
<% end %>
<%=h custom_fields_or_empty(tooltip) %>
<% unless tooltip.description.blank? %>
<div class="issue-description"><%= textilizable tooltip, :description, :attachments => tooltip.attachments %></div>
<% end %>

0 comments on commit c520625

Please sign in to comment.