effective_style_guide 1.5.5 → 2.0.0

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +13 -9
  4. data/app/controllers/effective/style_guide_controller.rb +17 -2
  5. data/app/models/effective/style_guide.rb +14 -2
  6. data/app/views/effective/style_guide/_alerts.html +45 -0
  7. data/app/views/effective/style_guide/_badges.html +45 -0
  8. data/app/views/effective/style_guide/_breadcrumbs.html +20 -0
  9. data/app/views/effective/style_guide/_buttons.html +87 -0
  10. data/app/views/effective/style_guide/_buttons_group.html +90 -0
  11. data/app/views/effective/style_guide/_cards.html +496 -0
  12. data/app/views/effective/style_guide/_collapse.html +85 -0
  13. data/app/views/effective/style_guide/_dropdowns.html +177 -0
  14. data/app/views/effective/style_guide/_form_with.html.haml +77 -0
  15. data/app/views/effective/style_guide/_input_groups.html +300 -0
  16. data/app/views/effective/style_guide/_jumbotrons.html +18 -0
  17. data/app/views/effective/style_guide/_list_groups.html +156 -0
  18. data/app/views/effective/style_guide/_modals.html +81 -0
  19. data/app/views/effective/style_guide/_navs.html +204 -0
  20. data/app/views/effective/style_guide/_pagination.html +126 -0
  21. data/app/views/effective/style_guide/_progress.html +120 -0
  22. data/app/views/effective/style_guide/show.html.haml +14 -80
  23. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_alerts.html.haml +0 -0
  24. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_breadcrumbs.html.haml +0 -0
  25. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_buttons.html.haml +0 -0
  26. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_form_horizontal.html.haml +0 -0
  27. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_form_inline.html.haml +0 -0
  28. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_form_vertical.html.haml +0 -0
  29. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_jumbotron.html.haml +0 -0
  30. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_labels.html.haml +0 -0
  31. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_list_groups.html.haml +0 -0
  32. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_modals.html.haml +0 -0
  33. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_navs.html.haml +0 -0
  34. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_pagination.html.haml +0 -0
  35. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_panels.html.haml +0 -0
  36. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_progress_bars.html.haml +0 -0
  37. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_tables.html.haml +0 -0
  38. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_thumbnails.html.haml +3 -2
  39. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_typography.html.haml +0 -0
  40. data/app/views/effective/{style_guide → style_guide_bootstrap3}/_wells.html.haml +0 -0
  41. data/app/views/effective/style_guide_bootstrap3/show.html.haml +89 -0
  42. data/config/effective_style_guide.rb +14 -14
  43. data/config/routes.rb +2 -3
  44. data/lib/effective_style_guide.rb +20 -6
  45. data/lib/effective_style_guide/version.rb +1 -1
  46. metadata +41 -56
  47. data/Rakefile +0 -20
  48. data/app/datatables/effective_style_guide_datatable.rb +0 -45
  49. data/app/models/effective/datatables/style_guide.rb +0 -55
  50. data/app/views/effective/style_guide/_effective_datatable.html.haml +0 -9
@@ -0,0 +1,126 @@
1
+ <nav aria-label="Page navigation example">
2
+ <ul class="pagination">
3
+ <li class="page-item"><a class="page-link" href="#">Previous</a></li>
4
+ <li class="page-item"><a class="page-link" href="#">1</a></li>
5
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
6
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
7
+ <li class="page-item"><a class="page-link" href="#">Next</a></li>
8
+ </ul>
9
+ </nav>
10
+
11
+ <br>
12
+
13
+ <nav aria-label="Page navigation example">
14
+ <ul class="pagination">
15
+ <li class="page-item">
16
+ <a class="page-link" href="#" aria-label="Previous">
17
+ <span aria-hidden="true">&laquo;</span>
18
+ <span class="sr-only">Previous</span>
19
+ </a>
20
+ </li>
21
+ <li class="page-item"><a class="page-link" href="#">1</a></li>
22
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
23
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
24
+ <li class="page-item">
25
+ <a class="page-link" href="#" aria-label="Next">
26
+ <span aria-hidden="true">&raquo;</span>
27
+ <span class="sr-only">Next</span>
28
+ </a>
29
+ </li>
30
+ </ul>
31
+ </nav>
32
+
33
+ <br>
34
+
35
+ <nav aria-label="...">
36
+ <ul class="pagination">
37
+ <li class="page-item disabled">
38
+ <a class="page-link" href="#" tabindex="-1">Previous</a>
39
+ </li>
40
+ <li class="page-item"><a class="page-link" href="#">1</a></li>
41
+ <li class="page-item active">
42
+ <a class="page-link" href="#">2 <span class="sr-only">(current)</span></a>
43
+ </li>
44
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
45
+ <li class="page-item">
46
+ <a class="page-link" href="#">Next</a>
47
+ </li>
48
+ </ul>
49
+ </nav>
50
+
51
+ <br>
52
+
53
+ <nav aria-label="...">
54
+ <ul class="pagination">
55
+ <li class="page-item disabled">
56
+ <span class="page-link">Previous</span>
57
+ </li>
58
+ <li class="page-item"><a class="page-link" href="#">1</a></li>
59
+ <li class="page-item active">
60
+ <span class="page-link">
61
+ 2
62
+ <span class="sr-only">(current)</span>
63
+ </span>
64
+ </li>
65
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
66
+ <li class="page-item">
67
+ <a class="page-link" href="#">Next</a>
68
+ </li>
69
+ </ul>
70
+ </nav>
71
+
72
+ <br>
73
+
74
+ <nav aria-label="...">
75
+ <ul class="pagination pagination-lg">
76
+ <li class="page-item disabled">
77
+ <a class="page-link" href="#" tabindex="-1">1</a>
78
+ </li>
79
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
80
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
81
+ </ul>
82
+ </nav>
83
+
84
+ <br>
85
+
86
+ <nav aria-label="...">
87
+ <ul class="pagination pagination-sm">
88
+ <li class="page-item disabled">
89
+ <a class="page-link" href="#" tabindex="-1">1</a>
90
+ </li>
91
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
92
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
93
+ </ul>
94
+ </nav>
95
+
96
+ <br>
97
+
98
+ <nav aria-label="Page navigation example">
99
+ <ul class="pagination justify-content-center">
100
+ <li class="page-item disabled">
101
+ <a class="page-link" href="#" tabindex="-1">Previous</a>
102
+ </li>
103
+ <li class="page-item"><a class="page-link" href="#">1</a></li>
104
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
105
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
106
+ <li class="page-item">
107
+ <a class="page-link" href="#">Next</a>
108
+ </li>
109
+ </ul>
110
+ </nav>
111
+
112
+ <br>
113
+
114
+ <nav aria-label="Page navigation example">
115
+ <ul class="pagination justify-content-end">
116
+ <li class="page-item disabled">
117
+ <a class="page-link" href="#" tabindex="-1">Previous</a>
118
+ </li>
119
+ <li class="page-item"><a class="page-link" href="#">1</a></li>
120
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
121
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
122
+ <li class="page-item">
123
+ <a class="page-link" href="#">Next</a>
124
+ </li>
125
+ </ul>
126
+ </nav>
@@ -0,0 +1,120 @@
1
+ <div class="progress">
2
+ <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
3
+ </div>
4
+
5
+ <br>
6
+
7
+ <div class="progress">
8
+ <div class="progress-bar" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
9
+ </div>
10
+
11
+ <br>
12
+
13
+ <div class="progress">
14
+ <div class="progress-bar" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
15
+ </div>
16
+
17
+ <br>
18
+
19
+ <div class="progress">
20
+ <div class="progress-bar" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
21
+ </div>
22
+
23
+ <br>
24
+
25
+ <div class="progress">
26
+ <div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
27
+ </div>
28
+
29
+ <br>
30
+
31
+ <div class="progress">
32
+ <div class="progress-bar w-75" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
33
+ </div>
34
+
35
+ <br>
36
+
37
+ <div class="progress">
38
+ <div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">25%</div>
39
+ </div>
40
+
41
+ <br>
42
+
43
+ <div class="progress" style="height: 1px;">
44
+ <div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
45
+ </div>
46
+
47
+ <br>
48
+
49
+ <div class="progress" style="height: 20px;">
50
+ <div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
51
+ </div>
52
+
53
+ <br>
54
+
55
+ <div class="progress">
56
+ <div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
57
+ </div>
58
+
59
+ <br>
60
+
61
+ <div class="progress">
62
+ <div class="progress-bar bg-info" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
63
+ </div>
64
+
65
+ <br>
66
+
67
+ <div class="progress">
68
+ <div class="progress-bar bg-warning" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
69
+ </div>
70
+
71
+ <br>
72
+
73
+ <div class="progress">
74
+ <div class="progress-bar bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
75
+ </div>
76
+
77
+ <br>
78
+
79
+ <div class="progress">
80
+ <div class="progress-bar" role="progressbar" style="width: 15%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
81
+ <div class="progress-bar bg-success" role="progressbar" style="width: 30%" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100"></div>
82
+ <div class="progress-bar bg-info" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
83
+ </div>
84
+
85
+ <br>
86
+
87
+ <div class="progress">
88
+ <div class="progress-bar progress-bar-striped" role="progressbar" style="width: 10%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
89
+ </div>
90
+
91
+ <br>
92
+
93
+ <div class="progress">
94
+ <div class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
95
+ </div>
96
+
97
+ <br>
98
+
99
+ <div class="progress">
100
+ <div class="progress-bar progress-bar-striped bg-info" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
101
+ </div>
102
+
103
+ <br>
104
+
105
+ <div class="progress">
106
+ <div class="progress-bar progress-bar-striped bg-warning" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
107
+ </div>
108
+
109
+ <br>
110
+
111
+ <div class="progress">
112
+ <div class="progress-bar progress-bar-striped bg-danger" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
113
+ </div>
114
+
115
+ <br>
116
+
117
+ <div class="progress">
118
+ <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
119
+ </div>
120
+
@@ -1,89 +1,23 @@
1
- .row.effective-style-guide
2
- .col-sm-3
3
- %nav
4
- %ul.nav.nav-pills.nav-stacked
5
- - @partials.each_with_index do |partial, index|
6
- %li{:class => ('active' if index == 0)}
7
- %a{:href => "##{partial.parameterize}"}= partial.titleize
1
+ .row{style: 'position: relative;'}
2
+ .col-3
3
+ .list-group{style: 'position: fixed;', id: 'effective-style-guide-sidebar'}
4
+ - @partials.each_with_index do |partial, index|
5
+ %a.list-group-item.list-group-item-action.py-1{href: '#' + partial.parameterize}= partial.titleize
8
6
 
