phcpress 3.6.1 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/phcpress/categories.js +2 -0
- data/app/assets/stylesheets/phcpress/categories.scss +3 -0
- data/app/assets/stylesheets/scaffolds.scss +73 -0
- data/app/controllers/phcpress/categories_controller.rb +63 -0
- data/app/controllers/phcpress/news/posts_controller.rb +5 -5
- data/app/helpers/phcpress/categories_helper.rb +4 -0
- data/app/models/phcpress/category.rb +4 -0
- data/app/views/phcpress/categories/_form.html.erb +19 -0
- data/app/views/phcpress/categories/edit.html.erb +12 -0
- data/app/views/phcpress/categories/index.html.erb +36 -0
- data/app/views/phcpress/categories/new.html.erb +12 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20160424211134_create_phcpress_categories.rb +9 -0
- data/lib/phcpress/version.rb +1 -1
- metadata +15 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d847b33ceb955f163672364bce714d6ccd8dc06
|
4
|
+
data.tar.gz: ce77b4034bbf005a466f5e64e267b97011b1f8ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abf87639dae46734ddaf81caf4ec01c7d5904db292d31e54539129334ad5ae64d1d805f7c4def5cd62850d06418c7631d727076dbe766166bd2cabb30076486c
|
7
|
+
data.tar.gz: ac25d819356234c29bd84ac53372abca71248fb026d6fa2547248149f149f11c9576709ffb9411bb2c46dc5ade0a978df3690a56ea668f3ce2bbeb6e1af7b2c1
|
@@ -0,0 +1,73 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #fff;
|
3
|
+
color: #333;
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
p, ol, ul, td {
|
10
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
11
|
+
font-size: 13px;
|
12
|
+
line-height: 18px;
|
13
|
+
}
|
14
|
+
|
15
|
+
pre {
|
16
|
+
background-color: #eee;
|
17
|
+
padding: 10px;
|
18
|
+
font-size: 11px;
|
19
|
+
}
|
20
|
+
|
21
|
+
a {
|
22
|
+
color: #000;
|
23
|
+
|
24
|
+
&:visited {
|
25
|
+
color: #666;
|
26
|
+
}
|
27
|
+
|
28
|
+
&:hover {
|
29
|
+
color: #fff;
|
30
|
+
background-color: #000;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
div {
|
35
|
+
&.field, &.actions {
|
36
|
+
margin-bottom: 10px;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
#notice {
|
41
|
+
color: green;
|
42
|
+
}
|
43
|
+
|
44
|
+
.field_with_errors {
|
45
|
+
padding: 2px;
|
46
|
+
background-color: red;
|
47
|
+
display: table;
|
48
|
+
}
|
49
|
+
|
50
|
+
#error_explanation {
|
51
|
+
width: 450px;
|
52
|
+
border: 2px solid red;
|
53
|
+
padding: 7px;
|
54
|
+
padding-bottom: 0;
|
55
|
+
margin-bottom: 20px;
|
56
|
+
background-color: #f0f0f0;
|
57
|
+
|
58
|
+
h2 {
|
59
|
+
text-align: left;
|
60
|
+
font-weight: bold;
|
61
|
+
padding: 5px 5px 5px 15px;
|
62
|
+
font-size: 12px;
|
63
|
+
margin: -7px;
|
64
|
+
margin-bottom: 0px;
|
65
|
+
background-color: #c00;
|
66
|
+
color: #fff;
|
67
|
+
}
|
68
|
+
|
69
|
+
ul li {
|
70
|
+
font-size: 12px;
|
71
|
+
list-style: square;
|
72
|
+
}
|
73
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require_dependency "phcpress/application_controller"
|
2
|
+
|
3
|
+
module Phcpress
|
4
|
+
class CategoriesController < ApplicationController
|
5
|
+
|
6
|
+
# Security and Filters
|
7
|
+
before_action :authenticate_user!
|
8
|
+
before_action :set_category, only: [:edit, :update, :destroy]
|
9
|
+
|
10
|
+
# GET /categories
|
11
|
+
def index
|
12
|
+
@categories = Category.all
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /categories/new
|
16
|
+
def new
|
17
|
+
@category = Category.new
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /categories/1/edit
|
21
|
+
def edit
|
22
|
+
end
|
23
|
+
|
24
|
+
# POST /categories
|
25
|
+
def create
|
26
|
+
@category = Category.new(category_params)
|
27
|
+
|
28
|
+
if @category.save
|
29
|
+
redirect_to categories_path, notice: 'Category was successfully created.'
|
30
|
+
else
|
31
|
+
render :new
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# PATCH/PUT
|
36
|
+
def update
|
37
|
+
if @category.update(category_params)
|
38
|
+
redirect_to categories_path, notice: 'Category was successfully updated.'
|
39
|
+
else
|
40
|
+
render :edit
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# DELETE
|
45
|
+
def destroy
|
46
|
+
@category.destroy
|
47
|
+
redirect_to categories_path, notice: 'Category was successfully destroyed.'
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
# Common callbacks
|
53
|
+
def set_category
|
54
|
+
@category = Category.find(params[:id])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Whitelist
|
58
|
+
def category_params
|
59
|
+
params.require(:category).permit(:catname)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
@@ -21,7 +21,7 @@ module Phcpress
|
|
21
21
|
#end
|
22
22
|
|
23
23
|
# Create a New News Post (/news/posts/new)
|
24
|
-
def
|
24
|
+
def newW
|
25
25
|
@news_post = News::Post.new
|
26
26
|
end
|
27
27
|
|
@@ -31,10 +31,10 @@ module Phcpress
|
|
31
31
|
|
32
32
|
# Create News Post /news/posts/new
|
33
33
|
def create
|
34
|
-
@news_post = News::Post.new(news_post_params)
|
34
|
+
@news_post = News::Post.new(news_post_params)W
|
35
35
|
@news_post.user_id = current_user
|
36
36
|
if @news_post.save
|
37
|
-
redirect_to news_posts_path, notice: 'News
|
37
|
+
redirect_to news_posts_path, notice: 'News Article was Successfully Created.'
|
38
38
|
else
|
39
39
|
render 'new'
|
40
40
|
end
|
@@ -43,7 +43,7 @@ module Phcpress
|
|
43
43
|
# PATCH/PUT
|
44
44
|
def update
|
45
45
|
if @news_post.update(news_post_params)
|
46
|
-
redirect_to news_posts_path, notice: 'News
|
46
|
+
redirect_to news_posts_path, notice: 'News Article was Successfully Updated.'
|
47
47
|
else
|
48
48
|
render :edit
|
49
49
|
end
|
@@ -52,7 +52,7 @@ module Phcpress
|
|
52
52
|
# DELETE
|
53
53
|
def destroy
|
54
54
|
@news_post.destroy
|
55
|
-
redirect_to news_posts_path, notice: 'News
|
55
|
+
redirect_to news_posts_path, notice: 'News Article was Successfully Destroyed.'
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-lg-12">
|
3
|
+
<%= form_for(@category) do |f| %>
|
4
|
+
|
5
|
+
<!-- PHC-Notifi Render Validation -->
|
6
|
+
<%= render 'phcnotifi/validations', :object => @category %>
|
7
|
+
|
8
|
+
<div class="form-group">
|
9
|
+
<label><%= f.label :catname, "Category Name" %></label>
|
10
|
+
<%= f.text_field :catname, class: "form-control" %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="actions">
|
14
|
+
<%= f.submit "Submit", class: "btn btn-primary" %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<!-- Main Content -->
|
2
|
+
<div class="wrapper wrapper-content">
|
3
|
+
<div class="panel panel-primary">
|
4
|
+
|
5
|
+
<div class="panel-heading">
|
6
|
+
<i class="fa fa-pencil-square-o"></i> Category List
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="panel-body">
|
10
|
+
|
11
|
+
<table class="table table-bordered table-striped table-hover">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th>Category Name</th>
|
15
|
+
<th></th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
|
19
|
+
<tbody>
|
20
|
+
<% @categories.each do |category| %>
|
21
|
+
<tr>
|
22
|
+
<td><%= category.catname %></td>
|
23
|
+
<td><div class="btn-group" role="group" aria-label="Blog Articles">
|
24
|
+
<%= link_to 'Edit', edit_category_path(category) , class: "btn btn-primary btn-xs" %>
|
25
|
+
<%= link_to 'Trash', category, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
|
26
|
+
</div>
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
<%= link_to 'New Category', new_category_path, class: "btn btn-primary" %>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
</div>
|
36
|
+
</div>
|
data/config/routes.rb
CHANGED
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: 3.
|
4
|
+
version: 3.7.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-04-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -198,26 +198,6 @@ dependencies:
|
|
198
198
|
- - ">="
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: 5.0.4
|
201
|
-
- !ruby/object:Gem::Dependency
|
202
|
-
name: figaro
|
203
|
-
requirement: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '1.1'
|
208
|
-
- - ">="
|
209
|
-
- !ruby/object:Gem::Version
|
210
|
-
version: 1.1.1
|
211
|
-
type: :runtime
|
212
|
-
prerelease: false
|
213
|
-
version_requirements: !ruby/object:Gem::Requirement
|
214
|
-
requirements:
|
215
|
-
- - "~>"
|
216
|
-
- !ruby/object:Gem::Version
|
217
|
-
version: '1.1'
|
218
|
-
- - ">="
|
219
|
-
- !ruby/object:Gem::Version
|
220
|
-
version: 1.1.1
|
221
201
|
- !ruby/object:Gem::Dependency
|
222
202
|
name: sqlite3
|
223
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -374,7 +354,7 @@ dependencies:
|
|
374
354
|
- - "~>"
|
375
355
|
- !ruby/object:Gem::Version
|
376
356
|
version: '2.53'
|
377
|
-
description: PHCPress(3) is an open source news & blog engine built for PHCPress application
|
357
|
+
description: PHCPress(3) is an open source news & blog engine built for PHCPress application.
|
378
358
|
email:
|
379
359
|
- info@phcnetworks.net
|
380
360
|
executables: []
|
@@ -385,14 +365,20 @@ files:
|
|
385
365
|
- README.md
|
386
366
|
- Rakefile
|
387
367
|
- app/assets/javascripts/phcpress/application.js
|
368
|
+
- app/assets/javascripts/phcpress/categories.js
|
388
369
|
- app/assets/stylesheets/phcpress/application.scss
|
370
|
+
- app/assets/stylesheets/phcpress/categories.scss
|
389
371
|
- app/assets/stylesheets/phcpress/custom.scss
|
372
|
+
- app/assets/stylesheets/scaffolds.scss
|
390
373
|
- app/controllers/phcpress/application_controller.rb
|
391
374
|
- app/controllers/phcpress/blog/posts_controller.rb
|
375
|
+
- app/controllers/phcpress/categories_controller.rb
|
392
376
|
- app/controllers/phcpress/news/posts_controller.rb
|
393
377
|
- app/helpers/phcpress/application_helper.rb
|
378
|
+
- app/helpers/phcpress/categories_helper.rb
|
394
379
|
- app/models/phcpress/blog.rb
|
395
380
|
- app/models/phcpress/blog/post.rb
|
381
|
+
- app/models/phcpress/category.rb
|
396
382
|
- app/models/phcpress/news.rb
|
397
383
|
- app/models/phcpress/news/post.rb
|
398
384
|
- app/uploaders/phcpress/pstimage_uploader.rb
|
@@ -404,6 +390,10 @@ files:
|
|
404
390
|
- app/views/phcpress/blog/posts/index.html.erb
|
405
391
|
- app/views/phcpress/blog/posts/new.html.erb
|
406
392
|
- app/views/phcpress/blog/posts/show.html.erb
|
393
|
+
- app/views/phcpress/categories/_form.html.erb
|
394
|
+
- app/views/phcpress/categories/edit.html.erb
|
395
|
+
- app/views/phcpress/categories/index.html.erb
|
396
|
+
- app/views/phcpress/categories/new.html.erb
|
407
397
|
- app/views/phcpress/news/posts/_form.html.erb
|
408
398
|
- app/views/phcpress/news/posts/edit.html.erb
|
409
399
|
- app/views/phcpress/news/posts/index.html.erb
|
@@ -412,6 +402,7 @@ files:
|
|
412
402
|
- config/routes.rb
|
413
403
|
- db/migrate/20160316131626_create_phcpress_news_posts.rb
|
414
404
|
- db/migrate/20160316131650_create_phcpress_blog_posts.rb
|
405
|
+
- db/migrate/20160424211134_create_phcpress_categories.rb
|
415
406
|
- lib/phcpress.rb
|
416
407
|
- lib/phcpress/engine.rb
|
417
408
|
- lib/phcpress/version.rb
|
@@ -439,5 +430,5 @@ rubyforge_project:
|
|
439
430
|
rubygems_version: 2.5.1
|
440
431
|
signing_key:
|
441
432
|
specification_version: 4
|
442
|
-
summary: News & Blog Posts
|
433
|
+
summary: News & Blog Posts Engine
|
443
434
|
test_files: []
|