phcpresspro 86.2.0 → 87.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/Rakefile +4 -18
- data/app/assets/config/phcpresspro_manifest.js +2 -2
- data/app/controllers/phcpresspro/application_controller.rb +4 -5
- data/app/controllers/phcpresspro/article/categories_controller.rb +1 -1
- data/app/controllers/phcpresspro/article/posts_controller.rb +1 -1
- data/app/models/phcpresspro/article/category.rb +18 -18
- data/app/models/phcpresspro/article/post.rb +21 -21
- data/app/views/layouts/phcpresspro/application.html.erb +58 -65
- data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +14 -6
- data/app/views/layouts/phcpresspro/components/backend/navigation/_top_menu.html.erb +41 -37
- data/app/views/layouts/phcpresspro/components/backend/sidebars/_side_menu.html.erb +921 -189
- data/app/views/layouts/phcpresspro/frontend.html.erb +2 -2
- data/app/views/phcpresspro/article/categories/_form.html.erb +16 -16
- data/app/views/phcpresspro/article/categories/edit.html.erb +21 -17
- data/app/views/phcpresspro/article/categories/index.html.erb +35 -34
- data/app/views/phcpresspro/article/categories/new.html.erb +21 -17
- data/app/views/phcpresspro/article/posts/_form.html.erb +11 -16
- data/app/views/phcpresspro/article/posts/edit.html.erb +10 -10
- data/app/views/phcpresspro/article/posts/index.html.erb +28 -27
- data/app/views/phcpresspro/article/posts/new.html.erb +10 -10
- data/app/views/phcpresspro/blog/articles/index.html.erb +1 -1
- data/config/routes.rb +16 -19
- data/db/migrate/20170509002355_create_phcpresspro_friendly_id_slugs.rb +18 -0
- data/db/migrate/20170517064030_create_phcpresspro_post_versions.rb +17 -0
- data/db/migrate/20170517064427_create_phcpresspro_category_versions.rb +17 -0
- data/db/migrate/20190315010932_create_phcpresspro_article_posts.rb +19 -0
- data/db/migrate/20190315040834_create_phcpresspro_article_categories.rb +16 -0
- data/db/migrate/20190315173237_create_join_table_categories_posts.rb +8 -0
- data/lib/phcpresspro/engine.rb +42 -68
- data/lib/phcpresspro/version.rb +1 -1
- data/lib/phcpresspro.rb +2 -0
- metadata +67 -390
- data/app/assets/javascripts/phcpresspro/application.js +0 -2
- data/app/assets/stylesheets/phcpresspro/application.scss +0 -2
@@ -1,22 +1,22 @@
|
|
1
|
-
<!-- Form - Article - Category -->
|
1
|
+
<!-- -PHCDEV- Form - Article - Category -->
|
2
2
|
<%= form_with(model: article_category, local: true) do |form| %>
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
<!-- -PHCDEV- Form Validation -->
|
5
|
+
<%= render "phcdevworks_notifications/bootstrap/validations", :object => @article_category %>
|
6
|
+
<!-- -PHCDEV- Form Validation -->
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
<!-- -PHCDEV- Form Input Fields -->
|
9
|
+
<div class="mb-3">
|
10
|
+
<%= form.label :category_name, "Category Name", class: "form-label" %>
|
11
|
+
<%= form.text_field :category_name, class: "form-control" %>
|
12
|
+
</div>
|
13
|
+
<!-- -PHCDEV- Form Input Fields -->
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
<!-- -PHCDEV- Form Submition Button -->
|
16
|
+
<div class="actions">
|
17
|
+
<%= form.submit class: "btn btn-primary" %>
|
18
|
+
</div>
|
19
|
+
<!-- -PHCDEV- Form Submition Button -->
|
20
20
|
|
21
21
|
<% end %>
|
22
|
-
<!-- Form - Article - Category -->
|
22
|
+
<!-- -PHCDEV- Form - Article - Category -->
|
@@ -1,37 +1,41 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Article Category Manager" %>
|
3
3
|
<% phc_title_tagline "Update Category Data" %>
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
5
|
<% phc_breadcrumb_two link_to "Category Index", phcpresspro.article_categories_path %>
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- Title
|
7
|
+
<!-- -PHCDEV- Title Variables -->
|
8
8
|
|
9
|
-
<!--
|
10
|
-
<ol class="breadcrumb
|
9
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb float-xl-end">
|
11
11
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
12
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
13
|
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
14
|
</ol>
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
16
16
|
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
20
20
|
|
21
|
-
<!--
|
21
|
+
<!-- -PHCDEV- Panel -->
|
22
22
|
<div class="panel panel-inverse">
|
23
|
+
|
24
|
+
<!-- -PHCDEV- Panel - Heading -->
|
23
25
|
<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
26
|
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
30
27
|
</div>
|
28
|
+
<!-- -PHCDEV- Panel - Heading -->
|
29
|
+
|
30
|
+
<!-- -PHCDEV- Panel - Body -->
|
31
31
|
<div class="panel-body">
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
|
33
|
+
<!-- -PHCDEV- Form to Edit Article Category -->
|
34
|
+
<%= render "form", article_category: @article_category %>
|
35
|
+
<!-- -PHCDEV- Form to Edit Article Category -->
|
36
|
+
|
35
37
|
</div>
|
38
|
+
<!-- -PHCDEV- Panel - Body -->
|
39
|
+
|
36
40
|
</div>
|
37
|
-
<!--
|
41
|
+
<!-- -PHCDEV- Panel -->
|
@@ -1,55 +1,53 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Article Category Manager" %>
|
3
3
|
<% phc_title_tagline "Category Index" %>
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
5
|
<% phc_breadcrumb_two link_to "Category Index", phcpresspro.article_categories_path %>
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- Title
|
7
|
+
<!-- -PHCDEV- Title Variables -->
|
8
8
|
|
9
|
-
<!--
|
10
|
-
<ol class="breadcrumb
|
11
|
-
|
12
|
-
|
9
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb float-xl-end">
|
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
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
15
15
|
|
16
|
-
<!--
|
16
|
+
<!-- -PHCDEV- Header -->
|
17
17
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
18
|
-
<!--
|
18
|
+
<!-- -PHCDEV- Header -->
|
19
19
|
|
20
|
-
<!--
|
20
|
+
<!-- -PHCDEV- Panel -->
|
21
21
|
<div class="panel panel-inverse">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<div class="panel-body">
|
34
|
-
<!-- Table - Category Index -->
|
22
|
+
|
23
|
+
<!-- -PHCDEV- Panel - Heading -->
|
24
|
+
<div class="panel-heading">
|
25
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
26
|
+
</div>
|
27
|
+
<!-- -PHCDEV- Panel - Heading -->
|
28
|
+
|
29
|
+
<!-- -PHCDEV- Panel - Body -->
|
30
|
+
<div class="panel-body">
|
31
|
+
|
32
|
+
<!-- -PHCDEV- Table - Category Index -->
|
35
33
|
<div class="table-responsive">
|
36
34
|
<table class="table table-striped table-bordered">
|
37
35
|
<thead>
|
38
36
|
<tr>
|
39
|
-
|
40
|
-
|
37
|
+
<th>Category Name</th>
|
38
|
+
<th></th>
|
41
39
|
</tr>
|
42
40
|
</thead>
|
43
41
|
<tbody>
|
44
42
|
<% @article_categories.each do |article_category| %>
|
45
43
|
<tr>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
44
|
+
<td style="width: 70%"><%= link_to article_category.category_name, phcpresspro.edit_article_category_path(article_category) %></td>
|
45
|
+
<td style="width: 30%">
|
46
|
+
<div class="btn-group d-flex" role="group">
|
47
|
+
<%= link_to "Update Category", edit_article_category_path(article_category), class: "btn btn-primary btn-xs" %>
|
48
|
+
<%= link_to "Remove Category", article_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: "Are you sure?" } %>
|
49
|
+
</div>
|
50
|
+
</td>
|
53
51
|
</tr>
|
54
52
|
<% end %>
|
55
53
|
</tbody>
|
@@ -59,7 +57,10 @@
|
|
59
57
|
<%= "Add a New Article Category" %>
|
60
58
|
<% end %>
|
61
59
|
</div>
|
62
|
-
<!-- Table - Category Index -->
|
60
|
+
<!-- -PHCDEV- Table - Category Index -->
|
61
|
+
|
63
62
|
</div>
|
63
|
+
<!-- -PHCDEV- Panel - Body -->
|
64
|
+
|
64
65
|
</div>
|
65
|
-
<!--
|
66
|
+
<!-- -PHCDEV- Panel -->
|
@@ -1,37 +1,41 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Article Category Manager" %>
|
3
3
|
<% phc_title_tagline "Create a New Category" %>
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
5
|
<% phc_breadcrumb_two link_to "Category Index", phcpresspro.article_categories_path %>
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- Title
|
7
|
+
<!-- -PHCDEV- Title Variables -->
|
8
8
|
|
9
|
-
<!--
|
10
|
-
<ol class="breadcrumb
|
9
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb float-xl-end">
|
11
11
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
12
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
13
|
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
14
|
</ol>
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
16
16
|
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
20
20
|
|
21
|
-
<!--
|
21
|
+
<!-- -PHCDEV- Panel -->
|
22
22
|
<div class="panel panel-inverse">
|
23
|
+
|
24
|
+
<!-- -PHCDEV- Panel - Heading -->
|
23
25
|
<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
26
|
<h4 class="panel-title"><%= yield(:phc_title) %></h4>
|
30
27
|
</div>
|
28
|
+
<!-- -PHCDEV- Panel - Heading -->
|
29
|
+
|
30
|
+
<!-- -PHCDEV- Panel - Body -->
|
31
31
|
<div class="panel-body">
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
|
33
|
+
<!-- -PHCDEV- Form for New Article Category -->
|
34
|
+
<%= render "form", article_category: @article_category %>
|
35
|
+
<!-- -PHCDEV- Form for New Article Category -->
|
36
|
+
|
35
37
|
</div>
|
38
|
+
<!-- -PHCDEV- Panel - Body -->
|
39
|
+
|
36
40
|
</div>
|
37
|
-
<!--
|
41
|
+
<!-- -PHCDEV- Panel -->
|
@@ -9,9 +9,9 @@
|
|
9
9
|
<h4 class="panel-title">Publish Panel</h4>
|
10
10
|
</div>
|
11
11
|
<div class="panel-body">
|
12
|
-
<div class="
|
13
|
-
<%= form.label :post_status, "Post Status" %>
|
14
|
-
<%= form.select( :post_status, [[
|
12
|
+
<div class="mb-3">
|
13
|
+
<%= form.label :post_status, "Post Status", class: "form-label" %>
|
14
|
+
<%= form.select( :post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control form-control-sm"}) %>
|
15
15
|
</div>
|
16
16
|
<div class="actions">
|
17
17
|
<%= form.submit class: "btn btn-primary" %>
|
@@ -26,8 +26,8 @@
|
|
26
26
|
<h4 class="panel-title">Post Images</h4>
|
27
27
|
</div>
|
28
28
|
<div class="panel-body">
|
29
|
-
<div class="
|
30
|
-
<%= form.label :post_image, "Featured Image" %>
|
29
|
+
<div class="mb-3">
|
30
|
+
<%= form.label :post_image, "Featured Image", class: "form-label" %>
|
31
31
|
<%= form.file_field :post_image, class: "form-control" %>
|
32
32
|
</div>
|
33
33
|
<% if form.object.post_image? %>
|
@@ -57,25 +57,20 @@
|
|
57
57
|
|
58
58
|
<div class="col-md-9 ">
|
59
59
|
|
60
|
-
<!--
|
61
|
-
<%= render
|
62
|
-
<!--
|
60
|
+
<!-- -PHCDEV- Form Validation -->
|
61
|
+
<%= render "phcdevworks_notifications/bootstrap/validations", :object => @article_post %>
|
62
|
+
<!-- -PHCDEV- Form Validation -->
|
63
63
|
|
64
64
|
<div class="panel panel-inverse">
|
65
65
|
<div class="panel-heading">
|
66
|
-
<div class="panel-heading-btn">
|
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>
|
70
|
-
</div>
|
71
66
|
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
72
67
|
</div>
|
73
68
|
<div class="panel-body ">
|
74
|
-
<div class="
|
75
|
-
<%= form.label :post_title, "Article Title" %>
|
69
|
+
<div class="mb-3">
|
70
|
+
<%= form.label :post_title, "Article Title", class: "form-label" %>
|
76
71
|
<%= form.text_field :post_title, class: "form-control" %>
|
77
72
|
</div>
|
78
|
-
<div class="
|
73
|
+
<div class="mb-3">
|
79
74
|
<%= form.text_area :post_text, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
|
80
75
|
</div>
|
81
76
|
</div>
|
@@ -1,23 +1,23 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Article Manager" %>
|
3
3
|
<% phc_title_tagline "Update Article" %>
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
5
|
<% phc_breadcrumb_two link_to "Article Index", phcpresspro.article_posts_path %>
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- Title
|
7
|
+
<!-- -PHCDEV- Title Variables -->
|
8
8
|
|
9
|
-
<!--
|
10
|
-
<ol class="breadcrumb
|
9
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb float-xl-end">
|
11
11
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
12
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
13
|
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
14
|
</ol>
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
16
16
|
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
20
20
|
|
21
|
-
<!-- Form to Edit Article Post -->
|
22
|
-
<%= render
|
23
|
-
<!-- Form to Edit Article Post -->
|
21
|
+
<!-- -PHCDEV- Form to Edit Article Post -->
|
22
|
+
<%= render "form", article_post: @article_post %>
|
23
|
+
<!-- -PHCDEV- Form to Edit Article Post -->
|
@@ -1,36 +1,34 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Article Manager" %>
|
3
3
|
<% phc_title_tagline "Article Index" %>
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
5
|
<% phc_breadcrumb_two yield(:phc_title_tagline) %>
|
6
|
-
<!-- Title
|
6
|
+
<!-- -PHCDEV- Title Variables -->
|
7
7
|
|
8
|
-
<!--
|
9
|
-
<ol class="breadcrumb
|
10
|
-
|
11
|
-
|
8
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
9
|
+
<ol class="breadcrumb float-xl-end">
|
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
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
14
14
|
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Header -->
|
16
16
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Panel -->
|
20
20
|
<div class="panel panel-inverse">
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<div class="panel-body">
|
33
|
-
<!-- Table - Article Index -->
|
21
|
+
|
22
|
+
<!-- -PHCDEV- Panel - Heading -->
|
23
|
+
<div class="panel-heading">
|
24
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
25
|
+
</div>
|
26
|
+
<!-- -PHCDEV- Panel - Heading -->
|
27
|
+
|
28
|
+
<!-- -PHCDEV- Panel - Body -->
|
29
|
+
<div class="panel-body">
|
30
|
+
|
31
|
+
<!-- -PHCDEV- Table - Article Index -->
|
34
32
|
<div class="table-responsive">
|
35
33
|
<table class="table table-striped table-bordered">
|
36
34
|
<thead>
|
@@ -49,8 +47,8 @@
|
|
49
47
|
<td><%= article_post.post_status.capitalize %></td>
|
50
48
|
<td>
|
51
49
|
<div class="btn-group d-flex" role="group">
|
52
|
-
<%= link_to
|
53
|
-
<%= link_to
|
50
|
+
<%= link_to "Update Post", edit_article_post_path(article_post), class: "btn btn-primary btn-xs" %>
|
51
|
+
<%= link_to "Remove Post", article_post, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: "Are you sure?" } %>
|
54
52
|
</div>
|
55
53
|
</td>
|
56
54
|
</tr>
|
@@ -62,7 +60,10 @@
|
|
62
60
|
<%= "Add a New Article Post" %>
|
63
61
|
<% end %>
|
64
62
|
</div>
|
65
|
-
<!-- Table - Article Index -->
|
63
|
+
<!-- -PHCDEV- Table - Article Index -->
|
64
|
+
|
66
65
|
</div>
|
66
|
+
<!-- -PHCDEV- Panel - Body -->
|
67
|
+
|
67
68
|
</div>
|
68
|
-
<!--
|
69
|
+
<!-- -PHCDEV- Panel -->
|
@@ -1,23 +1,23 @@
|
|
1
|
-
<!-- Title
|
1
|
+
<!-- -PHCDEV- Title Variables -->
|
2
2
|
<% phc_title "Article Manager" %>
|
3
3
|
<% phc_title_tagline "Create a New Article" %>
|
4
4
|
<% phc_breadcrumb_one yield(:phc_title) %>
|
5
5
|
<% phc_breadcrumb_two link_to "Article Index", phcpresspro.article_posts_path %>
|
6
6
|
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
-
<!-- Title
|
7
|
+
<!-- -PHCDEV- Title Variables -->
|
8
8
|
|
9
|
-
<!--
|
10
|
-
<ol class="breadcrumb
|
9
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb float-xl-end">
|
11
11
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
12
|
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
13
|
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
14
|
</ol>
|
15
|
-
<!--
|
15
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
16
16
|
|
17
|
-
<!--
|
17
|
+
<!-- -PHCDEV- Header -->
|
18
18
|
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
-
<!--
|
19
|
+
<!-- -PHCDEV- Bradcrumbs -->
|
20
20
|
|
21
|
-
<!-- Form for New Article Post -->
|
22
|
-
<%= render
|
23
|
-
<!-- Form for New Article Post -->
|
21
|
+
<!-- -PHCDEV- Form for New Article Post -->
|
22
|
+
<%= render "form", article_post: @article_post %>
|
23
|
+
<!-- -PHCDEV- Form for New Article Post -->
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<% end %>
|
57
57
|
</li>
|
58
58
|
<li class="list-inline-item">
|
59
|
-
<%= link_to blog_post_index, class: "btn btn-danger btn-sm", method: :delete, data: { confirm:
|
59
|
+
<%= link_to blog_post_index, class: "btn btn-danger btn-sm", method: :delete, data: { confirm: "Are you sure?" } do %>
|
60
60
|
<i class="fas fa-dumpster"></i> Delete Post
|
61
61
|
<% end %>
|
62
62
|
</li>
|
data/config/routes.rb
CHANGED
@@ -1,25 +1,22 @@
|
|
1
1
|
Phcpresspro::Engine.routes.draw do
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
# Article Routes
|
12
|
+
namespace :article do
|
13
|
+
resources :categories, class_name: "Phcpress::Articles::Category"
|
14
|
+
resources :posts, class_name: "Phcpress::Articles::Post"
|
15
|
+
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# PHCAccounts Routes
|
23
|
-
mount Phcaccountspro::Engine, :at => '/'
|
17
|
+
# Frontend Routes
|
18
|
+
namespace :blog do
|
19
|
+
resources :articles, only: [:index, :show]
|
20
|
+
end
|
24
21
|
|
25
22
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreatePhcpressproFriendlyIdSlugs < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :phcpresspro_friendly_id_slugs do |t|
|
5
|
+
t.string :slug, :null => false
|
6
|
+
t.integer :sluggable_id, :null => false
|
7
|
+
t.string :sluggable_type, :limit => 50
|
8
|
+
t.string :scope
|
9
|
+
t.datetime :created_at
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index :phcpresspro_friendly_id_slugs, :sluggable_id
|
13
|
+
add_index :phcpresspro_friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
|
14
|
+
add_index :phcpresspro_friendly_id_slugs, [:slug, :sluggable_type, :scope], name: 'phcpresspro_fri_id_slugable_scope_type', length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
|
15
|
+
add_index :phcpresspro_friendly_id_slugs, :sluggable_type
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreatePhcpressproPostVersions < ActiveRecord::Migration[7.0]
|
2
|
+
TEXT_BYTES = 1_073_741_823
|
3
|
+
def change
|
4
|
+
|
5
|
+
create_table :phcpresspro_post_versions do |t|
|
6
|
+
t.string :item_type, {:null=>false}
|
7
|
+
t.integer :item_id, null: false
|
8
|
+
t.string :event, null: false
|
9
|
+
t.string :whodunnit
|
10
|
+
t.text :object, limit: TEXT_BYTES
|
11
|
+
t.datetime :created_at
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :phcpresspro_post_versions, %i(item_type item_id), :name => 'presspro_post_versions'
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreatePhcpressproCategoryVersions < ActiveRecord::Migration[7.0]
|
2
|
+
TEXT_BYTES = 1_073_741_823
|
3
|
+
def change
|
4
|
+
|
5
|
+
create_table :phcpresspro_category_versions do |t|
|
6
|
+
t.string :item_type, {:null=>false}
|
7
|
+
t.integer :item_id, null: false
|
8
|
+
t.string :event, null: false
|
9
|
+
t.string :whodunnit
|
10
|
+
t.text :object, limit: TEXT_BYTES
|
11
|
+
t.datetime :created_at
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :phcpresspro_category_versions, %i(item_type item_id), :name => 'presspro_category_versions'
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreatePhcpressproArticlePosts < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :phcpresspro_article_posts do |t|
|
4
|
+
|
5
|
+
t.string :post_title
|
6
|
+
t.string :post_text
|
7
|
+
t.string :post_status
|
8
|
+
t.string :post_image
|
9
|
+
|
10
|
+
t.string :slug
|
11
|
+
|
12
|
+
t.string :user_id
|
13
|
+
t.string :org_id
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreatePhcpressproArticleCategories < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :phcpresspro_article_categories do |t|
|
4
|
+
|
5
|
+
t.string :category_name
|
6
|
+
|
7
|
+
t.string :slug
|
8
|
+
|
9
|
+
t.string :user_id
|
10
|
+
t.string :org_id
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|