9
- .col-sm-9
7
+ .col-9
10
8
  - @partials.each do |partial|
11
- %div.example{:id => "#{partial.parameterize}"}
12
- %span.example= partial.titleize
13
- = render :partial => partial
14
-
15
- - 10.times do
16
- %br
9
+ %a{name: partial.parameterize}
10
+ .card.my-3{id: partial.parameterize}
11
+ .card-header
12
+ = partial.titleize
13
+ .card-body
14
+ = render partial: partial
17
15
 
18
16
  :javascript
19
17
  var initStyleGuide = function() {
20
- $('.effective-style-guide > div > nav').affix({
21
- offset: { top: $('.effective-style-guide > div > nav').offset().top - 20 }
22
- });
23
-
24
- $('body').scrollspy({ target: '.effective-style-guide > div > nav', offset: 100 });
25
-
26
- $('.effective-style-guide > div > nav > ul a').on('click', function(event) {
27
- event.preventDefault();
28
- target = $(event.currentTarget).attr('href')
29
- if(target.length > 0) { $('html, body').scrollTop($(target).offset().top); }
30
- });
18
+ $('body').scrollspy({ target: '#effective-style-guide-sidebar', offset: 100 });
19
+ $('#effective-style-guide-sidebar').on('click', 'a', function(event) { event.stopPropagation(); });
31
20
  };
32
21
 
33
22
  $(document).ready(function() { initStyleGuide(); });
34
- $(document).on('page:change', function() { initStyleGuide(); });
35
23
  $(document).on('turbolinks:load', function() { initStyleGuide(); });
36
-
37
- :css
38
- .effective-style-guide nav {
39
- display: inline-block;
40
- }
41
-
42
- .effective-style-guide .nav > li > a {
43
- padding: 5px 10px;
44
- }
45
-
46
- .effective-style-guide .affix {
47
- position: fixed;
48
- top: 20px;
49
- }
50
-
51
- .effective-style-guide div.example {
52
- background-color: #fff;
53
- border-color: #ddd;
54
- border-radius: 4px 4px 0 0;
55
- border-width: 1px;
56
- box-shadow: none;
57
- margin-left: 0;
58
- margin-right: 0;
59
- margin-bottom: 30px;
60
- border-style: solid;
61
- padding: 45px 15px 15px;
62
- position: relative;
63
- }
64
-
65
- .effective-style-guide span.example {
66
- color: #959595;
67
- font-size: 12px;
68
- font-weight: 700;
69
- left: 15px;
70
- letter-spacing: 1px;
71
- position: absolute;
72
- text-transform: uppercase;
73
- top: 15px;
74
- }
75
-
76
- .effective-style-guide .inline-example {
77
- color: #959595;
78
- font-size: 12px;
79
- font-weight: 700;
80
- letter-spacing: 1px;
81
- text-transform: uppercase;
82
- margin-bottom: 20px;
83
- }
84
-
85
- / .effective-style-guide .inline-radio-or-checkboxes > span {
86
- / display: inline-block;
87
- / margin: 0px 10px 0px 0px;
88
- / }
89
-
@@ -2,13 +2,14 @@
2
2
  - 4.times do
