Skip to content

Commit c8551f1

Browse files
author
Kaitlyn Parkhurst
committed
Updated blog creation.
1 parent 9af0514 commit c8551f1

File tree

3 files changed

+25
-28
lines changed

3 files changed

+25
-28
lines changed

Web/lib/BlogDB/Web.pm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,20 @@ sub startup ($self) {
8585
$auth->post( '/user/settings/email' )->to( 'User#post_email' )->name( 'do_user_email' );
8686

8787
# /blog/ routes
88-
$r->get ( '/blog/:name' )->to( 'Blog#get_blog' )->name( 'blog' );
88+
$r->get ( '/blog/:name' )->to( 'Blog#get_blog' )->name( 'blog' ); # View A Specific Blog.
89+
90+
$auth->get ( '/blog/new' )->to( 'Blog#get_new_blogs' )->name( 'new_blogs' ); # List pending blogs for approval.
91+
$r->post ( '/blog/new' )->to( 'Blog#post_new_blog' )->name( 'do_new_blog' ); # Create a new blog.
92+
$r->get ( '/blog/new/:name' )->to( 'Blog#get_edit_blog' )->name( 'edit_new_blog' ); # Get the edit page for a new blog.
93+
$r->post ( '/blog/new/:name' )->to( 'Blog#post_edit_blog' )->name( 'do_edit_new_blog' ); # Post an update with the edit page.
94+
8995
$auth->post( '/blog/:name/follow' )->to( 'Blog#post_follow' )->name( 'do_follow_blog' );
9096
$auth->post( '/blog/:name/unfollow' )->to( 'Blog#post_unfollow' )->name( 'do_unfollow_blog' );
9197
$auth->get ( '/blog/:name/settings' )->to( 'Blog#get_settings' )->name( 'blog_settings' );
9298
$auth->post( '/blog/:name' )->to( 'Blog#post_settings' )->name( 'do_blog_settings' );
9399
$auth->post( '/blog/:name/publish' )->to( 'Blog#post_publish' )->name( 'do_publish' );
94100
$auth->post( '/blog/:name/unpublish' )->to( 'Blog#post_unpublish')->name( 'do_unpublish' );
95101

96-
# /new/
97-
$r->post ( '/new' )->to( 'Create#post_new' )->name( 'do_add_new_blog' );
98-
$r->get ( '/new/*name' )->to( 'Create#get_new_blog' )->name( 'update_new_blog' );
99-
$r->post ( '/new/*name' )->to( 'Create#post_new_blog' )->name( 'do_update_new_blog');
100-
101102
# /tags/
102103
$r->get ( '/tags' )->to( 'Tags#get_tags' )->name( 'tags' );
103104
$auth->post( '/tags/suggest' )->to( 'Tags#post_suggest_tag')->name( 'do_suggest_tag' );

Web/lib/BlogDB/Web/Controller/Blog.pm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,22 @@ sub post_unpublish ($c) {
3636

3737
}
3838

39+
# Handle New Blogs
40+
41+
sub get_new_blogs ($c) {
42+
43+
}
44+
45+
sub post_new_blog ($c) {
46+
47+
}
48+
49+
sub get_edit_new_blog ($c) {
50+
51+
}
52+
53+
sub post_edit_new_blog ($c) {
54+
55+
}
56+
3957
1;

Web/lib/BlogDB/Web/Controller/Create.pm

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)