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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 505d61237cbcac4f97576ec38ea0f6d4410876edce7eca99f771a22b9a984c33
4
- data.tar.gz: 36c6332bdea260f4faea10e1666fc4b7f0faab46efef7b71e6feda6104427878
3
+ metadata.gz: 88d4254b2a9308a8c10449a0e59fd24a137fa69375187892116f2f2e7b6eeffe
4
+ data.tar.gz: 736fa03c71485a66ad67753757ffdae8f0744ed737d9f703de474400eac89470
5
5
  SHA512:
6
- metadata.gz: c00e24901d2b982e02a04ab01080cb43bbe7a88c65fed8af6b62ea3c210c62bc2bb95e239b84cd6bba8cc0ae63da07c25881d8796dec50d4c891f45974cdbfc6
7
- data.tar.gz: b2a4d0531a5614450eafdde3fb03c066378ab862d8f1eb00bfa6fdb5c5085058394be25f6f9c0e49e5391a6780da51753c2b0f794e2c27e76330dfdbb45c9dac
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(project_post_params)
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(:project_category_name, :slug, :user_id, :org_id)
73
+ params.require(:project_category).permit(:category_name, :slug, :user_id, :org_id)
74
74
  end
75
75
 
76
76
  end
@@ -8,7 +8,7 @@ module PhcdevworksPortfolio
8
8
 
9
9
  # INDEX
10
10
  def index
11
- @phcdevworks_projects_index = Project::Post.where(project_post_status: "published")
11
+ @phcdevworks_projects_index = Project::Post.where(post_status: "published")
12
12
  end
13
13
 
14
14
  # SHOW
@@ -70,7 +70,7 @@ module PhcdevworksPortfolio
70
70
 
71
71
  # Whitelist
72
72
  def project_post_params
73
- params.require(:project_post).permit(:project_post_title, :project_post_description, :project_post_url, :project_post_type, :project_post_status, :project_post_image, :project_post_images, :slug, :user_id, :org_id, category_ids: [], type_ids: [])
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(project_post_params)
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(:project_type_name, :slug, :user_id, :org_id)
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
- class Project::Category < ApplicationRecord
2
+ class Project::Category < ApplicationRecord
3
3
 
4
- # Relationships
5
- has_and_belongs_to_many :posts, class_name: "Project::Post", :join_table => "phcdevworks_portfolio_categories_posts", :dependent => :destroy
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
- # Image Upload
5
- has_one_attached :project_post_image
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
6
 
7
- # Relationships
8
- has_and_belongs_to_many :categories, class_name: "Project::Category", :join_table => "phcdevworks_portfolio_categories_posts"
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
- end
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
- class Project::Type < ApplicationRecord
2
+ class Project::Type < ApplicationRecord
3
3
 
4
- # Relationships
5
- has_and_belongs_to_many :posts, class_name: "Project::Post", :join_table => "phcdevworks_portfolio_posts_types", :dependent => :destroy
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 :project_category_name, "Project Category" %>
11
- <%= form.text_field :project_category_name, placeholder: "Project Category", class: "form-control" %>
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.project_category_name %></td>
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 :project_post_title, "Project Title" %>
11
- <%= form.text_field :project_post_title, placeholder: "Project Title", class: "form-control" %>
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 :project_post_description, "Project Description" %>
16
- <%= form.text_area :project_post_description, placeholder: "Project Description", class: "form-control" %>
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 :project_post_url, "Project URL" %>
21
- <%= form.text_field :project_post_url, placeholder: "Project URL", class: "form-control" %>
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 :project_post_status, "Tutorial Status" %>
26
- <%= form.select( :project_post_status, [["Draft","draft"],["Published","published"],["Review","review"]], {}, {class: "form-control"}) %>
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 :project_post_image, "Project Image" %>
31
- <%= form.file_field :project_post_image, class: "form-control" %>
30
+ <%= form.label :post_image, "Project Image" %>
31
+ <%= form.file_field :post_image, class: "form-control" %>
32
32
  </div>
33
- <% if form.object.project_post_image.attached? %>
34
- <%= image_tag main_app.url_for(form.object.project_post_image), class: "img-responsive img-thumbnail" %>
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, :project_category_name do |project_category| %>
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, :project_type_name do |project_type| %>
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.project_post_title %></td>
52
- <td><%= project_post.project_post_description %></td>
53
- <td><%= project_post.project_post_status %></td>
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 :project_type_name, "Project Type Name" %>
11
- <%= form.text_field :project_type_name, placeholder: "Project Type", class: "form-control" %>
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.project_type_name %></td>
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 :project_post_title
6
- t.text :project_post_description
5
+ t.string :post_title
6
+ t.text :post_description
7
7
 
8
- t.string :project_post_url
9
- t.string :project_post_status
10
- t.string :project_post_image
11
- t.string :project_post_images
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
@@ -2,7 +2,7 @@ class CreatePhcdevworksPortfolioProjectCategories < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :phcdevworks_portfolio_project_categories do |t|
4
4
 
5
- t.string :project_category_name
5
+ t.string :category_name
6
6
 
7
7
  t.string :slug
8
8
  t.string :user_id
@@ -2,7 +2,7 @@ class CreatePhcdevworksPortfolioProjectTypes < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :phcdevworks_portfolio_project_types do |t|
4
4
 
5
- t.string :project_type_name
5
+ t.string :type_name
6
6
 
7
7
  t.string :slug
8
8
  t.string :user_id
@@ -1,3 +1,3 @@
1
1
  module PhcdevworksPortfolio
2
- VERSION = "1.0.3"
2
+ VERSION = "2.0.0"
3
3
  end
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: 1.0.3
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-25 00:00:00.000000000 Z
11
+ date: 2019-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails