inline_forms 1.6.15 → 1.6.16
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.
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
# not needed here, since this is only used in the views InlineForms::SPECIAL_COLUMN_TYPES[:info]=:string
|
3
|
+
|
4
|
+
def pdf_link_show(object, attribute)
|
5
|
+
# the attribute is the action
|
6
|
+
"#{link_to 'preview', "/#{attribute}/#{object.id}", :class => "pdf_preview"} #{link_to 'pdf', "/#{attribute}/#{object.id}.pdf", :class => "pdf_open"}".html_safe
|
7
|
+
end
|
8
|
+
|
9
|
+
def pdf_link_edit(object, attribute)
|
10
|
+
o = object.send(attribute)
|
11
|
+
o = o.to_s + " (" + distance_of_time_in_words_to_now(o) + ")" if o.is_a?(Time)
|
12
|
+
o = o._presentation if o.respond_to?(:_presentation)
|
13
|
+
o
|
14
|
+
end
|
15
|
+
|
16
|
+
def pdf_link_update(object, attribute)
|
17
|
+
# do absolutely nothing
|
18
|
+
end
|
19
|
+
|
20
|
+
module ActionView::Helpers::DateHelper
|
21
|
+
|
22
|
+
def distance_of_time_in_words_to_now_with_future(from_time, include_seconds = false)
|
23
|
+
if from_time > Time.now()
|
24
|
+
'in ' + distance_of_time_in_words_to_now_without_future(from_time, include_seconds)
|
25
|
+
else
|
26
|
+
distance_of_time_in_words_to_now_without_future(from_time, include_seconds) + ' ago'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
alias_method_chain :distance_of_time_in_words_to_now, :future
|
31
|
+
|
32
|
+
end
|
33
|
+
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rvm
|
@@ -253,6 +253,7 @@ files:
|
|
253
253
|
- lib/app/helpers/form_elements/image_field.rb
|
254
254
|
- lib/app/helpers/form_elements/info.rb
|
255
255
|
- lib/app/helpers/form_elements/money_field.rb
|
256
|
+
- lib/app/helpers/form_elements/pdf_link.rb
|
256
257
|
- lib/app/helpers/form_elements/plain_text_area.rb
|
257
258
|
- lib/app/helpers/form_elements/question_list.rb
|
258
259
|
- lib/app/helpers/form_elements/radio_button.rb
|