web_admin 0.0.2 → 0.1.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
  SHA1:
3
- metadata.gz: 8987bef5efca3d3218126df73a2bc4f69dc4f7d6
4
- data.tar.gz: 75291bc15dcad0a1cd7acd3a64ed0a009fc3c12e
3
+ metadata.gz: d53f2e09f6183db4a48a6ef9a6f91a2bd08e9f48
4
+ data.tar.gz: 79e2afdf2c53240e3c0336cb4eecb476c5c4eeba
5
5
  SHA512:
6
- metadata.gz: 0da68603c6467917c590805b243001acafd4fad7455eedd72342aa828c142624ddd8272d7cb50143619004883d9c64d59c684b96211433d4324dfbb8ac47df1d
7
- data.tar.gz: 39adc5c721deb7a4251a6c139224dc55cdf751525f8925d675cfd43ffe2b1f439788256decbe1aacc03442db02863fdaa19fe23adb7aeb98ad6469f6e925d433
6
+ metadata.gz: 70c5d1199214946e7c75704fa56c9fcb154cd046a07f11f7e5a25dd1e1bf6d392fa3daf1fa614ae7156d43ecf270ad9072e66aff267ee2bf81dc0409f2c472fd
7
+ data.tar.gz: 50d7c8b822747679ad6f79d8b86886e77d782901028005842a4d61e4037642b4b32ef8b0192ab114244095fdacc9a28fcb2fe5f9ab3ec03fc1382b99461f28ad
@@ -12,7 +12,7 @@ PATH
12
12
  jquery-fileupload-rails
13
13
  less-rails (~> 2.6.0)
14
14
  mini_magick
15
- rails (~> 4.1.6)
15
+ rails (>= 4.1.6)
16
16
  responders
17
17
  rmagick
18
18
  simple_form
@@ -70,7 +70,7 @@ GEM
70
70
  mime-types (>= 1.16)
71
71
  childprocess (0.5.5)
72
72
  ffi (~> 1.0, >= 1.0.11)
73
- ckeditor (4.1.1)
73
+ ckeditor (4.1.2)
74
74
  cocaine
75
75
  orm_adapter (~> 0.5.0)
76
76
  climate_control (0.0.3)
@@ -82,7 +82,7 @@ GEM
82
82
  colored (1.2)
83
83
  commonjs (0.2.7)
84
84
  database_cleaner (1.3.0)
85
- devise (3.4.1)
85
+ devise (3.5.1)
86
86
  bcrypt (~> 3.0)
87
87
  orm_adapter (~> 0.1)
88
88
  railties (>= 3.2.6, < 5)
@@ -91,10 +91,10 @@ GEM
91
91
  warden (~> 1.2.3)
92
92
  diff-lcs (1.2.5)
93
93
  docile (1.1.5)
94
- enumerate_it (1.2.3)
94
+ enumerate_it (1.2.8)
95
95
  activesupport (>= 3.0.0)
96
96
  erubis (2.7.0)
97
- excon (0.45.1)
97
+ excon (0.45.4)
98
98
  factory_girl (4.5.0)
99
99
  activesupport (>= 3.0.0)
100
100
  factory_girl_rails (4.5.0)
@@ -103,12 +103,13 @@ GEM
103
103
  ffi (1.9.6)
104
104
  fission (0.5.0)
105
105
  CFPropertyList (~> 2.2)
106
- fog (1.29.0)
106
+ fog (1.32.0)
107
107
  fog-atmos
108
- fog-aws (~> 0.0)
108
+ fog-aws (>= 0.6.0)
109
109
  fog-brightbox (~> 0.4)
110
- fog-core (~> 1.27, >= 1.27.4)
111
- fog-ecloud
110
+ fog-core (~> 1.32)
111
+ fog-ecloud (= 0.1.1)
112
+ fog-google (>= 0.0.2)
112
113
  fog-json
113
114
  fog-local
114
115
  fog-powerdns (>= 0.1.1)
@@ -128,16 +129,16 @@ GEM
128
129
  fog-atmos (0.1.0)
129
130
  fog-core
130
131
  fog-xml
131
- fog-aws (0.1.2)
132
+ fog-aws (0.7.3)
132
133
  fog-core (~> 1.27)
133
134
  fog-json (~> 1.0)
134
135
  fog-xml (~> 0.1)
135
136
  ipaddress (~> 0.8)
