tranzito_utils 1.1.4 → 1.1.5

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.
@@ -1,5 +1,43 @@
1
+ // Equivalent to: .nav.nav-pills
2
+ // Including in a mixin because otherwise it overrides nav styles everywhere when tranzito_utils.css is imported
3
+ @mixin bootstrap-nav-pills {
4
+ //
5
+ // .nav
6
+ //
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ padding-left: 0;
10
+ margin-bottom: 0;
11
+ list-style: none;
12
+
13
+ //
14
+ // .nav-pills
15
+ //
16
+ .nav-link {
17
+ @include border-radius($nav-pills-border-radius);
18
+ }
19
+
20
+ .nav-link.active,
21
+ .show > .nav-link {
22
+ color: $nav-pills-link-active-color;
23
+ background-color: $nav-pills-link-active-bg;
24
+ }
25
+ }
26
+
27
+ // Equivalent to .col-12
28
+ @mixin bootstrap-col-12 {
29
+ flex: 0 0 100%;
30
+ max-width: 100%;
31
+ position: relative;
32
+ width: 100%;
33
+ padding-right: 15px;
34
+ padding-left: 15px;
35
+ }
36
+
37
+ // ^ Bootstrap styles that are imported as mixins to avoid polluting general styles
38
+
1
39
  .admin-header {
2
- @extend .clearfix;
40
+ @include clearfix;
3
41
  margin-bottom: 1rem;
4
42
  padding-bottom: 1.5rem;
5
43
  border-bottom: 1px solid #bdbdbd;
@@ -24,9 +62,8 @@
24
62
  }
25
63
  }
26
64
  ul {
27
- @extend .nav;
28
- @extend .nav-pills;
29
- @extend .justify-content-end;
65
+ @include bootstrap-nav-pills;
66
+ justify-content: flex-end;
30
67
 
31
68
  // On small screens, make nav links align left
32
69
  @include media-breakpoint-down(sm) {
@@ -42,8 +79,8 @@
42
79
  }
43
80
  }
44
81
  .subtitle {
45
- @extend .mt-4;
46
- @extend .col-12;
82
+ @include bootstrap-col-12;
83
+ margin-top: 1.5rem !important;
47
84
  }
48
85
  }
49
86
 
@@ -54,7 +91,9 @@
54
91
 
55
92
  // Because we want it to break on small screens
56
93
  .header-sublink {
57
- @extend .float-md-right !optional;
94
+ @include media-breakpoint-up(md) {
95
+ float: right;
96
+ }
58
97
  }
59
98
 
60
99
  // Because otherwise they overflow the right side of the screen
@@ -1,14 +1,3 @@
1
- // Bootstrap alerts for flash message types
2
- .alert-error {
3
- @extend .alert-danger;
4
- }
5
- .alert-alert {
6
- @extend .alert-warning;
7
- }
8
- .alert-notice {
9
- @extend .alert-info;
10
- }
11
-
12
1
  .flash-alert-container {
13
2
  position: fixed;
14
3
  z-index: 1049; // Modal z-index minus 1
@@ -29,14 +18,3 @@
29
18
  right: 3%;
30
19
  }
31
20
  }
32
-
33
- .valet-interface .flash-alert-container {
34
- position: relative;
35
- z-index: 1;
36
- width: 100%;
37
- top: 0;
38
- left: 0;
39
- .alert {
40
- margin-bottom: 0.5rem;
41
- }
42
- }
@@ -9,7 +9,6 @@
9
9
  }
10
10
 
