poodle-rb 0.0.4 → 0.0.5

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: ad966d80727051aa1ec66cda0512b8ff140a4885
4
- data.tar.gz: e689a93766d9f7035eaf8b416a48427a683e1836
3
+ metadata.gz: 148d0f4cd6fb2c57e9b8e00fa0f2fecc475f333a
4
+ data.tar.gz: 29df628f0d01994f956cd73ea4a58b6c9394d418
5
5
  SHA512:
6
- metadata.gz: 5d0a5fef71c59114fc9696b871916941a34902e0c685c560e296be0ea3cdb969cdbaace2377c3f14fc38a10f316e7ba8d45f04af8634cdadfac201854c49075b
7
- data.tar.gz: eb67ab043e93d61d230b01cfb886c5f21d041ddf5b288e3dd5c69b918de5c8a5a09f27513636f02abf417e737883ab13fb3be00854bb41339ed427cfc283a1ad
6
+ metadata.gz: 805334ef3bc567ec4fe2f93eef62df67a08af93f29f781955c247aaf5a6da2306db769a4d6bf2feca18bdd57d39ed22b1817a7ca1bad971518d96e7197217e98
7
+ data.tar.gz: e29766968915d98137d0717eb2b1631e20aa720a1bf0af1e23f4dfec78b26720a01bd7eaeb5b14b7666faca189761c1ac525d9b2abab86e89336b5e7456cf990
@@ -248,34 +248,6 @@ module Poodle
248
248
  :display_footer => false}) if display
249
249
  end
250
250
 
251
- # Example
252
- # theme_image(@project, admin_project_path(@project), :url, "logo.image.url")
253
- # is equivalent to:
254
- # ---------------------------
255
- # <% change_picture_url = upload_image_link(@project, admin_project_path(@project), :logo) %>
256
- # <% img_tag = display_image(@project, "logo.image.url", width: "100%", place_holder: {width: 300, height: 180, text: "<No Image>"}) %>
257
- # <%= link_to img_tag, change_picture_url, :remote => true %>
258
- # <%= link_to raw("<i class=\"fa fa-photo mr-5\"></i> Change Picture"), change_picture_url, :class=>"btn btn-default btn-xs mt-10", :remote=>true %>
259
- def theme_image(object, url, assoc_name, assoc_url, options={})
260
- options.reverse_merge!(
261
- width: "100%",
262
- ph: {
263
- width: 300,
264
- height: 180,
265
- text: "<No Image>"
266
- },
267
- remote: true,
268
- text: "Change Image",
269
- icon: "photo",
270
- classes: "btn btn-default btn-xs mt-10"
271
- )
272
- change_picture_url = upload_image_link(object, url, assoc_name)
273
- img_tag = display_image(object, assoc_url, width: options[:width], place_holder: options[:ph])
274
- btn_display = raw(theme_fa_icon(options[:icon])+theme_button_text(options[:text]))
275
- link_to(img_tag, change_picture_url, :remote => options[:remote]) +
276
- link_to(btn_display, change_picture_url, :class=>options[:classes], :remote=>options[:remote])
277
- end
278
-
279
251
  # Example
280
252
  # theme_panel_heading(@project.name)
281
253
  # is equivalent to:
@@ -305,6 +277,33 @@ module Poodle
305
277
  content_tag(:div, text, class: classes)
306
278
  end
307
279
 
280
+ # Example
281
+ # theme_image(@project, admin_project_path(@project), :url, "logo.image.url", change_picture_url: change_picture_url)
282
+ # is equivalent to:
283
+ # ---------------------------
284
+ # <% img_tag = display_image(@project, "logo.image.url", width: "100%", place_holder: {width: 300, height: 180, text: "<No Image>"}) %>
285
+ # <%= link_to img_tag, change_picture_url, :remote => true %>
286
+ # <%= link_to raw("<i class=\"fa fa-photo mr-5\"></i> Change Picture"), change_picture_url, :class=>"btn btn-default btn-xs mt-10", :remote=>true %>
287
+ def theme_image(object, url, assoc_name, assoc_url, **options)
288
+ options.reverse_merge!(
289
+ width: "100%",
290
+ ph: {
291
+ width: 300,
292
+ height: 180,
293
+ text: "<No Image>"
294
+ },
295
+ remote: true,
296
+ text: "Change Image",
297
+ icon: "photo",
298
+ classes: "btn btn-default btn-xs mt-10",
299
+ change_picture_url: nil
300
+ )
301
+ img_tag = display_image(object, assoc_url, width: options[:width], place_holder: options[:ph])
302
+ btn_display = raw(theme_fa_icon(options[:icon])+theme_button_text(options[:text]))
303
+ link_to(img_tag, options[:change_picture_url], :remote => options[:remote]) +
304
+ link_to(btn_display, options[:change_picture_url], :class=>options[:classes], :remote=>options[:remote])
305
+ end
306
+
308
307
  # Example
309
308
  # theme_user_image(@user, @role)
310
309
  # is equivalent to:
@@ -1,3 +1,3 @@
1
1
  module Poodle
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poodle-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krishnaprasad Varma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails