phcpress 42.0.0 → 43.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +2 -14
  4. data/Rakefile +3 -0
  5. data/app/assets/javascripts/phcpress/application.js +2 -2
  6. data/app/assets/stylesheets/phcpress/application.scss +2 -2
  7. data/app/controllers/phcpress/article/posts_controller.rb +2 -1
  8. data/app/models/phcpress/article/post.rb +1 -1
  9. data/app/views/layouts/phcpress/application.html.erb +79 -54
  10. data/app/views/layouts/phcpress/components/backend/footer/_footer.html.erb +1 -0
  11. data/app/views/layouts/phcpress/components/backend/navigation/_top_menu.html.erb +143 -0
  12. data/app/views/layouts/phcpress/components/backend/sidebars/_side_menu.html.erb +116 -0
  13. data/app/views/phcpress/article/posts/_form.html.erb +67 -62
  14. data/app/views/phcpress/article/posts/edit.html.erb +24 -23
  15. data/app/views/phcpress/article/posts/index.html.erb +39 -63
  16. data/app/views/phcpress/article/posts/new.html.erb +5 -25
  17. data/app/views/phcpress/article/posts/show.html.erb +39 -28
  18. data/app/views/phcpress/modules/categories/_form.html.erb +6 -9
  19. data/app/views/phcpress/modules/categories/edit.html.erb +15 -30
  20. data/app/views/phcpress/modules/categories/index.html.erb +32 -58
  21. data/app/views/phcpress/modules/categories/new.html.erb +14 -31
  22. data/app/views/phcpress/modules/categories/show.html.erb +13 -31
  23. data/config/routes.rb +6 -0
  24. data/db/migrate/20160716182936_create_phcpress_modules_categories.rb +16 -0
  25. data/db/migrate/20160718204718_create_phcpress_article_posts.rb +19 -0
  26. data/db/migrate/20160719221205_create_phcpress_modules_connections.rb +17 -0
  27. data/db/migrate/20170509002355_create_phcpress_friendly_id_slugs.rb +18 -0
  28. data/lib/phcpress.rb +1 -0
  29. data/lib/phcpress/engine.rb +61 -59
  30. data/lib/phcpress/version.rb +1 -1
  31. metadata +93 -63
  32. data/app/views/layouts/components/backend/footer/_footer.html.erb +0 -4
  33. data/app/views/layouts/components/backend/navigation/_navigation.html.erb +0 -48
  34. data/app/views/layouts/components/backend/topbar/_topbar.html.erb +0 -5
  35. data/app/views/layouts/components/backend/topbar/_topbar_links.html.erb +0 -0
@@ -1,80 +1,85 @@
1
+ <%= form_for(@article_post, :html => {:multipart => true}) do |phc_press_article_post| %>
1
2
  <div class="row">
2
- <%= form_for(@article_post, :html => {:multipart => true}) do |f| %>
3
+ <div class="col-md-3">
3
4
 
