--- /dev/null
+= Quick View
+
+Plugin's features:
+- You can see a context menu to see the details of the issue.
+
+INSTALL:
+
+- Download the plugin to your plugins directory.
+
+ examples)
+ cd redmine/plugins/
+ git clone git://git.sourceforge.jp/gitroot/quickedit/quick_view.git
+
+- Restart your redmine.
+
+
--- /dev/null
+#coding: utf-8
+
+module ApplicationHelper
+ def quick_edit_link(caption, target_field, field_type, default_value, disabled)
+ help_message= l(:text_edit_confirm)
+
+ case field_type.to_s
+ when "string", "text"
+ pattern = ''
+ when "int"
+ pattern = '\d+'
+ when "date"
+ pattern = '\d{4}-\d{2}-\d{2}'
+ help_message += " (yyyy-mm-dd)"
+ end
+
+ pattern = h(pattern.gsub(/\\/,'\\\\\\\\'))
+
+ sprintf('<li>%s%s</li>',
+ context_menu_link(
+ h(caption),
+ "javascript:quick_edit_show_input_dialog('#{caption}', '#{target_field}', '#{pattern}', '#{help_message}', '#{default_value}')",
+ :class => 'icon-edit',
+ :disabled => disabled
+ ),
+ context_menu_link(
+ h(:dummy),
+ '#',
+ :id => 'context_edit_update_link_%s' % target_field.to_s().tr('[]','__'),
+ :style=>'display:none',
+ :method => :post,
+ )
+ ).html_safe()
+ end
+end
+
--- /dev/null
+<%
+ custom_fields = @issues.map(&:available_custom_fields).reduce(:&).select do |f|
+ #concat f.field_format
+ %w(string date int).include?(f.field_format)
+ end
+
+ issue = @issues.first
+%>
+ <li><%= context_menu_link(
+ l(:button_quick_view),
+ "javascript:quick_view_show_dialog()",
+ :class => 'icon-show'
+ ) %></li>
+
+ <div id="quick_view_dialog" style="display:none; background-color: white;" title="Quick View - <%= issue.subject %>">
+ <div class="issue">
+ <div class="wiki">
+ <% if issue.description? %>
+ <%= textilizable issue, :description, :attachments => issue.attachments %>
+ <% else %>
+ <i>description is none.</i>
+ <% end %>
+ </div>
+ </div>
+ </div>
+
+<script>
+//<![CDATA[
+function quick_view_show_dialog() {
+ $("#quick_view_dialog").dialog({
+ modal: true,
+ closeOnEscape: false,
+ width: 800,
+ height: 480,
+ buttons: {
+ "close" : quick_view_dialog_cancel
+ },
+ close: quick_view_dialog_close
+ });
+}
+
+function quick_view_dialog_close(){
+ $("#quick_view_dialog").remove();
+}
+
+function quick_view_dialog_cancel(){
+ $("#quick_view_dialog").dialog("close");
+}
+
+//]]>
+</script>
--- /dev/null
+# English strings go here for Rails i18n
+en:
+ label_quick_view: Quick View
+ project_module_quick_view: Quick View Plugin
+
+ button_quick_view: Quick View
+
+
--- /dev/null
+# English strings go here for Rails i18n
+ja:
+ label_quick_view: Quick View
+ project_module_quick_view: Quick View Plugin
+
+ button_quick_view: Quick View
--- /dev/null
+# Plugin's routes
+# See: http://guides.rubyonrails.org/routing.html
--- /dev/null
+#coding: utf-8
+
+class QuickViewHooks < Redmine::Hook::ViewListener
+ render_on :view_issues_context_menu_end, :partial=> 'hooks/quick_view_context'
+end
--- /dev/null
+#coding: utf-8
+
+require_dependency File.expand_path('../app/helpers/application_helper.rb', __FILE__)
+require_dependency File.expand_path('../hooks', __FILE__)
+
+Redmine::Plugin.register :quick_view do
+ name 'Quick View plugin'
+ author 'Akira Saito'
+ description 'This is a plugin for Redmine'
+ version '0.0.1'
+end
--- /dev/null
+# Load the Redmine helper
+require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')