lay_me_out 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +172 -0
  3. data/Rakefile +89 -0
  4. data/app/assets/images/lay_me_out/crumb-arrows.png +0 -0
  5. data/app/assets/images/lay_me_out/favicon.ico +0 -0
  6. data/app/assets/images/lay_me_out/header-background.png +0 -0
  7. data/app/assets/images/lay_me_out/main-background.png +0 -0
  8. data/app/assets/images/lay_me_out/missing_profile.png +0 -0
  9. data/app/assets/images/lay_me_out/payroll-hero-logo-light.png +0 -0
  10. data/app/assets/images/lay_me_out/ph-logo.png +0 -0
  11. data/app/assets/javascripts/lay_me_out.js +18 -0
  12. data/app/assets/javascripts/lay_me_out/application-config.js +3 -0
  13. data/app/assets/javascripts/lay_me_out/navigation.js +29 -0
  14. data/app/assets/javascripts/lay_me_out/user_profile.js +25 -0
  15. data/app/assets/javascripts/lay_me_out/utils/flash-message.js +68 -0
  16. data/app/assets/javascripts/lay_me_out/utils/namespace.js +17 -0
  17. data/app/assets/stylesheets/lay_me_out.css +15 -0
  18. data/app/assets/stylesheets/lay_me_out/buttons.css.scss +55 -0
  19. data/app/assets/stylesheets/lay_me_out/colors.css.scss +31 -0
  20. data/app/assets/stylesheets/lay_me_out/flash.css.scss +40 -0
  21. data/app/assets/stylesheets/lay_me_out/flash_mobile.css.scss +7 -0
  22. data/app/assets/stylesheets/lay_me_out/forms.css.scss +79 -0
  23. data/app/assets/stylesheets/lay_me_out/headers.css.scss +50 -0
  24. data/app/assets/stylesheets/lay_me_out/layout.css.scss +377 -0
  25. data/app/assets/stylesheets/lay_me_out/mixins.css.scss +5 -0
  26. data/app/assets/stylesheets/lay_me_out/reset.css.scss +37 -0
  27. data/app/assets/stylesheets/lay_me_out/side_menu.css.scss +32 -0
  28. data/app/assets/stylesheets/lay_me_out/simple.css.scss +96 -0
  29. data/app/assets/stylesheets/lay_me_out/simple_mobile.css.scss +112 -0
  30. data/app/assets/stylesheets/lay_me_out/tables.css.scss +39 -0
  31. data/app/assets/stylesheets/lay_me_out/text.css.scss +3 -0
  32. data/app/controllers/lay_me_out/styleguide_controller.rb +11 -0
  33. data/app/helpers/lay_me_out/application_helper.rb +49 -0
  34. data/app/models/lay_me_out/user_details.rb +20 -0
  35. data/app/views/lay_me_out/common/_flash.html.haml +14 -0
  36. data/app/views/lay_me_out/common/_flash.mustache.haml +3 -0
  37. data/app/views/lay_me_out/common/_navigation.html.haml +12 -0
  38. data/app/views/lay_me_out/common/_segment_io.html.haml +3 -0
  39. data/app/views/lay_me_out/common/_user_profile.html.haml +12 -0
  40. data/app/views/lay_me_out/styleguide/index.html.haml +1786 -0
  41. data/app/views/layouts/lay_me_out/application.html.haml +47 -0
  42. data/app/views/layouts/lay_me_out/simple.html.haml +42 -0
  43. data/config/routes.rb +3 -0
  44. data/lib/lay_me_out.rb +18 -0
  45. data/lib/lay_me_out/breadcrumb_builder.rb +46 -0
  46. data/lib/lay_me_out/controllers/layout.rb +13 -0
  47. data/lib/lay_me_out/controllers/navigation.rb +36 -0
  48. data/lib/lay_me_out/engine.rb +12 -0
  49. data/lib/lay_me_out/segment_io.rb +20 -0
  50. data/lib/lay_me_out/version.rb +3 -0
  51. data/lib/tasks/lay_me_out_tasks.rake +4 -0
  52. metadata +276 -0
