lalala 4.0.0.dev.224 → 4.0.0.dev.227

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7314e8f7a9befcc525c6329eeba49e2b2086ac9
4
- data.tar.gz: 8e22778b81fc3a18e08931add4f53da8a11aa6d2
3
+ metadata.gz: 94648eedf5496e82cbc5b2162f1d736b48f73bc7
4
+ data.tar.gz: 8781740443196720d4f4492d871e21227b985105
5
5
  SHA512:
6
- metadata.gz: 511a431c0045a716b6cd1a1814e36045dfb00262246c32dcc09c4d9fb8d003f915198322f56b3a9299f57a8a24a12a56de43d045aa96f4ea872e3480c8d9c297
7
- data.tar.gz: 408a133d383a8c593b37e12389237d7318f8a18c5fd3afa6ae359e34009978dec815e9ff1f055e42a72aa9cdc78ec576da3b3696812e10591cf84f3ce7758030
6
+ metadata.gz: 38ba27b9a21af7e08ba2bf636df44a7d09fff9e22a5ecb58618f6d83e88dedd68136a287f79e30406faf5b074da82973c2435c7234b19379e3e9c6cdcb6a0313
7
+ data.tar.gz: 6fc2e359ab825ff6ace2f2c34aa76f56d51e5df9277a15cb5acf2184c59e66b83e2696308a9dd512f398b793f80af666a9f2bf1c72e87368b1b6cec14ef42517
@@ -6,10 +6,15 @@
6
6
  @import "lalala/base/base";
7
7
  @import "lalala/base/layout";
8
8
 
9
+ @import "lalala/lib/jquery-ui";
10
+ @import "lalala/lib/chosen";
11
+ @import "lalala/lib/pikaday";
12
+
9
13
  @import "lalala/components/icons";
10
14
  @import "lalala/components/forms";
11
15
  @import "lalala/components/buttons";
12
16
  @import "lalala/components/tables";
17
+ @import "lalala/components/chosen-lalala";
13
18
 
14
19
  @import "lalala/modules/flashes";
15
20
  @import "lalala/modules/login";
@@ -28,7 +33,3 @@
28
33
  @import "lalala/modules/editor";
29
34
  @import "lalala/modules/editor-cheatsheet";
30
35
  @import "lalala/modules/grid";
31
-
32
- @import "lalala/lib/jquery-ui";
33
- @import "lalala/lib/chosen";
34
- @import "lalala/lib/pikaday";
@@ -2,7 +2,8 @@
2
2
  $white: rgb(255,255,255);
3
3
  $black: rgb(35,31,32);
4
4
  $gray_lighter: rgb(211,211,211);
5
- $yellow: rgb(255,204,100);
5
+ $yellow: rgb(255,202,19);
6
+ $orange: rgb(255,168,0);
6
7
  $blue: rgb(31,115,255);
7
8
  $red: rgb(225,70,62);
8
9
 
