Skip to content
Browse files

Cleanup issue partial

  • Loading branch information...
1 parent 3ad12a9 commit 9fe6a792506d33429985afcd80ab7080fa10c51c @den-plugins committed
Showing with 89 additions and 32 deletions.
  1. +3 −14 app/views/task_boards/_feature.rhtml
  2. +71 −15 app/views/task_boards/_issue.html.erb
  3. +15 −3 assets/javascripts/sticky_note.js
View
17 app/views/task_boards/_feature.rhtml
@@ -47,18 +47,7 @@
</div>
</div>
- <script type="text/javascript">
- sticky_note("<%= dom_id(feature) %>", "<%= feature.assigned_to_id %>", "<%= feature.status_id %>");
- jQuery(function(){
- jQuery("#<%= feature.id %>_discussion").slimScroll({
- height: '150px',
- });
- });
- jQuery("#text_comment_<%= feature.id %>").focusout(function(){
- if(jQuery(this).val() == "") jQuery(this).val("Type your comment here...");
- });
- jQuery("#text_comment_<%= feature.id %>").focusin(function(){
- if(jQuery(this).val() == "Type your comment here...") jQuery(this).val("");
- });
- </script>
+<script type="text/javascript">
+ sticky_note("<%= dom_id(feature) %>", "<%= feature.assigned_to_id %>", "<%= feature.status_id %>", "<%= feature.id %>", false);
+</script>
View
86 app/views/task_boards/_issue.html.erb
@@ -1,18 +1,74 @@
<li id="<%= dom_id(issue) %>" class="<%= status_classes_for(issue, User.current) %> task_board_data <%= task_board_border_class(issue)%> <%= 'current_is_assigned' if issue.assigned_to.eql? User.current %> <%= 'isBug' if defined?(bug) %> assigned_to_<%= issue.assigned_to_id %>" <%= "style='border: 3px solid #E33;'" if issue.if_blocked %>>
- <%= render :partial => 'issue_show', :locals => {:issue => issue } %>
-</li>
-<script type="text/javascript">
- /* if (jQuery("#show_bugs").is(":checked")) {
- jQuery('.isBug').show();
- }
- else {
- jQuery('.isBug').hide();
- } */
- <% if (issue.assigned_to_id == @selected_resource.to_i) or ["", "All", "Select a resource..."].member?(@selected_resource) %>
- jQuery('.assigned_to_<%= issue.assigned_to_id %>').show();
- <% else %>
- jQuery('.assigned_to_<%= issue.assigned_to_id %>').hide();
- <% end %>
-</script>
+<!--- START-------------------------------------------------------------------------------------------------------------->
+
+ <div class="issue_number">
+ <% if params[:board].to_i.eql? 1 %>
+ <%= link_to "#{issue.parent.issue_from_id} &raquo; ", "##{dom_id(issue.parent.issue_from)}",
+ :class => "to_parent", :style => "color: orange;",
+ :title => "Jump to parent." if (!issue.parent.nil? and !issue.parent.issue_from.feature?) and not issue.task_parent? %>
+ <% elsif params[:board].to_i.eql? 2 %>
+ <%= link_to "#{issue.parent.issue_from_id} &raquo; ", "##{dom_id(issue.parent.issue_from)}",
+ :class => "to_parent", :style => "color: orange;",
+ :title => "Jump to parent." if !issue.parent.nil? %>
+ <% end %>
+ <div class="tooltip">
+ <%= link_to_issue issue %><span id="<%= issue.id %>_tip" class="tip"><%= task_board_tooltip(issue) %></span>
+ </div>
+ </div>
+
+ <div class="bulk_details">
+
+ <div class="initial_controls" style="display: none;">
+ <div class="edit" title="Edit">Edit</div>
+ <div class="toggle_details maximized" title="Show Details">Show Details</div>
+ <div class="talk" title="Comment">Comment</div>
+ </div>
+
+ <div class="current_data">
+ <p class="estimate"><%= "R: #{issue.remaining_effort}" if issue.remaining_effort %></p>
+ <p class="assignee <%= "assigned_to_current" if issue.assigned_to.eql? User.current %>"><%= issue.assigned_to ? issue.assigned_to : '' %></p>
+ <p class="est"><%= "E: #{issue.estimated_hours}" if issue.estimated_hours %></p>
+ <p class="status"><%= issue.status.name %></p>
+ <hr/>
+ <p><%= truncate(issue.subject, :length => 50) %></p>
+ <%= progress_bar issue.done_ratio, :width =>'100%' %>
+ </div>
+
+ <div class="edit_here" style="display:none;">
+ <div class="cancel" title="Cancel">Cancel</div>
+ <div class="submit_link" title="Save">Save</div>
+ <div style="width: 100%; margin: 0; padding: 0;">
+ <%= render :partial => 'edit_form', :locals => {:issue => issue}%>
+ </div>
+ </div>
+
+ <div class="talk_here" style="display:none">
+ <div class="cancel" title="Cancel">Cancel</div>
+ <div class="comment_form_panel">
+ <% remote_form_for :issue, issue, :url => {:action => "add_comment", :controller => "task_boards",
+ :id => @project, :issue_id => issue }, :html => {:id => "#{issue.id}_comment_form", :class => "comment_form"},
+ :complete => "jQuery('#text_comment_#{issue.id}').val('Type your comment here...');
+ var barheight = getbarHeight(jQuery('##{issue.id}_discussion'), 30);
+ jQuery('.slimScrollBar').css({height: barheight + 'px'});
+ " do |f| %>
+ <%= text_area_tag "comment", nil, :id => "text_comment_#{issue.id}" %>
+ <%= f.submit "+", :class => "add" %><div class="clear"></div>
+ <% end %>
+ </div>
+ <div class="discussion">
+ <div id="<%= issue.id %>_discussion">
+ <%= render :partial => "discussion", :locals => {:issue => issue} %>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ <script type="text/javascript" id="stickynotejs_<%= issue.id %>" class="stickynotejs">
+ sticky_note('<%= dom_id(issue) %>', '<%= issue.assigned_to_id %>', '<%= issue.status_id %>', '<%= issue.id %>', <%= issue.version_descendants.empty? %>);
+ </script>
+
+<!----------------------------------------------------------------------------------------------------------------END --->
+
+</li>
View
18 assets/javascripts/sticky_note.js
@@ -1,6 +1,6 @@
j = jQuery.noConflict(); //This allows Prototype to go undisturbed
-function sticky_note(issue, assigned_to, status_id)
+function sticky_note(issue, assigned_to, status_id, issue_id, draggable)
{
jQuery("#" + issue + "").hover(
function(){
@@ -19,7 +19,7 @@ function sticky_note(issue, assigned_to, status_id)
jQuery("#" + issue + " .talk_here").show();
jQuery("#" + issue + " .talk_here textarea").val("Type your comment here...");
});
-
+
jQuery("#" + issue + " .cancel").click(function(){
jQuery("#" + issue + " #issue_assigned_to_id").val(assigned_to);
jQuery("#" + issue + " #issue_status_id").val(status_id);
@@ -30,7 +30,7 @@ function sticky_note(issue, assigned_to, status_id)
if ( jQuery("#" + issue + " .toggle_details").hasClass('maximized'))
jQuery("#" + issue + " .current_data").show();
});
-
+
jQuery("#" + issue + " .toggle_details").click(function(){
jQuery("#" + issue + " .current_data").toggle(1, function()
{
@@ -54,4 +54,16 @@ function sticky_note(issue, assigned_to, status_id)
return false;
}
});
+
+ jQuery("#" + issue_id + "_discussion").slimScroll({ height: '150px'});
+ jQuery("#text_comment_" + issue_id).focusout(function(){
+ if(jQuery(this).val() == "") jQuery(this).val("Type your comment here...");
+ });
+ jQuery("#text_comment_" + issue_id).focusin(function(){
+ if(jQuery(this).val() == "Type your comment here...") jQuery(this).val("");
+ });
+
+ if(draggable)
+ new Draggable(issue, {constraint:"horizontal", revert:"failure"});
}
+

0 comments on commit 9fe6a79

Please sign in to comment.
Something went wrong with that request. Please try again.