Changing display of page title depending on edit/create state

This commit is contained in:
Eston Bond
2010-11-08 14:48:04 -08:00
parent 46104dcb83
commit 34b75c2a60
7 changed files with 41 additions and 6 deletions
+6 -2
View File
@@ -77,13 +77,17 @@
}
/* @control function-bar */
#gollum-editor #gollum-editor-function-bar {
#gollum-editor #gollum-editor-function-bar {
border-bottom: 1px solid #ddd;
overflow: hidden;
padding: 0.6em 0 1.1em 0;
padding: 0 0 1.1em 0;
display: none;
}
#gollum-editor-title-field + #gollum-editor-function-bar {
margin-top: 0.6em;
}
#gollum-editor #gollum-editor-function-bar.active {
display: block;
}
@@ -37,6 +37,11 @@
if ( EditorHas.editSummaryMarkup() ) {
Placeholder.add( $('#gollum-editor-edit-summary input') )
$('#gollum-editor form[name="gollum-editor"]').submit(function( e ) {
e.preventDefault();
Placeholder.clearAll();
$(this).submit();
});
}
if ( EditorHas.collapsibleInputs() ) {
@@ -1,10 +1,15 @@
<div id="gollum-editor">
<form name="gollum-editor" action="/create/{{escaped_name}}" method="post">
<fieldset id="gollum-editor-fields">
{{#show_title}}
<div id="gollum-editor-title-field" class="singleline">
<label for="page" class="jaws">Page Title</label>
<input type="text" name="page" id="gollum-editor-page-title" value="{{page_name}}">
</div>
{{/show_title}}
{{#hidden_title}}
<input type="hidden" name="page" id="gollum-editor-page-title" value="{{page_name}}">
{{/hidden_title}}
<div id="gollum-editor-function-bar">
<a href="#" id="function-bold" class="function-button">
<span>Bold</span></a>
@@ -4,7 +4,7 @@
<ul class="actions">
<li class="minibutton"><a href="/{{escaped_name}}"
class="action-view-page">View Page</a></li>
<li class="minibutton"><a href="/edit/{escaped_name}}"
<li class="minibutton"><a href="/edit/{{escaped_name}}"
class="action-edit-page">Edit Page</a></li>
</ul>
</div>
+8
View File
@@ -8,6 +8,14 @@ module Precious
def title
"Create a new page"
end
def show_title
true
end
def hidden_title
false
end
def page_name
@name.gsub('-', ' ')
+15 -2
View File
@@ -5,9 +5,22 @@ module Precious
attr_reader :page, :content
def title
"Editing #{@page.title}"
def page_name
@name.gsub('-', ' ')
end
def edit_title
false
end
def hidden_title
true
end
def title
"#{@page.title}"
end
end
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ module Precious
attr_reader :page, :page_num
def title
"History of #{@page.title}"
@page.title
end
def versions