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 +4 -4
- data/app/controllers/phcpress/articles/posts_controller.rb +0 -1
- data/app/controllers/phcpress/modules/connections_controller.rb +2 -2
- data/app/models/phcpress/articles/post.rb +2 -2
- data/app/models/phcpress/modules/category.rb +2 -2
- data/app/models/phcpress/modules/connection.rb +2 -2
- data/app/views/phcpress/articles/posts/_form.html.erb +1 -1
- data/app/views/phcpress/articles/posts/edit.html.erb +1 -2
- data/app/views/phcpress/articles/posts/index.html.erb +2 -1
- data/app/views/phcpress/articles/posts/new.html.erb +1 -2
- data/app/views/phcpress/modules/categories/_form.html.erb +2 -3
- data/app/views/phcpress/modules/categories/edit.html.erb +1 -12
- data/app/views/phcpress/modules/categories/index.html.erb +3 -1
- data/app/views/phcpress/modules/categories/new.html.erb +1 -12
- data/app/views/phcpress/modules/connections/_form.html.erb +19 -23
- data/app/views/phcpress/modules/connections/edit.html.erb +0 -5
- data/app/views/phcpress/modules/connections/index.html.erb +33 -24
- data/app/views/phcpress/modules/connections/new.html.erb +0 -4
- data/app/views/phcpress/modules/connections/show.html.erb +2 -2
- data/config/routes.rb +3 -3
- data/db/migrate/20160720235314_create_phcpress_modules_connections.rb +9 -7
- data/lib/phcpress/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d04bf361b222a9d32f8e4b2e5fe0fd97d159d50
|
4
|
+
data.tar.gz: 06a8c08d9edd60dd09d971b179e7f669c8f0df02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a992ee118f81c11082f216ad6d9cffe558eed417bf8fbd5f8717f9f201196e38e828f7c549165f76bb49a2fe569385d54d85c8ec71c0830abec7c303c415abc8
|
7
|
+
data.tar.gz: b116d78dbdabdbe8973f05e8f7dfe32527a13d4be9e76ff0617f4997617125fc84ab345ba262b20b399116960134ee9d9ff4e7baec00e5667bfb2db4bd857a70
|
@@ -52,12 +52,12 @@ module Phcpress
|
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
-
#
|
55
|
+
# Common Callbacks
|
56
56
|
def set_modules_connection
|
57
57
|
@modules_connection = Modules::Connection.find(params[:id])
|
58
58
|
end
|
59
59
|
|
60
|
-
#
|
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.
|
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
|
-
|
2
|
-
<%= render 'form' %>
|
1
|
+
<%= render 'form', articles_post: @articles_post %>
|
@@ -1,2 +1 @@
|
|
1
|
-
|
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
|
-
|
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
|
-
|
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)
|
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
|
-
|
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
|
-
|
2
|
-
|
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
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
16
|
+
<div class="actions">
|
17
|
+
<%= f.submit "Submit", class: "btn btn-primary" %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -1,29 +1,38 @@
|
|
1
|
-
|
1
|
+
<!-- Main Content -->
|
2
|
+
<div class="wrapper wrapper-content">
|
3
|
+
<div class="panel panel-primary">
|
2
4
|
|
3
|
-
<
|
5
|
+
<div class="panel-heading">
|
6
|
+
<i class="fa fa-list-ul"></i> Connections List
|
7
|
+
</div>
|
4
8
|
|
5
|
-
<
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
<
|
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
|
33
|
+
<%= link_to 'New Connection', new_modules_connection_path, class: "btn btn-primary" %>
|
34
|
+
|
35
|
+
</div>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
<p>
|
4
4
|
<strong>Post:</strong>
|
5
|
-
<%= @modules_connection.
|
5
|
+
<%= @modules_connection.post_id %>
|
6
6
|
</p>
|
7
7
|
|
8
8
|
<p>
|
9
9
|
<strong>Category:</strong>
|
10
|
-
<%= @modules_connection.
|
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
|
-
|
3
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
5
|
+
t.references :post
|
6
|
+
t.references :category
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
10
12
|
end
|
data/lib/phcpress/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|