adminpanel 0.0.6.1 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/adminpanel/sessions_controller.rb +1 -2
- data/app/helpers/adminpanel/images_helper.rb +10 -0
- data/app/models/adminpanel/image.rb +11 -4
- data/app/uploaders/adminpanel/image_uploader.rb +0 -5
- data/app/views/adminpanel/products/_image_fields.html.erb +1 -1
- data/app/views/layouts/_top_bar.html.erb +4 -2
- data/app/views/layouts/admin-login.html.erb +1 -0
- data/config/locales/es.yml +1 -0
- data/lib/adminpanel/version.rb +1 -1
- data/spec/uploaders/image_uploader_spec.rb +0 -6
- metadata +2 -4
- data/app/views/layouts/sessions.html.erb +0 -11
- data/spec/models/image_uploader.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: f89ba58112b29a75f227a8d2220d5d53e86de71b
|
4
|
-
data.tar.gz: df1e26ec3b6fb85782c1876dcdc9a866c8126e99
|
5
2
|
SHA512:
|
6
|
-
|
7
|
-
|
3
|
+
data.tar.gz: c1b2563a9b1c4c707c9653e0361a2fe667e1e06d4187d1191ae29b7f188ccd861ab5d231881e158266f1481a0b9c5b6920b317e96c6a227aab085d3e18c41dd0
|
4
|
+
metadata.gz: 7c5526de8b8d50f76261a7b6973ec949020ad24da0dd6fc53c76394f135d526819f48304dfc186e69584acbfd318de30845d0021c48140016cebe0ab808440c8
|
5
|
+
SHA1:
|
6
|
+
data.tar.gz: a985bd1a3f33365906afb35f48d872c1829952cf
|
7
|
+
metadata.gz: 1a829db829744d3dc281b3ac16ecd74618855d84
|
@@ -1,8 +1,15 @@
|
|
1
1
|
module Adminpanel
|
2
2
|
class Image < ActiveRecord::Base
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
extend ImagesHelper
|
4
|
+
|
5
|
+
attr_accessible :file, :foreign_key, :model
|
6
|
+
validates_presence_of :model
|
7
|
+
validates_presence_of :file
|
8
|
+
|
9
|
+
if is_class?("ProductUploader")
|
10
|
+
mount_uploader :file, ProductUploader
|
11
|
+
else
|
12
|
+
mount_uploader :file, Adminpanel::ImageUploader
|
13
|
+
end
|
7
14
|
end
|
8
15
|
end
|
@@ -5,7 +5,6 @@ module Adminpanel
|
|
5
5
|
# Include RMagick or MiniMagick support:
|
6
6
|
include CarrierWave::RMagick
|
7
7
|
# include CarrierWave::MiniMagick
|
8
|
-
|
9
8
|
# Choose what kind of storage to use for this uploader:
|
10
9
|
storage :file
|
11
10
|
# storage :fog
|
@@ -38,10 +37,6 @@ module Adminpanel
|
|
38
37
|
process :resize_to_fill => [468, 312]
|
39
38
|
end
|
40
39
|
|
41
|
-
version :tiny do
|
42
|
-
process :resize_to_fill => [460, 307]
|
43
|
-
end
|
44
|
-
|
45
40
|
# Create different versions of your uploaded files:
|
46
41
|
version :thumb do
|
47
42
|
process :resize_to_limit => [220, 220]
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</div>
|
8
8
|
<% end %>
|
9
9
|
<div class="control-group">
|
10
|
-
<%= f.label t("model.Image"), :class => "control-label" %>
|
10
|
+
<%= f.label t("model.Adminpanel::Image"), :class => "control-label" %>
|
11
11
|
<div class="controls">
|
12
12
|
<%= f.file_field :file %>
|
13
13
|
<%= f.hidden_field :model, :value => model_name %>
|
@@ -4,11 +4,13 @@
|
|
4
4
|
<div class="logo">
|
5
5
|
<%= link_to image_tag("logo.png", :alt => "PCP del Sureste"), root_path %>
|
6
6
|
</div>
|
7
|
+
<% if signed_in? %>
|
7
8
|
<a class="btn btn-navbar visible-phone" data-toggle="collapse" data-target=".nav-collapse">
|
8
9
|
<span class="icon-bar"></span>
|
9
10
|
<span class="icon-bar"></span>
|
10
11
|
<span class="icon-bar"></span>
|
11
12
|
</a>
|
13
|
+
<% end %>
|
12
14
|
<a class="btn btn-navbar slide_menu_left visible-tablet">
|
13
15
|
<span class="icon-bar"></span>
|
14
16
|
<span class="icon-bar"></span>
|
@@ -26,16 +28,16 @@
|
|
26
28
|
</li>
|
27
29
|
</ul>
|
28
30
|
</div>
|
29
|
-
|
31
|
+
|
30
32
|
<div class="top-menu visible-phone visible-tablet">
|
31
33
|
<ul class="pull-right">
|
32
34
|
<li>
|
33
35
|
<% if signed_in? %>
|
34
36
|
<%= link_to content_tag('i', nil, :class => 'icon-off'), signout_path, :method => "delete", :title => 'Logout', :id => "signout-button" %>
|
35
|
-
<% end %>
|
36
37
|
</li>
|
37
38
|
</ul>
|
38
39
|
</div>
|
40
|
+
<% end %>
|
39
41
|
|
40
42
|
</div>
|
41
43
|
</div>
|
data/config/locales/es.yml
CHANGED
data/lib/adminpanel/version.rb
CHANGED
@@ -28,10 +28,4 @@ describe Adminpanel::ImageUploader do
|
|
28
28
|
@image_uploader.portfolio.should be_no_larger_than(468, 312)
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
32
|
-
context 'the tiny version' do
|
33
|
-
it "should scale down a landscape image to fit within 400 by 307 pixels" do
|
34
|
-
@image_uploader.tiny.should have_dimensions(460, 307)
|
35
|
-
end
|
36
|
-
end
|
37
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adminpanel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jose Ramon Camacho
|
@@ -266,6 +266,7 @@ files:
|
|
266
266
|
- app/controllers/adminpanel/sessions_controller.rb
|
267
267
|
- app/controllers/adminpanel/users_controller.rb
|
268
268
|
- app/helpers/adminpanel/application_helper.rb
|
269
|
+
- app/helpers/adminpanel/images_helper.rb
|
269
270
|
- app/helpers/adminpanel/sessions_helper.rb
|
270
271
|
- app/helpers/custom_form_builder.rb
|
271
272
|
- app/models/adminpanel/category.rb
|
@@ -315,7 +316,6 @@ files:
|
|
315
316
|
- app/views/layouts/_top_bar.html.erb
|
316
317
|
- app/views/layouts/admin-login.html.erb
|
317
318
|
- app/views/layouts/admin.html.erb
|
318
|
-
- app/views/layouts/sessions.html.erb
|
319
319
|
- app/views/shared/_breadcrumb.html.erb
|
320
320
|
- app/views/shared/_error_messages.html.erb
|
321
321
|
- config/database.yml
|
@@ -369,7 +369,6 @@ files:
|
|
369
369
|
- spec/features/product_pages_spec.rb
|
370
370
|
- spec/models/category_spec.rb
|
371
371
|
- spec/models/gallery_spec.rb
|
372
|
-
- spec/models/image_uploader.rb
|
373
372
|
- spec/models/product_spec.rb
|
374
373
|
- spec/models/section_spec.rb
|
375
374
|
- spec/models/user_spec.rb
|
@@ -449,7 +448,6 @@ test_files:
|
|
449
448
|
- spec/features/product_pages_spec.rb
|
450
449
|
- spec/models/category_spec.rb
|
451
450
|
- spec/models/gallery_spec.rb
|
452
|
-
- spec/models/image_uploader.rb
|
453
451
|
- spec/models/product_spec.rb
|
454
452
|
- spec/models/section_spec.rb
|
455
453
|
- spec/models/user_spec.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<% content_for :login do %>
|
2
|
-
<div class="row-fluid">
|
3
|
-
<div class="span12">
|
4
|
-
<div class="row-fluid">
|
5
|
-
<%= yield %>
|
6
|
-
</div><!--/row-fluid-->
|
7
|
-
<%= debug(params) if Rails.env.development? %>
|
8
|
-
</div><!--/span10-->
|
9
|
-
</div><!--/row-fluid-->
|
10
|
-
<% end %>
|
11
|
-
<%= render :template => 'layouts/admin' %>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Adminpanel::Image do
|
4
|
-
before do
|
5
|
-
@image = Adminpanel::Image.new(
|
6
|
-
:file => "Test file"
|
7
|
-
)
|
8
|
-
end
|
9
|
-
|
10
|
-
subject { @image }
|
11
|
-
|
12
|
-
it { should respond_to(:file) }
|
13
|
-
it { should respond_to(:foreign_key) }
|
14
|
-
it { should respond_to(:model) }
|
15
|
-
|
16
|
-
describe "when file is not present" do
|
17
|
-
before {@image.file = " "}
|
18
|
-
it {should_not be_valid}
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "when model is not present" do
|
22
|
-
before {@image.model = " "}
|
23
|
-
it {should_not be_valid}
|
24
|
-
end
|
25
|
-
end
|