loft 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -22
- data/app/assets/stylesheets/loft.scss +38 -34
- data/lib/loft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8b9a117b09ce200d56515481cb519409596bc08
|
4
|
+
data.tar.gz: c13408a45069a156bb785670d9a8392b41529f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
//
|
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
|
10
|
+
@mixin loft-icon-label($title) {
|
11
11
|
&:before {
|
12
12
|
display: block; margin-top: 2.6em;
|
13
|
-
content: $title; color: $
|
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
|
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
|
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
|
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 $
|
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:
|
118
|
-
.accept {
|
119
|
-
.delete {
|
120
|
-
.unselect {
|
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
|
-
@
|
133
|
-
|
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 {
|
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 {
|
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
|
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: $
|
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;
|
187
|
-
&:before { content: 'Grid'; color: $
|
188
|
-
&:after { content: 'List'; color: $
|
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: $
|
192
|
-
&:after { color: $
|
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 $
|
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:
|
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:
|
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
|
228
|
-
.asset-archive .asset-icon { @include
|
229
|
-
.asset-audio .asset-icon { @include
|
230
|
-
.asset-video .asset-icon { @include
|
231
|
-
.asset-other .asset-icon { @include
|
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 {
|
244
|
+
.loft .list:not(:first-child) .back { display: none; }
|
241
245
|
|
242
246
|
// GRID MODE
|
243
247
|
.assets-switch-mode { left: 1em; }
|
data/lib/loft/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chr
|