interview 0.0.9 → 0.0.10

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: a79c351a953b407088c70c6686535f16980de03e
4
- data.tar.gz: 2715694c6c5444764247942612506e19921b4390
3
+ metadata.gz: e0987d22cba5baabe541a7ae501b86bccda646af
4
+ data.tar.gz: 1cb566e1b6476cdc43db858886d308fb9eb6a3bf
5
5
  SHA512:
6
- metadata.gz: e12ba218332bfac951c2d76f15262cd50b1e1f7f48f4299955441b6aefa3912e49562cfe20997ad688b86d8ed25f24bee13fa0062cc1c4bd131380695e31dd2f
7
- data.tar.gz: 671e31446ed9a9843030ddb389671ab48aa842e31f2281c02585890a3c01e49576177f432439a57262a1c604d10da1029f9bcbfbd134a9bdf2732e85a40d4e87
6
+ metadata.gz: 3b65f38a45783254b969e4e5c0d2f14f059a2481f62eccec699d0e1d57b59afd523c163816f50483a0ed50d848950abbc36bdc0ec2ff7addebeeb2e973c76e6a
7
+ data.tar.gz: 81d1359df3bc2f486dc044f59dd67dda765729669a06c1b388c1df4e2bd527edff4e9b6a99de679f70cd8b9abae6b014267de2051be78c398abb425c3e5ce00f
@@ -100,7 +100,7 @@ jQuery ->
100
100
  done: (e, data) ->
101
101
  $(this).closest('.image_attribute_container').find('.upload_buffer_id').attr('value', data.result.id)
102
102
  $(this).closest('.image_attribute_container').find('.image').attr('src', data.result.thumb_url)
103
-
103
+
104
104
  $('.nested_form_add_images').fileupload
105
105
  add: (e, data) ->
106
106
  types = /(\.|\/)(gif|jpe?g|png|mov|mpeg|mpeg4|avi)$/i
@@ -111,9 +111,9 @@ jQuery ->
111
111
  $(this).closest('.nested_form_container').append(data.context)
112
112
  data.context.find('.progress').collapse('show')
113
113
  bind_remove_links()
114
- $("input[name='_method']").attr('name', 'x_method')
114
+ $("input[name='_method']").attr('name', '__method')
115
115
  data.submit()
116
- $("input[name='x_method']").attr('name', '_method')
116
+ $("input[name='__method']").attr('name', '_method')
117
117
  else
118
118
  alert("#{file.name} is not a gif, jpg or png image file")
119
119
  progress: (e, data) ->
@@ -122,4 +122,11 @@ jQuery ->
122
122
  data.context.find('.bar').css('width', progress + '%')
123
123
  done: (e, data) ->
124
124
  data.context.find('.upload_buffer_id').attr('value', data.result.id)
125
- data.context.find('.image').attr('src', data.result.thumb_url)
125
+ data.context.find('.image').attr('src', data.result.thumb_url)
126
+
127
+ $('.nested_form').each ->
128
+ nested_form = $(this)
129
+ upload_buffer_id = $(this).find('.upload_buffer_id').attr('value')
130
+ if upload_buffer_id
131
+ $.getJSON "upload_buffers/#{upload_buffer_id}.json", (data) ->
132
+ nested_form.find('.image').attr('src', data.thumb_url)
@@ -1,12 +1,10 @@
1
1
  module Interview
2
2
  class ImageAttribute < Attribute
3
3
 
4
- # - Bild muss in eingener Klasse ausgelagert werden
5
- # - object muss die Methode method_id= implementieren
6
- # - method_id muss als parameter erlaubt werden
4
+ # - Modul UploadBuffer muss für write vorhanden sein
7
5
  # - json ansicht auf bild muss vorhanden sein
8
6
 
9
- attr_accessor :object, :submethod, :image_style, :hide_if_not_exists
7
+ attr_accessor :image_style, :hide_if_not_exists, :object
10
8
 
11
9
  def render_read
12
10
  image_style = @image_style || :thumb
@@ -17,10 +15,10 @@ module Interview
17
15
  opts = {class: "image_#{image_style}"}