136
- fog-brightbox (0.7.1)
137
+ fog-brightbox (0.7.2)
137
138
  fog-core (~> 1.22)
138
139
  fog-json
139
140
  inflecto (~> 0.0.2)
140
- fog-core (1.30.0)
141
+ fog-core (1.32.0)
141
142
  builder
142
143
  excon (~> 0.45)
143
144
  formatador (~> 0.2)
@@ -147,16 +148,20 @@ GEM
147
148
  fog-ecloud (0.1.1)
148
149
  fog-core
149
150
  fog-xml
150
- fog-json (1.0.1)
151
+ fog-google (0.0.7)
152
+ fog-core
153
+ fog-json
154
+ fog-xml
155
+ fog-json (1.0.2)
151
156
  fog-core (~> 1.0)
152
- multi_json (~> 1.0)
157
+ multi_json (~> 1.10)
153
158
  fog-local (0.2.1)
154
159
  fog-core (~> 1.27)
155
160
  fog-powerdns (0.1.1)
156
161
  fog-core (~> 1.27)
157
162
  fog-json (~> 1.0)
158
163
  fog-xml (~> 0.1)
159
- fog-profitbricks (0.0.2)
164
+ fog-profitbricks (0.0.3)
160
165
  fog-core
161
166
  fog-xml
162
167
  nokogiri
@@ -174,7 +179,7 @@ GEM
174
179
  fog-serverlove (0.1.2)
175
180
  fog-core
176
181
  fog-json
177
- fog-softlayer (0.4.5)
182
+ fog-softlayer (0.4.7)
178
183
  fog-core
179
184
  fog-json
180
185
  fog-storm_on_demand (0.1.1)
@@ -199,9 +204,10 @@ GEM
199
204
  i18n (~> 0.6)
200
205
  inflecto (0.0.2)
201
206
  ipaddress (0.8.0)
202
- jquery-fileupload-rails (0.4.1)
207
+ jquery-fileupload-rails (0.4.5)
203
208
  actionpack (>= 3.1)
204
209
  railties (>= 3.1)
210
+ sass (>= 3.2)
205
211
  jquery-rails (3.1.2)
206
212
  railties (>= 3.0, < 5.0)
207
213
  thor (>= 0.14, < 2.0)
@@ -213,12 +219,12 @@ GEM
213
219
  less-rails (2.6.0)
214
220
  actionpack (>= 3.1)
215
221
  less (~> 2.6.0)
216
- libv8 (3.16.14.7)
222
+ libv8 (3.16.14.11)
217
223
  mail (2.6.3)
218
224
  mime-types (>= 1.16, < 3)
219
225
  method_source (0.8.2)
220
226
  mime-types (2.4.3)
221
- mini_magick (4.2.1)
227
+ mini_magick (4.2.7)
222
228
  mini_portile (0.6.2)
223
229
  minitest (5.4.2)
224
230
  multi_json (1.11.0)
@@ -257,10 +263,10 @@ GEM
257
263
  rake (>= 0.8.7)
258
264
  thor (>= 0.18.1, < 2.0)
259
265
  rake (10.3.2)
260
- ref (1.0.5)
266
+ ref (2.0.0)
261
267
  responders (1.1.2)
262
268
  railties (>= 3.2, < 4.2)
263
- rmagick (2.13.4)
269
+ rmagick (2.15.2)
264
270
  rspec-core (3.1.7)
265
271
  rspec-support (~> 3.1.0)
266
272
  rspec-expectations (3.1.2)
@@ -278,6 +284,7 @@ GEM
278
284
  rspec-support (~> 3.1.0)
279
285
  rspec-support (3.1.2)
280
286
  rubyzip (1.1.6)
287
+ sass (3.4.13)
281
288
  selenium-webdriver (2.43.0)
282
289
  childprocess (~> 0.5)
283
290
  multi_json (~> 1.0)
@@ -300,7 +307,7 @@ GEM
300
307
  actionpack (>= 3.0)
301
308
  activesupport (>= 3.0)
302
309
  sprockets (>= 2.8, < 4.0)
303
- therubyracer (0.12.1)
310
+ therubyracer (0.12.2)
304
311
  libv8 (~> 3.16.14.0)
305
312
  ref
306
313
  thor (0.19.1)
@@ -13,3 +13,11 @@
13
13
  *= require_tree .
14
14
  *= require_self
15
15
  */