@@ -0,0 +1,289 @@
1
+ /* @group Base */
2
+ .chosen-container {
3
+ position: relative;
4
+ display: inline-block;
5
+ vertical-align: middle;
6
+ font-size: 13px;
7
+ zoom: 1;
8
+ *display: inline;
9
+ -webkit-user-select: none;
10
+ -moz-user-select: none;
11
+ user-select: none;
12
+ }
13
+ .chosen-container .chosen-drop {
14
+ position: absolute;
15
+ top: 100%;
16
+ left: -9999px;
17
+ z-index: 1010;
18
+ -webkit-box-sizing: border-box;
19
+ -moz-box-sizing: border-box;
20
+ box-sizing: border-box;
21
+ width: 100%;
22
+ border: 1px solid $yellow;
23
+ border-top: 0;
24
+ background: #fff;
25
+ @include box-shadow(transparentize($yellow, .2) 0 0 5px);
26
+ }
27
+ .chosen-container.chosen-with-drop .chosen-drop {
28
+ left: 0;
29
+ }
30
+ .chosen-container a {
31
+ cursor: pointer;
32
+ }
33
+
34
+ /* @end */
35
+ /* @group Single Chosen */
36
+ .chosen-container-single .chosen-single {
37
+ position: relative;
38
+ display: block;
39
+ overflow: hidden;
40
+ padding: 5px 6px 5px 8px;
41
+ border: 1px solid gray(200);
42
+ border-radius: 5px;
43
+ background-color: #fff;
44
+ background: none;
45
+ background-clip: padding-box;
46
+ box-shadow: none;
47
+ color: #444;
48
+ text-decoration: none;
49
+ white-space: nowrap;
50
+ line-height: 24px;
51
+ }
52
+ .chosen-container-single .chosen-default {
53
+ color: #999;
54
+ }
55
+ .chosen-container-single .chosen-single span {
56
+ display: block;
57
+ overflow: hidden;
58
+ margin-right: 26px;
59
+ text-overflow: ellipsis;
60
+ white-space: nowrap;
61
+ }
62
+ .chosen-container-single .chosen-single-with-deselect span {
63
+ margin-right: 38px;
64
+ }
65
+ .chosen-container-single .chosen-single abbr {
66
+ position: absolute;
67
+ top: 8px;
68
+ right: 26px;
69
+ display: block;
70
+ width: 12px;
71
+ height: 12px;
72
+ background: image-url('lalala/chosen/chosen-sprite.png') -42px 1px no-repeat;
73
+ font-size: 1px;
74
+ }
75
+ .chosen-container-single .chosen-single abbr:hover {
76
+ background-position: -42px -10px;
77
+ }
78
+ .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
79
+ background-position: -42px -10px;
80
+ }
81
+ .chosen-container-single .chosen-single div {
82
+ position: absolute;
83
+ top: 6px;
84
+ right: 0;
85
+ display: block;
86
+ width: 18px;
87
+ height: 100%;
88
+ }
89
+ .chosen-container-single .chosen-single div b {
90
+ display: block;
91
+ width: 100%;
92
+ height: 100%;
93
+ background: image-url('lalala/chosen/chosen-sprite.png') no-repeat 0px 1px;
94
+ }
95
+ .chosen-container-single .chosen-search {
96
+ position: relative;
97
+ z-index: 1010;
98
+ margin: 0;
99
+ padding: 3px 4px;
100
+ white-space: nowrap;
101
+ }
102
+ .chosen-container-single .chosen-search input[type="text"] {
103
+ -webkit-box-sizing: border-box;
104
+ -moz-box-sizing: border-box;
105
+ box-sizing: border-box;
106
+ margin: 1px 0;
107
+ padding: 4px 20px 4px 5px;
108
+ width: 100%;
109
+ height: auto;
110
+ outline: 0;
111
+ border: 1px solid gray(200);
112
+ background: white image-url('lalala/chosen/chosen-sprite.png') no-repeat 100% -20px;
113
+ box-shadow: none;
114
+ background: none;
115
+ font-size: 1em;
116
+ font-family: sans-serif;
117
+ line-height: normal;
118
+ border-radius: 0;
119
+ }
120
+ .chosen-container-single .chosen-drop {
121
+ margin-top: -1px;
122
+ border-radius: 0 0 4px 4px;
123
+ background-clip: padding-box;
124
+ }
125
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
126
+ position: absolute;
127
+ left: -9999px;
128
+ }
129
+
130
+ /* @end */
131
+ /* @group Results */
132
+ .chosen-container .chosen-results {
133
+ position: relative;
134
+ overflow-x: hidden;
135
+ overflow-y: auto;
136
+ margin: 0 4px 4px 0;
137
+ padding: 0 0 0 4px;
138
+ max-height: 240px;
139
+ -webkit-overflow-scrolling: touch;
140
+ }
141
+ .chosen-container .chosen-results li {
142
+ display: none;
143
+ margin: 0;
144
+ padding: 5px 6px;
145
+ list-style: none;
146
+ line-height: 15px;
147
+ }
148
+ .chosen-container .chosen-results li.active-result {
149
+ display: list-item;
150
+ cursor: pointer;
151
+ }
152
+ .chosen-container .chosen-results li.disabled-result {
153
+ display: list-item;
154
+ color: #ccc;
155
+ cursor: default;
156
+ }
157
+ .chosen-container .chosen-results li.highlighted {
158
+ background-color: $blue;
159
+ background-image: none;
160
+ color: #fff;
161
+ }
162
+ .chosen-container .chosen-results li.no-results {
163
+ display: list-item;
164
+ background: #f4f4f4;
165
+ }
166
+ .chosen-container .chosen-results li.group-result {
167
+ display: list-item;
168
+ font-weight: bold;
169
+ cursor: default;
170
+ }
171
+ .chosen-container .chosen-results li.group-option {
172
+ padding-left: 15px;
173
+ }
174
+ .chosen-container .chosen-results li em {
175
+ font-style: normal;
176
+ text-decoration: underline;
177
+ }
178
+
179
+ /* @end */
180
+ /* @group Multi Chosen */
181
+ .chosen-container-multi .chosen-choices {
182
+ @include border-radius(5px);
183
+ border: 1px solid gray(200);
184
+
185
+ background-color: white;
186
+ background-image: none !important;
187
+ }
188
+ .chosen-container-multi .chosen-choices li {
189
+ float: left;
190
+ list-style: none;
191
+ }
192
+ .chosen-container-multi .chosen-choices li.search-field {
193
+ margin: 0;
194
+ padding: 0;
195
+ white-space: nowrap;
196
+ }
197
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
198
+ margin: 1px 0;
199
+ padding: 5px;
200
+ height: 15px;
201
+ outline: 0;
202
+ border: 0 !important;
203
+ background: transparent !important;
204
+ box-shadow: none;
205
+ color: #666;
206
+ font-size: 100%;
207
+ font-family: sans-serif;
208
+ line-height: normal;
209
+ border-radius: 0;
210
+ }
211
+ .chosen-container-multi .chosen-choices li.search-field .default {
212
+ color: #999;
213
+ }
214
+ .chosen-container-multi .chosen-choices li.search-choice {
215
+ @include text-shadow(rgba($orange, 1) 1px 1px 0);
216
+ background-image: none;
217
+ background-color: $yellow;
218
+ border: 1px solid $orange;
219
+ box-shadow: none;
220
+ color: white;
221
+ font-size: 14px;
222
+ font-weight: bold;
223
+ padding: 7px 20px 7px 6px;
224
+ }
225
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
226
+ position: absolute;
227
+ top: 4px;
228
+ right: 3px;
229
+ display: block;
230
+ width: 12px;
231
+ height: 15px;
232
+ background: image-url('lalala/chosen/chosen-sprite.png') -43px 5px no-repeat;
233
+ font-size: 1px;
234
+ }
235
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
236
+ background-position: -43px 6px;
237
+ }
238
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
239
+ background-color: #e4e4e4;
240
+ background-image: none;
241
+ color: #666;
242
+ }
243
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
244
+ background: #d4d4d4;
245
+ }
246
+ .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
247
+ background-position: -42px -10px;
248
+ }
249
+ .chosen-container-multi .chosen-results {
250
+ margin: 0;
251
+ padding: 0;
252
+ }
253
+ .chosen-container-multi .chosen-drop .result-selected {
254
+ display: list-item;
255
+ color: #ccc;
256
+ cursor: default;
257
+ }
258
+
259
+ /* @end */
260
+ /* @group Active */
261
+ .chosen-container-active .chosen-single {
262
+ border: 1px solid $yellow;
263
+ @include box-shadow(transparentize($yellow, .2) 0 0 5px);
264
+ }
265
+ .chosen-container-active.chosen-with-drop .chosen-single {
266
+ border: 1px solid $yellow;
267
+ -moz-border-radius-bottomright: 0;
268
+ border-bottom-right-radius: 0;
269
+ -moz-border-radius-bottomleft: 0;
270
+ border-bottom-left-radius: 0;
271
+ background-image: none;
272
+ @include box-shadow(transparentize($yellow, .2) 0 0 5px);
273
+ }
274
+ .chosen-container-active.chosen-with-drop .chosen-single div {
275
+ border-left: none;
276
+ background: transparent;
277
+ }
278
+ .chosen-container-active.chosen-with-drop .chosen-single div b {
279
+ background-position: -18px 2px;
280
+ }
281
+ .chosen-container-active .chosen-choices {
282
+ @include box-shadow(transparentize($yellow, .2) 0 0 5px);
283
+ border: 1px solid $yellow;
284
+ }
285
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
286
+ color: #111 !important;
287
+ }
288
+
289
+ /* @end */
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "224"
3
+ BUILD = "227"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
@@ -4,6 +4,7 @@ ActiveAdmin.register Article do
4
4
  f.inputs do
