lalala 4.0.0.dev.114 → 4.0.0.dev.116

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: 9a1fad3d77c965bd1802434f7178f03407ddcaa0
4
- data.tar.gz: ea76065b4866879a8fd9dc794eca8ae489f7d73b
3
+ metadata.gz: 320e3ccbb7e876b90dfdedde5009021a5e19c93d
4
+ data.tar.gz: 83aa07124ba072c6f9013447d6a265adf2547ae0
5
5
  SHA512:
6
- metadata.gz: cb9105e8848057d62e27b1d8cb99970d7f7ca511ccf1dc932c3500e15ffd1064d57b5637ea78edbf3a85182d1b8be401d475b7f46d258b41cbdcd9baa1a6c16d
7
- data.tar.gz: 40bdd34d506aff22ad8376d75fccd7f63e27d08e62a0b9e1b69874bd8c5664dd40f3702a4d54c9e85ddc379ee47a75e008d12429d652baf0f894a7c05c2bee51
6
+ metadata.gz: e9adf760f8062960f9c26b970656843f1b5342efe518ebb46c0f8690843128f32d85969b073c0c237cc6756ee737f60110850fef88b52c1fddafc5c731872c80
7
+ data.tar.gz: a0b1f393209726a0cf501390dc9f920a9bd62513c8b312b54d3ab645e4153677a087e7c652e3e9a556fb567b9fdb26ff53867d06782620449a75a73e2e58c0d4
@@ -39,8 +39,9 @@ Grid = (function() {
39
39
  fragment = document.createDocumentFragment();
40
40
 
41
41
  // transform images html
42
- $grid.find("li").not(":last-child").each(function() {
42
+ $grid.find("li.asset").not(":last-child").each(function() {
43
43
  var grid_piece = document.createElement("li");
44
+ grid_piece.className = "asset";
44
45
  grid_piece.innerHTML = this.innerHTML.replace("<a", "<a class=\"image\"");
45
46
  var overlay = document.createElement("div");
46
47
  overlay.className = "overlay";
@@ -177,7 +178,7 @@ Grid = (function() {
177
178
  var grid = this;
178
179
 
179
180
  this.$el.selectable({
180
- filter: "li",
181
+ filter: "li.asset",
181
182
  cancel: ".actions,.button,input,textarea,button",
182
183
  selecting: function(e, ui) {
183
184
  $row = $(ui.selecting);
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  // [row]
24
- li {
24
+ .asset {
25
25
  float: left;
26
26
  margin: 0 11px 11px 0;
27
27
  position: relative;
@@ -34,36 +34,42 @@
34
34
  &.move,
35
35
  &.properties,
36
36
  &.selected,
37
- &.will-destroy { .overlay { display: block; }}
37
+ &.will-destroy {
38
+ .overlay { display: block; }
39
+ }
40
+
41
+ &.edit-block .attributes {
42
+ display: block;
43
+ }
38
44
  }
39
45
 
40
46
  // [row]:types
41
- li.move label { cursor: move; }
42
- li.properties { cursor: pointer; }
43
- li.selected .overlay { background: rgba($yellow, .5); }
44
- li.will-destroy .overlay,
45
- li.selected.will-destroy .overlay { background: rgba($red, .5); }
47
+ .asset.move label { cursor: move; }
48
+ .asset.properties { cursor: pointer; }
49
+ .asset.selected .overlay { background: rgba($yellow, .5); }
50
+ .asset.will-destroy .overlay,
51
+ .asset.selected.will-destroy .overlay { background: rgba($red, .5); }
46
52
 
47
53
  // image + overlay
48
- li .image,
49
- li .overlay {
54
+ .asset .image,
55
+ .asset .overlay {
50
56
  left: 0;
51
57
  position: absolute;
52
58
  top: 0;
53
59
  }
54
60
 
55
- li .image {
61
+ .asset .image {
56
62
  z-index: 0;
57
63
  }
58
64
 
59
- li .overlay {
65
+ .asset .overlay {
60
66
  background: rgba(black, .5);
61
67
  display: none;
62
68
  z-index: 1;
63
69
  }
64
70
 
65
71
  // [row].edit-block
66
- li.edit-block {
72
+ .asset.edit-block {
67
73
  clear: both;
68
74
  height: auto;
69
75
  min-height: 100px;
@@ -71,7 +77,7 @@
71
77
  }
72
78
 
73
79
  // label
74
- li label {
80
+ .asset label {
75
81
  @include border-radius(2px);
76
82
  background: #fff;
77
83
  bottom: 6px;
@@ -90,22 +96,29 @@
90
96
  }
91
97
 
92
98
  // attributes
93
- li .attributes { display: none; position: relative }
94
- li.edit-block .attributes { display: block }
99
+ .asset .attributes { display: none; position: relative }
95
100
 
96
- li .attributes input,
97
- li .attributes textarea {
101
+ .asset .attributes input,
102
+ .asset .attributes textarea {
98
103
  margin-bottom: 6px;
99
104
  margin-left: 115px;
100
105
  resize: none;
101
106
  width: 300px;
102
107
  }
103
108
 
104
- li .attributes textarea {
109
+ .asset .attributes textarea {
105
110
  height: 100px !important;
106
111
  }
107
112
 
108
- li .attributes .close-button {
113
+ .asset .attributes li {
114
+ margin: 0;
115
+ }
116
+
117
+ .asset .attributes label {
118
+ display: none;
119
+ }
120
+
121
+ .asset .attributes .close-button {
109
122
  color: #c5c5c5;
110
123
  cursor: pointer;
111
124
  display: inline-block;
@@ -2,6 +2,8 @@ class Lalala::AbstractAsset < ActiveRecord::Base
2
2
  self.abstract_class = true
3
3
  self.table_name = "assets"
4
4
 
5
+ include Lalala::ExtActiveRecord::I18nTranslationsWriter
6
+
5
7
  attr_accessible :asset, :title, :caption
6
8
  translates :title, :caption
7
9
  Lalala::AbstractAsset::Translation.table_name = 'asset_translations'
@@ -7,30 +7,20 @@ class Formtastic::Inputs::GridInput
7
7
 
8
8
  image_model_class = object.class.reflect_on_association(method).class_name.constantize
9
9
  image_attributes = image_model_class.accessible_attributes.to_a
10
- image_attributes.select! { |x| x.size > 0 and x != "asset" }
10
+ image_attributes.select! { |x| x.size > 0 and !%w(asset translations_writer).include?(x) }
11
11
 
12
12
  ul = template.content_tag :ul do
13
13
  html = template.raw("")
14
14
 
15
15
  assets.each_with_index do |asset, idx|
16
- html += template.content_tag :li do
16
+ html += template.content_tag :li, class: "asset" do
17
17
  builder.fields_for(method, asset) do |f|
18
18
  thumbnail_html = template.image_tag f.object.asset.lalala_thumb.url
19
19
  asset_html = template.raw("")
20
20
  asset_html << template.link_to(thumbnail_html, f.object.asset.url)
21
- asset_html << template.content_tag(:div, { class: "attributes" }) do
21
+ asset_html << template.content_tag(:ol, { class: "attributes" }) do
22
22
  inputs = image_attributes.map do |ia|
23
- if image_model_class.columns_hash[ia]
24
- column_type = image_model_class.columns_hash[ia].type
25
- elsif image_model_class.translation_class.columns_hash[ia]
26
- column_type = image_model_class.translation_class.columns_hash[ia].type
27
- end
28
-
29
- case column_type
30
- when :string then f.text_field(ia.to_sym, placeholder: ia)
31
- when :text then f.text_area(ia.to_sym, placeholder: ia)
32
- when :boolean then f.check_box(ia.to_sym)
33
- end
23
+ f.input ia.to_sym, placeholder: ia
34
24
  end
35
25
 
36
26
  template.raw(inputs.join) + template.content_tag(
@@ -34,7 +34,6 @@ module Lalala::ExtI18n::InputHelper
34
34
  I18n.locale = locale
35
35
  @object_name = "#{_object_name}[translations_writer][#{locale}]"
36
36
 
37
-
38
37
  opts[:wrapper_html][:'data-locale'] = locale.to_s
39
38
 
40
39
  h << super(method, opts)
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "114"
3
+ BUILD = "116"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.114
4
+ version: 4.0.0.dev.116
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-05-06 00:00:00.000000000 Z
16
+ date: 2013-05-08 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: carrierwave