phcpress 53.1.0 → 54.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/assets/javascripts/phcpress/application.js +0 -3
- data/app/assets/stylesheets/phcpress/application.scss +0 -2
- data/app/controllers/phcpress/api/v1/post_index.json.rabl +1 -1
- data/app/controllers/phcpress/api/v1/post_single.json.rabl +1 -1
- data/app/controllers/phcpress/application_controller.rb +19 -19
- data/app/controllers/phcpress/article/categories_controller.rb +10 -10
- data/app/controllers/phcpress/article/posts_controller.rb +13 -13
- data/app/controllers/phcpress/blog/articles_controller.rb +3 -3
- data/app/models/phcpress/article/category.rb +6 -10
- data/app/models/phcpress/article/post.rb +6 -14
- data/app/views/layouts/phcpress/application.html.erb +6 -7
- data/app/views/layouts/phcpress/components/backend/footer/_footer.html.erb +5 -5
- data/app/views/layouts/phcpress/components/backend/navigation/_top_menu.html.erb +0 -41
- data/app/views/layouts/phcpress/components/backend/sidebars/_side_menu.html.erb +9 -9
- data/app/views/phcpress/article/categories/_form.html.erb +8 -4
- data/app/views/phcpress/article/categories/edit.html.erb +15 -3
- data/app/views/phcpress/article/categories/index.html.erb +17 -14
- data/app/views/phcpress/article/categories/new.html.erb +15 -3
- data/app/views/phcpress/article/posts/_form.html.erb +20 -12
- data/app/views/phcpress/article/posts/edit.html.erb +3 -3
- data/app/views/phcpress/article/posts/index.html.erb +18 -15
- data/app/views/phcpress/article/posts/new.html.erb +3 -3
- data/app/views/phcpress/blog/articles/index.html.erb +56 -56
- data/config/routes.rb +11 -11
- data/db/migrate/20190315010932_create_phcpress_article_posts.rb +1 -1
- data/lib/phcpress/engine.rb +54 -54
- data/lib/phcpress/version.rb +1 -1
- metadata +6 -15
- data/app/assets/javascripts/phcpress/article/categories.js +0 -0
- data/app/assets/javascripts/phcpress/article/posts.js +0 -0
- data/app/assets/javascripts/phcpress/blog/articles.js +0 -0
- data/app/assets/javascripts/phcpress/custom/custom.js +0 -0
- data/app/assets/stylesheets/phcpress/article/categories.scss +0 -0
- data/app/assets/stylesheets/phcpress/article/posts.scss +0 -0
- data/app/assets/stylesheets/phcpress/blog/articles.scss +0 -0
- data/app/views/phcpress/article/categories/show.html.erb +0 -9
- data/app/views/phcpress/article/posts/show.html.erb +0 -51
@@ -1,18 +1,22 @@
|
|
1
|
+
<!-- Form - Article - Category -->
|
1
2
|
<%= form_with(model: article_category, local: true) do |form| %>
|
2
3
|
|
3
4
|
<!-- PHCNotifi Render Validation -->
|
4
5
|
<%= render 'phcnotifi/default/validations', :object => @article_category %>
|
5
6
|
<!-- PHCNotifi Render Validation -->
|
6
|
-
|
7
|
-
<!--
|
8
|
-
<div class="form-group">
|
7
|
+
|
8
|
+
<!-- Form Input Fields -->
|
9
|
+
<div class="form-group field_with_errors">
|
9
10
|
<%= form.label :category_name, "Category Name" %>
|
10
11
|
<%= form.text_field :category_name, class: "form-control" %>
|
11
12
|
</div>
|
13
|
+
<!-- Form Input Fields -->
|
12
14
|
|
15
|
+
<!-- Form Submition Button -->
|
13
16
|
<div class="actions">
|
14
17
|
<%= form.submit class: "btn btn-primary" %>
|
15
18
|
</div>
|
16
|
-
<!--
|
19
|
+
<!-- For Submition Button -->
|
17
20
|
|
18
21
|
<% end %>
|
22
|
+
<!-- Form - Article - Category -->
|
@@ -6,6 +6,18 @@
|
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
7
|
<!-- Title System -->
|
8
8
|
|
9
|
+
<!-- Page Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb pull-right">
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
+
</ol>
|
15
|
+
<!-- Page Bradcrumbs -->
|
16
|
+
|
17
|
+
<!-- Page Header -->
|
18
|
+
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
+
<!-- Page Header -->
|
20
|
+
|
9
21
|
<!-- Page Content -->
|
10
22
|
<div class="panel panel-inverse">
|
11
23
|
<div class="panel-heading">
|
@@ -14,12 +26,12 @@
|
|
14
26
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
15
27
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
16
28
|
</div>
|
17
|
-
<h4 class="panel-title"><%= yield(:
|
29
|
+
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
18
30
|
</div>
|
19
31
|
<div class="panel-body">
|
20
|
-
<!--
|
32
|
+
<!-- Form to Edit Article Category -->
|
21
33
|
<%= render 'form', article_category: @article_category %>
|
22
|
-
<!--
|
34
|
+
<!-- Form to Edit Article Category -->
|
23
35
|
</div>
|
24
36
|
</div>
|
25
37
|
<!-- Page Content -->
|
@@ -8,29 +8,32 @@
|
|
8
8
|
|
9
9
|
<!-- Page Bradcrumbs -->
|
10
10
|
<ol class="breadcrumb pull-right">
|
11
|
-
|
12
|
-
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
|
13
13
|
</ol>
|
14
14
|
<!-- Page Bradcrumbs -->
|
15
15
|
|
16
16
|
<!-- Page Header -->
|
17
17
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
18
18
|
<!-- Page Header -->
|
19
|
-
|
20
|
-
<!-- Page Content -->
|
19
|
+
|
20
|
+
<!-- Page & Panel Content -->
|
21
21
|
<div class="panel panel-inverse">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
<!-- Panel Heading -->
|
23
|
+
<div class="panel-heading">
|
24
|
+
<div class="panel-heading-btn">
|
25
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
26
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
27
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
28
|
+
</div>
|
29
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
30
|
+
</div>
|
31
|
+
<!-- Panel Heading -->
|
32
|
+
<!-- Panel Body -->
|
33
|
+
<div class="panel-body">
|
31
34
|
<!-- Table - Category Index -->
|
32
35
|
<div class="table-responsive">
|
33
|
-
<table class="table table-striped table-bordered
|
36
|
+
<table class="table table-striped table-bordered">
|
34
37
|
<thead>
|
35
38
|
<tr>
|
36
39
|
<th>Category Name</th>
|
@@ -6,6 +6,18 @@
|
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
7
|
<!-- Title System -->
|
8
8
|
|
9
|
+
<!-- Page Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb pull-right">
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
+
</ol>
|
15
|
+
<!-- Page Bradcrumbs -->
|
16
|
+
|
17
|
+
<!-- Page Header -->
|
18
|
+
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
+
<!-- Page Header -->
|
20
|
+
|
9
21
|
<!-- Page Content -->
|
10
22
|
<div class="panel panel-inverse">
|
11
23
|
<div class="panel-heading">
|
@@ -14,12 +26,12 @@
|
|
14
26
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
15
27
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
16
28
|
</div>
|
17
|
-
<h4 class="panel-title"><%= yield(:
|
29
|
+
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
18
30
|
</div>
|
19
31
|
<div class="panel-body">
|
20
|
-
<!--
|
32
|
+
<!-- Form for New Article Category -->
|
21
33
|
<%= render 'form', article_category: @article_category %>
|
22
|
-
<!--
|
34
|
+
<!-- Form for New Article Category -->
|
23
35
|
</div>
|
24
36
|
</div>
|
25
37
|
<!-- Page Content -->
|
@@ -1,28 +1,32 @@
|
|
1
1
|
<%= form_with(model: article_post, local: true) do |form| %>
|
2
2
|
<div class="row">
|
3
|
+
|
3
4
|
<div class="col-md-3">
|
4
5
|
|
6
|
+
<!-- Panel - Publishing -->
|
5
7
|
<div class="panel panel-inverse">
|
6
8
|
<div class="panel-heading">
|
7
9
|
<h4 class="panel-title">Publish Panel</h4>
|
8
10
|
</div>
|
9
11
|
<div class="panel-body">
|
10
|
-
<div class="form-group">
|
12
|
+
<div class="form-group field_with_errors">
|
11
13
|
<%= form.label :post_status, "Post Status" %>
|
12
14
|
<%= form.select( :post_status, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
|
13
15
|
</div>
|
14
16
|
<div class="actions">
|
15
|
-
<%= form.submit class: "btn btn-primary
|
17
|
+
<%= form.submit class: "btn btn-primary" %>
|
16
18
|
</div>
|
17
19
|
</div>
|
18
20
|
</div>
|
21
|
+
<!-- Panel - Publishing -->
|
19
22
|
|
23
|
+
<!-- Panel - Image Uploading -->
|
20
24
|
<div class="panel panel-inverse">
|
21
25
|
<div class="panel-heading">
|
22
|
-
|
26
|
+
<h4 class="panel-title">Post Images</h4>
|
23
27
|
</div>
|
24
28
|
<div class="panel-body">
|
25
|
-
<div class="form-group">
|
29
|
+
<div class="form-group field_with_errors">
|
26
30
|
<%= form.label :post_image, "Featured Image" %>
|
27
31
|
<%= form.file_field :post_image, class: "form-control" %>
|
28
32
|
</div>
|
@@ -33,7 +37,9 @@
|
|
33
37
|
<% end %>
|
34
38
|
</div>
|
35
39
|
</div>
|
40
|
+
<!-- Panel - Image Uploading -->
|
36
41
|
|
42
|
+
<!-- Panel - Article - Categories -->
|
37
43
|
<div class="panel panel-inverse">
|
38
44
|
<div class="panel-heading">
|
39
45
|
<h4 class="panel-title">Post Categories</h4>
|
@@ -41,12 +47,14 @@
|
|
41
47
|
<div class="panel-body">
|
42
48
|
<%= form.collection_check_boxes :category_ids, Phcpress::Article::Category.all, :id, :category_name do |post_category| %>
|
43
49
|
<%= post_category.check_box %>
|
44
|
-
<%= post_category.label
|
50
|
+
<%= post_category.label %><br>
|
45
51
|
<% end %>
|
46
52
|
</div>
|
47
53
|
</div>
|
54
|
+
<!-- Panel - Article - Categories -->
|
48
55
|
|
49
56
|
</div>
|
57
|
+
|
50
58
|
<div class="col-md-9 ">
|
51
59
|
|
52
60
|
<!-- PHCNotifi Render Validation -->
|
@@ -56,18 +64,18 @@
|
|
56
64
|
<div class="panel panel-inverse">
|
57
65
|
<div class="panel-heading">
|
58
66
|
<div class="panel-heading-btn">
|
59
|
-
|
60
|
-
|
61
|
-
|
67
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
68
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
69
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
62
70
|
</div>
|
63
71
|
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
64
72
|
</div>
|
65
73
|
<div class="panel-body ">
|
66
|
-
<div class="form-group">
|
67
|
-
<%= form.label :
|
68
|
-
<%= form.text_field :
|
74
|
+
<div class="form-group field_with_errors">
|
75
|
+
<%= form.label :post_title, "Article Title" %>
|
76
|
+
<%= form.text_field :post_title, class: "form-control" %>
|
69
77
|
</div>
|
70
|
-
<div class="form-group">
|
78
|
+
<div class="form-group field_with_errors">
|
71
79
|
<%= form.text_area :post_text, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
|
72
80
|
</div>
|
73
81
|
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<!-- Page Header -->
|
18
18
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
19
|
<!-- Page Header -->
|
20
|
-
|
21
|
-
<!--
|
20
|
+
|
21
|
+
<!-- Form to Edit Article Post -->
|
22
22
|
<%= render 'form', article_post: @article_post %>
|
23
|
-
<!--
|
23
|
+
<!-- Form to Edit Article Post -->
|
@@ -7,29 +7,32 @@
|
|
7
7
|
|
8
8
|
<!-- Page Bradcrumbs -->
|
9
9
|
<ol class="breadcrumb pull-right">
|
10
|
-
|
11
|
-
|
10
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
11
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
|
12
12
|
</ol>
|
13
13
|
<!-- Page Bradcrumbs -->
|
14
14
|
|
15
15
|
<!-- Page Header -->
|
16
16
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
17
17
|
<!-- Page Header -->
|
18
|
-
|
19
|
-
<!-- Page Content -->
|
18
|
+
|
19
|
+
<!-- Page & Panel Content -->
|
20
20
|
<div class="panel panel-inverse">
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
<!-- Panel Heading -->
|
22
|
+
<div class="panel-heading">
|
23
|
+
<div class="panel-heading-btn">
|
24
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
25
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
26
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
27
|
+
</div>
|
28
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
29
|
+
</div>
|
30
|
+
<!-- Panel Heading -->
|
31
|
+
<!-- Panel Body -->
|
32
|
+
<div class="panel-body">
|
30
33
|
<!-- Table - Article Index -->
|
31
34
|
<div class="table-responsive">
|
32
|
-
<table class="table table-striped table-bordered
|
35
|
+
<table class="table table-striped table-bordered">
|
33
36
|
<thead>
|
34
37
|
<tr>
|
35
38
|
<th>Post Headline</th>
|
@@ -41,7 +44,7 @@
|
|
41
44
|
<tbody>
|
42
45
|
<% @article_posts.each do |article_post| %>
|
43
46
|
<tr>
|
44
|
-
<td><%= article_post.
|
47
|
+
<td><%= article_post.post_title %></td>
|
45
48
|
<td><%= truncate(article_post.post_text, :length => 80, :escape => false) %></td>
|
46
49
|
<td><%= article_post.post_status.capitalize %></td>
|
47
50
|
<td>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<!-- Page Header -->
|
18
18
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
19
|
<!-- Page Header -->
|
20
|
-
|
21
|
-
<!--
|
20
|
+
|
21
|
+
<!-- Form for New Article Post -->
|
22
22
|
<%= render 'form', article_post: @article_post %>
|
23
|
-
<!--
|
23
|
+
<!-- Form for New Article Post -->
|
@@ -1,69 +1,69 @@
|
|
1
1
|
<% @phcpress_posts_index.each do |blog_post_index| %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
<div class="row blog-post">
|
3
|
+
<div class="col-md-2 date-md">
|
4
|
+
<div class="date-wrapper">
|
5
|
+
<span class="date-m bg-primary"><%= blog_post_index.created_at.strftime("%B") %></span>
|
6
|
+
<span class="date-d"><%= blog_post_index.created_at.strftime("%d") %></span>
|
7
|
+
</div>
|
8
|
+
<p class="text-muted text-sm">
|
9
|
+
<i class="fas fa-user-tie text-xs"></i>
|
10
|
+
<%= blog_post_index.user_id %>
|
11
|
+
</p>
|
12
|
+
</div>
|
13
|
+
<div class="col-md-10">
|
14
|
+
<div class="text-xs">
|
15
|
+
<a href="#" class="text-primary text-uppercase">Blog</a> /
|
16
|
+
<a href="#" class="text-dark text-uppercase">Post</a>
|
17
|
+
</div>
|
18
|
+
<h4 class="title media-heading">
|
19
|
+
<%= blog_post_index.post_title %>
|
20
|
+
</h4>
|
21
|
+
<ul class="list-inline meta text-muted">
|
22
|
+
<li class="list-inline-item">
|
23
|
+
<i class="fas fa-calendar-alt text-xs"></i>
|
24
|
+
<%= blog_post_index.created_at.strftime("%a %B %d %Y") %>
|
25
|
+
</li>
|
26
|
+
<li class="list-inline-item">
|
9
27
|
<i class="fas fa-user-tie text-xs"></i>
|
10
28
|
<%= blog_post_index.user_id %>
|
11
|
-
</
|
12
|
-
</
|
13
|
-
<div class="
|
14
|
-
<div class="
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</h4>
|
21
|
-
<ul class="list-inline meta text-muted">
|
22
|
-
<li class="list-inline-item">
|
23
|
-
<i class="fas fa-calendar-alt text-xs"></i>
|
24
|
-
<%= blog_post_index.created_at.strftime("%a %B %d %Y") %>
|
25
|
-
</li>
|
26
|
-
<li class="list-inline-item">
|
27
|
-
<i class="fas fa-user-tie text-xs"></i>
|
28
|
-
<%= blog_post_index.user_id %>
|
29
|
-
</li>
|
30
|
-
</ul>
|
31
|
-
<div class="row">
|
32
|
-
<div class="col-md-12">
|
33
|
-
<% if blog_post_index.pstimage.attached? %>
|
34
|
-
<div class="blog-media">
|
35
|
-
<img src="<%= url_for(blog_post_index.pstimage) %>" alt="Picture for Blog Post - <%= blog_post_index.psttittle %>" class="img-fluid" />
|
36
|
-
</div>
|
37
|
-
<% end %>
|
38
|
-
</div>
|
29
|
+
</li>
|
30
|
+
</ul>
|
31
|
+
<div class="row">
|
32
|
+
<div class="col-md-12">
|
33
|
+
<% if blog_post_index.pstimage.attached? %>
|
34
|
+
<div class="blog-media">
|
35
|
+
<img src="<%= url_for(blog_post_index.post_image) %>" alt="Picture for Blog Post - <%= blog_post_index.post_title %>" class="img-fluid" />
|
36
|
+
</div>
|
37
|
+
<% end %>
|
39
38
|
</div>
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
</div>
|
40
|
+
<div class="row">
|
41
|
+
<div class="col-md-12">
|
42
|
+
<%= truncate(blog_post_index.post_text, :length => 120, :escape => false) %>
|
43
|
+
<ul class="list-inline links">
|
44
|
+
<li class="list-inline-item">
|
45
|
+
<%= link_to blog_article_path(blog_post_index), class: "btn btn-secondary btn-sm" do %>
|
46
|
+
<i class="fas fa-arrow-alt-circle-right"></i> Read More
|
47
|
+
<% end %>
|
48
|
+
</li>
|
49
|
+
<li class="list-inline-item">
|
50
|
+
<a href="blog-post.html#comments" class="btn btn-secondary btn-sm"><i class="fa fa-comment"></i> 64 Comments</a>
|
51
|
+
</li>
|
52
|
+
<% if current_user.admin! %>
|
44
53
|
<li class="list-inline-item">
|
45
|
-
<%= link_to
|
46
|
-
<i class="fas fa-
|
54
|
+
<%= link_to edit_article_post_path(blog_post_index), class: "btn btn-secondary btn-sm" do %>
|
55
|
+
<i class="fas fa-edit"></i> Edit Post
|
47
56
|
<% end %>
|
48
57
|
</li>
|
49
58
|
<li class="list-inline-item">
|
50
|
-
|
59
|
+
<%= link_to blog_post_index, class: "btn btn-danger btn-sm", method: :delete, data: { confirm: 'Are you sure?' } do %>
|
60
|
+
<i class="fas fa-dumpster"></i> Delete Post
|
61
|
+
<% end %>
|
51
62
|
</li>
|
52
|
-
|
53
|
-
|
54
|
-
<%= link_to edit_article_post_path(blog_post_index), class: "btn btn-secondary btn-sm" do %>
|
55
|
-
<i class="fas fa-edit"></i> Edit Post
|
56
|
-
<% end %>
|
57
|
-
</li>
|
58
|
-
<li class="list-inline-item">
|
59
|
-
<%= link_to blog_post_index, class: "btn btn-danger btn-sm", method: :delete, data: { confirm: 'Are you sure?' } do %>
|
60
|
-
<i class="fas fa-dumpster"></i> Delete Post
|
61
|
-
<% end %>
|
62
|
-
</li>
|
63
|
-
<% end %>
|
64
|
-
</ul>
|
65
|
-
</div>
|
63
|
+
<% end %>
|
64
|
+
</ul>
|
66
65
|
</div>
|
67
66
|
</div>
|
68
67
|
</div>
|
68
|
+
</div>
|
69
69
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
Phcpress::Engine.routes.draw do
|
2
2
|
|
3
|
-
#
|
4
|
-
|
3
|
+
# API Routes
|
4
|
+
namespace :api, :path => "", :constraints => {:subdomain => "api"} do
|
5
|
+
namespace :v1 do
|
6
|
+
resources :posts, defaults: {format: 'json'}
|
7
|
+
resources :categories, defaults: {format: 'json'}
|
8
|
+
end
|
9
|
+
end
|
5
10
|
|
6
|
-
#
|
11
|
+
# Article Routes
|
7
12
|
namespace :article do
|
8
13
|
resources :categories, class_name: 'Phcpress::Articles::Category'
|
9
14
|
resources :posts, class_name: 'Phcpress::Articles::Post'
|
10
15
|
end
|
11
16
|
|
12
|
-
#
|
17
|
+
# Frontend Routes
|
13
18
|
namespace :blog do
|
14
19
|
resources :articles, only: [:index, :show]
|
15
20
|
end
|
16
21
|
|
17
|
-
#
|
18
|
-
|
19
|
-
namespace :v1 do
|
20
|
-
resources :posts, defaults: {format: 'json'}
|
21
|
-
resources :categories, defaults: {format: 'json'}
|
22
|
-
end
|
23
|
-
end
|
22
|
+
# PHCAccounts Routes
|
23
|
+
mount Phcaccounts::Engine, :at => '/'
|
24
24
|
|
25
25
|
end
|