phcpress 5.0.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbc269366d81527369f7b9587a583cda84c973f8
4
- data.tar.gz: 594aeff4503c50fabe4ce714c61c03b88c994229
3
+ metadata.gz: 4d04bf361b222a9d32f8e4b2e5fe0fd97d159d50
4
+ data.tar.gz: 06a8c08d9edd60dd09d971b179e7f669c8f0df02
5
5
  SHA512:
6
- metadata.gz: de9aeece950c6456fc9c797151a071bec57a50de375468b8a5654af7d5f0064a63e51856a4d01ee40aafae3a039558f1107ce5fd60f87d8ed91755861694f201
7
- data.tar.gz: 8b25b3934796402f5bc18cb4590f159f2f2e239637560395f6f1ef879c1c42b9b904cd75f3b1b16dd322ba513d66260fdd560935715705fe303a73af5ed8394a
6
+ metadata.gz: a992ee118f81c11082f216ad6d9cffe558eed417bf8fbd5f8717f9f201196e38e828f7c549165f76bb49a2fe569385d54d85c8ec71c0830abec7c303c415abc8
7
+ data.tar.gz: b116d78dbdabdbe8973f05e8f7dfe32527a13d4be9e76ff0617f4997617125fc84ab345ba262b20b399116960134ee9d9ff4e7baec00e5667bfb2db4bd857a70
@@ -18,7 +18,6 @@ module Phcpress
18
18
  # Article New
19
19
  def new
20
20
  @articles_post = Articles::Post.new
21
-
22
21
  end
23
22
 
24
23
  # Article Edit
@@ -52,12 +52,12 @@ module Phcpress
52
52
 
53
53
  private
54
54
 
55
- # Use callbacks to share common setup or constraints between actions.
55
+ # Common Callbacks
56
56
  def set_modules_connection
57
57
  @modules_connection = Modules::Connection.find(params[:id])
58
58
  end
59
59
 
60
- # Only allow a trusted parameter "white list" through.
60
+ # Whitelist
61
61
  def modules_connection_params
62
62
  params.require(:modules_connection).permit(:post_id, :category_id)
63
63
  end
@@ -5,8 +5,8 @@ module Phcpress
5
5
  mount_uploader :pstimage, Phcpress::PstimageUploader
6
6
 
7
7
  # Relationships
8
- has_many :connections, class_name: 'Modules::Connection'
9
- has_many :categories, class_name: 'Modules::Category', :through => :connections
8
+ has_many :connections, class_name: 'Phcpress::Modules::Connection', dependent: :destroy
9
+ has_many :categories, class_name: 'Phcpress::Modules::Category', :through => :connections
10
10
 
11
11
  end
12
12
  end
@@ -2,8 +2,8 @@ module Phcpress
2
2
  class Modules::Category < ApplicationRecord
3
3
 
4
4
  # Relationships
5
- has_many :connections, class_name: 'Modules::Connection'
6
- has_many :posts, class_name: 'Modules::Category', :through => :connections
5
+ has_many :connections, class_name: 'Phcpress::Modules::Connection', dependent: :destroy
6
+ has_many :posts, class_name: 'Phcpress::Modules::Category', :through => :connections
7
7
 
8
8
  end
9
9
  end
@@ -2,8 +2,8 @@ module Phcpress
2
2
  class Modules::Connection < ApplicationRecord
3
3
 
4
4
  # Relationships
5
- belongs_to :post, class_name: 'Articles::Post'
6
- belongs_to :category, class_name: 'Modules::Category'
5
+ belongs_to :post, class_name: 'Phcpress::Articles::Post'
6
+ belongs_to :category, class_name: 'Phcpress::Modules::Category'
7
7
 
8
8
  end
9
9
  end
@@ -31,7 +31,7 @@
31
31
  <%= f.file_field :pstimage, class: "form-control" %>
32
32
  </div>
33
33
  <% if f.object.pstimage? %>
34
- <%= image_tag f.object.pstimage, class: "img-responsive img-thumbnail" %>
34
+ <%= image_tag f.object.pstimage_url, class: "img-responsive img-thumbnail" %>
35
35
  <%= f.label :remove_pstimage %>
36
36
  <%= f.check_box :remove_pstimage %>
37
37
  <% end %>
@@ -1,2 +1 @@
1
- <!-- Main Form -->
2
- <%= render 'form' %>
1
+ <%= render 'form', articles_post: @articles_post %>
@@ -36,7 +36,8 @@
36
36
  </table>
37
37
 
38
38
  <%= link_to 'New Blog Post', new_articles_post_path, class: "btn btn-primary" %>