5
5
  f.input :title
6
6
  f.input :body
7
+ f.input :tags
7
8
  f.input :category, as: :select, collection: %w(A B C)
8
9
  f.input :image, as: :single_file
9
10
  end
@@ -0,0 +1,14 @@
1
+ ActiveAdmin.register Tag do
2
+
3
+ #menu priority: 50, html_options: { class: 'icon-tag-purple' }
4
+
5
+
6
+ form do |f|
7
+ f.inputs do
8
+ f.input :title
9
+ end
10
+
11
+ f.actions
12
+ end
13
+
14
+ end
@@ -1,5 +1,5 @@
1
1
  class Article < ActiveRecord::Base
2
- attr_accessible :body, :title, :category
2
+ attr_accessible :body, :title, :category, :tag_ids
3
3
 
4
4
  has_one_asset :image
5
5
 
@@ -9,4 +9,7 @@ class Article < ActiveRecord::Base
9
9
  # Validations
10
10
  validates :title, presence: true
11
11
 
12
+ # Bindings
13
+ has_and_belongs_to_many :tags
14
+
12
15
  end
@@ -0,0 +1,13 @@
1
+ class Tag < ActiveRecord::Base
2
+
3
+ attr_accessible :title, :article_ids
4
+
5
+ translates :title
6
+
7
+ validates :title,
8
+ presence: true
9
+
10
+ # Bindings
11
+ has_and_belongs_to_many :articles
12
+
13
+ end
@@ -0,0 +1,17 @@
1
+ class CreateTags < ActiveRecord::Migration
2
+
3
+ def up
4
+ create_table :tags do |t|
5
+ t.timestamps
6
+ end
7
+ Tag.create_translation_table!(
8
+ title: :string
9
+ )
10
+ end
11
+
12
+ def down
13
+ drop_table :tags
14
+ Tag.drop_translation_table!
15
+ end
16
+
17
+ end
@@ -0,0 +1,9 @@
1
+ class AddArticlesTagsBinding < ActiveRecord::Migration
2
+ def up
3
+ create_join_table :tags, :articles
4
+ end
5
+
6
+ def down
7
+ drop_table :articles_tags
8
+ end
9
+ end
@@ -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 => 20131121092946) do
14
+ ActiveRecord::Schema.define(:version => 20131122170308) do
15
15
 