11
11
  .custom-time-selection {
12
- @extend .row;
13
12
  justify-content: flex-end;
14
13
  // We always want the form to be inline, so style manually
15
14
  .form-group {
@@ -1,11 +1,59 @@
1
- // Some tables have skip-user as an option. Because of caching, we always want the same columns
2
- // So include the user and hide it the class is enabled
3
- .skip-user .user-cell,
4
- .skip-parking-location .parking-location-cell {
5
- display: none;
1
+ // Equivalent to: .table.table-striped.table-bordered.table-sm
2
+ // Including in a mixin because otherwise it overrides table styles everywhere when tranzito_utils.css is imported
3
+ @mixin bootstrap-table-sm-striped-bordered {
4
+ //
5
+ // .table
6
+ //
7
+ width: 100%;
8
+ margin-bottom: $spacer;
9
+ color: $table-color;
10
+ background-color: $table-bg; // Reset for nesting within parents with `background-color`.
11
+ th,
12
+ td {
13
+ padding: $table-cell-padding;
14
+ vertical-align: top;
15
+ border-top: $table-border-width solid $table-border-color;
16
+ }
17
+ thead th {
18
+ vertical-align: bottom;
19
+ border-bottom: (2 * $table-border-width) solid $table-border-color;
20
+ }
21
+ tbody + tbody {
22
+ border-top: (2 * $table-border-width) solid $table-border-color;
23
+ }
24
+
25
+ //
26
+ // .table-sm
27
+ //
28
+ th,
29
+ td {
30
+ padding: $table-cell-padding-sm;
31
+ }
32
+
33
+ //
34
+ // .table-bordered
35
+ //
36
+ border: $table-border-width solid $table-border-color;
37
+ th,
38
+ td {
39
+ border: $table-border-width solid $table-border-color;
40
+ }
41
+ thead {
42
+ th,
43
+ td {
44
+ border-bottom-width: 2 * $table-border-width;
45
+ }
46
+ }
47
+
48
+ //
49
+ // .table-striped
50
+ //
51
+ tbody tr:nth-of-type(#{$table-striped-order}) {
52
+ background-color: $table-accent-bg;
53
+ }
6
54
  }
7
55
 
8
- // ^ is bikehub unique styles, the following is shared with Bike Index
56
+ // ^ Bootstrap styles that are imported as mixins to avoid polluting general styles
9
57
 
10
58
  // Full screen table stuff
11
59
  @mixin full-screen-table-overflown {
@@ -42,10 +90,7 @@
42
90
  }
43
91
 
44
92
  .table-list {
45
- @extend .table;
46
- @extend .table-striped;
47
- @extend .table-bordered;
48
- @extend .table-sm;
93
+ @include bootstrap-table-sm-striped-bordered;
49
94
  tr td {
50
95
  line-height: 1.5;
51
96
  &:first-child {
@@ -36,8 +36,8 @@
36
36
  }
37
37
 
38
38
  label,
39
- input[type="checkbox"],
40
- input[type="radio"] {
39
+ input[type='checkbox'],
40
+ input[type='radio'] {
41
41
  cursor: pointer;
42
42
  }
43
43
 
@@ -1,14 +1,15 @@
1
- @import 'bootstrap/scss/bootstrap';
1
+ @import 'bootstrap/scss/functions';
2
+ @import 'bootstrap/scss/variables';
3
+ @import 'bootstrap/scss/mixins';
2
4
 
3
- // Variables
4
- @import "tranzito_utils/variables";
5
+ $text-color: #212529;
5
6
 
6
7
  // Utilities
7
- @import "tranzito_utils/utils";
8
- @import "tranzito_utils/pagination";
9
- @import "tranzito_utils/period_selection";
10
- @import "tranzito_utils/table_extensions";
8
+ @import 'tranzito_utils/utilities';
9
+ @import 'tranzito_utils/pagination';
10
+ @import 'tranzito_utils/period_selection';
11
+ @import 'tranzito_utils/table_extensions';
11
12
 
12
13
  // Sections
13
- @import "tranzito_utils/admin_header";
14
- @import "tranzito_utils/alerts";
14
+ @import 'tranzito_utils/admin_header';
15
+ @import 'tranzito_utils/alerts';
@@ -2,8 +2,8 @@
2
2
  - if flash.present?
3
3
  - flash.each do |type, message|
4
4
  - next unless message.present?
5
- .alert.alert-dismissible.fade.show{class: "alert-#{type}"}
6
- %button.close{ 'data-dismiss' => 'alert' } ×
5
+ .alert.alert-dismissible.fade.show{class: alert_class_for_flash(type)}
6
+ %button.close{'data-dismiss' => 'alert'} ×
7
7
  = message
8
8
  - if flash[:link]
9
9
  %br
@@ -34,7 +34,7 @@
34
34
  %button#periodSelectCustom.btn.btn-outline-secondary.btn-sm.ml-2{ class: ("active" if @period == "custom"), data: { period: "custom" } }
35
35
  custom
36
36
 
37
- %form#timeSelectionCustom.custom-time-selection.mt-2.collapse{ class: @period == "custom" ? "in show" : "" }
37
+ %form#timeSelectionCustom.custom-time-selection.row.mt-2.collapse{ class: @period == "custom" ? "in show" : "" }
38
38
  .form-group
39
39
  = label_tag :start_time_selector, "from", class: "control-label mr-2"
40
40
  = datetime_local_field_tag :start_time_selector, @start_time.strftime("%Y-%m-%dT%H:%M"), step: 60, class: "form-control"
@@ -55,6 +55,16 @@ module TranzitoUtils
55
55
  CodeRay.scan(JSON.pretty_generate(data), :json).div.html_safe
56
56
  end
57
57
 
58
+ def alert_class_for_flash(flash_type)
59
+ case flash_type
60
+ when "error" then "alert-danger"
61
+ when "alert" then "alert-warning"
62
+ when "notice" then "alert-info"
63
+ else
64
+ "alert-#{flash_type}"
65
+ end
66
+ end
67
+
58
68
  private
59
69
 
60
70
  def default_action_name_title
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TranzitoUtils
4
- VERSION = "1.1.4"
4
+ VERSION = "1.1.5"
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tranzito_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - willbarrettdev
8
8
  - sethherr
9
9
  - hafiz-ahmed
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-10-18 00:00:00.000000000 Z
13
+ date: 2022-10-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -58,8 +58,7 @@ files:
58
58
  - app/assets/stylesheets/tranzito_utils/_pagination.scss
59
59
  - app/assets/stylesheets/tranzito_utils/_period_selection.scss
60
60
  - app/assets/stylesheets/tranzito_utils/_table_extensions.scss
61
- - app/assets/stylesheets/tranzito_utils/_utils.scss
62
- - app/assets/stylesheets/tranzito_utils/_variables.scss
61
+ - app/assets/stylesheets/tranzito_utils/_utilities.scss
63
62
  - app/views/tranzito_utils/_flash_messages.html.haml
64
63
  - app/views/tranzito_utils/_period_select.html.haml
65
64
  - config/locales/en.yml
@@ -82,7 +81,7 @@ licenses:
82
81
  metadata:
83
82
  homepage_uri: https://github.com/Tranzito/tranzito_utils
84
83
  source_code_uri: https://github.com/Tranzito/tranzito_utils
85
- post_install_message:
84
+ post_install_message:
86
85
  rdoc_options: []
87
86
  require_paths:
88
87
  - lib
@@ -97,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
96
  - !ruby/object:Gem::Version
98
97
  version: '0'
99
98
  requirements: []
100
- rubygems_version: 3.1.2
101
- signing_key:
99
+ rubygems_version: 3.1.6
100
+ signing_key:
102
101
  specification_version: 4
103
102
  summary: Ruby gem contain several modules mainly containing the helpers, concerns
104
103
  and services for personal use by Tranzito
@@ -1,2 +0,0 @@
1
- $text-color: #212529;
2
-