4
- <!-- PHC-Notifi Render Validation -->
5
- <%= render 'phcnotifi/validations', :object => @article_post %>
6
-
7
- <div class="col-md-3">
8
-
9
- <div class="panel panel-primary">
10
- <div class="panel-heading">
11
- <i class="fa fa-paper-plane-o"></i> Publish Panel
5
+ <div class="panel panel-inverse">
6
+ <div class="panel-heading">
7
+ <h4 class="panel-title">Publish Panel</h4>
8
+ </div>
9
+ <div class="panel-body">
10
+ <div class="form-group">
11
+ <%= phc_press_article_post.label :pststatus, "Post Status" %>
12
+ <%= phc_press_article_post.select( :pststatus, [['Draft','draft'],['Published','published'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
12
13
  </div>
13
- <div class="panel-body">
14
- <div class="form-group">
15
- <%= f.label :pststatus, "Post Status" %>
16
- <%= f.select( :pststatus, [['Draft','draft'],['Publish','publish'],['Review','review']], {}, {class: "form-control form-control-sm"}) %>
17
- </div>
18
- <div class="actions">
19
- <%= f.submit "Publish", class: "btn btn-primary btn-sm" %>
20
- </div>
14
+ <div class="actions">
15
+ <%= phc_press_article_post.submit class: "btn btn-primary waves-effect" %>
21
16
  </div>
22
17
  </div>
18
+ </div>
23
19
 
24
- <div class="panel panel-primary">
25
- <div class="panel-heading">
26
- <i class="fa fa-camera-retro"></i> Post Images
27
- </div>
28
- <div class="panel-body">
29
- <div class="form-group">
30
- <%= f.label :pstimage, "Featured Image" %>
31
- <%= f.file_field :pstimage, class: "form-control" %>
32
- </div>
33
- <% if f.object.pstimage? %>
34
- <%= image_tag f.object.pstimage_url, class: "img-responsive img-thumbnail" %>
35
- <%= f.label :remove_pstimage %>
36
- <%= f.check_box :remove_pstimage %>
37
- <% end %>
20
+ <div class="panel panel-inverse">
21
+ <div class="panel-heading">
22
+ <h4 class="panel-title">Post Images</h4>
23
+ </div>
24
+ <div class="panel-body">
25
+ <div class="form-group">
26
+ <%= phc_press_article_post.label :pstimage, "Featured Image" %>
27
+ <%= phc_press_article_post.file_field :pstimage, class: "form-control" %>
38
28
  </div>
29
+ <% if phc_press_article_post.object.pstimage? %>
30
+ <%= image_tag phc_press_article_post.object.pstimage_url, class: "img-responsive img-thumbnail" %>
31
+ <%= phc_press_article_post.label :remove_pstimage %>
32
+ <%= phc_press_article_post.check_box :remove_pstimage %>
33
+ <% end %>
39
34
  </div>
35
+ </div>
40
36
 
41
- <div class="panel panel-primary">
42
- <div class="panel-heading">
43
- <i class="fa fa-sitemap"></i> Post Categories &amp; Tags
44
- </div>
45
- <div class="panel-body">
46
- <div class="form-group">
47
- <%= f.collection_check_boxes :category_ids, Phcpress::Modules::Category.all, :id, :catname do |post_category| %>
48
- <%= post_category.check_box %>
49
- <%= post_category.label %></br>
50
- <% end %>
51
- </div>
52
- </div>
37
+ <div class="panel panel-inverse">
38
+ <div class="panel-heading">
39
+ <h4 class="panel-title">Post Categories</h4>
40
+ </div>
41
+ <div class="panel-body">
42
+ <%= phc_press_article_post.collection_check_boxes :category_ids, Phcpress::Modules::Category.all, :id, :catname do |post_category| %>
43
+ <%= post_category.check_box %>
44
+ <%= post_category.label %></br>
45
+ <% end %>
53
46
  </div>
47
+ </div>
48
+
49
+ </div>
50
+ <div class="col-md-9 ">
54
51
 
52
+ <!-- PHCNotifi Render Validation -->
53
+ <%= render 'phcnotifi/validations', :object => @article_post %>
54
+ <!-- PHCNotifi Render Validation -->
55
+ <div class="panel panel-inverse">
56
+ <div class="panel-heading">
57
+ <h4 class="panel-title">Article TItle</h4>
58
+ </div>
59
+ <div class="panel-body">
60
+ <div class="form-group">
61
+ <%= phc_press_article_post.label :psttitle, "Article Title" %>
62
+ <%= phc_press_article_post.text_field :psttitle, class: "form-control" %>
63
+ </div>
64
+ </div>
55
65
  </div>
56
- <div class="col-md-9 ">
57
66
 
58
- <div class="panel panel-primary">
59
- <div class="panel-heading">
60
- <i class="fa fa-pencil-square-o"></i> Blog Post Publisher
67
+ <div class="panel panel-inverse">
68
+ <div class="panel-heading">
69
+ <div class="panel-heading-btn">
70
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
71
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
72
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
61
73
  </div>
62
- <div class="panel-body">
63
- <%= render 'phcnotifi/validations', :object => @article_post %>
64
- <div class="form-group">
65
- <%= f.label :psttext, "Post Title" %>
66
- <%= f.text_field :psttitle, class: "form-control" %>
67
- </div>
68
- <div class="form-group">
69
- <%= f.label :psttext, "Post Text" %>
70
- <%= f.text_area :psttext, :class => "tinymce form-control", :rows => 20, :cols => 60 %>
71
- </div>
74
+ <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
75
+ </div>
76
+ <div class="panel-body panel-form">
77
+ <div class="form-group">
78
+ <%= phc_press_article_post.text_area :psttext, :class => "ckeditor form-control", :id => "editor1", :rows => 20, :cols => 60 %>
72
79
  </div>
73
80
  </div>
74
-
75
81
  </div>
76
- <% end %>
77
- </div>
78
82
 
79
- <!-- Tinymce Javascript -->
80
- <%= tinymce %>
83
+ </div>
84
+ </div>
85
+ <% end %>
@@ -5,28 +5,29 @@
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
8
- <!-- Page Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
15
- </ol>
16
- <!-- Page Title and BreadCrumb -->
17
- </section>
18
- <!-- Page Title Bar -->
19
-
20
- <!-- Main Content -->
21
- <section class="content">
22
- <div class="row">
23
- <div class="col-lg-12">
24
-
25
- <!-- Page Form (Edit) -->
26
- <%= render 'form', article_post: @article_post %>
27
- <!-- Page Form (Edit) -->
28
-
8
+ <!-- Page Header -->
9
+ <div class="row wrapper border-bottom white-bg page-heading">
10
+ <div class="col-sm-8">
11
+ <h2><%= yield(:phc_title) %></h2>
12
+ <!-- Bread Crumb -->
13
+ <ol class="breadcrumb">
14
+ <li><%= yield(:phc_breadcrumb_one) %></li>
15
+ <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
16
+ </ol>
17
+ <!-- Bread Crumb -->
18
+ </div>
19
+ <div class="col-sm-4">
20
+ <div class="title-action">
21
+ <%= link_to phcpress.article_posts_path, class: "btn btn-default" do %>
22
+ <i class="fa fa fa-arrow-left"></i> Back to Article Index
23
+ <% end %>
29
24
  </div>
30
25
  </div>
31
- </section>
32
- <!-- Main Content -->
26
+ </div>
27
+ <!-- Page Header -->
28
+
29
+ <!-- Page Content -->
30
+ <div class="wrapper wrapper-content animated fadeInRight">
31
+ <%= render 'form', article_post: @article_post %>
32
+ </div>
33
+ <!-- Page Content -->
@@ -5,68 +5,44 @@
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
8
- <!-- Page Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
15
- </ol>
16
- <!-- Page Title and BreadCrumb -->
17
- </section>
18
- <!-- Page Title Bar -->
19
-
20
- <!-- Main Content -->
21
- <section class="content">
22
- <div class="row">
23
- <div class="col-lg-12">
24
- <div class="box">
25
- <div class="box-header with-border">
26
- <h3 class="box-title"><%= yield(:phc_title) %></h3>
27
- </div>
28
- <div class="box-body">
29
- <!-- Index Table -->
30
- <div class="table-responsive">
31
- <table class="table table-bordered table-striped table-hover">
32
- <thead>
33
- <tr>
34
- <th>Title</th>
35
- <th>Article Status</th>
36
- <th>Date Posted</th>
37
- <th>Last Update</th>
38
- <th></th>
39
- </tr>
40
- </thead>
41
- <tbody>
42
- <% @article_posts.each do |article_post| %>
43
- <tr>
44
- <td><%= article_post.psttitle.titleize %></td>
45
- <td><%= article_post.pststatus.capitalize %></td>
46
- <td><%= l(article_post.created_at, format: "%-d/%m/%Y - %H:%M:%S %Z") %></td>
47
- <td><%= l(article_post.updated_at, format: "%-d/%m/%Y - %H:%M:%S %Z") %></td>
48
- <td>
49
- <div class="btn-group" role="group" aria-label="Blog Articles">
50
- <%= link_to 'Edit', edit_article_post_path(article_post), class: "btn btn-primary btn-xs" %>
51
- <%= link_to 'Delete', article_post, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
52
- </div>
53
- </td>
54
- </tr>
55
- <% end %>
56
- </tbody>
57
- </table>
58
- </div>
59
- <!-- Index Table -->
60
-
61
- <!-- Panel Footer -->
62
- <div class="box-footer clearfix">
63
- <%= link_to 'New Blog Post', new_article_post_path, class: "btn btn-primary" %>
64
- </div>
65
- <!-- Panel Footer -->
66
-
67
- </div>
68
- </div>
8
+ <!-- Page Content -->
9
+ <div class="panel panel-inverse">
10
+ <div class="panel-heading">
11
+ <div class="panel-heading-btn">
12
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
13
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
14
+ <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
15
+ </div>
16
+ <h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
17
+ </div>
18
+ <div class="panel-body">
19
+ <!-- Table - Article Index -->
20
+ <div class="table-responsive">
21
+ <table class="table table-striped table-bordered table-hover dataTables-example">
22
+ <thead>
23
+ <tr>
24
+ <th>Post Headline</th>
25
+ <th>Post Preview</th>
26
+ <th>Post Status</th>
27
+ <th></th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <% @article_posts.each do |article_post| %>
32
+ <tr>
33
+ <td><%= article_post.psttitle %></td>
34
+ <td><%= truncate(article_post.psttext, :length => 80, :escape => false) %></td>
35
+ <td><%= article_post.pststatus.capitalize %></td>
36
+ <td><div class="btn-group" role="group" aria-label="Blog Articles">
37
+ <%= link_to 'Edit Post', edit_article_post_path(article_post), class: "btn btn-primary btn-xs" %>
38
+ <%= link_to 'Trash Post', article_post, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
39
+ </div></td>
40
+ </tr>
41
+ <% end %>
42
+ </tbody>
43
+ </table>
69
44
  </div>
45
+ <!-- Table - Article Index -->
70
46
  </div>
71
- </section>
72
- <!-- Main Content -->
47
+ </div>
48
+ <!-- Page Content -->
@@ -5,28 +5,8 @@
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
8
- <!-- Page Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
15
- </ol>
16
- <!-- Page Title and BreadCrumb -->
17
- </section>
18
- <!-- Page Title Bar -->
19
-
20
- <!-- Main Content -->
21
- <section class="content">
22
- <div class="row">
23
- <div class="col-lg-12">
24
-
25
- <!-- Page Form (New) -->
26
- <%= render 'form', article_post: @article_post %>
27
- <!-- Page Form (New) -->
28
-
29
- </div>
30
- </div>
31
- </section>
32
- <!-- Main Content -->
8
+ <!-- Page Content -->
9
+ <div class="wrapper wrapper-content animated fadeInRight">
10
+ <%= render 'form', article_post: @article_post %>
11
+ </div>
12
+ <!-- Page Content -->
@@ -5,36 +5,47 @@
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
8
- <!-- Page Title Bar -->
9
- <section class="content-header">
10
- <!-- Page Title and BreadCrumb -->
11
- <h1><%= yield(:phc_title) %> <small><%= yield(:phc_title_tagline) %></small></h1>
12
- <ol class="breadcrumb">
13
- <li><%= yield(:phc_breadcrumb_one) %></li>
14
- <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
15
- </ol>
16
- <!-- Page Title and BreadCrumb -->
17
- </section>
18
- <!-- Page Title Bar -->
8
+ <!-- Page Header -->
9
+ <div class="row wrapper border-bottom white-bg page-heading">
10
+ <div class="col-sm-8">
11
+ <h2><%= yield(:phc_title) %></h2>
12
+ <!-- Bread Crumb -->
13
+ <ol class="breadcrumb">
14
+ <li><%= yield(:phc_breadcrumb_one) %></li>
15
+ <li class="active"><%= yield(:phc_breadcrumb_two) %></li>
16
+ </ol>
17
+ <!-- Bread Crumb -->
18
+ </div>
19
+ <div class="col-sm-4">
20
+ <div class="title-action">
21
+ <%= link_to phcpress.article_posts_path, class: "btn btn-default" do %>
22
+ <i class="fa fa fa-arrow-left"></i> Back to Article Index
23
+ <% end %>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <!-- Page Header -->
19
28
 
20
- <!-- Main Content -->
21
- <section class="content">
29
+ <!-- Page Content -->
30
+ <div class="wrapper wrapper-content animated fadeInRight">
22
31
  <div class="row">
23
32
  <div class="col-lg-12">
24
- <div class="box">
25
- <div class="box-header with-border">
26
- <h3 class="box-title"><%= yield(:phc_title) %></h3>
27
- </div>
28
- <div class="box-body">
29
-
30
- <!-- Show Content -->
31
- <%= link_to 'Edit', edit_article_post_path(@article_post) %> |
32
- <%= link_to 'Back', article_posts_path %>
33
- <!-- Show Content -->
34
33
 
34
+ <div class="ibox float-e-margins">
35
+ <div class="ibox-title">
36
+ <h5><%= yield(:phc_title_tagline) %></h5>
37
+ <div class="ibox-tools">
38
+ <a class="collapse-link">
39
+ <i class="fa fa-chevron-up"></i>
40
+ </a>
41
+ <a class="close-link">
42
+ <i class="fa fa-times"></i>
43
+ </a>
44
+ </div>
35
45
  </div>
36
- </div>
37
- </div>
38
- </div>
39
- </section>
40
- <!-- Main Content -->
46
+ <div class="ibox-content">
47
+ <p id="notice"><%= notice %></p>
48
+ <%= link_to 'Edit', phcpress.edit_article_post_path(@article_post) %> |
49
+ <%= link_to 'Back', phcpress.article_posts_path %>
50
+ </div>
51
+ <!-- Page Content -->
@@ -1,20 +1,17 @@
1
1
  <%= form_for(@modules_category) do |f| %>
2
2
 
3
- <!-- PHC-Notifi Render Validation -->
3
+ <!-- PHCNotifi Render Validation -->
4
4
  <%= render 'phcnotifi/validations', :object => @modules_category %>
5
- <!-- PHC-Notifi Render Validation -->
5
+ <!-- PHCNotifi Render Validation -->
6
6
 
7
- <!-- Form Fields -->
8
- <div class="form-group field_with_errors">
9
- <label><%= f.label :catname, "Category Name" %></label>
7
+ <!-- PHCPressPro - Category Form -->
8
+ <div class="form-group">
9
+ <%= f.label :catname, "Category Name" %>
10
10
  <%= f.text_field :catname, class: "form-control" %>
11
11
  </div>
12
- <!-- Form Fields -->
13
-
14
- <!-- Form Button -->
15
12
  <div class="actions">
16
13
  <%= f.submit class: "btn btn-primary" %>
17
14
  </div>
18
- <!-- Form Button -->
15
+ <!-- PHCPressPro - Category Form -->
19
16
 
20
17
  <% end %>