--- /dev/null
+class QuickViewIssuesController < ApplicationController
+ #before_filter :find_project, :authorize, :only => [:show]
+ before_filter :find_issue, :find_project_from_association, :only => [:show]
+
+ def show
+ respond_to do |format|
+ #render 'hooks/quick_view_issue_dialog', :project => @project, :issue => other_issue
+ logger.debug ' *** format='+format.inspect
+ lookup_context.view_paths do |path|
+ logger.debug ' *** lookup='+path.to_s
+ end
+ logger.debug ' *** issue='+@issue.inspect
+ format.html { render :template => 'quick_view_issues/quick_view_issue_dialog', :layout => false, :project => @project, :issue => @issue }
+ end
+ end
+
+private
+ def find_project
+ logger.info "project_id => #{params[:project_id]}"
+ @issue = Project.find(params[:project_id])
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ end
+
+ def find_issue
+ logger.info "issue_id => #{params[:id]}"
+ @issue = @object = Issue.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ end
+
+ def find_relation
+ @relation = IssueRelation.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ end
+
+end
--- /dev/null
+<div id="quick_view_dialogs"></div>
+<%= form_tag({:controller=>'quick_view_issues', :action=>:show, :id=>0}, :method=>:get, :id=> 'quick_view_form') do %>
+<% end %>
+<script>
+//<![CDATA[
+var lastmoved = Date.now();
+var me = null;
+/*
+$(".issue").mouseover( function () {
+ me = this;
+ setTimeout(delayToolTip, 3000);
+ lastmoved = Date.now();
+});
+$(".issue").tooltip({track:true});
+*/
+function delayToolTip(){
+ var elapsed = Date.now() - lastmoved;
+ if (elapsed > 2900) {
+ //$(me).attr("title", getContent(me));
+ getContent(me);
+ //$(me).tooltip("open");
+ }
+}
+function getContent(me){
+ var content;
+ var issue_id = $(me).attr("id").slice("issue-".length);
+ var url='<%= issues_path() %>/'+issue_id+".json";
+ console.log(url);
+
+ $.ajax({url: url, dataType: 'json'}).done( function(data){
+ //console.log(data.issue.id + ":" + data.issue.description);
+ console.log(data.issue.id + ": get");
+ //content = '<div class="tooltip-content" style="overflow: hidden;">' + data.issue.description+'</div>';
+ $(me).attr("title", data.issue.description);
+ });
+ return content;
+}
+
+function rewriteToolTip(){
+
+}
+
+function quick_view_show_dialog(issue_id) {
+ if (!issue_id) {
+ return;
+ }
+
+ //$(".quick_view_dialog").each(function() {
+ // alert($(this).attr("id"));
+ //});
+
+ for (var i = 0; i < arguments.length; ++i) {
+ var issue_id = arguments[i];
+ var url = '/quick_view_issues/' + issue_id;
+ $("quick_view_form").attr("action", url);
+ $.ajax({url: url, data: $("quick_view_format").serialize(), dataType: 'html', success: function(data){
+// console.log(data.issue.id + ": get");
+ var res = data;
+ console.log(res);
+ $("#quick_view_dialogs").append(res);
+
+ var search_id_str = "[data-issue=\"%s\"]".replace('%s',issue_id);
+ var matched = /id="(quick_view_dialog_[0-9]+)"/.exec(res);
+ console.log("search_id=" + matched[1]);
+ var dialog_id = matched[1];
+ console.log("dialog_id=" + dialog_id);
+
+ var last = $(".quick_view_dialog:visible:last");
+ var position = null;
+ if (last.length == 1 && last.attr("id") != dialog_id) {
+ position={ my: "left top", at: "left+10px top+10px", of : last };
+ }
+
+ $('#'+dialog_id).dialog({
+ modal: false,
+ closeOnEscape: false,
+ width: 800,
+ height: 480,
+ position: position,
+ show: "clip",
+ close: "clip",
+ buttons: {
+ "close" : quick_view_dialog_cancel
+ },
+ close: quick_view_dialog_close
+ });
+ }});
+ };
+}
+
+function quick_view_dialog_close(){
+ $(this).remove();
+}
+
+function quick_view_dialog_cancel(){
+ $(this).dialog("close");
+}
+
+
+//]]>
+</script>
+
--- /dev/null
+<%
+ #template args
+ # project - drawing target
+ # issue - drawing target
+ logger.debug "template"
+
+ extend IssuesHelper
+ extend AttachmentsHelper
+ extend CustomFieldsHelper
+ extend JournalsHelper
+
+ project = @project
+ issue = @issue
+ journals = issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all
+ journals.each_with_index {|j,i| j.indice = i+1}
+ journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, project)
+ journals.reverse! if User.current.wants_comments_in_reverse_order?
+
+ dialog_id = Time.now.to_i
+ dialog_html_id = "quick_view_dialog_#{dialog_id}"
+%>
+ <div id="<%= dialog_html_id %>" class="quick_view_dialog" style="background-color: white;" title="Quick View - <%= issue.subject %>" data-issue="<%= issue.id.to_s %>">
+ <div class="issue">
+ <div class="subject">
+ <%= render_issue_subject_with_tree(issue) %>
+ </div>
+ <p class="author">
+ <%= authoring issue.created_on, issue.author %>.
+ <% if issue.created_on != issue.updated_on %>
+ <%= l(:label_updated_time, time_tag(issue.updated_on)).html_safe %>.
+ <% end %>
+ </p>
+
+ <table class="attributes">
+ <%= issue_fields_rows do |rows|
+ rows.left l(:field_status), h(issue.status.name), :class => 'status'
+ rows.left l(:field_priority), h(issue.priority.name), :class => 'priority'
+
+ unless issue.disabled_core_fields.include?('assigned_to_id')
+ rows.left l(:field_assigned_to), avatar(issue.assigned_to, :size => "14").to_s.html_safe + (issue.assigned_to ? link_to_user(issue.assigned_to) : "-"), :class => 'assigned-to'
+ end
+ unless issue.disabled_core_fields.include?('category_id')
+ rows.left l(:field_category), h(issue.category ? issue.category.name : "-"), :class => 'category'
+ end
+ unless issue.disabled_core_fields.include?('fixed_version_id')
+ rows.left l(:field_fixed_version), (issue.fixed_version ? link_to_version(issue.fixed_version) : "-"), :class => 'fixed-version'
+ end
+
+ unless issue.disabled_core_fields.include?('start_date')
+ rows.right l(:field_start_date), format_date(issue.start_date), :class => 'start-date'
+ end
+ unless issue.disabled_core_fields.include?('due_date')
+ rows.right l(:field_due_date), format_date(issue.due_date), :class => 'due-date'
+ end
+ unless issue.disabled_core_fields.include?('done_ratio')
+ rows.right l(:field_done_ratio), progress_bar(issue.done_ratio, :width => '80px', :legend => "#{issue.done_ratio}%"), :class => 'progress'
+ end
+ unless issue.disabled_core_fields.include?('estimated_hours')
+ unless issue.estimated_hours.nil?
+ rows.right l(:field_estimated_hours), l_hours(issue.estimated_hours), :class => 'estimated-hours'
+ end
+ end
+ if User.current.allowed_to?(:view_time_entries, project)
+ rows.right l(:label_spent_time), (issue.total_spent_hours > 0 ? link_to(l_hours(issue.total_spent_hours), project_issue_time_entries_path(project, issue)) : "-"), :class => 'spent-time'
+ end
+
+ end %>
+
+ <%= render_custom_fields_rows(issue) %>
+ </table>
+
+ <hr />
+
+ <div class="description">
+ <p><strong><%=l(:field_description)%></strong></p>
+ <div class="wiki">
+ <% if issue.description? %>
+ <%= textilizable issue, :description, :attachments => issue.attachments %>
+ <% else %>
+ <i>description is none.</i>
+ <% end %>
+ </div>
+ <% if issue.attachments.any? %>
+ <%= link_to_attachments issue, :thumbnails => true %>
+ <% end %>
+ </div>
+ </div>
+
+ <% if journals.present? %>
+ <div id="history">
+ <h3><%=l(:label_history)%></h3>
+ <%= render :partial => '../../../../app/views/issues/history', :locals => { :issue => issue, :journals => journals } %>
+ </div>
+ <% end %>
+
+ </div>
+ <!--<script>$('#<%= dialog_html_id %>').dialog();</script>-->