lalala 4.1.0.dev.342 → 4.1.0.dev.355
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lalala/base.js +1 -1
- data/app/assets/javascripts/lalala/modules/input_group.module.js +36 -0
- data/app/assets/stylesheets/lalala/components/_forms.css.scss +34 -0
- data/app/assets/stylesheets/lalala/modules/_title-bar.css.scss +17 -0
- data/lib/lalala/admin/pages.rb +16 -1
- data/lib/lalala/version.rb +1 -1
- data/test/dummy/app/admin/articles.rb +2 -0
- data/test/dummy/app/models/article.rb +1 -1
- data/test/dummy/db/migrate/20140926152646_add_pre_and_postpend_test_columns_to_articles.rb +6 -0
- data/test/dummy/db/schema.rb +23 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13a743bef666720edcb001f00581985995ea7d3e
|
4
|
+
data.tar.gz: d7954e8b380b8fb860ad9be7594d305f6752ee84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d2580ecb6c7c71e8b2ab312985d373dcd22b05efd1ad7d64518845d822cf2153c2e494b5c39bcc548d6108f294b9a56b6385d8e7d06a7dd83d2f7c5dbf329f5
|
7
|
+
data.tar.gz: 0c1087b6925649a282010692d47db2bdaa8bafd07b55ec485bef8c5e07d24c225644b0a7baba2cabb7cb13ffbd04fd81820f123c8c3393ce872e856b45454e25
|
@@ -0,0 +1,36 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Append or prepend placeholders to certain inputs
|
5
|
+
*/
|
6
|
+
|
7
|
+
exports.init = function () {
|
8
|
+
$('.js-prepend-placeholder[placeholder], .js-append-placeholder[placeholder]').each(function () {
|
9
|
+
var $this = $(this);
|
10
|
+
replace_input_with_group($this, $this.attr('placeholder'), $this.hasClass('js-append-placeholder'));
|
11
|
+
});
|
12
|
+
}
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Replace an <input> element with an appended/prepended placeholder
|
16
|
+
* @param {jQuery} $input
|
17
|
+
* @param {string} placeholder
|
18
|
+
* @param {optional} {bool} reverse - false: prepend, true: append (default false)
|
19
|
+
* @return {jQuery} The new input group
|
20
|
+
*/
|
21
|
+
function replace_input_with_group ($input, placeholder, reverse) {
|
22
|
+
var placeholder = placeholder || '',
|
23
|
+
reverse = (typeof reverse === 'undefined') ? false : reverse,
|
24
|
+
span_class = !!reverse ? 'input-append' : 'input-prepend',
|
25
|
+
$clone = $input.clone(),
|
26
|
+
$input_group = $('<div class="input-group"></div>'),
|
27
|
+
$prepend = $('<span class="' + span_class + '">' + placeholder + '</span>');
|
28
|
+
|
29
|
+
$prepend.prependTo($input_group);
|
30
|
+
$clone.attr('placeholder', '')
|
31
|
+
.appendTo($input_group);
|
32
|
+
$input.replaceWith($input_group);
|
33
|
+
$clone.css(!!reverse ? 'padding-right' : 'padding-left', (parseInt($clone.css('padding-right'), 10) + parseInt($prepend.outerWidth(), 10)) + 'px');
|
34
|
+
|
35
|
+
return $input_group;
|
36
|
+
}
|
@@ -260,3 +260,37 @@ select:focus {
|
|
260
260
|
.chosen-container {
|
261
261
|
margin-top: 4px;
|
262
262
|
}
|
263
|
+
|
264
|
+
.input-group {
|
265
|
+
display: inline-block;
|
266
|
+
position: relative;
|
267
|
+
width: $input_width;
|
268
|
+
|
269
|
+
input {
|
270
|
+
width: 100%;
|
271
|
+
}
|
272
|
+
|
273
|
+
.input-prepend,
|
274
|
+
.input-append {
|
275
|
+
background-color: rgb(220, 220, 220);
|
276
|
+
color: rgb(110, 110, 110);
|
277
|
+
bottom: 0;
|
278
|
+
line-height: 2.875;
|
279
|
+
padding: 0 15px;
|
280
|
+
position: absolute;
|
281
|
+
text-shadow: 0 1px 0 rgb(240, 240, 240);
|
282
|
+
top: 0;
|
283
|
+
}
|
284
|
+
|
285
|
+
.input-prepend {
|
286
|
+
border-top-left-radius: 5px;
|
287
|
+
border-bottom-left-radius: 5px;
|
288
|
+
left: 0;
|
289
|
+
}
|
290
|
+
|
291
|
+
.input-append {
|
292
|
+
border-top-right-radius: 5px;
|
293
|
+
border-bottom-right-radius: 5px;
|
294
|
+
right: 0;
|
295
|
+
}
|
296
|
+
}
|
data/lib/lalala/admin/pages.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
if defined?(ActiveAdmin) and defined?(ApplicationPage)
|
2
2
|
ActiveAdmin.register ApplicationPage, :as => 'Page' do
|
3
|
-
|
4
3
|
menu priority: 20, html_options: { class: 'icon-page' }
|
5
4
|
|
6
5
|
config.filters = false
|
7
6
|
config.paginate = false
|
7
|
+
config.clear_action_items!
|
8
8
|
|
9
|
+
#
|
10
|
+
# Index
|
11
|
+
#
|
9
12
|
index as: :tree_table, paginator: false, download_links: false do
|
10
13
|
selectable_column
|
11
14
|
|
@@ -44,6 +47,10 @@ if defined?(ActiveAdmin) and defined?(ApplicationPage)
|
|
44
47
|
|
45
48
|
end
|
46
49
|
|
50
|
+
|
51
|
+
#
|
52
|
+
# Form
|
53
|
+
#
|
47
54
|
form do |f|
|
48
55
|
h = "".html_safe
|
49
56
|
if f.object.new_record?
|
@@ -54,6 +61,10 @@ if defined?(ActiveAdmin) and defined?(ApplicationPage)
|
|
54
61
|
h
|
55
62
|
end
|
56
63
|
|
64
|
+
|
65
|
+
#
|
66
|
+
# Order action
|
67
|
+
#
|
57
68
|
collection_action :order, :method => :put do
|
58
69
|
unless Array === params[:ordered_ids]
|
59
70
|
render status: 422
|
@@ -68,6 +79,10 @@ if defined?(ActiveAdmin) and defined?(ApplicationPage)
|
|
68
79
|
render json: { status: "OK" }, status: 200
|
69
80
|
end
|
70
81
|
|
82
|
+
|
83
|
+
#
|
84
|
+
# Controller
|
85
|
+
#
|
71
86
|
controller do
|
72
87
|
|
73
88
|
def new
|
data/lib/lalala/version.rb
CHANGED
@@ -13,6 +13,8 @@ ActiveAdmin.register Article do
|
|
13
13
|
f.input :body
|
14
14
|
f.input :tags
|
15
15
|
f.input :category, as: :select, collection: %w(A B C)
|
16
|
+
f.input :url, input_html: { placeholder: 'http://', class: 'js-prepend-placeholder' }
|
17
|
+
f.input :price, input_html: { placeholder: '€', class: 'js-append-placeholder' }
|
16
18
|
f.input :poster_image, as: :single_file
|
17
19
|
|
18
20
|
f.input :images, as: :multiple_files do |h|
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20140926152646) do
|
15
15
|
|
16
16
|
create_table "active_admin_comments", :force => true do |t|
|
17
17
|
t.string "resource_id", :null => false
|
@@ -60,10 +60,12 @@ ActiveRecord::Schema.define(:version => 20140228141749) do
|
|
60
60
|
add_index "article_translations", ["locale"], :name => "index_article_translations_on_locale"
|
61
61
|
|
62
62
|
create_table "articles", :force => true do |t|
|
63
|
-
t.text "haraway_metadata"
|
64
63
|
t.datetime "created_at", :null => false
|
65
64
|
t.datetime "updated_at", :null => false
|
66
65
|
t.string "category"
|
66
|
+
t.text "haraway_metadata"
|
67
|
+
t.string "url"
|
68
|
+
t.string "price"
|
67
69
|
end
|
68
70
|
|
69
71
|
create_table "articles_tags", :id => false, :force => true do |t|
|
@@ -73,6 +75,25 @@ ActiveRecord::Schema.define(:version => 20140228141749) do
|
|
73
75
|
|
74
76
|
add_index "articles_tags", ["article_id", "tag_id"], :name => "index_articles_tags_on_article_id_and_tag_id", :unique => true
|
75
77
|
|
78
|
+
create_table "asset_translations", :force => true do |t|
|
79
|
+
t.string "locale"
|
80
|
+
t.integer "asset_id"
|
81
|
+
t.string "title"
|
82
|
+
t.text "caption"
|
83
|
+
end
|
84
|
+
|
85
|
+
create_table "assets", :force => true do |t|
|
86
|
+
t.string "asset"
|
87
|
+
t.string "type"
|
88
|
+
t.integer "asset_owner_id"
|
89
|
+
t.string "asset_owner_type"
|
90
|
+
t.string "asset_owner_section"
|
91
|
+
t.datetime "created_at", :null => false
|
92
|
+
t.datetime "updated_at", :null => false
|
93
|
+
end
|
94
|
+
|
95
|
+
add_index "assets", ["asset_owner_id", "asset_owner_type", "asset_owner_section"], :name => "asset_owner_idx"
|
96
|
+
|
76
97
|
create_table "page_hierarchies", :id => false, :force => true do |t|
|
77
98
|
t.integer "ancestor_id", :null => false
|
78
99
|
t.integer "descendant_id", :null => false
|
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.1.0.dev.
|
4
|
+
version: 4.1.0.dev.355
|
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: 2014-09-
|
16
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: activeadmin
|
@@ -1307,6 +1307,7 @@ files:
|
|
1307
1307
|
- app/assets/javascripts/lalala/modules/editor.module.js
|
1308
1308
|
- app/assets/javascripts/lalala/modules/file-metadata.module.js
|
1309
1309
|
- app/assets/javascripts/lalala/modules/helpers.module.js
|
1310
|
+
- app/assets/javascripts/lalala/modules/input_group.module.js
|
1310
1311
|
- app/assets/javascripts/lalala/modules/locale_chooser.module.js
|
1311
1312
|
- app/assets/javascripts/lalala/modules/login.module.js
|
1312
1313
|
- app/assets/javascripts/lalala/modules/media_selector.module.js
|
@@ -1535,6 +1536,7 @@ files:
|
|
1535
1536
|
- test/dummy/db/migrate/20131122165715_create_tags.rb
|
1536
1537
|
- test/dummy/db/migrate/20131122170308_add_articles_tags_binding.rb
|
1537
1538
|
- test/dummy/db/migrate/20140228141749_create_media_page.rb
|
1539
|
+
- test/dummy/db/migrate/20140926152646_add_pre_and_postpend_test_columns_to_articles.rb
|
1538
1540
|
- test/dummy/db/schema.rb
|
1539
1541
|
- test/dummy/lib/assets/.gitkeep
|
1540
1542
|
- test/dummy/log/.gitkeep
|
@@ -1639,6 +1641,7 @@ test_files:
|
|
1639
1641
|
- test/dummy/db/migrate/20131122165715_create_tags.rb
|
1640
1642
|
- test/dummy/db/migrate/20131122170308_add_articles_tags_binding.rb
|
1641
1643
|
- test/dummy/db/migrate/20140228141749_create_media_page.rb
|
1644
|
+
- test/dummy/db/migrate/20140926152646_add_pre_and_postpend_test_columns_to_articles.rb
|
1642
1645
|
- test/dummy/db/schema.rb
|
1643
1646
|
- test/dummy/lib/assets/.gitkeep
|
1644
1647
|
- test/dummy/log/.gitkeep
|