55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
|
<%= error_messages_for :page %>
|
||
|
|
||
|
<% form_for :page, :action => url(:page, :id => @page.name.gsub(/ /, '_')) do -%>
|
||
|
<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>
|
||
|
|
||
|
<p><%= checkbox_control :published, :label => ' Published in blog?', :value => "1" %></p>
|
||
|
|
||
|
<h3>Department</h3>
|
||
|
<p><%= text_control :department, :size => 50 %></p>
|
||
|
|
||
|
<h3>Description</h3>
|
||
|
<p><%= text_area_control :description, :rows => 10, :cols => 70 %></p>
|
||
|
|
||
|
<h3>Tags</h3>
|
||
|
<p>
|
||
|
<p><a href="#" onclick="$('page[tag_names]').value = ''; return false;"><img src="/images/edit-clear.png" style="vertical-align: top;" /></a> <%= text_control 'tag_names', :size => 30 -%></p>
|
||
|
<div id="tag_auto_complete" class="auto_complete"></div>
|
||
|
</p>
|
||
|
</fieldset>
|
||
|
|
||
|
<br />
|
||
|
|
||
|
<p><%= submit_button 'Update' %></p>
|
||
|
<% end -%>
|
||
|
|
||
|
<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>
|