@@ -0,0 +1,5 @@
1
+ @mixin background-gradient($colour1, $colour2) {
2
+ background: -webkit-linear-gradient($colour1, $colour2);
3
+ background: -moz-linear-gradient($colour1, $colour2);
4
+ background: linear-gradient($colour1, $colour2);
5
+ }
@@ -0,0 +1,37 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ b, u, i, center,
7
+ dl, dt, dd, ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, embed,
11
+ figure, figcaption, footer, header, hgroup,
12
+ menu, nav, output, ruby, section, summary,
13
+ time, mark, audio, video {
14
+ margin: 0;
15
+ padding: 0;
16
+ border: 0;
17
+ font-size: 100%;
18
+ font: inherit;
19
+ vertical-align: baseline;
20
+ }
21
+
22
+ body {
23
+ line-height:1;
24
+ font-family: Helvetica,Arial;
25
+ font-size: 12px;
26
+ color: #696969;
27
+ background: image-url('lay_me_out/main-background.png') #dedede;
28
+ margin: 0
29
+ }
30
+
31
+ a {
32
+ text-decoration:none;
33
+ }
34
+
35
+ ul {
36
+ list-style:none;
37
+ }
@@ -0,0 +1,32 @@
1
+ @import "mixins.css.scss";
2
+
3
+ div#side-menu {
4
+ width:250px;
5
+ float:left;
6
+
7
+ li a {
8
+ color: #d8d8d8;
9
+ text-shadow: 0 -1px 0 black;
10
+ @include background-gradient(#4d4d4d,#464646);
11
+ border-top: 1px solid rgba(0,0,0,0.1);
12
+ border-left: 0;
13
+ border-bottom: 1px solid rgba(0,0,0,0.1);
14
+ border-right: 0;
15
+ box-shadow: inset 0 1px 0 rgba(141,141,141,0.2);
16
+ font-weight: normal;
17
+ padding: 12px 15px;
18
+ display:block;
19
+
20
+ &:hover { @include background-gradient(#5F5F5F, #555); }
21
+ }
22
+
23
+ li.active a {
24
+ background: #f7f7f7;
25
+ border-left: 3px solid #52c7ec;
26
+ color: #707070;
27
+ text-shadow: none;
28
+ font-weight: bold;
29
+ box-shadow: -4px 6px 6px rgba(34,34,34,0.23);
30
+ }
31
+ }
32
+
@@ -0,0 +1,96 @@
1
+ @import "colors.css.scss";
2
+
3
+ body.simple {
4
+ -webkit-user-select: none;
5
+ user-select: none;
6
+
7
+ header {
8
+ background: #222;
9
+
10
+ .tagline {
11
+ height: 46px;
12
+ display: inline-block;
13
+ border-left: 1px solid rgba(255, 255, 255, 0.06);
14
+ margin-left: 15px;
15
+ vertical-align: top;
16
+
17
+ p {
18
+ font-size: 17px;
19
+ font-weight: lighter;
20
+ margin-top: 12px;
21
+ padding-left: 20px;
22
+ color: #979797;
23
+ text-shadow: 1px 1px 1px #000;
24
+ font-family: Helvetica Neue, Helvetica, Arial;
25
+ }
26
+
27
+ strong {
28
+ font-weight: bold;
29
+ color: #fff;
30
+ }
31
+ }
32
+ }
33
+
34
+ div.wrapper {
35
+ max-width: 1400px;
36
+ margin: 0 auto;
37
+ padding: 0 25px;
38
+ }
39
+
40
+ section#contents-container {
41
+ margin:45px 0 40px;
42
+
43
+ div#content {
44
+ margin: 0 auto;
45
+ box-shadow: 0 4px 10px rgba(0,0,0,0.12),inset 0 1px 0 white;
46
+ border-radius: 5px;
47
+ background: #f7f7f7;
48
+ padding: 25px;
49
+ border: 1px solid rgba(0,0,0,0.25);
50
+
51
+ h3 {
52
+ font-weight: normal;
53
+ font-size: 16px;
54
+ color: #999;
55
+ text-align: center;
56
+ }
57
+
58
+ }
59
+ }
60
+
61
+ footer {
62
+ margin-top: 40px;
63
+ width: 100%;
64
+ height: 60px;
65
+
66
+ text-align: center;
67
+ margin-bottom: 50px;
68
+
69
+ ul {
70
+ list-style: none;
71
+ padding: 5px 0;
72
+
73
+ li {
74
+ display: inline-block;
75
+ }
76
+ }
77
+
78
+ ul#legalese li {
79
+ display:inline-block;
80
+
81
+ a {
82
+ background: #fff;
83
+ padding: 3px 6px 4px;
84
+ font-size: 11px;
85
+ border-radius: 2px;
86
+ vertical-align: 2px;
87
+ box-shadow: 0 2px 2px rgba(0,0,0,0.1);
88
+ border: 1px solid #d0d0d0;
89
+ }
90
+
91
+ a:active {
92
+ box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.05);
93
+ }
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,112 @@
1
+ body.simple {
2
+ button,
3
+ input[type=submit] {
4
+ -webkit-appearance: none; // turn off iOS's button re-styling
5
+ }
6
+ }
7
+
8
+ // general adjustment to switch to mobile mode
9
+ @media only
10
+ screen and (max-width: 550px),
11
+ screen and (max-height: 550px) {
12
+ body.simple {
13
+ -webkit-text-size-adjust: none; // turn off iOS's text scaling
14
+
15
+ footer {
16
+ display: none;
17
+ }
18
+
19
+ header {
20
+ text-align: center;
21
+
22
+ .tagline {
23
+ border: none;
24
+ margin: 0;
25
+ height: initial;
26
+
27
+ p {
28
+ padding: 0;
29
+ }
30
+ }
31
+ }
32
+
33
+ section#contents-container {
34
+ margin: 0;
35
+
36
+ form {
37
+ label {
38
+ display: inline;
39
+ font-size: 16px;
40
+ }
41
+
42
+ input[type=text],
43
+ input[type=password] {
44
+ margin-top: 5px;
45
+ font-size: 24px;
46
+ height: 50px;
47
+ }
48
+
49
+ input[type=submit] {
50
+ width: 100%;
51
+ height: 50px;
52
+ font-size: 120%;
53
+ }
54
+
55
+ }
56
+
57
+ .wrapper {
58
+ padding: 0;
59
+
60
+ #content {
61
+ border: none;
62
+ border-radius: 0;
63
+ box-shadow: none;
64
+ width: auto;
65
+ }
66
+ }
67
+ }
68
+
69
+ }
70
+
71
+ }
72
+
73
+ // specific tweaks for horizontal mode
74
+ @media only
75
+ screen and (max-height: 426px) {
76
+ body.simple {
77
+ header {
78
+ padding: 0;
79
+
80
+ .tagline {
81
+ display: none;
82
+ }
83
+ }
84
+
85
+ section#contents-container {
86
+
87
+ form {
88
+ label {
89
+ font-size: 12px;
90
+ }
91
+
92
+ input[type=text],
93
+ input[type=password] {
94
+ font-size: 16px;
95
+ height: 34px;
96
+ margin-bottom: 10px;
97
+ }
98
+
99
+ input[type=submit] {
100
+ height: 34px;
101
+ }
102
+
103
+ }
104
+
105
+ .wrapper {
106
+ #content {
107
+ padding: 10px;
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,39 @@
1
+ table.normal {
2
+ position: relative;
3
+ margin-bottom: 30px;
4
+ width: 100%;
5
+ overflow: visible;
6
+ border: 1px solid #E9E9E9;
7
+ }
8
+
9
+ table.normal tr{font-size: 12px;}
10
+
11
+ table.normal tr th, summary {
12
+ color: #878787;
13
+ font-weight: bold;
14
+ font-size: 11px;
15
+ text-align: left;
16
+ text-shadow: 1px 1px 0 white;
17
+ background: -webkit-linear-gradient(#E6E6E6, #dcdcdc);
18
+ background: -moz-linear-gradient(#E6E6E6, #dcdcdc);
19
+ background: linear-gradient(#E6E6E6, #dcdcdc);
20
+ padding: 5px 15px 2px;
21
+ border: 1px solid #DDD;
22
+ border-bottom: 1px solid #BBB;
23
+ }
24
+
25
+ table.normal th, table.normal td {
26
+ padding: 6px 8px;
27
+ border: 1px solid #e9e9e9;
28
+ box-shadow: inset 1px 1px 0 rgba(255,255,255,0.7);
29
+ vertical-align: middle;
30
+ text-align: left;
31
+ line-height: 20px;
32
+ }
33
+
34
+ table.normal th:first-child {box-shadow: inset 0 1px 0 #fff;}
35
+ table.normal th:last-child, .table td:last-child {border-right: 0 none;}
36
+ table.normal tr:nth-child(odd) td {background: #f2f2f2;}
37
+ table.normal tr:nth-child(even) td {background: #f8f8f8;}
38
+ table.normal tr:last-child td {border-bottom: 0 none;}
39
+ table.normal tbody tr:hover td { color: #2d2d2d; }
@@ -0,0 +1,3 @@
1
+ p {
2
+ margin-bottom:10px;
3
+ }
@@ -0,0 +1,11 @@
1
+ module LayMeOut
2
+ class StyleguideController < ::ApplicationController
3
+ add_breadcrumb "Styleguide", :root_path
4
+
5
+ def index
6
+ flash.now[:error] = "This is an error message!"
7
+ flash.now[:warning] = "This is a warning message"
8
+ flash.now[:success] = ["This is a success message!", "So it this!"]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,49 @@
1
+ module LayMeOut
2
+ module ApplicationHelper
3
+ def render_user_profile
4
+ render :partial => "lay_me_out/common/user_profile", :locals => { :user => controller.current_user_details } if has_value_for?(:current_user_details)
5
+ end
6
+
7
+ def render_navigation
8
+ render :partial => 'lay_me_out/common/navigation', :locals => { :links => controller.navigation_links } if has_value_for?(:navigation_links)
9
+ end
10
+
11
+ def css_active_class_for(path)
12
+ is_active = false
13
+
14
+ if path.is_a? Hash
15
+ path.each do |key, subpath|
16
+ is_active = controller.active_page?(subpath)
17
+ break if is_active
18
+ end
19
+ else
20
+ is_active = controller.active_page?(path)
21
+ end
22
+
23
+ is_active ? "active" : ""
24
+ end
25
+
26
+ def content_class
27
+ content_for?(:side_menu) ? "two-column" : "one-column"
28
+ end
29
+
30
+ def convert_flash_to_json
31
+ messages = []
32
+
33
+ flash.each do |key, values|
34
+ values = [values] unless values.is_a?(Array)
35
+ values.each do |value|
36
+ messages << { :content => value, :type => key }
37
+ end
38
+ end
39
+
40
+ messages.to_json
41
+ end
42
+
43
+ private
44
+
45
+ def has_value_for?(method)
46
+ !!(controller.class.method_defined?(method) and controller.send(method))
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,20 @@
1
+ module LayMeOut
2
+ class UserDetails
3
+ def initialize(attr)
4
+ @name = attr.fetch(:name)
5
+ @position = attr[:position]
6
+ @links = attr[:links]
7
+ @profile_picture = attr[:profile_picture]
8
+ end
9
+
10
+ attr_reader :name, :position
11
+
12
+ def profile_picture
13
+ @profile_picture ||= 'lay_me_out/missing_profile.png'
14
+ end
15
+
16
+ def links
17
+ @links ||= {}
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ %script{:id => 'flash-message-template', :type => 'text/html'}
2
+ = render :template => 'lay_me_out/common/_flash.mustache'
3
+
4
+ :javascript
5
+ $(function() {
6
+ var flash = LayMeOut.Utils.FlashMessage.getInstance({
7
+ containerId: 'flash',
8
+ messageClass: 'message',
9
+ messageTemplateId: 'flash-message-template',
10
+ interval: 5000
11
+ });
12
+
13
+ flash.showFlashMessages(#{convert_flash_to_json});
14
+ });
@@ -0,0 +1,3 @@
1
+ %div{ :class => "message {{type}}"}
2
+ %p {{content}}
3
+ %span.close
@@ -0,0 +1,12 @@
1
+ %ul
2
+ - links.each do |text, path|
3
+ - if path.is_a? Hash
4
+ %li{ :class => "has-sub-menu #{css_active_class_for(path) }" }
5
+ = link_to text, "#"
6
+ %nav.sub-menu
7
+ .wrapper
8
+ %ul
9
+ - path.each do |text, subpath|
10
+ %li{ :class => css_active_class_for(subpath) }= link_to text, subpath
11
+ - else
12
+ %li{ :class => css_active_class_for(path) }= link_to text, path