16
+
17
+ .right{
18
+ text-align: right !important;
19
+ }
20
+
21
+ img{
22
+ padding: 15px;
23
+ }
@@ -3,7 +3,7 @@ class WebAdmin::EventsController < WebAdmin::CrudController
3
3
  protected
4
4
 
5
5
  def permitted_params
6
- params.require(:event).permit(:id, :title, :start_date, :end_date,
6
+ params.require(:event).permit(:id, :title, :start_date, :end_date, :image,
7
7
  :description, :street, :zipcode, :number, :neighborhood, :city, :state)
8
8
  end
9
9
  end
@@ -1,6 +1,7 @@
1
1
  module WebAdmin
2
2
  class Event < ActiveRecord::Base
3
3
  include I18n::Alchemy
4
+ mount_uploader :image, ImageEventUploader
4
5
 
5
6
  validates :title, :start_date, :end_date, :description, presence: true
6
7
  validate :end_date_is_greater_than_start_date
@@ -0,0 +1,55 @@
1
+ # encoding: utf-8
2
+ module WebAdmin
3
+ class ImageEventUploader < CarrierWave::Uploader::Base
4
+
5
+ # Include RMagick or MiniMagick support:
6
+ include CarrierWave::RMagick
7
+ # include CarrierWave::MiniMagick
8
+
9
+ # Choose what kind of storage to use for this uploader:
10
+ # storage :file
11
+ storage :fog
12
+
13
+ # Override the directory where uploaded files will be stored.
14
+ # This is a sensible default for uploaders that are meant to be mounted:
15
+ def store_dir
16
+ "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
17
+ end
18
+
19
+ # Provide a default URL as a default if there hasn't been a file uploaded:
20
+ # def default_url
21
+ # # For Rails 3.1+ asset pipeline compatibility:
22
+ # # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
23
+ #
24
+ # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
25
+ # end
26
+
27
+ # Process files as they are uploaded:
28
+ # process :scale => [200, 300]
29
+ #
30
+ # def scale(width, height)
31
+ # # do something
32
+ # end
33
+
34
+ # Create different versions of your uploaded files:
35
+ # version :thumb do
36
+ # process :resize_to_fit => [50, 50]
37
+ # end
38
+ version :thumb do
39
+ process :resize_to_fit => [80, nil]
40
+ end
41
+
42
+ # Add a white list of extensions which are allowed to be uploaded.
43
+ # For images you might use something like this:
44
+ # def extension_white_list
45
+ # %w(jpg jpeg gif png)
46
+ # end
47
+
48
+ # Override the filename of the uploaded files:
49
+ # Avoid using model.id or version_name here, see uploader/store.rb for details.
50
+ # def filename
51
+ # "something.jpg" if original_filename
52
+ # end
53
+
54
+ end
55
+ end
@@ -2,10 +2,16 @@
2
2
  <div class="col-md-12">
3
3
  <div class="panel">
4
4
  <div class="panel-body">
5
- <%= simple_form_for @object, html: { class: "form-horizontal", role: "form"} do |f| %>
5
+ <%= simple_form_for @object, html: { class: "form-horizontal", role: "form", multipart: true} do |f| %>
6
+
7
+ <div class="col-md-12 right">
8
+ <%= image_tag f.object.image.url(:thumb), class: "right" if f.object.image.present? %>
9
+ </div>
6
10
 
7
11
  <%= f.input :title, input_html: { class: 'col-md-8' } %>
8
12
 
13
+ <%= f.input :image, input_html: { class: "col-md-6" } %>
14
+
9
15
  <%= f.input :start_date, as: :string, :input_html => { class: "datetime" } %>
10
16
 
11
17
  <%= f.input :end_date, as: :string, :input_html => { class: "datetime" } %>
@@ -37,6 +37,7 @@ pt-BR:
37
37
  web_admin/event:
38
38
  title: "Título"
39
39
  start_date: "Início às"
40
+ image: "Imagem"
40
41
  end_date: "Término às"
41
42
  description: "Descrição"
42
43
  zipcode: "CEP"
@@ -0,0 +1,5 @@
1
+ class AddImageToWebAdminEvents < ActiveRecord::Migration
2
+ def change
3
+ add_column :web_admin_events, :image, :string
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module WebAdmin
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -13,6 +13,7 @@ feature WebAdmin::Event do
13
13
  click_link 'Novo'
14
14
 
15
15
  fill_in 'Título', with: "Evento 1"
16
+ attach_file('Selecione o(s) arquivo(s)', "spec/fixtures/p3-single.jpg")
16
17
  fill_in 'Início às', with: '30/01/2015 21:00'
17
18
  fill_in 'Término às', with: '31/01/2015 00:00'
18
19
  fill_in 'Descrição', with: 'Descrição do evento 1'
@@ -11,11 +11,41 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20150510191213) do
14
+ ActiveRecord::Schema.define(version: 20150725151008) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"
18
18
 
