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.
- checksums.yaml +4 -4
- data/app/assets/builds/tranzito_utils-compiled.css +71 -9919
- data/app/assets/stylesheets/tranzito_utils/_admin_header.scss +46 -7
- data/app/assets/stylesheets/tranzito_utils/_alerts.scss +0 -22
- data/app/assets/stylesheets/tranzito_utils/_period_selection.scss +0 -1
- data/app/assets/stylesheets/tranzito_utils/_table_extensions.scss +55 -10
- data/app/assets/stylesheets/tranzito_utils/{_utils.scss → _utilities.scss} +2 -2
- data/app/assets/stylesheets/tranzito_utils.scss +10 -9
- data/app/views/tranzito_utils/_flash_messages.html.haml +2 -2
- data/app/views/tranzito_utils/_period_select.html.haml +1 -1
- data/lib/tranzito_utils/helpers/helpers.rb +10 -0
- data/lib/tranzito_utils/version.rb +1 -1
- metadata +7 -8
- data/app/assets/stylesheets/tranzito_utils/_variables.scss +0 -2
@@ -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
|
-
@
|
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
|
-
@
|
28
|
-
|
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
|
-
@
|
46
|
-
|
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
|
-
@
|
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
|
-
}
|
@@ -1,11 +1,59 @@
|
|
1
|
-
//
|
2
|
-
//
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
// ^
|
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
|
-
@
|
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 {
|
@@ -1,14 +1,15 @@
|
|
1
|
-
@import 'bootstrap/scss/
|
1
|
+
@import 'bootstrap/scss/functions';
|
2
|
+
@import 'bootstrap/scss/variables';
|
3
|
+
@import 'bootstrap/scss/mixins';
|
2
4
|
|
3
|
-
|
4
|
-
@import "tranzito_utils/variables";
|
5
|
+
$text-color: #212529;
|
5
6
|
|
6
7
|
// Utilities
|
7
|
-
@import
|
8
|
-
@import
|
9
|
-
@import
|
10
|
-
@import
|
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
|
14
|
-
@import
|
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:
|
6
|
-
%button.close{
|
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
|
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
|
+
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-
|
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/
|
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.
|
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
|