loft 0.2.3 → 0.2.4

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: 8fa0ceece3baceaa0c8cc5dc8a58b3b04b34df0c
4
- data.tar.gz: 9def5e72b04e4884ba241a644e85e0d1c4a6481b
3
+ metadata.gz: e8b9a117b09ce200d56515481cb519409596bc08
4
+ data.tar.gz: c13408a45069a156bb785670d9a8392b41529f45
5
5
  SHA512:
6
- metadata.gz: 56247b30e1596cd637d088426d222b92a15906cb20d6292d7995ea722e691dc46c74fd052601eeceb8860a88ee26ca061fcb6b26cb0c51700d210c4c196238e7
7
- data.tar.gz: f2fb1cde327e9685427c31acc2189e09f60da2eb8a22bdf512dae8fb6430c4492d6f21c6a96a8cbfd370d08fd641830de75e45ec0b76ce61636302d1174af334
6
+ metadata.gz: 1c1ff5b7c51376b27a239822053261959ab97e06a0587ece747b94803cde516c414ac37e330280780bd359ec06e7d6fcff81ea8ef336fc10bcdb51c4cc44383a
7
+ data.tar.gz: cf268fc05a8ace3ae6312575bc3bd82bc30cecd20ce47a161928b6e211b1cf822e2bd7119a56fcb0d38d26f0afd5b7d7c306b6177ca44c10e816279fe04d197d
data/README.md CHANGED
@@ -9,37 +9,22 @@ Add to ```Gemfile```:
9
9
 
10
10
  gem 'loft'
11
11
 
12
- Setup a new model for assets ```asset.rb```:
13
-
14
- ```ruby
15
- class Asset
16
- include Mongoid::Document
17
- include Mongoid::LoftAsset
18
- end
19
- ```
20
-
21
- Add controller for asset model to make it accesible via CMS, e.g. ```app/controllers/admin/assets_controller.rb```:
22
-
23
- ```ruby
24
- class Admin::AssetsController < Admin::BaseController
25
- mongosteen
26
-
27
- has_scope :by_type
28
- end
29
- ```
30
-
31
12
  Add admin assets controller to ```routes.rb```:
32
13
 
33
14
  ```ruby
34
- resources :assets
15
+ resources :assets, controller: 'assets'
35
16
  ```
36
17
 
37
- Add to ```admin.scss```:
18
+ Add to ```admin.scss``` and ```admin.coffee```:
38
19
 
39
20
  ```scss
40
21
  @import "loft";
41
22
  ```
42
23
 
24
+ ```coffee
25
+ #= require loft
26
+ ```
27
+
43
28
  Add to ```admin.coffee``` character configuration object:
44
29
 
45
30
  ```coffee
@@ -47,10 +32,11 @@ loft: new Loft('Files', 'asset', '/admin/assets')
47
32
  ```
48
33
 
49
34
 
50
- ## Notes
35
+ ## TODO Notes
51
36
 
