From 6d2ec96d5c784e1e6b63897ce793de1f05e86f5a Mon Sep 17 00:00:00 2001 From: rick Date: Wed, 4 Aug 2010 16:37:56 -0700 Subject: [PATCH] add rename support to the frontend --- lib/gollum/frontend/app.rb | 11 ++--- lib/gollum/frontend/templates/edit.mustache | 47 ++++++++++++--------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 6c0621f4..6b5bf188 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -51,14 +51,15 @@ module Precious end post '/edit/:name' do - name = params[:name] - wiki = Gollum::Wiki.new($path) - page = wiki.page(name) + name = params[:name] + wiki = Gollum::Wiki.new($path) + page = wiki.page(name) format = params[:format].intern + name = params[:rename] if params[:rename] - wiki.update_page(page, page.name, format, params[:content], commit_message) + wiki.update_page(page, name, format, params[:content], commit_message) - redirect "/#{name}" + redirect "/#{Gollum::Page.cname name}" end post '/create/:name' do diff --git a/lib/gollum/frontend/templates/edit.mustache b/lib/gollum/frontend/templates/edit.mustache index b5a4a161..0d1ecdc7 100644 --- a/lib/gollum/frontend/templates/edit.mustache +++ b/lib/gollum/frontend/templates/edit.mustache @@ -2,28 +2,37 @@ « Back

Editing “{{name}}”

-
-
- -
- {{>editbar}} -
- + +
+ +
+ +
+ +
+ + {{>editbar}} +
+ +
+
+
+

Loading content...

-
-

Loading content...

+ +
+
- -
- -
\ No newline at end of file