spina-reviews 0.0.3 → 0.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/spina/admin/reviews_controller.rb +9 -2
- data/app/decorators/controllers/spina/pages_controller_decorator.rb +1 -1
- data/app/models/spina/review.rb +4 -0
- data/app/views/spina/admin/reviews/_form.html.haml +1 -1
- data/app/views/spina/admin/reviews/index.html.haml +17 -4
- data/config/routes.rb +5 -1
- data/lib/spina/reviews/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15e7ee2f3cd3d7f6d1bbf5416dd627e2b54484d4
|
4
|
+
data.tar.gz: acbe2d25563a87f70d93b620a7d8dfb6c62d01ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 985cd25cf5b7e0c95f1bc73f5b30694d7d88a1c52e1ff229de216031a685043652e1a7d512429587e8524b964d2eb5a64580577145cf144e99a8cc5340ade981
|
7
|
+
data.tar.gz: b5e0b1c654e00a1c44469503c54efd23d9ffdb6d250bbb2cd645f38c4d2d791fd04f9a8e3b171a5155efeaff3c328f4cc02cf99a017d162fec789bd576f23236
|
@@ -10,7 +10,7 @@ module Spina
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def index
|
13
|
-
@reviews = Review.
|
13
|
+
@reviews = Review.ordered
|
14
14
|
@average_rating = Review.average('rating') || 0
|
15
15
|
end
|
16
16
|
|
@@ -54,6 +54,13 @@ module Spina
|
|
54
54
|
redirect_to spina.admin_reviews_url, notice: "De beoordeling is verwijderd."
|
55
55
|
end
|
56
56
|
|
57
|
+
def confirm
|
58
|
+
@review = Review.find(params[:id])
|
59
|
+
@review.confirmed_at = Date.today
|
60
|
+
@review.save
|
61
|
+
redirect_to spina.admin_reviews_url
|
62
|
+
end
|
63
|
+
|
57
64
|
private
|
58
65
|
|
59
66
|
def set_breadcrumb
|
@@ -61,7 +68,7 @@ module Spina
|
|
61
68
|
end
|
62
69
|
|
63
70
|
def review_params
|
64
|
-
params.require(:review).permit(:name, :rating, :created_at, :explanation)
|
71
|
+
params.require(:review).permit(:name, :rating, :created_at, :explanation, :confirmed_at)
|
65
72
|
end
|
66
73
|
end
|
67
74
|
end
|
data/app/models/spina/review.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
.select-dropdown= f.select :rating, [["1 ster", 1], ["2 sterren", 2], ["3 sterren", 3], ["4 sterren", 4], ["5 sterren", 5]]
|
18
18
|
%tr
|
19
19
|
%td
|
20
|
-
Datum
|
20
|
+
Datum beoordeling
|
21
21
|
%td
|
22
22
|
= f.text_field :created_at, value: (@review.created_at.strftime("%d-%m-%Y") unless @review.new_record?), placeholder: "Datum van beoordeling", class: 'datepicker'
|
23
23
|
%tr
|
@@ -8,6 +8,7 @@
|
|
8
8
|
%table.table
|
9
9
|
%thead
|
10
10
|
%tr
|
11
|
+
%th
|
11
12
|
%th Naam
|
12
13
|
%th Beoordeling
|
13
14
|
%th
|
@@ -16,18 +17,30 @@
|
|
16
17
|
- if @reviews.any?
|
17
18
|
- @reviews.each do |review|
|
18
19
|
%tr
|
20
|
+
%td
|
21
|
+
- if review.confirmed_at.present?
|
22
|
+
%label.label.label-success
|
23
|
+
Live
|
24
|
+
- else
|
25
|
+
%label.label
|
26
|
+
Concept
|
19
27
|
%td.nowrap
|
20
28
|
= review.name
|
21
29
|
%small= time_ago_in_words(review.created_at) + " geleden"
|
22
30
|
%td
|
23
31
|
.rating
|
24
32
|
- review.rating.times do
|
25
|
-
%i{
|
33
|
+
%i.icon.icon-check{style: 'color: #ffb500'}
|
26
34
|
- (5 - review.rating).times do
|
27
|
-
%i.icon-dimmed{
|
35
|
+
%i.icon-dimmed.icon.icon-check{style: 'color: #ccc'}
|
28
36
|
%p= review.explanation
|
29
|
-
%td.nowrap
|
30
|
-
|
37
|
+
%td.nowrap.align-right
|
38
|
+
- if review.confirmed_at.nil?
|
39
|
+
= link_to spina.confirm_admin_review_path(review), class: 'button button-mini button-primary', data: {method: :post, confirm: "Weet je zeker dat je deze beoordeling wilt publiceren op de website?"} do
|
40
|
+
= icon('check')
|
41
|
+
Publiceer
|
42
|
+
= link_to spina.edit_admin_review_path(review), class: 'button button-link' do
|
43
|
+
= icon('pencil-outline')
|
31
44
|
|
32
45
|
- else
|
33
46
|
%tr
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spina-reviews
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bram Jetten
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.4.5
|
119
|
+
rubygems_version: 2.4.5.1
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Review system for Spina
|