16
16
  create_table "active_admin_comments", :force => true do |t|
17
17
  t.string "resource_id", :null => false
@@ -65,6 +65,13 @@ ActiveRecord::Schema.define(:version => 20131121092946) do
65
65
  t.string "category"
66
66
  end
67
67
 
68
+ create_table "articles_tags", :id => false, :force => true do |t|
69
+ t.integer "article_id"
70
+ t.integer "tag_id"
71
+ end
72
+
73
+ add_index "articles_tags", ["article_id", "tag_id"], :name => "index_articles_tags_on_article_id_and_tag_id", :unique => true
74
+
68
75
  create_table "asset_translations", :force => true do |t|
69
76
  t.string "locale"
70
77
  t.integer "asset_id"
@@ -114,4 +121,20 @@ ActiveRecord::Schema.define(:version => 20131121092946) do
114
121
  t.datetime "updated_at", :null => false
115
122
  end
116
123
 
124
+ create_table "tag_translations", :force => true do |t|
125
+ t.integer "tag_id"
126
+ t.string "locale"
127
+ t.string "title"
128
+ t.datetime "created_at", :null => false
129
+ t.datetime "updated_at", :null => false
130
+ end
131
+
132
+ add_index "tag_translations", ["locale"], :name => "index_tag_translations_on_locale"
133
+ add_index "tag_translations", ["tag_id"], :name => "index_tag_translations_on_tag_id"
134
+
135
+ create_table "tags", :force => true do |t|
136
+ t.datetime "created_at", :null => false
137
+ t.datetime "updated_at", :null => false
138
+ end
139
+
117
140
  end
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class TagTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
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.224
4
+ version: 4.0.0.dev.227
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-11-21 00:00:00.000000000 Z
16
+ date: 2013-11-25 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activeadmin
@@ -1324,6 +1324,7 @@ files:
1324
1324
  - app/assets/stylesheets/lalala/base/_mixins.css.scss
1325
1325
  - app/assets/stylesheets/lalala/base/_variables.css.scss
1326
1326
  - app/assets/stylesheets/lalala/components/_buttons.css.scss
1327
+ - app/assets/stylesheets/lalala/components/_chosen-lalala.css.scss
1327
1328
  - app/assets/stylesheets/lalala/components/_forms.css.scss
1328
1329
  - app/assets/stylesheets/lalala/components/_icons.css.scss
1329
1330
  - app/assets/stylesheets/lalala/components/_tables.css.scss
@@ -1470,6 +1471,7 @@ files:
1470
1471
  - test/dummy/app/admin/admin_users.rb
1471
1472
  - test/dummy/app/admin/articles.rb
1472
1473
  - test/dummy/app/admin/dashboard.rb