19
+ create_table "admin_web_posts", force: true do |t|
20
+ t.integer "user_id", null: false
21
+ t.string "title", null: false
22
+ t.string "abstract"
23
+ t.text "body", null: false
24
+ t.string "image"
25
+ t.datetime "created_at"
26
+ t.datetime "updated_at"
27
+ end
28
+
29
+ add_index "admin_web_posts", ["user_id"], name: "index_admin_web_posts_on_user_id", using: :btree
30
+
31
+ create_table "admin_web_users", force: true do |t|
32
+ t.string "email", default: "", null: false
33
+ t.string "encrypted_password", default: "", null: false
34
+ t.string "reset_password_token"
35
+ t.datetime "reset_password_sent_at"
36
+ t.datetime "remember_created_at"
37
+ t.integer "sign_in_count", default: 0, null: false
38
+ t.datetime "current_sign_in_at"
39
+ t.datetime "last_sign_in_at"
40
+ t.string "current_sign_in_ip"
41
+ t.string "last_sign_in_ip"
42
+ t.datetime "created_at"
43
+ t.datetime "updated_at"
44
+ end
45
+
46
+ add_index "admin_web_users", ["email"], name: "index_admin_web_users_on_email", unique: true, using: :btree
47
+ add_index "admin_web_users", ["reset_password_token"], name: "index_admin_web_users_on_reset_password_token", unique: true, using: :btree
48
+
19
49
  create_table "ckeditor_assets", force: true do |t|
20
50
  t.string "data_file_name", null: false
21
51
  t.string "data_content_type"
@@ -53,6 +83,7 @@ ActiveRecord::Schema.define(version: 20150510191213) do
53
83
  t.string "state", null: false
54
84
  t.datetime "created_at"
55
85
  t.datetime "updated_at"
86
+ t.string "image"
56
87
  end
57
88
 
58
89
  create_table "web_admin_images", force: true do |t|
Binary file
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
19
19
 
20
20
 
21
- s.add_dependency "rails", "~> 4.1.6"
21
+ s.add_dependency "rails", ">= 4.1.6"
22
22
  s.add_dependency "simple_form"
23
23
  s.add_dependency "devise"
24
24
  s.add_dependency "ckeditor"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devworks Soluções e Tecnologia
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.1.6
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
26
  version: 4.1.6
27
27
  - !ruby/object:Gem::Dependency
@@ -351,6 +351,7 @@ files:
351
351
  - app/models/web_admin/video.rb
352
352
  - app/uploaders/ckeditor_attachment_file_uploader.rb
353
353
  - app/uploaders/ckeditor_picture_uploader.rb
354
+ - app/uploaders/web_admin/image_event_uploader.rb
354
355
  - app/uploaders/web_admin/image_post_uploader.rb
355
356
  - app/uploaders/web_admin/image_uploader.rb
356
357
  - app/views/devise/confirmations/new.html.erb
@@ -426,6 +427,7 @@ files:
426
427
  - db/migrate/20141224221959_create_admin_web_events.rb
427
428
  - db/migrate/20150130140502_create_admin_web_permissions.rb
428
429
  - db/migrate/20150510191213_rename_tables.rb
430
+ - db/migrate/20150719130224_add_image_to_web_admin_events.rb
429
431
  - lib/application_responder.rb
430
432
  - lib/tasks/web_admin_tasks.rake
431
433
  - lib/templates/erb/scaffold/_form.html.erb
@@ -503,6 +505,7 @@ files:
503
505
  - spec/test_app/spec/factories/admin_web_users.rb
504
506
  - spec/test_app/spec/factories/permissions.rb
505
507
  - web_admin-0.0.1.gem
508
+ - web_admin-0.0.2.gem
506
509
  - web_admin.gemspec
507
510
  - wercker.yml
508
511
  homepage: http://www.devworks.net.br