Skip to content

Commit

Permalink
focus name field in change version, display version name in history
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Sep 9, 2010
1 parent 459778a commit 5776c4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/views/edit/_change_version.html.erb
Expand Up @@ -3,10 +3,14 @@
<h3><%= "Save as a new version".t %></h3>

<% admin_form_for :page_revision, @page_revision, :html => {:onsubmit => 'cmsEdit.saveAsSpecificSubmit(this); return false;'} do |f| -%>
<%= f.custom_field :version_name, :value => text_field_tag(:name, '') %>
<%= f.custom_field :version_name, :value => text_field_tag(:name, '', :id => 'version_name') %>
<%= f.custom_field :version, :value => text_field_tag(:version, @page_revision.get_next_version(@version)) %>
<%= f.spacer %>
<%= f.cancel_submit_buttons "Cancel", "Submit", { :onclick => 'RedBox.close(); return false;' } %>
<% end -%>

</div>

<script>
setTimeout(function() {$('version_name').focus(); }, 100);
</script>
3 changes: 2 additions & 1 deletion app/views/edit/version_history.rhtml
Expand Up @@ -2,6 +2,7 @@
<% @revisions.each do |rev| -%>
<a href='javascript:void(0);' <%= (@revision.revision == rev.revision && @revision.language == rev.language) ? "class='cms_ajax_link_selected'" : "class='cms_ajax_link'" %> onclick='cmsEdit.loadVersion(<%= rev.id %>);'><%= dec(rev.revision) %> <%= rev.language.upcase %> - <%= render :partial => 'saved_by', :locals => {:revision => rev} %>
<% if rev.active %> - <%= "Active".t %> <% end -%>
<%= h "(#{rev.version_name})" unless rev.version_name.blank? %>
</a><br/>
<% end -%>
<% if @version_pages > 1 %>
Expand All @@ -18,4 +19,4 @@
</td>
</table>
<% end -%>
</div>
</div>

0 comments on commit 5776c4c

Please sign in to comment.