light_mobile 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -0
- data/app/assets/javascripts/light_mobile/application.js.coffee +15 -0
- data/app/assets/javascripts/light_mobile/flash_errors.js.coffee +5 -0
- data/app/assets/stylesheets/light_mobile/application.css.scss +6 -2
- data/app/assets/stylesheets/light_mobile/flash_errors.css.scss +30 -0
- data/app/assets/stylesheets/light_mobile/tabs.css.scss +8 -1
- data/lib/light_mobile/tabs.rb +8 -2
- data/lib/light_mobile/version.rb +1 -1
- metadata +4 -2
- data/app/assets/javascripts/light_mobile/application.js +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 009b1c5db61a89a92593d33631e46eddabc76688
|
4
|
+
data.tar.gz: 5d251ca79f8c329193eea19d07d29a30ce2ba89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1216d1839ea095c86f510708cd8b06f49d6813197d4aa00fd8993eb530ac3651edc91c0e007ab642b4528a4fb555b7d147d31e709e6161d5db536f3c53243e58
|
7
|
+
data.tar.gz: ab978b3980369133a18924c0833870a3eba597f418a02df6071cc381ce6ce9d6ab2d45e536db2f389ac7365f69b4ca91ee8bff86e98224f112e7a494b6f77be1
|
data/README.md
CHANGED
@@ -64,6 +64,37 @@ Add a new file "app/assets/javascripts/application_mobile.js.coffee":
|
|
64
64
|
#tab-assigned-users This is the assigned users
|
65
65
|
```
|
66
66
|
|
67
|
+
### Flash errors
|
68
|
+
|
69
|
+
In beginning of the body-element do something like this:
|
70
|
+
```haml
|
71
|
+
%body
|
72
|
+
- if flash.any?
|
73
|
+
.mobile-flash-messages
|
74
|
+
- flash.each do |flash_type, message|
|
75
|
+
.mobile-flash{class: "mobile-flash-#{flash_type}"}
|
76
|
+
= message
|
77
|
+
= link_to _("OK"), "#", class: ["mobile-button", "mobile-flash-ok"]
|
78
|
+
|
79
|
+
### Link buttons
|
80
|
+
|
81
|
+
```haml
|
82
|
+
= link_to "Users", users_path, class: "mobile-button"
|
83
|
+
= link_to "Users", users_path, class: ["mobile-button", "mobile-button-primary"]
|
84
|
+
= link_to "Users", users_path, class: ["mobile-button", "mobile-button-danger"], data: {confirm: "Are you sure?"}
|
85
|
+
```
|
86
|
+
|
87
|
+
### Tables
|
88
|
+
|
89
|
+
```haml
|
90
|
+
%table.mobile-table
|
91
|
+
%tbody
|
92
|
+
%tr
|
93
|
+
%td Row 1
|
94
|
+
%tr
|
95
|
+
%td Row 2
|
96
|
+
```
|
97
|
+
|
67
98
|
## License
|
68
99
|
|
69
100
|
This project rocks and uses MIT-LICENSE.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
# listed below.
|
3
|
+
#
|
4
|
+
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
#
|
7
|
+
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
# compiled file.
|
9
|
+
#
|
10
|
+
# Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
# about supported directives.
|
12
|
+
#
|
13
|
+
#= require light_mobile/flash_errors
|
14
|
+
#= require light_mobile/menu
|
15
|
+
#= require light_mobile/tabs
|
@@ -8,6 +8,10 @@
|
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
9
|
* compiled file, but it's generally better to create a new file per style scope.
|
10
10
|
*
|
11
|
-
*=
|
12
|
-
*=
|
11
|
+
*= require light_mobile/buttons
|
12
|
+
*= require light_mobile/flash_errors
|
13
|
+
*= require light_mobile/menu
|
14
|
+
*= require light_mobile/simple_form
|
15
|
+
*= require light_mobile/tables
|
16
|
+
*= require light_mobile/tabs
|
13
17
|
*/
|
@@ -0,0 +1,30 @@
|
|
1
|
+
.mobile-flash-messages {
|
2
|
+
position: relative;
|
3
|
+
|
4
|
+
.mobile-flash {
|
5
|
+
position: fixed;
|
6
|
+
display: block;
|
7
|
+
top: 70px;
|
8
|
+
left: 0;
|
9
|
+
right: 0;
|
10
|
+
border: 1px solid black;
|
11
|
+
background-color: white;
|
12
|
+
border-radius: 7px;
|
13
|
+
color: #ffffff;
|
14
|
+
padding: 15px 15px 15px 15px;
|
15
|
+
width: 70%;
|
16
|
+
max-width: 400px;
|
17
|
+
background-color: #2c3b62;
|
18
|
+
opacity: 0.94;
|
19
|
+
text-align: center;
|
20
|
+
margin: auto;
|
21
|
+
}
|
22
|
+
|
23
|
+
.mobile-flash-ok {
|
24
|
+
margin-top: 15px;
|
25
|
+
margin-bottom: 0px;
|
26
|
+
background: linear-gradient(#c0c6d2, #606b87);
|
27
|
+
border-color: #212c4c;
|
28
|
+
color: #ffffff !important;
|
29
|
+
}
|
30
|
+
}
|
@@ -13,7 +13,7 @@ table.mobile-tabs {
|
|
13
13
|
background-color: #f6f6f6;
|
14
14
|
list-style-type: none;
|
15
15
|
padding: 10px;
|
16
|
-
text-align:
|
16
|
+
text-align: left;
|
17
17
|
cursor: pointer;
|
18
18
|
width: auto;
|
19
19
|
}
|
@@ -34,6 +34,13 @@ table.mobile-tabs {
|
|
34
34
|
border-bottom-right-radius: 10px;
|
35
35
|
border-right: 1px solid #ababab;
|
36
36
|
}
|
37
|
+
|
38
|
+
> td.mobile-tab-icon {
|
39
|
+
background-size: auto 75%;
|
40
|
+
background-repeat: no-repeat;
|
41
|
+
background-position: 7px 5px;
|
42
|
+
padding-left: 44px;
|
43
|
+
}
|
37
44
|
}
|
38
45
|
}
|
39
46
|
}
|
data/lib/light_mobile/tabs.rb
CHANGED
@@ -12,11 +12,17 @@ class LightMobile::Tabs
|
|
12
12
|
tr = table.add_ele(:tbody).add_ele(:tr)
|
13
13
|
|
14
14
|
@tabs.each do |tab|
|
15
|
-
td = tr.
|
15
|
+
td = tr.add(:td)
|
16
16
|
|
17
17
|
td.classes << "mobile-tab-active" if tab[:active]
|
18
18
|
td.data[:tab] = tab[:id]
|
19
|
-
|
19
|
+
|
20
|
+
if tab[:icon]
|
21
|
+
td.css["background-image"] = "url('#{tab[:icon]}')"
|
22
|
+
td.classes << "mobile-tab-icon"
|
23
|
+
end
|
24
|
+
|
25
|
+
td.add_str tab[:label] if tab[:label]
|
20
26
|
end
|
21
27
|
|
22
28
|
table.html.html_safe
|
data/lib/light_mobile/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: light_mobile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
@@ -65,11 +65,13 @@ files:
|
|
65
65
|
- app/assets/images/light_mobile/buttons/button_dark_bg.png
|
66
66
|
- app/assets/images/light_mobile/buttons/menu_icon.png
|
67
67
|
- app/assets/images/light_mobile/layout/header_bar_bg.png
|
68
|
-
- app/assets/javascripts/light_mobile/application.js
|
68
|
+
- app/assets/javascripts/light_mobile/application.js.coffee
|
69
|
+
- app/assets/javascripts/light_mobile/flash_errors.js.coffee
|
69
70
|
- app/assets/javascripts/light_mobile/menu.js.coffee
|
70
71
|
- app/assets/javascripts/light_mobile/tabs.js.coffee
|
71
72
|
- app/assets/stylesheets/light_mobile/application.css.scss
|
72
73
|
- app/assets/stylesheets/light_mobile/buttons.css.scss
|
74
|
+
- app/assets/stylesheets/light_mobile/flash_errors.css.scss
|
73
75
|
- app/assets/stylesheets/light_mobile/menu.css.scss
|
74
76
|
- app/assets/stylesheets/light_mobile/simple_form.css.scss
|
75
77
|
- app/assets/stylesheets/light_mobile/tables.css.scss
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|