52
37
  1. Check out [kraken.io](https://github.com/kraken-io/kraken-ruby) for image optimization.
53
38
 
39
+
54
40
  ## Loft family
55
41
 
56
42
  - [Character](https://github.com/slate-studio/chr): Powerful javascript CMS for apps
@@ -1,22 +1,22 @@
1
- //
2
- // Styles for Loft Character CMS plugin, this should be included in
1
+ // -----------------------------------------------------------------------
2
+ // Basic styles for Loft Character CMS plugin, this should be included in
3
3
  // admin.scss (default)
4
- //
4
+ // -----------------------------------------------------------------------
5
5
 
6
6
  @import "inputs/loft-image";
7
7
 
8
8
  // MIXINS
9
9
 
10
- @mixin iconLabel($title) {
10
+ @mixin loft-icon-label($title) {
11
11
  &:before {
12
12
  display: block; margin-top: 2.6em;
13
- content: $title; color: $contrastColor;
13
+ content: $title; color: rgba($base-font-color, .2);
14
14
  font-size: 1.5em; font-weight: 300; letter-spacing: 8px;
15
15
  text-align: center; text-transform: uppercase;
16
16
  }
17
17
  }
18
18
 
19
- @mixin iconBase($bgSize, $width, $height) {
19
+ @mixin loft-icon-base($bgSize, $width, $height) {
20
20
  display: block; background-size: $bgSize; width: $width; height: $height;
21
21
  background-image: image-url("loft/library@3x.png");
22
22
  }
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  .item {
33
- &:before { @include iconBase(32px 112px, 16px, 16px); }
33
+ &:before { @include loft-icon-base(32px 112px, 16px, 16px); }
34
34
  &.active:before { background-position: 16px 0px; }
35
35
  }
36
36
  .item:nth-child(2) {
@@ -73,7 +73,7 @@
73
73
 
74
74
  // type icon
75
75
  .asset-icon {
76
- @include iconBase(64px 224px, 32px, 32px);
76
+ @include loft-icon-base(64px 224px, 32px, 32px);
77
77
  @include position(absolute, 12px null null 3.05em);
78
78
  }
79
79
 
@@ -100,7 +100,7 @@
100
100
  display: none; z-index: 1;
101
101
  @include position(absolute, 7px .5em null 94px);
102
102
  input { width: 100%; padding: .1em .3em .3em .3em; @include no-focus-outline;
103
- border: 1px solid $stableColor; box-shadow: 0 0 10px $lightColor; border-radius: 3px; }
103
+ border: 1px solid lighten($base-font-color, 35%); box-shadow: 0 0 10px lighten($base-font-color, 50%); border-radius: 3px; }
104
104
  }
105
105
  &.edit-name .asset-name { display: block; }
106
106
  }
@@ -114,10 +114,10 @@
114
114
  // GROUP ACTIONS
115
115
 
116
116
  .assets-group-actions {
117
- @include position(absolute, 0 0 0 0); background: $white;
118
- .accept { @include header-button($positiveColor); float: right; margin-right: 1em; }
119
- .delete { @include header-button($assertiveColor); float: right; margin-right: 1em; }
120
- .unselect { @include header-button($stableColor); float: left; margin-left: 1em; }
117
+ @include position(absolute, 0 0 0 0); background: white;
118
+ .accept { color: $positive-color; float: right; margin-right: 1em; }
119
+ .delete { color: $assertive-color; float: right; margin-right: 1em; }
120
+ .unselect { color: lighten($base-font-color, 35%); float: left; margin-left: 1em; }
121
121
  }
122
122
 
123
123
  .assets-group-actions .accept { display: none; }
@@ -129,8 +129,12 @@
129
129
 
130
130
  .asset-upload {
131
131
  @include position(absolute, 0 -40px null null);
132
- @extend .icon-plus; @include no-focus-outline;
133
- cursor: pointer; padding-left: 80px;
132
+ @include icon-plus($positive-color);
133
+ @include no-focus-outline;
134
+ cursor : pointer;
135
+ padding-left : 80px;
136
+ &:before { @include position(absolute, null null null 0); }
137
+ &:hover { opacity : .5; }
134
138
  }
135
139
 
136
140
  .list header .asset-upload + .search { @include position(absolute, 0 40px null null); }
@@ -141,11 +145,11 @@
141
145
  // MODAL MODE
142
146
 
143
147
  .loft {
144
- .modal-close { @include hide(); }
148
+ .modal-close { display: none; }
145
149
  &.module-modal {
146
150
  @include position(absolute, 0 .5em 0 .5em); z-index: 1100;
147
151
 
148
- &:after { @include hide(); }
152
+ &:after { display: none; }
149
153
 
150
154
  // dark background
151
155
  &:before {
@@ -153,10 +157,10 @@
153
157
  content: ''; display: block; background: rgba(0,0,0,.25);
154
158
  }
155
159
 
156
- .modal-close { @include header-button(); @include position(absolute, null null null 1em ); }
160
+ .modal-close { @include position(absolute, null null null 1em ); display: inline-block; }
157
161
  .header { top: 0; left: .5em; right: .5em; width: auto; }
158
162
 
159
- .list:first-child .back { display: none }
163
+ .list:first-child .back { display: none; }
160
164
  }
161
165
  }
162
166
 
@@ -169,7 +173,7 @@
169
173
  padding-top: 19px; padding-bottom: 19px;
170
174
  .item-title {
171
175
  display: inline; cursor: pointer;
172
- &:hover { color: $positiveColor; text-decoration: underline; }
176
+ &:hover { color: $positive-color; text-decoration: underline; }
173
177
  }
174
178
  .item-subtitle { @include position(absolute, 1.55em 1em null null); }
175
179
  .asset-name { top: 16px; }
@@ -183,13 +187,13 @@
183
187
  // GRID MODE
184
188
  .assets-switch-mode {
185
189
  @include position(absolute, null null null 1em);
186
- display: inline; font-size: .9em; line-height: 2.9; left: 3em;
187
- &:before { content: 'Grid'; color: $lightColor; margin-right: .25em; }
188
- &:after { content: 'List'; color: $stableColor; }
190
+ display: inline; line-height: 2.5; left: 3em;
191
+ &:before { content: 'Grid'; color: lighten($base-font-color, 50%); margin-right: .25em; }
192
+ &:after { content: 'List'; color: lighten($base-font-color, 35%); }
189
193
  }
190
194
  .loft.grid-mode .assets-switch-mode {
191
- &:before { color: $stableColor; }
192
- &:after { color: $lightColor; }
195
+ &:before { color: lighten($base-font-color, 35%); }
196
+ &:after { color: lighten($base-font-color, 50%); }
193
197
  }
194
198
 
195
199
  .loft.grid-mode {
@@ -199,18 +203,18 @@
199
203
 
200
204
  .item.asset {
201
205
  padding-left: 1em; width: 222px; height: 222px;
202
- @include no-bottom-border; border: 1px solid $contrastColor; border-radius: 4px;
206
+ @include no-bottom-border; border: 1px solid rgba($base-font-color, .2); border-radius: 4px;
203
207
 
204
208
  // checkbox: position + decoration
205
209
  .asset-checkbox {
206
- top: 10px; left: 10px; width: 24px; height: 24px; background: $white;
210
+ top: 10px; left: 10px; width: 24px; height: 24px; background: white;
207
211
  box-shadow: 0 1px 0 rgba(0,0,0,0.05),1px 0 0 rgba(0,0,0,0.05); border-bottom-right-radius: 4px;
208
212
  }
209
213
 
210
214
  // thumbnail
211
215
  .asset-icon {
212
216
  @include position(absolute, 10px null null 10px);
213
- width: 200px; height: 150px; background: $white; border-radius: 0;
217
+ width: 200px; height: 150px; background: white; border-radius: 0;
214
218
  &:after { @include position(absolute, 0px 0px 0px 0px); box-shadow: 0 0 1px rgba(0,0,0,0.2) inset; content: ''; display: block; }
215
219
  }
216
220
 
@@ -224,11 +228,11 @@
224
228
  }
225
229
 
226
230
  // asset type labels
227
- .asset-text .asset-icon { @include iconLabel('Text'); }
228
- .asset-archive .asset-icon { @include iconLabel('Archive'); }
229
- .asset-audio .asset-icon { @include iconLabel('Audio'); }
230
- .asset-video .asset-icon { @include iconLabel('Video'); }
231
- .asset-other .asset-icon { @include iconLabel('File'); }
231
+ .asset-text .asset-icon { @include loft-icon-label('Text'); }
232
+ .asset-archive .asset-icon { @include loft-icon-label('Archive'); }
233
+ .asset-audio .asset-icon { @include loft-icon-label('Audio'); }
234
+ .asset-video .asset-icon { @include loft-icon-label('Video'); }
235
+ .asset-other .asset-icon { @include loft-icon-label('File'); }
232
236
  }
233
237
  }
234
238
  }
@@ -237,7 +241,7 @@
237
241
  /* Desktop ----------------------------------------------------------------- */
238
242
  @media #{$desktop} {
239
243
  // BACK
240
- .loft .list:not(:first-child) .back { @include hide; }
244
+ .loft .list:not(:first-child) .back { display: none; }
241
245
 
242
246
  // GRID MODE
243
247
  .assets-switch-mode { left: 1em; }
@@ -1,3 +1,3 @@
1
1
  module Loft
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chr