39
+
39
40
  </div>
40
41
 
41
42
  </div>
42
- </div>
43
+ </div>
@@ -1,2 +1 @@
1
- <!-- Main From -->
2
- <%= render 'form' %>
1
+ <%= render 'form', articles_post: @articles_post %>
@@ -1,9 +1,7 @@
1
1
  <div class="row">
2
2
  <div class="col-lg-12">
3
- <%= form_for(@modules_category) do |f| %>
4
3
 
5
- <!-- PHC-Notifi Render Validation -->
6
- <%= render 'phcnotifi/validations', :object => @modules_category %>
4
+ <%= form_for(@modules_category) do |f| %>
7
5
 
8
6
  <div class="form-group">
9
7
  <label><%= f.label :catname, "Category Name" %></label>
@@ -15,5 +13,6 @@
15
13
  </div>
16
14
 
17
15
  <% end %>
16
+
18
17
  </div>
19
18
  </div>
@@ -1,12 +1 @@
1
- <!-- Main Content -->
2
- <div class="panel panel-primary">
3
-
4
- <div class="panel-heading">
5
- <i class="fa fa-list-ul"></i> Edit Category
6
- </div>
7
-
8
- <div class="panel-body">
9
- <%= render 'form' %>
10
- </div>
11
-
12
- </div>
1
+ <%= render 'form', modules_category: @modules_category %>
@@ -21,7 +21,7 @@
21
21
  <tr>
22
22
  <td><%= modules_category.catname %></td>
23
23
  <td><div class="btn-group" role="group" aria-label="Blog Articles">
24
- <%= link_to 'Edit', edit_modules_category_path(modules_category) , class: "btn btn-primary btn-xs" %>
24
+ <%= link_to 'Edit', edit_modules_category_path(modules_category), class: "btn btn-primary btn-xs" %>
25
25
  <%= link_to 'Trash', modules_category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
26
26
  </div>
27
27
  </td>
@@ -29,7 +29,9 @@
29
29
  <% end %>
30
30
  </tbody>
31
31
  </table>
32
+
32
33
  <%= link_to 'New Category', new_modules_category_path, class: "btn btn-primary" %>
34
+
33
35
  </div>
34
36
 
35
37
  </div>
@@ -1,12 +1 @@
1
- <!-- Main Content -->
2
- <div class="panel panel-primary">
3
-
4
- <div class="panel-heading">
5
- <i class="fa fa-list-ul"></i> New Category
6
- </div>
7
-
8
- <div class="panel-body">
9
- <%= render 'form' %>
10
- </div>
11
-
12
- </div>
1
+ <%= render 'form', modules_category: @modules_category %>
@@ -1,27 +1,23 @@
1
- <%= form_for(modules_connection) do |f| %>
2
- <% if modules_connection.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(modules_connection.errors.count, "error") %> prohibited this modules_connection from being saved:</h2>
1
+ <div class="row">
2
+ <div class="col-lg-12">
5
3
 
6
- <ul>
7
- <% modules_connection.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
4
+ <%= form_for(@modules_connection) do |f| %>
13
5
 
14
- <div class="field">
15
- <%= f.label :post_id %>
16
- <%= f.text_field :post_id %>
17
- </div>
6
+ <div class="form-group">
7
+ <%= f.label :category_id, "Category ID" %>
8
+ <%= f.text_field :category_id, class: "form-control" %>
9
+ </div>
18
10
 
19
- <div class="field">
20
- <%= f.label :category_id %>
21
- <%= f.text_field :category_id %>
22
- </div>
11
+ <div class="form-group">
12
+ <%= f.label :post_id, "Post ID" %>
13
+ <%= f.text_field :post_id, class: "form-control" %>
14
+ </div>
23
15
 
24
- <div class="actions">
25
- <%= f.submit %>
26
- </div>
27
- <% end %>
16
+ <div class="actions">
17
+ <%= f.submit "Submit", class: "btn btn-primary" %>
18
+ </div>
19
+
20
+ <% end %>
21
+
22
+ </div>
23
+ </div>
@@ -1,6 +1 @@
1
- <h1>Editing Modules Connection</h1>
2
-
3
1
  <%= render 'form', modules_connection: @modules_connection %>
4
-
5
- <%= link_to 'Show', @modules_connection %> |
6
- <%= link_to 'Back', modules_connections_path %>
@@ -1,29 +1,38 @@
1
- <p id="notice"><%= notice %></p>
1
+ <!-- Main Content -->
2
+ <div class="wrapper wrapper-content">
3
+ <div class="panel panel-primary">
2
4
 
