ogatstyle 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +59 -0
- data/.csslintrc +2 -0
- data/.eslintignore +1 -0
- data/.eslintrc +213 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.rubocop.yml +17 -0
- data/.travis.yml +19 -0
- data/CHANGELOG.md +58 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +56 -0
- data/Rakefile +7 -0
- data/app/assets/fonts/GillSans.woff +0 -0
- data/app/assets/fonts/GillSansBold.woff +0 -0
- data/app/assets/fonts/GillSansLight.eot +0 -0
- data/app/assets/fonts/GillSansLight.ttf +0 -0
- data/app/assets/fonts/GillSansLight.woff +0 -0
- data/app/assets/fonts/GillSansLightItalic.woff +0 -0
- data/app/assets/images/fileicon/archive.png +0 -0
- data/app/assets/images/fileicon/css.png +0 -0
- data/app/assets/images/fileicon/default.png +0 -0
- data/app/assets/images/fileicon/developer.png +0 -0
- data/app/assets/images/fileicon/excel.png +0 -0
- data/app/assets/images/fileicon/fireworks.png +0 -0
- data/app/assets/images/fileicon/flash.png +0 -0
- data/app/assets/images/fileicon/folder.png +0 -0
- data/app/assets/images/fileicon/html.png +0 -0
- data/app/assets/images/fileicon/illustrator.png +0 -0
- data/app/assets/images/fileicon/image.png +0 -0
- data/app/assets/images/fileicon/keynote.png +0 -0
- data/app/assets/images/fileicon/movie.png +0 -0
- data/app/assets/images/fileicon/music.png +0 -0
- data/app/assets/images/fileicon/numbers.png +0 -0
- data/app/assets/images/fileicon/pages.png +0 -0
- data/app/assets/images/fileicon/pdf.png +0 -0
- data/app/assets/images/fileicon/photoshop.png +0 -0
- data/app/assets/images/fileicon/powerpoint.png +0 -0
- data/app/assets/images/fileicon/text.png +0 -0
- data/app/assets/images/fileicon/word.png +0 -0
- data/app/assets/images/ogatstyle/swirl-white-nav.png +0 -0
- data/app/assets/images/ogatstyle/swirl-white-nav2x.png +0 -0
- data/app/assets/stylesheets/ogatstyle/_base_fonts.scss +23 -0
- data/app/assets/stylesheets/ogatstyle/_gill_sans.scss +6 -0
- data/app/assets/stylesheets/ogatstyle/_social.scss +33 -0
- data/app/assets/stylesheets/ogatstyle/_tables.scss +8 -0
- data/app/assets/stylesheets/ogatstyle/_type.scss +35 -0
- data/app/assets/stylesheets/ogatstyle/_variables.scss +14 -0
- data/app/assets/stylesheets/ogatstyle/_visibility.scss +25 -0
- data/app/assets/stylesheets/ogatstyle/apps/_bootstrap_overrides.scss +25 -0
- data/app/assets/stylesheets/ogatstyle/apps/_bootstrap_variables.scss +13 -0
- data/app/assets/stylesheets/ogatstyle/apps/_navbar.scss +75 -0
- data/app/assets/stylesheets/ogatstyle/apps/_purple.scss +28 -0
- data/app/assets/stylesheets/ogatstyle/sites/_base_style.scss +13 -0
- data/app/assets/stylesheets/ogatstyle/sites/_bootstrap_overrides.scss +61 -0
- data/app/assets/stylesheets/ogatstyle/sites/_bootstrap_variables.scss +3 -0
- data/app/assets/stylesheets/ogatstyle.scss +14 -0
- data/app/assets/stylesheets/ogatstyle_app.scss +14 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/coffeelint.json +129 -0
- data/lib/ogatstyle/fileicon/mapping.rb +69 -0
- data/lib/ogatstyle/fileicon.rb +26 -0
- data/lib/ogatstyle/version.rb +5 -0
- data/lib/ogatstyle.rb +22 -0
- data/ogatstyle.gemspec +33 -0
- metadata +251 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
// Official OGAT branding colors
|
2
|
+
|
3
|
+
// #5B3393 / rgb(91,51,147)
|
4
|
+
$ogat-purple: rgb(91,51,147) !default;
|
5
|
+
// #AD99C9 / rgb(173,153,201)
|
6
|
+
$ogat-purple-secondary: mix($ogat-purple, white, 50%) !default;
|
7
|
+
// #B09C78 / rgb(176,156,119)
|
8
|
+
$ogat-gold: #B09C78 !default;
|
9
|
+
|
10
|
+
// Web colors: prefer tints and shades of brand colors
|
11
|
+
// for tints: mix with white
|
12
|
+
// for shades: mix with black
|
13
|
+
|
14
|
+
$ogat-purple-alt: mix($ogat-purple, white, 60%) !default;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
@media (max-width: 479px) {
|
2
|
+
.visible-phone-portrait {
|
3
|
+
display: inherit !important;
|
4
|
+
}
|
5
|
+
|
6
|
+
.hidden-phone-portrait {
|
7
|
+
display: none !important;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
@media (min-width: 480px) {
|
12
|
+
.visible-phone-portrait {
|
13
|
+
display: none !important;
|
14
|
+
}
|
15
|
+
|
16
|
+
.hidden-phone-portrait {
|
17
|
+
display: inherit !important;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
@media (max-width: 767px) {
|
22
|
+
.visible-xs-inline {
|
23
|
+
display: inline-block !important;
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.footer {
|
2
|
+
color: #999;
|
3
|
+
padding: 30px;
|
4
|
+
|
5
|
+
.copyright,
|
6
|
+
.legal {
|
7
|
+
font-size: 80%;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
.table-attributes tbody th {
|
12
|
+
text-align: right;
|
13
|
+
width: 20%;
|
14
|
+
}
|
15
|
+
|
16
|
+
td.actions {
|
17
|
+
text-align: right;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Adjust heading line-height in media items to account for GillSansBold
|
21
|
+
.media-body {
|
22
|
+
h4 {
|
23
|
+
line-height: 1.3;
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
$brand-primary: $ogat-purple;
|
2
|
+
|
3
|
+
$navbar-inverse-bg: $ogat-purple;
|
4
|
+
$navbar-inverse-link-color: #fff;
|
5
|
+
$navbar-inverse-link-hover-bg: $ogat-purple-alt;
|
6
|
+
$navbar-inverse-link-hover-color: #efefef;
|
7
|
+
$navbar-inverse-link-active-bg: $ogat-purple-alt;
|
8
|
+
$navbar-inverse-toggle-hover-bg: mix($ogat-purple, black, 5%);
|
9
|
+
$navbar-inverse-brand-color: #fff;
|
10
|
+
$navbar-inverse-brand-hover-color: #efefef;
|
11
|
+
$navbar-inverse-brand-hover-bg: $ogat-purple-alt;
|
12
|
+
|
13
|
+
$headings-font-family: GillSansBold, "Helvetica Neue", Arial, sans-serif;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
@media (min-width: 768px) {
|
2
|
+
.navbar > .container-fluid .navbar-app-title {
|
3
|
+
margin-left: 0;
|
4
|
+
}
|
5
|
+
}
|
6
|
+
.navbar-brand {
|
7
|
+
line-height: inherit;
|
8
|
+
padding: 7px;
|
9
|
+
}
|
10
|
+
|
11
|
+
.navbar-app-title {
|
12
|
+
@extend .navbar-brand;
|
13
|
+
font-family: GillSansLight;
|
14
|
+
margin-left: 0;
|
15
|
+
padding: 10px 15px 10px 5px;
|
16
|
+
text-transform: uppercase;
|
17
|
+
|
18
|
+
.app-title {
|
19
|
+
position: relative;
|
20
|
+
top: 4px;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
#avatar {
|
25
|
+
padding-bottom: 10px;
|
26
|
+
padding-top: 10px;
|
27
|
+
|
28
|
+
img {
|
29
|
+
border-radius: 2px;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
.navbar-icon {
|
33
|
+
padding-bottom: 12px !important;
|
34
|
+
padding-top: 12px !important;
|
35
|
+
position: relative;
|
36
|
+
|
37
|
+
.fa {
|
38
|
+
font-size: 25px;
|
39
|
+
}
|
40
|
+
|
41
|
+
.badge {
|
42
|
+
background-color: #FDB61D;
|
43
|
+
color: $ogat-purple;
|
44
|
+
position: absolute;
|
45
|
+
right: 4px;
|
46
|
+
top: 6px;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
.navbar-inverse {
|
50
|
+
.form-control,
|
51
|
+
.input-group-addon,
|
52
|
+
.btn-default {
|
53
|
+
@include form-control-focus($ogat-purple-alt);
|
54
|
+
background-color: mix($ogat-purple, black, 80%);
|
55
|
+
border-color: mix($ogat-purple, black, 50%);
|
56
|
+
color: $navbar-inverse-link-color;
|
57
|
+
}
|
58
|
+
|
59
|
+
.btn-default:hover {
|
60
|
+
background-color: mix($ogat-purple, white, 80%);
|
61
|
+
}
|
62
|
+
|
63
|
+
.navbar-app-title {
|
64
|
+
&:hover,
|
65
|
+
&:focus {
|
66
|
+
background-color: transparent;
|
67
|
+
text-shadow: 0 0 6px $navbar-inverse-link-color;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
.badge {
|
72
|
+
background-color: #FDB61D;
|
73
|
+
color: $ogat-purple;
|
74
|
+
}
|
75
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
$purple-gradient-color: mix($ogat-purple, black, 80%) !default;
|
2
|
+
$purple-panel-color: mix($ogat-purple, white, 20%) !default;
|
3
|
+
|
4
|
+
body.purple {
|
5
|
+
background-color: $ogat-purple;
|
6
|
+
background: -moz-linear-gradient(top, $ogat-purple 0%, $purple-gradient-color 100%);
|
7
|
+
background: -webkit-linear-gradient(top, $ogat-purple 0%, $purple-gradient-color 100%);
|
8
|
+
background: linear-gradient(to bottom, $ogat-purple 0%, $purple-gradient-color 100%);
|
9
|
+
color: #EFEFEF;
|
10
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=$ogat-purple, endColorstr=$purple-gradient-color,GradientType=0 );
|
11
|
+
|
12
|
+
.footer {
|
13
|
+
color: #AAA;
|
14
|
+
}
|
15
|
+
|
16
|
+
.panel-default {
|
17
|
+
background-color: rgba($purple-panel-color, 0.7);
|
18
|
+
border-color: $purple-gradient-color;
|
19
|
+
-moz-box-shadow: 0px 1px 16px 0px rgba(0,0,0,0.6);
|
20
|
+
-webkit-box-shadow: 0px 1px 16px 0px rgba(0,0,0,0.6);
|
21
|
+
box-shadow: 0px 1px 16px 0px rgba(0,0,0,0.6);
|
22
|
+
color: $text-color;
|
23
|
+
|
24
|
+
.panel-heading {
|
25
|
+
background-color: rgba($purple-gradient-color, 0.15);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
.footer {
|
2
|
+
background-color: #f7f7f7;
|
3
|
+
background-color: rgba(255, 255, 255, 0.65);
|
4
|
+
padding: 30px;
|
5
|
+
color: #999;
|
6
|
+
|
7
|
+
.copyright, .legal {
|
8
|
+
font-size: 80%;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
.image-header {
|
13
|
+
text-indent: -9999px;
|
14
|
+
margin-top: 20px;
|
15
|
+
margin-bottom: 20px;
|
16
|
+
}
|
17
|
+
|
18
|
+
.container-fluid-main {
|
19
|
+
margin-top: 10px;
|
20
|
+
margin-bottom: 10px;
|
21
|
+
background-color: white;
|
22
|
+
}
|
23
|
+
|
24
|
+
@media (min-width: 980px) {
|
25
|
+
.container {
|
26
|
+
padding: 0 30px 0;
|
27
|
+
}
|
28
|
+
.container-main {
|
29
|
+
border: 1px solid #bbb;
|
30
|
+
|
31
|
+
&.container {
|
32
|
+
min-height: 70%;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
@media (max-width: 979px) {
|
38
|
+
.footer {
|
39
|
+
background-color: #f7f7f7;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
html, body {
|
44
|
+
height: 100%;
|
45
|
+
}
|
46
|
+
|
47
|
+
// Adjust heading line-height in media items to account for GillSansBold
|
48
|
+
.media-body {
|
49
|
+
h4 {
|
50
|
+
line-height: 1.3;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// Fix button text shadow in OGATstyle
|
55
|
+
.btn-primary {
|
56
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
57
|
+
}
|
58
|
+
// Fix active state + badge text shadow
|
59
|
+
.active .badge {
|
60
|
+
text-shadow: none;
|
61
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@import "ogatstyle/variables";
|
2
|
+
@import "ogatstyle/sites/bootstrap_variables";
|
3
|
+
@import "ogatstyle/base_fonts";
|
4
|
+
@import "bootstrap-sprockets";
|
5
|
+
@import "bootstrap";
|
6
|
+
@import "bootstrap/theme";
|
7
|
+
@import "ogatstyle/sites/bootstrap_overrides";
|
8
|
+
@import "ogatstyle/social";
|
9
|
+
@import "ogatstyle/visibility";
|
10
|
+
@import "ogatstyle/type";
|
11
|
+
@import "ogatstyle/tables";
|
12
|
+
@import "ogatstyle/sites/base_style";
|
13
|
+
@import "font-awesome-sprockets";
|
14
|
+
@import "font-awesome";
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@import "ogatstyle/variables";
|
2
|
+
@import "ogatstyle/apps/bootstrap_variables";
|
3
|
+
@import "ogatstyle/base_fonts";
|
4
|
+
@import "bootstrap-sprockets";
|
5
|
+
@import "bootstrap";
|
6
|
+
|
7
|
+
@import "ogatstyle/apps/bootstrap_overrides";
|
8
|
+
@import "ogatstyle/social";
|
9
|
+
@import "ogatstyle/visibility";
|
10
|
+
@import "ogatstyle/type";
|
11
|
+
@import "ogatstyle/tables";
|
12
|
+
@import "ogatstyle/apps/navbar";
|
13
|
+
@import "font-awesome-sprockets";
|
14
|
+
@import "font-awesome";
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rails'
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'ogatstyle'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start
|
data/bin/setup
ADDED
data/coffeelint.json
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
{
|
2
|
+
"arrow_spacing": {
|
3
|
+
"level": "ignore"
|
4
|
+
},
|
5
|
+
"braces_spacing": {
|
6
|
+
"level": "ignore",
|
7
|
+
"spaces": 0,
|
8
|
+
"empty_object_spaces": 0
|
9
|
+
},
|
10
|
+
"camel_case_classes": {
|
11
|
+
"level": "error"
|
12
|
+
},
|
13
|
+
"coffeescript_error": {
|
14
|
+
"level": "error"
|
15
|
+
},
|
16
|
+
"colon_assignment_spacing": {
|
17
|
+
"level": "ignore",
|
18
|
+
"spacing": {
|
19
|
+
"left": 0,
|
20
|
+
"right": 0
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"cyclomatic_complexity": {
|
24
|
+
"value": 10,
|
25
|
+
"level": "ignore"
|
26
|
+
},
|
27
|
+
"duplicate_key": {
|
28
|
+
"level": "error"
|
29
|
+
},
|
30
|
+
"empty_constructor_needs_parens": {
|
31
|
+
"level": "ignore"
|
32
|
+
},
|
33
|
+
"ensure_comprehensions": {
|
34
|
+
"level": "warn"
|
35
|
+
},
|
36
|
+
"eol_last": {
|
37
|
+
"level": "ignore"
|
38
|
+
},
|
39
|
+
"indentation": {
|
40
|
+
"value": 2,
|
41
|
+
"level": "error"
|
42
|
+
},
|
43
|
+
"line_endings": {
|
44
|
+
"level": "ignore",
|
45
|
+
"value": "unix"
|
46
|
+
},
|
47
|
+
"max_line_length": {
|
48
|
+
"value": 80,
|
49
|
+
"level": "error",
|
50
|
+
"limitComments": true
|
51
|
+
},
|
52
|
+
"missing_fat_arrows": {
|
53
|
+
"level": "ignore",
|
54
|
+
"is_strict": false
|
55
|
+
},
|
56
|
+
"newlines_after_classes": {
|
57
|
+
"value": 3,
|
58
|
+
"level": "ignore"
|
59
|
+
},
|
60
|
+
"no_backticks": {
|
61
|
+
"level": "error"
|
62
|
+
},
|
63
|
+
"no_debugger": {
|
64
|
+
"level": "warn",
|
65
|
+
"console": false
|
66
|
+
},
|
67
|
+
"no_empty_functions": {
|
68
|
+
"level": "ignore"
|
69
|
+
},
|
70
|
+
"no_empty_param_list": {
|
71
|
+
"level": "ignore"
|
72
|
+
},
|
73
|
+
"no_implicit_braces": {
|
74
|
+
"level": "ignore",
|
75
|
+
"strict": true
|
76
|
+
},
|
77
|
+
"no_implicit_parens": {
|
78
|
+
"strict": true,
|
79
|
+
"level": "ignore"
|
80
|
+
},
|
81
|
+
"no_interpolation_in_single_quotes": {
|
82
|
+
"level": "ignore"
|
83
|
+
},
|
84
|
+
"no_plusplus": {
|
85
|
+
"level": "ignore"
|
86
|
+
},
|
87
|
+
"no_stand_alone_at": {
|
88
|
+
"level": "ignore"
|
89
|
+
},
|
90
|
+
"no_tabs": {
|
91
|
+
"level": "error"
|
92
|
+
},
|
93
|
+
"no_this": {
|
94
|
+
"level": "ignore"
|
95
|
+
},
|
96
|
+
"no_throwing_strings": {
|
97
|
+
"level": "error"
|
98
|
+
},
|
99
|
+
"no_trailing_semicolons": {
|
100
|
+
"level": "error"
|
101
|
+
},
|
102
|
+
"no_trailing_whitespace": {
|
103
|
+
"level": "error",
|
104
|
+
"allowed_in_comments": false,
|
105
|
+
"allowed_in_empty_lines": true
|
106
|
+
},
|
107
|
+
"no_unnecessary_double_quotes": {
|
108
|
+
"level": "ignore"
|
109
|
+
},
|
110
|
+
"no_unnecessary_fat_arrows": {
|
111
|
+
"level": "warn"
|
112
|
+
},
|
113
|
+
"non_empty_constructor_needs_parens": {
|
114
|
+
"level": "ignore"
|
115
|
+
},
|
116
|
+
"prefer_english_operator": {
|
117
|
+
"level": "ignore",
|
118
|
+
"doubleNotLevel": "ignore"
|
119
|
+
},
|
120
|
+
"space_operators": {
|
121
|
+
"level": "ignore"
|
122
|
+
},
|
123
|
+
"spacing_after_comma": {
|
124
|
+
"level": "ignore"
|
125
|
+
},
|
126
|
+
"transform_messes_up_line_numbers": {
|
127
|
+
"level": "warn"
|
128
|
+
}
|
129
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ogatstyle
|
4
|
+
module Fileicon
|
5
|
+
MAPPING = {
|
6
|
+
'bmp' => 'image',
|
7
|
+
'gif' => 'image',
|
8
|
+
'jpeg' => 'image',
|
9
|
+
'jpg' => 'image',
|
10
|
+
'png' => 'image',
|
11
|
+
'svg' => 'image',
|
12
|
+
'tiff' => 'image',
|
13
|
+
|
14
|
+
'7z' => 'archive',
|
15
|
+
'bz2' => 'archive',
|
16
|
+
'gz' => 'archive',
|
17
|
+
'rar' => 'archive',
|
18
|
+
'sit' => 'archive',
|
19
|
+
'sitx' => 'archive',
|
20
|
+
'tar' => 'archive',
|
21
|
+
'tgz' => 'archive',
|
22
|
+
'zip' => 'archive',
|
23
|
+
'zipx' => 'archive',
|
24
|
+
|
25
|
+
'css' => 'css',
|
26
|
+
|
27
|
+
'htm' => 'html',
|
28
|
+
'html' => 'html',
|
29
|
+
|
30
|
+
'xls' => 'excel',
|
31
|
+
'xlsx' => 'excel',
|
32
|
+
|
33
|
+
'ppt' => 'powerpoint',
|
34
|
+
'pptx' => 'powerpoint',
|
35
|
+
|
36
|
+
'doc' => 'word',
|
37
|
+
'docx' => 'word',
|
38
|
+
|
39
|
+
'pdd' => 'photoshop',
|
40
|
+
'psb' => 'photoshop',
|
41
|
+
'psd' => 'photoshop',
|
42
|
+
|
43
|
+
'ai' => 'illustrator',
|
44
|
+
'pdf' => 'pdf',
|
45
|
+
'swf' => 'flash',
|
46
|
+
'txt' => 'text',
|
47
|
+
|
48
|
+
'aac' => 'music',
|
49
|
+
'aif' => 'music',
|
50
|
+
'aiff' => 'music',
|
51
|
+
'flac' => 'music',
|
52
|
+
'm4a' => 'music',
|
53
|
+
'm4p' => 'music',
|
54
|
+
'mp3' => 'music',
|
55
|
+
'ogg' => 'music',
|
56
|
+
'vob' => 'music',
|
57
|
+
'wav' => 'music',
|
58
|
+
'wma' => 'music',
|
59
|
+
|
60
|
+
'avi' => 'movie',
|
61
|
+
'divx' => 'movie',
|
62
|
+
'm4v' => 'movie',
|
63
|
+
'mkv' => 'movie',
|
64
|
+
'mov' => 'movie',
|
65
|
+
'mpeg' => 'movie',
|
66
|
+
'mpg' => 'movie'
|
67
|
+
}.freeze
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'ogatstyle/fileicon/mapping'
|
3
|
+
|
4
|
+
module Ogatstyle
|
5
|
+
# Provides lookup of file type icon assets
|
6
|
+
module Fileicon
|
7
|
+
# Returns an icon to represent the given file
|
8
|
+
# @param name_or_path [String] file name or path
|
9
|
+
# @return (see #from_extension)
|
10
|
+
def self.from_filename(name_or_path)
|
11
|
+
Ogatstyle::Fileicon.from_extension File.extname(name_or_path)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns an icon to represent the given file extension
|
15
|
+
# @param extension [String] file extension (initial period optional)
|
16
|
+
# @return [String] path to icon asset
|
17
|
+
def self.from_extension(extension)
|
18
|
+
if extension.present?
|
19
|
+
extension = extension.downcase
|
20
|
+
extension = extension[1..-1] if extension[0, 1] == '.'
|
21
|
+
end
|
22
|
+
|
23
|
+
"fileicon/#{MAPPING.fetch(extension, 'default')}.png"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/ogatstyle.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'ogatstyle/version'
|
3
|
+
require 'ogatstyle/fileicon'
|
4
|
+
|
5
|
+
# Implement Outwood web style
|
6
|
+
module Ogatstyle
|
7
|
+
module Rails
|
8
|
+
# Integrate through Rails engine
|
9
|
+
class Engine < ::Rails::Engine
|
10
|
+
require 'bootstrap-sass'
|
11
|
+
require 'font-awesome-sass'
|
12
|
+
|
13
|
+
initializer 'ogatstyle.assets.precompile' do |app|
|
14
|
+
app.config.assets.precompile << 'ogatstyle/swirl-white-nav.png'
|
15
|
+
app.config.assets.precompile << 'ogatstyle/swirl-white-nav2x.png'
|
16
|
+
Fileicon::MAPPING.values.uniq.each do |ext|
|
17
|
+
app.config.assets.precompile << "fileicon/#{ext}.png"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/ogatstyle.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'ogatstyle/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'ogatstyle'
|
9
|
+
spec.version = Ogatstyle::VERSION
|
10
|
+
spec.authors = ['Elliot Bowes', 'Tom Crouch']
|
11
|
+
spec.email = ['e.bowes@outwood.com']
|
12
|
+
|
13
|
+
spec.summary = 'OGAT Style Gem'
|
14
|
+
spec.description = 'Provides SCSS stylesheets and assets for the OGAT Style.'
|
15
|
+
spec.homepage = 'https://github.com/Outwood/ogat-style'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
24
|
+
spec.add_development_dependency 'rake', '~> 11.2'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.2'
|
26
|
+
spec.add_development_dependency 'rubocop', '~> 0.45'
|
27
|
+
spec.add_development_dependency 'activesupport', '< 5.0'
|
28
|
+
spec.add_dependency 'rails', '>= 4.1'
|
29
|
+
spec.add_dependency 'sass-rails', '>= 3.2'
|
30
|
+
spec.add_dependency 'bootstrap-sass', '~> 3.3'
|
31
|
+
spec.add_dependency 'font-awesome-sass', '~> 4.2'
|
32
|
+
spec.add_dependency 'sprockets-rails', '>= 3'
|
33
|
+
end
|