18
16
  opts[:class] += ' ' + @html_class.join(' ') unless @html_class.empty? or @surrounding_tag
19
17
  html.div opts do
20
- if value.nil?
21
- html << h.image_tag('missing_thumb.png', class: 'image img-responsive')
22
- else
18
+ if value
23
19
  html << h.image_tag(value.url(image_style), class: 'image img-responsive')
20
+ else
21
+ html << h.image_tag('missing_thumb.png', class: 'image img-responsive')
24
22
  end
25
23
  end
26
24
  return html.target!
@@ -55,48 +53,6 @@ module Interview
55
53
  end
56
54
  end
57
55
  return html.target!
58
-
59
- # object = @object || find_attribute(:object)
60
- # submethod = @submethod || 'attachment'
61
- # image_style = @image_style || :thumb
62
- # image = object.send(@method) || object.association(@method).build
63
- # attachment = image.send(submethod)
64
- # model = image.class.model_name.singular
65
- #
66
- # html = Builder::XmlMarkup.new
67
- #
68
- # html << form_builder.hidden_field("#{@method.singularize}_id", class: 'image-id')
69
- #
70
- # html.div class: 'inline-block' do
71
- # html << h.image_tag(attachment.url(image_style), id: 'image-tag')
72
- # end
73
- #
74
- # html.div class: 'inline-block' do
75
- # html.span class: "btn btn-default fileinput-button" do
76
- # html.span "Select file..."
77
- # html << h.file_field_tag("#{model}[#{submethod}]", class: 'image-upload',
78
- # data: {url: "/#{model.pluralize}.json", type: 'POST'})
79
- # end
80
- #
81
- # # if attachment.exists?
82
- # # html << form_builder.check_box("destroy_#{@method}")
83
- # # html.text! ' Datei löschen'
84
- # # end
85
- # end
86
- #
87
- # html.div id: 'upload-progress' do
88
- # end
89
- #
90
- # html.script id: 'upload-progress-script', type: 'text/x-tmpl' do
91
- # html.div class: 'upload' do
92
- # html.text! "{%=o.name%}"
93
- # html.div class: 'progress' do
94
- # html.div '', class: 'progress-bar bar', style: 'width: 0%'
95
- # end
96
- # end
97
- # end
98
- #
99
- # return html.target!
100
56
  end
101
57
 
102
58
  end
@@ -7,7 +7,6 @@ module Interview
7
7
 
8
8
  def render
9
9
  objects = @objects || find_attribute!(:objects)
10
- puts "objects: #{objects.size}"
11
10
  html = Builder::XmlMarkup.new
12
11
  objects.each do |object|
13
12
  @object = object
@@ -19,25 +19,6 @@ module Interview
19
19
  end
20
20
  end
21
21
  end
22
-
23
- # html.a class: 'pull-left', href: '#' do
24
- # html << h.image_tag(object.send(@image_method.to_sym).url(image_size), class: 'media-object')
25
- # end
26
- # html.div class: 'media-body' do
27
- # html.h4 object.send(@heading_method.to_sym), class: 'media-heading' if @heading_method
28
- # @controls.each do |control|
29
- # html << control.render
30
- # end
31
- # if @children_method
32
- # object.send(@children_method).each do |child_object|
33
- # @object = child_object
34
- # media_object = MediaObject.new(parent: self, image_method: @image_method, heading_method: @heading_method, children_method: @children_method)
35
- # media_object.add_controls(self.controls)
36
- # html << media_object.render
37
- # end
38
- # end
39
- # end
40
- # end
41
22
  return html.target!
42
23
  end
43
24
 
@@ -1,3 +1,3 @@
1
1
  module Interview
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
data/lib/interview.rb CHANGED
@@ -114,7 +114,6 @@ module ActiveRecord
114
114
  elsif filter.respond_to? :each
115
115
  result = filter_combination_to_sql(filter)
116
116
  end # todo: else
117
- puts result.first
118
117
  return result
119
118
  end
120
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannes Köhler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-16 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler