phcdevworks_portfolio 1.0.3 → 2.0.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/phcdevworks_portfolio/project/categories_controller.rb +2 -2
- data/app/controllers/phcdevworks_portfolio/project/pages_controller.rb +1 -1
- data/app/controllers/phcdevworks_portfolio/project/posts_controller.rb +1 -1
- data/app/controllers/phcdevworks_portfolio/project/types_controller.rb +2 -2
- data/app/models/phcdevworks_portfolio/project/category.rb +14 -4
- data/app/models/phcdevworks_portfolio/project/post.rb +18 -8
- data/app/models/phcdevworks_portfolio/project/type.rb +14 -4
- data/app/views/phcdevworks_portfolio/project/categories/_form.html.erb +2 -2
- data/app/views/phcdevworks_portfolio/project/categories/index.html.erb +1 -1
- data/app/views/phcdevworks_portfolio/project/posts/_form.html.erb +14 -14
- data/app/views/phcdevworks_portfolio/project/posts/index.html.erb +3 -4
- data/app/views/phcdevworks_portfolio/project/types/_form.html.erb +2 -2
- data/app/views/phcdevworks_portfolio/project/types/index.html.erb +1 -1
- data/db/migrate/20191014112330_create_phcdevworks_portfolio_project_posts.rb +6 -6
- data/db/migrate/20191021225231_create_phcdevworks_portfolio_project_categories.rb +1 -1
- data/db/migrate/20191021225316_create_phcdevworks_portfolio_project_types.rb +1 -1
- data/lib/phcdevworks_portfolio/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88d4254b2a9308a8c10449a0e59fd24a137fa69375187892116f2f2e7b6eeffe
|
4
|
+
data.tar.gz: 736fa03c71485a66ad67753757ffdae8f0744ed737d9f703de474400eac89470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 222fbeb4f1500e23952780ed5664450ec7f200b71447a420115bdf9f76f711844baa10a23ca18e305cc685525a084bb3000bfe2fa89292a30d77b3e766c253dc
|
7
|
+
data.tar.gz: dcf022db1c94f3af4ff1527d556272896681416153f97b5f8522385ef8c047e40eaa555d54fc4e57747ec72f8c093635a8e48af9129e0b67bd614c89257a2290
|
@@ -42,7 +42,7 @@ module PhcdevworksPortfolio
|
|
42
42
|
# PATCH/PUT /project/categories/1
|
43
43
|
def update
|
44
44
|
respond_to do |format|
|
45
|
-
if @project_category.update(
|
45
|
+
if @project_category.update(project_category_params)
|
46
46
|
format.html { redirect_to project_categories_path, :flash => { :notice => 'Project Category has been Updated.' }}
|
47
47
|
format.json { render :show, status: :ok, location: @project_category }
|
48
48
|
else
|
@@ -70,7 +70,7 @@ module PhcdevworksPortfolio
|
|
70
70
|
|
71
71
|
# Whitelist
|
72
72
|
def project_category_params
|
73
|
-
params.require(:project_category).permit(:
|
73
|
+
params.require(:project_category).permit(:category_name, :slug, :user_id, :org_id)
|
74
74
|
end
|
75
75
|
|
76
76
|
end
|
@@ -70,7 +70,7 @@ module PhcdevworksPortfolio
|
|
70
70
|
|
71
71
|
# Whitelist
|
72
72
|
def project_post_params
|
73
|
-
params.require(:project_post).permit(:
|
73
|
+
params.require(:project_post).permit(:post_title, :post_description, :post_url, :post_type, :post_status, :post_image, :post_images, :slug, :user_id, :org_id, category_ids: [], type_ids: [])
|
74
74
|
end
|
75
75
|
|
76
76
|
end
|
@@ -42,7 +42,7 @@ module PhcdevworksPortfolio
|
|
42
42
|
# PATCH/PUT /project/types/1
|
43
43
|
def update
|
44
44
|
respond_to do |format|
|
45
|
-
if @project_type.update(
|
45
|
+
if @project_type.update(project_type_params)
|
46
46
|
format.html { redirect_to project_types_path, :flash => { :notice => 'Project Type has been Updated.' }}
|
47
47
|
format.json { render :show, status: :ok, location: @project_type }
|
48
48
|
else
|
@@ -70,7 +70,7 @@ module PhcdevworksPortfolio
|
|
70
70
|
|
71
71
|
# Whitelist
|
72
72
|
def project_type_params
|
73
|
-
params.require(:project_type).permit(:
|
73
|
+
params.require(:project_type).permit(:type_name, :slug, :user_id, :org_id)
|
74
74
|
end
|
75
75
|
|
76
76
|
end
|
@@ -1,9 +1,19 @@
|
|
1
1
|
module PhcdevworksPortfolio
|
2
|
-
|
2
|
+
class Project::Category < ApplicationRecord
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
7
6
|
|
7
|
+
# Relationships
|
8
|
+
has_and_belongs_to_many :posts, class_name: "Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
|
9
|
+
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
10
|
+
|
11
|
+
# Clean URL Define
|
12
|
+
friendly_id :phcdev_project_category_nice_urls, use: [:slugged, :finders]
|
13
|
+
|
14
|
+
def phcdev_project_category_nice_urls
|
15
|
+
[:category_name]
|
8
16
|
end
|
17
|
+
|
18
|
+
end
|
9
19
|
end
|
@@ -1,13 +1,23 @@
|
|
1
1
|
module PhcdevworksPortfolio
|
2
|
-
class Project::Post < ApplicationRecord
|
2
|
+
class Project::Post < ApplicationRecord
|
3
3
|
|
4
|
-
#
|
5
|
-
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
6
6
|
|
7
|
-
#
|
8
|
-
|
9
|
-
has_and_belongs_to_many :types, class_name: "Project::Type", :join_table => "phcdevworks_portfolio_posts_types"
|
10
|
-
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
7
|
+
# Image Upload
|
8
|
+
has_one_attached :post_image
|
11
9
|
|
12
|
-
|
10
|
+
# Relationships
|
11
|
+
has_and_belongs_to_many :categories, class_name: "Project::Category", :join_table => "phcdevworks_portfolio_categories_posts"
|
12
|
+
has_and_belongs_to_many :types, class_name: "Project::Type", :join_table => "phcdevworks_portfolio_posts_types"
|
13
|
+
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
14
|
+
|
15
|
+
# Clean URL Define
|
16
|
+
friendly_id :phcdev_project_post_nice_urls, use: [:slugged, :finders]
|
17
|
+
|
18
|
+
def phcdev_project_post_nice_urls
|
19
|
+
[:post_title]
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
13
23
|
end
|
@@ -1,9 +1,19 @@
|
|
1
1
|
module PhcdevworksPortfolio
|
2
|
-
|
2
|
+
class Project::Type < ApplicationRecord
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
4
|
+
# Clean URL Initialize
|
5
|
+
extend FriendlyId
|
7
6
|
|
7
|
+
# Relationships
|
8
|
+
has_and_belongs_to_many :posts, class_name: "Project::Post", :join_table => "phcdevworks_portfolio_posts_types", :dependent => :destroy
|
9
|
+
belongs_to :user, class_name: "PhcdevworksAccounts::User"
|
10
|
+
|
11
|
+
# Clean URL Define
|
12
|
+
friendly_id :phcdev_project_type_nice_urls, use: [:slugged, :finders]
|
13
|
+
|
14
|
+
def phcdev_project_type_nice_urls
|
15
|
+
[:type_name]
|
8
16
|
end
|
17
|
+
|
18
|
+
end
|
9
19
|
end
|
@@ -7,8 +7,8 @@
|
|
7
7
|
|
8
8
|
<!-- Form Input Fields -->
|
9
9
|
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :
|
11
|
-
<%= form.text_field :
|
10
|
+
<%= form.label :category_name, "Project Category" %>
|
11
|
+
<%= form.text_field :category_name, placeholder: "Project Category", class: "form-control" %>
|
12
12
|
</div>
|
13
13
|
<!-- Form Input Fields -->
|
14
14
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<tbody>
|
47
47
|
<% @project_categories.each do |project_category| %>
|
48
48
|
<tr>
|
49
|
-
<td><%= project_category.
|
49
|
+
<td><%= project_category.category_name %></td>
|
50
50
|
<td>
|
51
51
|
<div class="btn-group d-flex" role="group">
|
52
52
|
<%= link_to "Update Category", edit_project_category_path(project_category), class: "btn btn-purple btn-xs" %>
|
@@ -7,35 +7,35 @@
|
|
7
7
|
|
8
8
|
<!-- Form Input Fields -->
|
9
9
|
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :
|
11
|
-
<%= form.text_field :
|
10
|
+
<%= form.label :post_title, "Project Title" %>
|
11
|
+
<%= form.text_field :post_title, placeholder: "Project Title", class: "form-control" %>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="form-group field_with_errors">
|
15
|
-
<%= form.label :
|
16
|
-
<%= form.text_area :
|
15
|
+
<%= form.label :post_description, "Project Description" %>
|
16
|
+
<%= form.text_area :post_description, placeholder: "Project Description", class: "form-control" %>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<div class="form-group field_with_errors">
|
20
|
-
<%= form.label :
|
21
|
-
<%= form.text_field :
|
20
|
+
<%= form.label :post_url, "Project URL" %>
|
21
|
+
<%= form.text_field :post_url, placeholder: "Project URL", class: "form-control" %>
|
22
22
|
</div>
|
23
23
|
|
24
24
|
<div class="form-group field_with_errors">
|
25
|
-
<%= form.label :
|
26
|
-
<%= form.select( :
|
25
|
+
<%= form.label :post_status, "Tutorial Status" %>
|
26
|
+
<%= form.select( :post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control"}) %>
|
27
27
|
</div>
|
28
28
|
|
29
29
|
<div class="form-group field_with_errors">
|
30
|
-
<%= form.label :
|
31
|
-
<%= form.file_field :
|
30
|
+
<%= form.label :post_image, "Project Image" %>
|
31
|
+
<%= form.file_field :post_image, class: "form-control" %>
|
32
32
|
</div>
|
33
|
-
<% if form.object.
|
34
|
-
<%= image_tag main_app.url_for(form.object.
|
33
|
+
<% if form.object.post_image.attached? %>
|
34
|
+
<%= image_tag main_app.url_for(form.object.post_image), class: "img-responsive img-thumbnail" %>
|
35
35
|
<% end %>
|
36
36
|
|
37
37
|
<div class="form-group field_with_errors">
|
38
|
-
<%= form.collection_check_boxes :category_ids, PhcdevworksPortfolio::Project::Category.all, :id, :
|
38
|
+
<%= form.collection_check_boxes :category_ids, PhcdevworksPortfolio::Project::Category.all, :id, :category_name do |project_category| %>
|
39
39
|
<%= project_category.check_box %>
|
40
40
|
<%= project_category.label %><br>
|
41
41
|
<% end %>
|
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
|
45
45
|
<div class="form-group field_with_errors">
|
46
|
-
<%= form.collection_check_boxes :type_ids, PhcdevworksPortfolio::Project::Type.all, :id, :
|
46
|
+
<%= form.collection_check_boxes :type_ids, PhcdevworksPortfolio::Project::Type.all, :id, :type_name do |project_type| %>
|
47
47
|
<%= project_type.check_box %>
|
48
48
|
<%= project_type.label %><br>
|
49
49
|
<% end %>
|
@@ -48,12 +48,11 @@
|
|
48
48
|
<tbody>
|
49
49
|
<% @project_posts.each do |project_post| %>
|
50
50
|
<tr>
|
51
|
-
<td><%= project_post.
|
52
|
-
<td><%= project_post.
|
53
|
-
<td><%= project_post.
|
51
|
+
<td><%= project_post.post_title %></td>
|
52
|
+
<td><%= project_post.post_description %></td>
|
53
|
+
<td><%= project_post.post_status.capitalize %></td>
|
54
54
|
<td>
|
55
55
|
<div class="btn-group d-flex" role="group">
|
56
|
-
<%= link_to "Project Details", project_post, class: "btn btn-primary btn-xs" %>
|
57
56
|
<%= link_to "Update Project", edit_project_post_path(project_post), class: "btn btn-purple btn-xs" %>
|
58
57
|
<%= link_to "Remove Project", project_post, method: :delete, data: { confirm: "Are you sure? This will also remove the Members addresses and listings. This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
|
59
58
|
</div>
|
@@ -7,8 +7,8 @@
|
|
7
7
|
|
8
8
|
<!-- Form Input Fields -->
|
9
9
|
<div class="form-group field_with_errors">
|
10
|
-
<%= form.label :
|
11
|
-
<%= form.text_field :
|
10
|
+
<%= form.label :type_name, "Project Type Name" %>
|
11
|
+
<%= form.text_field :type_name, placeholder: "Project Type", class: "form-control" %>
|
12
12
|
</div>
|
13
13
|
<!-- Form Input Fields -->
|
14
14
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<tbody>
|
47
47
|
<% @project_types.each do |project_type| %>
|
48
48
|
<tr>
|
49
|
-
<td><%= project_type.
|
49
|
+
<td><%= project_type.type_name %></td>
|
50
50
|
<td>
|
51
51
|
<div class="btn-group d-flex" role="group">
|
52
52
|
<%= link_to "Update Type Name", edit_project_type_path(project_type), class: "btn btn-purple btn-xs" %>
|
@@ -2,13 +2,13 @@ class CreatePhcdevworksPortfolioProjectPosts < ActiveRecord::Migration[6.0]
|
|
2
2
|
def change
|
3
3
|
create_table :phcdevworks_portfolio_project_posts do |t|
|
4
4
|
|
5
|
-
t.string :
|
6
|
-
t.text :
|
5
|
+
t.string :post_title
|
6
|
+
t.text :post_description
|
7
7
|
|
8
|
-
t.string :
|
9
|
-
t.string :
|
10
|
-
t.string :
|
11
|
-
t.string :
|
8
|
+
t.string :post_url
|
9
|
+
t.string :post_status
|
10
|
+
t.string :post_image
|
11
|
+
t.string :post_images
|
12
12
|
|
13
13
|
t.string :slug
|
14
14
|
t.string :user_id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_portfolio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|