1474
+ - test/dummy/app/admin/tags.rb
1473
1475
  - test/dummy/app/assets/javascripts/active_admin.js
1474
1476
  - test/dummy/app/assets/javascripts/application.js
1475
1477
  - test/dummy/app/assets/stylesheets/active_admin.css.scss
@@ -1484,6 +1486,7 @@ files:
1484
1486
  - test/dummy/app/models/article.rb
1485
1487
  - test/dummy/app/models/file_asset.rb
1486
1488
  - test/dummy/app/models/image_asset.rb
1489
+ - test/dummy/app/models/tag.rb
1487
1490
  - test/dummy/app/pages/application_page.rb
1488
1491
  - test/dummy/app/pages/basic_page.rb
1489
1492
  - test/dummy/app/pages/home_page.rb
@@ -1514,6 +1517,8 @@ files:
1514
1517
  - test/dummy/db/migrate/20130729125648_create_home_page.rb
1515
1518
  - test/dummy/db/migrate/20131113134503_add_category_to_articles.rb
1516
1519
  - test/dummy/db/migrate/20131121092946_make_articles_translatable.rb
1520
+ - test/dummy/db/migrate/20131122165715_create_tags.rb
1521
+ - test/dummy/db/migrate/20131122170308_add_articles_tags_binding.rb
1517
1522
  - test/dummy/db/schema.rb
1518
1523
  - test/dummy/lib/assets/.gitkeep
1519
1524
  - test/dummy/log/.gitkeep
@@ -1523,7 +1528,9 @@ files:
1523
1528
  - test/dummy/public/favicon.ico
1524
1529
  - test/dummy/script/rails
1525
1530
  - test/dummy/test/fixtures/admin_users.yml
1531
+ - test/dummy/test/fixtures/tags.yml
1526
1532
  - test/dummy/test/unit/admin_user_test.rb
1533
+ - test/dummy/test/unit/tag_test.rb
1527
1534
  - test/dummy/tmp/cache/.gitkeep
1528
1535
  - test/fixtures/files/image.png
1529
1536
  - test/i18n/router_test.rb
@@ -1563,6 +1570,7 @@ test_files:
1563
1570
  - test/dummy/app/admin/admin_users.rb
1564
1571
  - test/dummy/app/admin/articles.rb
1565
1572
  - test/dummy/app/admin/dashboard.rb
1573
+ - test/dummy/app/admin/tags.rb
1566
1574
  - test/dummy/app/assets/javascripts/active_admin.js
1567
1575
  - test/dummy/app/assets/javascripts/application.js
1568
1576
  - test/dummy/app/assets/stylesheets/active_admin.css.scss
@@ -1577,6 +1585,7 @@ test_files:
1577
1585
  - test/dummy/app/models/article.rb
1578
1586
  - test/dummy/app/models/file_asset.rb
1579
1587
  - test/dummy/app/models/image_asset.rb
1588
+ - test/dummy/app/models/tag.rb
1580
1589
  - test/dummy/app/pages/application_page.rb
1581
1590
  - test/dummy/app/pages/basic_page.rb
1582
1591
  - test/dummy/app/pages/home_page.rb
@@ -1607,6 +1616,8 @@ test_files:
1607
1616
  - test/dummy/db/migrate/20130729125648_create_home_page.rb
1608
1617
  - test/dummy/db/migrate/20131113134503_add_category_to_articles.rb
1609
1618
  - test/dummy/db/migrate/20131121092946_make_articles_translatable.rb
1619
+ - test/dummy/db/migrate/20131122165715_create_tags.rb
1620
+ - test/dummy/db/migrate/20131122170308_add_articles_tags_binding.rb
1610
1621
  - test/dummy/db/schema.rb
1611
1622
  - test/dummy/lib/assets/.gitkeep
1612
1623
  - test/dummy/log/.gitkeep
@@ -1616,7 +1627,9 @@ test_files:
1616
1627
  - test/dummy/public/favicon.ico
1617
1628
  - test/dummy/script/rails
1618
1629
  - test/dummy/test/fixtures/admin_users.yml
1630
+ - test/dummy/test/fixtures/tags.yml
1619
1631
  - test/dummy/test/unit/admin_user_test.rb
1632
+ - test/dummy/test/unit/tag_test.rb
1620
1633
  - test/dummy/tmp/cache/.gitkeep
1621
1634
  - test/fixtures/files/image.png
1622
1635
  - test/i18n/router_test.rb