2008-06-27 00:13:15 -04:00
|
|
|
<%= error_messages_for :page %>
|
|
|
|
|
2008-10-01 02:57:49 -04:00
|
|
|
<%= form_for :page, :action => url(:page, :id => @page.name.gsub(/ /, '_')) do -%>
|
2008-06-27 00:13:15 -04:00
|
|
|
<fieldset>
|
|
|
|
<legend>Update a page</legend>
|
|
|
|
|
|
|
|
<h3 style="margin-top: 10px;">Name</h3>
|
|
|
|
<p><img src="/images/emblem-readonly.png" alt="Read Only" /> <span style="vertical-align: top"><%= (@page.name) %></span></p>
|
|
|
|
|
|
|
|
<h3>Original Author</h3>
|
|
|
|
<p><img src="/images/emblem-readonly.png" alt="Read Only" /> <span style="vertical-align: top"><%= (@page.author.name) %></span></p>
|
|
|
|
|
2008-10-01 02:57:49 -04:00
|
|
|
<p><label>Published in blog? <%= check_box :published %></label></p>
|
2008-06-27 00:13:15 -04:00
|
|
|
|
|
|
|
<h3>Department</h3>
|
2008-10-01 02:57:49 -04:00
|
|
|
<p><%= text_field :department, :size => 50 %></p>
|
2008-06-27 00:13:15 -04:00
|
|
|
|
|
|
|
<h3>Description</h3>
|
2008-10-01 02:57:49 -04:00
|
|
|
<p><%= text_area :description, :rows => 10, :cols => 70 %></p>
|
2008-06-27 00:13:15 -04:00
|
|
|
|
|
|
|
<h3>Tags</h3>
|
|
|
|
<p>
|
2008-10-01 02:57:49 -04:00
|
|
|
<p><a href="#" onclick="$('page_tag_names').value = ''; return false;"><img src="/images/edit-clear.png" style="vertical-align: top;" /></a> <%= text_field :tag_names, :size => 30 -%></p>
|
2008-06-27 00:13:15 -04:00
|
|
|
<div id="tag_auto_complete" class="auto_complete"></div>
|
|
|
|
</p>
|
|
|
|
</fieldset>
|
|
|
|
|
2008-10-01 02:57:49 -04:00
|
|
|
<p><%= submit 'Update' %></p>
|
|
|
|
<% end =%>
|
2008-06-27 00:13:15 -04:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
//<![CDATA[
|
|
|
|
|
|
|
|
new Ajax.Autocompleter(
|
|
|
|
'page_tag_names',
|
|
|
|
'tag_auto_complete',
|
|
|
|
'/tags/auto_complete',
|
|
|
|
{
|
|
|
|
paramName: 'id',
|
|
|
|
updateElement: function(tag_name)
|
|
|
|
{
|
|
|
|
var new_tag = tag_name.innerHTML.gsub(/\<[^>]+\>/, '');
|
|
|
|
var existing_tags = $('page_tag_names').value.gsub(/( |^)[^ ]+$/, '');
|
|
|
|
var plus_space = (existing_tags.length == 0 ? '' : ' ');
|
|
|
|
$('page_tag_names').value = existing_tags + plus_space + new_tag;
|
|
|
|
$('page_tag_names').focus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
//]]>
|
|
|
|
</script>
|