3
- <h1>Modules Connections</h1>
5
+ <div class="panel-heading">
6
+ <i class="fa fa-list-ul"></i> Connections List
7
+ </div>
4
8
 
5
- <table>
6
- <thead>
7
- <tr>
8
- <th>Post</th>
9
- <th>Category</th>
10
- <th colspan="3"></th>
11
- </tr>
12
- </thead>
9
+ <div class="panel-body">
13
10
 
14
- <tbody>
15
- <% @modules_connections.each do |modules_connection| %>
16
- <tr>
17
- <td><%= modules_connection.post %></td>
18
- <td><%= modules_connection.category %></td>
19
- <td><%= link_to 'Show', modules_connection %></td>
20
- <td><%= link_to 'Edit', edit_modules_connection_path(modules_connection) %></td>
21
- <td><%= link_to 'Destroy', modules_connection, method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
- </tr>
23
- <% end %>
24
- </tbody>
25
- </table>
11
+ <table class="table table-bordered table-striped table-hover">
12
+ <thead>
13
+ <tr>
14
+ <th>Category</th>
15
+ <th>Posts</th>
16
+ <th colspan="3"></th>
17
+ </tr>
18
+ </thead>
26
19
 
27
- <br>
20
+ <tbody>
21
+ <% @modules_connections.each do |modules_connection| %>
22
+ <tr>
23
+ <td><%= modules_connection.category.catname %></td>
24
+ <td><%= modules_connection.post.psttitle %></td>
25
+ <td><%= link_to 'Show', modules_connection, class: "btn btn-primary btn-xs" %></td>
26
+ <td><%= link_to 'Edit', edit_modules_connection_path(modules_connection), class: "btn btn-primary btn-xs" %></td>
27
+ <td><%= link_to 'Destroy', modules_connection, class: "btn btn-primary btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %></td>
28
+ </tr>
29
+ <% end %>
30
+ </tbody>
31
+ </table>
28
32
 
29
- <%= link_to 'New Modules Connection', new_modules_connection_path %>
33
+ <%= link_to 'New Connection', new_modules_connection_path, class: "btn btn-primary" %>
34
+
35
+ </div>
36
+
37
+ </div>
38
+ </div>
@@ -1,5 +1 @@
1
- <h1>New Modules Connection</h1>
2
-
3
1
  <%= render 'form', modules_connection: @modules_connection %>
4
-
5
- <%= link_to 'Back', modules_connections_path %>
@@ -2,12 +2,12 @@
2
2
 
3
3
  <p>
4
4
  <strong>Post:</strong>
5
- <%= @modules_connection.post %>
5
+ <%= @modules_connection.post_id %>
6
6
  </p>
7
7
 
8
8
  <p>
9
9
  <strong>Category:</strong>
10
- <%= @modules_connection.category %>
10
+ <%= @modules_connection.category_id %>
11
11
  </p>
12
12
 
13
13
  <%= link_to 'Edit', edit_modules_connection_path(@modules_connection) %> |
data/config/routes.rb CHANGED
@@ -2,13 +2,13 @@ Phcpress::Engine.routes.draw do
2
2
 
3
3
  # Article Routes
4
4
  namespace :articles do
5
- resources :posts, class_name: 'Articles::Post'
5
+ resources :posts, class_name: 'Phcpress::Articles::Post'
6
6
  end
7
7
 
8
8
  # Module Routes
9
9
  namespace :modules do
10
- resources :connections, class_name: 'Modules::Connection'
11
- resources :categories, class_name: 'Modules::Category'
10
+ resources :connections, class_name: 'Phcpress::Modules::Connection'
11
+ resources :categories, class_name: 'Phcpress::Modules::Category'
12
12
  end
13
13
 
14
14
  end
@@ -1,10 +1,12 @@
1
1
  class CreatePhcpressModulesConnections < ActiveRecord::Migration[5.0]
2
- def change
3
- create_table :phcpress_modules_connections do |t|
4
- t.references :post, foreign_key: true
5
- t.references :category, foreign_key: true
2
+ def change
3
+ create_table :phcpress_modules_connections do |t|
6
4
 
7
- t.timestamps
8
- end
9
- end
5
+ t.references :post
6
+ t.references :category
7
+
8
+ t.timestamps
9
+
10
+ end
11
+ end
10
12
  end
@@ -1,3 +1,3 @@
1
1
  module Phcpress
2
- VERSION = "5.0.0"
2
+ VERSION = "5.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-22 00:00:00.000000000 Z
11
+ date: 2016-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails