summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-06 08:54:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-06 08:54:05 +0000
commit5259dec0611a00c84b4ae7f460202c761abec5f9 (patch)
tree822871e3d465a28590245498779f2282dbc7ab39 /app/views
parent75c4c4f6b3fa799f06354467517d3f39cd9e945a (diff)
downloadredmine-5259dec0611a00c84b4ae7f460202c761abec5f9.tar.gz
redmine-5259dec0611a00c84b4ae7f460202c761abec5f9.zip
Added preview on add/edit issue form.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@812 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/common/_preview.rhtml (renamed from app/views/wiki/_preview.rhtml)0
-rw-r--r--app/views/issues/_form.rhtml6
-rw-r--r--app/views/issues/edit.rhtml14
-rw-r--r--app/views/projects/add_issue.rhtml14
4 files changed, 31 insertions, 3 deletions
diff --git a/app/views/wiki/_preview.rhtml b/app/views/common/_preview.rhtml
index e3bfc3a25..e3bfc3a25 100644
--- a/app/views/wiki/_preview.rhtml
+++ b/app/views/common/_preview.rhtml
diff --git a/app/views/issues/_form.rhtml b/app/views/issues/_form.rhtml
index 28d2b97ec..203d1cca3 100644
--- a/app/views/issues/_form.rhtml
+++ b/app/views/issues/_form.rhtml
@@ -25,7 +25,11 @@
</div>
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
-<p><%= f.text_area :description, :required => true, :cols => 60, :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), :class => 'wiki-edit' %></p>
+<p><%= f.text_area :description, :required => true,
+ :cols => 60,
+ :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
+ :accesskey => accesskey(:edit),
+ :class => 'wiki-edit' %></p>
<p><%= f.select :fixed_version_id, (@project.versions.sort.collect {|v| [v.name, v.id]}), { :include_blank => true } %></p>
<% for @custom_value in @custom_values %>
<p><%= custom_field_tag_with_label @custom_value %></p>
diff --git a/app/views/issues/edit.rhtml b/app/views/issues/edit.rhtml
index 9efaeb2e4..1577216ed 100644
--- a/app/views/issues/edit.rhtml
+++ b/app/views/issues/edit.rhtml
@@ -1,7 +1,19 @@
<h2><%=h "#{@issue.tracker.name} ##{@issue.id}" %></h2>
-<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'edit'} do |f| %>
+<% labelled_tabular_form_for :issue, @issue,
+ :url => {:action => 'edit'},
+ :html => {:id => 'issue-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= f.hidden_field :lock_version %>
<%= submit_tag l(:button_save) %>
+ <%= link_to_remote l(:label_preview),
+ { :url => { :controller => 'issues', :action => 'preview', :id => @issue },
+ :method => 'post',
+ :update => 'preview',
+ :with => "Form.serialize('issue-form')",
+ :complete => "location.href='#preview-top'"
+ }, :accesskey => accesskey(:preview) %>
<% end %>
+
+<a name="preview-top"></a>
+<div id="preview" class="wiki"></div>
diff --git a/app/views/projects/add_issue.rhtml b/app/views/projects/add_issue.rhtml
index f0dbead94..8382d6c9f 100644
--- a/app/views/projects/add_issue.rhtml
+++ b/app/views/projects/add_issue.rhtml
@@ -1,7 +1,19 @@
<h2><%=l(:label_issue_new)%>: <%= @tracker.name %></h2>
-<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'add_issue'}, :html => {:multipart => true} do |f| %>
+<% labelled_tabular_form_for :issue, @issue,
+ :url => {:action => 'add_issue'},
+ :html => {:multipart => true, :id => 'issue-form'} do |f| %>
<%= hidden_field_tag 'tracker_id', @tracker.id %>
<%= render :partial => 'issues/form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %>
+ <%= link_to_remote l(:label_preview),
+ { :url => { :controller => 'issues', :action => 'preview', :id => @issue },
+ :method => 'post',
+ :update => 'preview',
+ :with => "Form.serialize('issue-form')",
+ :complete => "location.href='#preview-top'"
+ }, :accesskey => accesskey(:preview) %>
<% end %>
+
+<a name="preview-top"></a>
+<div id="preview" class="wiki"></div>