Skip to content

Commit

Permalink
change /edit/:name to /page/:name/_edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Nov 1, 2015
1 parent c116cc7 commit 9ba4899
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Galileo.pm
Expand Up @@ -197,7 +197,7 @@ sub startup {
});

$if_author->any( '/admin/menu' )->to('menu#edit');
$if_author->any( '/edit/:name' )->to('page#edit')->name('edit_page');
$if_author->any( '/page/:name/_edit' )->to('page#edit')->name('edit_page');
$if_author->websocket( '/store/page' )->to('page#store');
$if_author->websocket( '/store/menu' )->to('menu#store');
$if_author->websocket( '/files/list' )->to('file#list');
Expand Down
2 changes: 1 addition & 1 deletion lib/Galileo/files/templates/user_menu.html.ep
Expand Up @@ -48,7 +48,7 @@
show_modal( '#page-modal', function () {
var link = $('#new-page-link').val();
if (link.length > 0) {
window.location.href = '/edit/' + link;
window.location.href = '/page/' + link + '/_edit';
} else {
humane.log('New link name cannot be empty');
}
Expand Down
4 changes: 2 additions & 2 deletions t/basic.t
Expand Up @@ -27,7 +27,7 @@ subtest 'Anonymous User' => sub {
->status_is(404);

# attempt to edit page
$t->get_ok('/edit/home')
$t->get_ok('/page/home/_edit')
->status_is(200)
->content_like( qr/Not Authorized/ );

Expand Down Expand Up @@ -73,7 +73,7 @@ subtest 'Do Login' => sub {
subtest 'Edit Page' => sub {

# page editor
$t->get_ok('/edit/home')
$t->get_ok('/page/home/_edit')
->status_is(200)
->text_like( '#wmd-input' => qr/Welcome to your Galileo CMS site!/ )
->element_exists( '#wmd-preview' );
Expand Down

0 comments on commit 9ba4899

Please sign in to comment.