3
3
  .col-sm-3
4
4
  %a.thumbnail{:href => '#'}
5
- %img{:src => 'http://placekitten.com/171/180', :height => 180, :width => 171}
5
+ %img{:src => 'http://placehold.it/171x180', :height => 180, :width => 171}
6
+
6
7
 
7
8
  .row
8
9
  - 3.times do
9
10
  .col-sm-4
10
11
  .thumbnail
11
- %img{:src => 'http://placekitten.com/242/200', :height => 200, :width => 242}
12
+ %img{:src => 'http://placehold.it/242x200', :height => 200, :width => 242}
12
13
  .caption
13
14
  %h3 Thumbnail Label
14
15
  %p Cumque iste repellat rerum asperiores libero. Omnis quia et illo. Dignissimos ut quod debitis.
@@ -0,0 +1,89 @@
1
+ .row.effective-style-guide
2
+ .col-sm-3
3
+ %nav
4
+ %ul.nav.nav-pills.nav-stacked
5
+ - @partials.each_with_index do |partial, index|
6
+ %li{:class => ('active' if index == 0)}
7
+ %a{:href => "##{partial.parameterize}"}= partial.titleize
8
+
9
+ .col-sm-9
10
+ - @partials.each do |partial|
11
+ %div.example{:id => "#{partial.parameterize}"}
12
+ %span.example= partial.titleize
13
+ = render partial: "effective/style_guide_bootstrap3/#{partial}"
14
+
15
+ - 10.times do
16
+ %br
17
+
18
+ :javascript
19
+ var initStyleGuide = function() {
20
+ $('.effective-style-guide > div > nav').affix({
21
+ offset: { top: $('.effective-style-guide > div > nav').offset().top - 20 }
22
+ });
23
+
24
+ $('body').scrollspy({ target: '.effective-style-guide > div > nav', offset: 100 });
25
+
26
+ $('.effective-style-guide > div > nav > ul a').on('click', function(event) {
27
+ event.preventDefault();
28
+ target = $(event.currentTarget).attr('href')
29
+ if(target.length > 0) { $('html, body').scrollTop($(target).offset().top); }
30
+ });
31
+ };
32
+
33
+ $(document).ready(function() { initStyleGuide(); });
34
+ $(document).on('page:change', function() { initStyleGuide(); });
35
+ $(document).on('turbolinks:load', function() { initStyleGuide(); });
36
+
37
+ :css
38
+ .effective-style-guide nav {
39
+ display: inline-block;
40
+ }
41
+
42
+ .effective-style-guide .nav > li > a {
43
+ padding: 5px 10px;
44
+ }
45
+
46
+ .effective-style-guide .affix {
47
+ position: fixed;
48
+ top: 20px;
49
+ }
50
+
51
+ .effective-style-guide div.example {
52
+ background-color: #fff;
53
+ border-color: #ddd;
54
+ border-radius: 4px 4px 0 0;
55
+ border-width: 1px;
56
+ box-shadow: none;
57
+ margin-left: 0;
58
+ margin-right: 0;
59
+ margin-bottom: 30px;
60
+ border-style: solid;
61
+ padding: 45px 15px 15px;
62
+ position: relative;
63
+ }
64
+
65
+ .effective-style-guide span.example {
66
+ color: #959595;
67
+ font-size: 12px;
68
+ font-weight: 700;
69
+ left: 15px;
70
+ letter-spacing: 1px;
71
+ position: absolute;
72
+ text-transform: uppercase;
73
+ top: 15px;
74
+ }
75
+
76
+ .effective-style-guide .inline-example {
77
+ color: #959595;
78
+ font-size: 12px;
79
+ font-weight: 700;
80
+ letter-spacing: 1px;
81
+ text-transform: uppercase;
82
+ margin-bottom: 20px;
83
+ }
84
+
85
+ / .effective-style-guide .inline-radio-or-checkboxes > span {
86
+ / display: inline-block;
87
+ / margin: 0px 10px 0px 0px;
88
+ / }
89
+