tkh_illustrations 0.9 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/app/controllers/illustrations_controller.rb +18 -10
- data/app/models/header.rb +10 -10
- data/app/models/illustration.rb +11 -10
- data/lib/tkh_illustrations/version.rb +1 -1
- data/lib/tkh_illustrations.rb +1 -1
- metadata +49 -34
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d959cb0c0ee4e29518bf52a69affaa3fef6622a
|
|
4
|
+
data.tar.gz: 21e0d9c7edb6121a0f0efba648b2d7ebc17f6f6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d99b19201c36a0eb27e80e98a9948fbb124d96e85d79b5f72bdf6c02bb7bac494b1132b633355b48e5a901cf842817e8c10c96f1a53c675579d69419d8e800f
|
|
7
|
+
data.tar.gz: c301088627b0426b2d41d14966f50a9e7b82586580bb5e0bd9d691a5b42eb7700248d2ffa52dad63921c78eb8e9b88f5a56d2876607866e9563ea4b5070f0d93
|
data/CHANGELOG.md
CHANGED
|
@@ -1,49 +1,57 @@
|
|
|
1
1
|
class IllustrationsController < ApplicationController
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
before_filter :authenticate
|
|
4
4
|
before_filter :authenticate_with_admin
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
def index
|
|
7
7
|
@illustrations = Illustration.by_recent.paginate(:page => params[:page], :per_page => 25)
|
|
8
8
|
switch_to_admin_layout
|
|
9
9
|
end
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
def show
|
|
12
12
|
@illustration = Illustration.find(params[:id])
|
|
13
13
|
switch_to_admin_layout
|
|
14
14
|
end
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
def new
|
|
17
17
|
@illustration = Illustration.new
|
|
18
18
|
switch_to_admin_layout
|
|
19
19
|
end
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
def edit
|
|
22
22
|
@illustration = Illustration.find(params[:id])
|
|
23
23
|
switch_to_admin_layout
|
|
24
24
|
end
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
def create
|
|
27
|
-
@illustration = Illustration.new(
|
|
27
|
+
@illustration = Illustration.new(illustration_params)
|
|
28
28
|
if @illustration.save
|
|
29
29
|
redirect_to @illustration, notice: t('illustrations.create.notice')
|
|
30
30
|
else
|
|
31
31
|
render action: "new", layout: 'admin'
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
def update
|
|
36
36
|
@illustration = Illustration.find(params[:id])
|
|
37
|
-
if @illustration.update_attributes(
|
|
37
|
+
if @illustration.update_attributes(illustration_params)
|
|
38
38
|
redirect_to @illustration, notice: t('illustrations.update.notice')
|
|
39
39
|
else
|
|
40
40
|
render action: "edit", layout: 'admin'
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
def destroy
|
|
45
45
|
@illustration = Illustration.find(params[:id])
|
|
46
46
|
@illustration.destroy
|
|
47
47
|
redirect_to illustrations_url
|
|
48
48
|
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
|
53
|
+
def illustration_params
|
|
54
|
+
params.require(:illustration).permit(:name, :image)
|
|
55
|
+
end
|
|
56
|
+
|
|
49
57
|
end
|
data/app/models/header.rb
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# this is needed for now to make mass assignment security compatible with the translation of globalize3
|
|
2
|
-
Globalize::ActiveRecord::Translation.class_eval do
|
|
3
|
-
|
|
4
|
-
end
|
|
2
|
+
# Globalize::ActiveRecord::Translation.class_eval do
|
|
3
|
+
# attr_accessible :locale
|
|
4
|
+
# end
|
|
5
5
|
|
|
6
6
|
class Header < ActiveRecord::Base
|
|
7
|
-
|
|
8
|
-
attr_accessible :photo, :name
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
# attr_accessible :photo, :name
|
|
9
|
+
|
|
10
10
|
validates_presence_of :name
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
translates :name
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
mount_uploader :photo, PhotoUploader
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
def to_param
|
|
17
17
|
name ? "#{id}-#{name.to_url}" : id
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
scope :by_recent,
|
|
20
|
+
scope :by_recent, -> { order('updated_at desc') }
|
|
21
21
|
end
|
data/app/models/illustration.rb
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
# this is needed for now to make mass assignment security compatible with the translation of globalize3
|
|
2
|
-
Globalize::ActiveRecord::Translation.class_eval do
|
|
3
|
-
|
|
4
|
-
end
|
|
2
|
+
# Globalize::ActiveRecord::Translation.class_eval do
|
|
3
|
+
# attr_accessible :locale
|
|
4
|
+
# end
|
|
5
5
|
|
|
6
6
|
class Illustration < ActiveRecord::Base
|
|
7
|
-
|
|
8
|
-
attr_accessible :image, :name
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
# attr_accessible :image, :name
|
|
9
|
+
|
|
10
10
|
validates_presence_of :name
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
translates :name
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
mount_uploader :image, ImageUploader
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
def to_param
|
|
17
17
|
name ? "#{id}-#{name.to_url}" : id
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
scope :by_recent,
|
|
20
|
+
scope :by_recent, -> { order('updated_at desc') }
|
|
21
|
+
scope :alphabetically, -> { order('name') }
|
|
21
22
|
end
|
data/lib/tkh_illustrations.rb
CHANGED
metadata
CHANGED
|
@@ -1,111 +1,125 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tkh_illustrations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Swami Atma
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 4.0.1
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 4.0.1
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: carrierwave
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - ~>
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0.9'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - ~>
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0.9'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rmagick
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: stringex
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: '0'
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: globalize
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 4.0.0
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 4.0.0
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: will_paginate
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
72
86
|
requirements:
|
|
73
|
-
- -
|
|
87
|
+
- - ">="
|
|
74
88
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
89
|
+
version: '0'
|
|
76
90
|
type: :runtime
|
|
77
91
|
prerelease: false
|
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
93
|
requirements:
|
|
80
|
-
- -
|
|
94
|
+
- - ">="
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
96
|
+
version: '0'
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
98
|
name: bootstrap-will_paginate
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
86
100
|
requirements:
|
|
87
|
-
- -
|
|
101
|
+
- - ">="
|
|
88
102
|
- !ruby/object:Gem::Version
|
|
89
103
|
version: '0'
|
|
90
104
|
type: :runtime
|
|
91
105
|
prerelease: false
|
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
107
|
requirements:
|
|
94
|
-
- -
|
|
108
|
+
- - ">="
|
|
95
109
|
- !ruby/object:Gem::Version
|
|
96
110
|
version: '0'
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: sqlite3
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
100
114
|
requirements:
|
|
101
|
-
- -
|
|
115
|
+
- - ">="
|
|
102
116
|
- !ruby/object:Gem::Version
|
|
103
117
|
version: '0'
|
|
104
118
|
type: :development
|
|
105
119
|
prerelease: false
|
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
121
|
requirements:
|
|
108
|
-
- -
|
|
122
|
+
- - ">="
|
|
109
123
|
- !ruby/object:Gem::Version
|
|
110
124
|
version: '0'
|
|
111
125
|
description: A Rails engine for carrierwave upload illustrations with minimum fuss.
|
|
@@ -115,6 +129,10 @@ executables: []
|
|
|
115
129
|
extensions: []
|
|
116
130
|
extra_rdoc_files: []
|
|
117
131
|
files:
|
|
132
|
+
- CHANGELOG.md
|
|
133
|
+
- MIT-LICENSE
|
|
134
|
+
- README.md
|
|
135
|
+
- Rakefile
|
|
118
136
|
- app/controllers/headers_controller.rb
|
|
119
137
|
- app/controllers/illustrations_controller.rb
|
|
120
138
|
- app/models/header.rb
|
|
@@ -145,17 +163,16 @@ files:
|
|
|
145
163
|
- lib/generators/tkh_illustrations/create_or_update_migrations/templates/create_headers.rb
|
|
146
164
|
- lib/generators/tkh_illustrations/create_or_update_migrations/templates/create_illustrations.rb
|
|
147
165
|
- lib/tasks/tkh_illustrations_tasks.rake
|
|
148
|
-
- lib/tkh_illustrations/version.rb
|
|
149
166
|
- lib/tkh_illustrations.rb
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
- CHANGELOG.md
|
|
167
|
+
- lib/tkh_illustrations/version.rb
|
|
168
|
+
- test/dummy/README.rdoc
|
|
169
|
+
- test/dummy/Rakefile
|
|
154
170
|
- test/dummy/app/assets/javascripts/application.js
|
|
155
171
|
- test/dummy/app/assets/stylesheets/application.css
|
|
156
172
|
- test/dummy/app/controllers/application_controller.rb
|
|
157
173
|
- test/dummy/app/helpers/application_helper.rb
|
|
158
174
|
- test/dummy/app/views/layouts/application.html.erb
|
|
175
|
+
- test/dummy/config.ru
|
|
159
176
|
- test/dummy/config/application.rb
|
|
160
177
|
- test/dummy/config/boot.rb
|
|
161
178
|
- test/dummy/config/database.yml
|
|
@@ -171,18 +188,16 @@ files:
|
|
|
171
188
|
- test/dummy/config/initializers/wrap_parameters.rb
|
|
172
189
|
- test/dummy/config/locales/en.yml
|
|
173
190
|
- test/dummy/config/routes.rb
|
|
174
|
-
- test/dummy/config.ru
|
|
175
191
|
- test/dummy/public/404.html
|
|
176
192
|
- test/dummy/public/422.html
|
|
177
193
|
- test/dummy/public/500.html
|
|
178
194
|
- test/dummy/public/favicon.ico
|
|
179
|
-
- test/dummy/Rakefile
|
|
180
|
-
- test/dummy/README.rdoc
|
|
181
195
|
- test/dummy/script/rails
|
|
182
196
|
- test/test_helper.rb
|
|
183
197
|
- test/tkh_illustrations_test.rb
|
|
184
198
|
homepage: https://github.com/allesklar/tkh_illustrations
|
|
185
|
-
licenses:
|
|
199
|
+
licenses:
|
|
200
|
+
- MIT
|
|
186
201
|
metadata: {}
|
|
187
202
|
post_install_message:
|
|
188
203
|
rdoc_options: []
|
|
@@ -190,17 +205,17 @@ require_paths:
|
|
|
190
205
|
- lib
|
|
191
206
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
207
|
requirements:
|
|
193
|
-
- -
|
|
208
|
+
- - ">="
|
|
194
209
|
- !ruby/object:Gem::Version
|
|
195
210
|
version: '0'
|
|
196
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
212
|
requirements:
|
|
198
|
-
- -
|
|
213
|
+
- - ">="
|
|
199
214
|
- !ruby/object:Gem::Version
|
|
200
215
|
version: '0'
|
|
201
216
|
requirements: []
|
|
202
217
|
rubyforge_project:
|
|
203
|
-
rubygems_version: 2.0
|
|
218
|
+
rubygems_version: 2.2.0
|
|
204
219
|
signing_key:
|
|
205
220
|
specification_version: 4
|
|
206
221
|
summary: Rails engine for carrierwave illustrations.
|