kuppayam 0.1.30 → 0.1.31

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: 4998ab221ce7a37eeaa2da7f93e5100d626c407b
4
- data.tar.gz: f7c4613e52dc060d0f0dea1f190728cb02971d8c
3
+ metadata.gz: cbe766f7291ba4a2f0af39c7049fc578f7371806
4
+ data.tar.gz: 6b1781e3efc6351968b04c793ea401669a36d3fc
5
5
  SHA512:
6
- metadata.gz: 3a629e6f1954c5812e734dd641aa324a3c011ec4af6ca58fedbcba8b1d4a227714574db288c47e92d17cc1301427616618994ddcb88128dc5e15567fdfeeb74d
7
- data.tar.gz: e9d20ca257f99469c3da36da0e940ad0e18cf48f58cb5f5b5827c0c95098b6034dae12385805d6cd1c07734e2375b303869b2d0ce096f338b46d9b0f998c0b29
6
+ metadata.gz: 0a747d97826f750374c1c212f2e72335ebab73230e8e7cc2d4e47eedfe5876716362198a3184e3142c252565f38a9db30072ffc459ac53b01583f1e7aecc84b0
7
+ data.tar.gz: 215aa34acd72a2078a454ad71d2436382a20cd6b559bda33060f6a55d63dc547c9c689ac17067cf223184908b02501a45450764635940c7156753deb20244892
@@ -148,8 +148,8 @@ module Kuppayam
148
148
  def get_image_configuration
149
149
  imageable = @image.imageable
150
150
  hsh = {}
151
- if imageable.respond_to?(:image_configuration)
152
- hsh = imageable.image_configuration[@image_type]
151
+ if imageable.class.respond_to?(:image_configuration)
152
+ hsh = imageable.class.image_configuration[@image_type]
153
153
  elsif @image.class.respond_to?(:image_configuration)
154
154
  hsh = @image.class.image_configuration
155
155
  else
@@ -20,7 +20,9 @@ class ImageUploader < CarrierWave::Uploader::Base
20
20
  Rails.root.join 'tmp/uploads'
21
21
  end
22
22
 
23
- #process :crop
23
+ process resize_to_limit: [2048, 2048]
24
+ process :optimize
25
+ # process :crop
24
26
 
25
27
  # version :large do
26
28
  # #process :crop
@@ -55,6 +57,18 @@ class ImageUploader < CarrierWave::Uploader::Base
55
57
  end
56
58
  end
57
59
 
60
+ def optimize
61
+ manipulate! do |img|
62
+ img.combine_options do |c|
63
+ c.strip
64
+ c.quality '85'
65
+ c.depth '8'
66
+ c.interlace 'Line'
67
+ end
68
+ img
69
+ end
70
+ end
71
+
58
72
  # Provide a default URL as a default if there hasn't been a file uploaded:
59
73
  # def default_url
60
74
  # # For Rails 3.1+ asset pipeline compatibility:
@@ -5,9 +5,28 @@
5
5
 
6
6
  <div class="modal-body">
7
7
 
8
+ <%# if @current_user.has_role?("Technical Admin") %>
9
+ <% unless @image.new_record? %>
10
+ <blockquote class="blockquote blockquote-warning">
11
+ <p><strong><i class="fa fa-download mr-5"></i>Download</strong></p>
12
+ <div class="row">
13
+ <% @image.image.versions.each do |k, v| %>
14
+ <% next unless @image.image %>
15
+ <div class="col-md-4" style="margin-top:10px;">
16
+ <%= link_to @image.image.versions[k].url, target: "_blank" do %>
17
+ <%= display_image(@image, "image.#{k}.url", width: "auto", height: "60px", style: "display:block; margin-left:auto; margin-right:auto;") %>
18
+ <div style="text-align: center;color: #4b4b4b;font-size:12px;padding:5px;"><%= k.to_s.titleize %></div>
19
+ <% end %>
20
+ </div>
21
+ <% end %>
22
+ </div>
23
+ </blockquote>
24
+ <% end %>
25
+ <%# end %>
26
+
8
27
  <!-- Display Instructions - Get instructions from the imageable settings else display default instructions -->
9
28
  <blockquote class="blockquote blockquote-warning">
10
- <p><strong><i class="linecons-lightbulb"></i><%= @form_sub_title %></strong></p>
29
+ <p><strong><i class="fa fa-lightbulb-o mr-5"></i><%= @form_sub_title %></strong></p>
11
30
  <ul>
12
31
  <% @form_instructions.each do |i| %>
13
32
  <li><%= raw i %></li>
@@ -1,7 +1,7 @@
1
1
  <div class="row">
2
2
  <% items.each do |key, values| %>
3
3
  <% next unless values[:has_permission] %>
4
- <div class="col-lg-2 col-md-3 col-sm-6 col-xs-12">
4
+ <div class="col-lg-2 col-md-3 col-sm-6 col-xs-6">
5
5
 
6
6
  <div class="xe-widget xe-vertical-counter xe-vertical-counter-white" data-count=".num" data-from="0" data-to="128" data-duration="4" style="min-height:230px;">
7
7
  <%= link_to values[:url] do %>
@@ -1,4 +1,4 @@
1
- <div class="sidebar-menu toggle-others fixed collapsed">
1
+ <div class="sidebar-menu toggle-others fixed">
2
2
 
3
3
  <div class="sidebar-menu-inner">
4
4
 
@@ -1,3 +1,3 @@
1
1
  module Kuppayam
2
- VERSION = '0.1.30'
2
+ VERSION = '0.1.31'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuppayam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-14 00:00:00.000000000 Z
11
+ date: 2017-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails