shopapp 0.1.36 → 0.2.01

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 809c1808bac4fa298096a6f2acf6625e1cf214e7d5e78acc1c720f54eee5154c
4
- data.tar.gz: ac8c3e0b55f19b827fc09ccb7a4cbdf7a33dc5c20ee3c8875387b976bafd81ee
3
+ metadata.gz: 60b93c309ec47d8b932f06ba91255875d5c2ff5674218c7602532eb3b5c42baa
4
+ data.tar.gz: 4aa50ec7b8174321676bb1b331f6ed2fe8c783e441d2b9c3126ba0596384c4f8
5
5
  SHA512:
6
- metadata.gz: d60687bd2ed907f02c03afbfd622e6e9d72574f64db96571c1ecc8d10a1c819988d3ced9451559e1003666ebb55a6b843440de204070d538d4b2018bfa12541a
7
- data.tar.gz: 13c989dc16b127dca9e8b188158c7fe25c3c2cd0069c5de07d36132c2fc9ed068aa490cb0918f5cc1e0aed630547857315462b1446695f3a8930e42378122f87
6
+ metadata.gz: 808659fb8360689bcf614971378c48e792b0e8bb47eed0f86a39b8233d4e2dfdc6eee190f7a80a92bc10c064fec25c26babd8061fefa8a378059965ef538319c
7
+ data.tar.gz: 41cf3d4673a47ce451ed48a7e79173bc8f2b7b02db0c26ef8d03b549f6d248cc39694d85d128cbad2f783cf5264e5a47dd38e267a428585146afc5c2bf0b7899
@@ -1,2 +1,88 @@
1
+ @import "variables";
1
2
  @import "bootstrap";
2
3
  @import "font-awesome";
4
+
5
+ body {
6
+ font-size: .875rem;
7
+ }
8
+
9
+ .feather {
10
+ width: 16px;
11
+ height: 16px;
12
+ vertical-align: text-bottom;
13
+ }
14
+
15
+ /*
16
+ * Sidebar
17
+ */
18
+
19
+ .sidebar {
20
+ position: fixed;
21
+ top: 0;
22
+ bottom: 0;
23
+ left: 0;
24
+ z-index: 100; /* Behind the navbar */
25
+ padding: 48px 0 0; /* Height of navbar */
26
+ box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
27
+ }
28
+
29
+ .sidebar-sticky {
30
+ position: relative;
31
+ top: 0;
32
+ height: calc(100vh - 48px);
33
+ padding-top: .5rem;
34
+ overflow-x: hidden;
35
+ overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
36
+ }
37
+
38
+ @supports ((position: -webkit-sticky) or (position: sticky)) {
39
+ .sidebar-sticky {
40
+ position: -webkit-sticky;
41
+ position: sticky;
42
+ }
43
+ }
44
+
45
+ .sidebar .nav-link {
46
+ font-weight: 500;
47
+ color: $info;
48
+ }
49
+
50
+ .sidebar .nav-link .feather {
51
+ margin-right: 4px;
52
+ color: $secondary;
53
+ }
54
+
55
+ .sidebar .nav-link.active {
56
+ color: $primary;
57
+ }
58
+
59
+ .sidebar .nav-link:hover .feather,
60
+ .sidebar .nav-link.active .feather {
61
+ color: inherit;
62
+ }
63
+
64
+ .sidebar-heading {
65
+ font-size: .75rem;
66
+ text-transform: uppercase;
67
+ }
68
+
69
+ /*
70
+ * Content
71
+ */
72
+
73
+ [role="main"] {
74
+ padding-top: 48px; /* Space for fixed navbar */
75
+ }
76
+
77
+ /*
78
+ * Navbar
79
+ */
80
+
81
+ .navbar-brand {
82
+ //padding-top: .75rem;
83
+ //padding-bottom: .75rem;
84
+ //font-size: 1rem;
85
+ background-color: rgba(0, 0, 0, .25);
86
+ box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
87
+ }
88
+
@@ -0,0 +1,120 @@
1
+ // // Pulse 4.1.3
2
+ // // Bootswatch
3
+ //
4
+ // //
5
+ // // Color system
6
+ // //
7
+ //
8
+ // $white: #fff !default;
9
+ // $gray-100: #fafafa !default;
10
+ // $gray-200: #F9F8FC !default;
11
+ // $gray-300: #EDEDED !default;
12
+ // $gray-400: #cbc8d0 !default;
13
+ // $gray-500: #adb5bd !default;
14
+ // $gray-600: #868e96 !default;
15
+ // $gray-700: #444 !default;
16
+ // $gray-800: #343a40 !default;
17
+ // $gray-900: #17141F !default;
18
+ // $black: #000 !default;
19
+ //
20
+ // $blue: #007bff !default;
21
+ // $indigo: #6610f2 !default;
22
+ // $purple: #593196 !default;
23
+ // $pink: #e83e8c !default;
24
+ // $red: #FC3939 !default;
25
+ // $orange: #fd7e14 !default;
26
+ // $yellow: #EFA31D !default;
27
+ // $green: #13B955 !default;
28
+ // $teal: #20c997 !default;
29
+ // $cyan: #009CDC !default;
30
+
31
+ // Z theme colors
32
+ // Defined with help of http://colormind.io/bootstrap/
33
+
34
+ $zcolor_main: #6D049B !default;
35
+ $zcolor_neutral: #7487D0 !default; //928DAE
36
+ $zcolor_light: #f1f0f6 !default; //CECACF
37
+ $zcolor_dark: #100C2E !default;
38
+ $zcolor_secondary: #71678C !default; //8B669D
39
+
40
+ // Z functional colors
41
+ // As suggested by http://colormind.io/bootstrap/
42
+
43
+ $seance: #761ca6 !default; //Primary
44
+ $haiti: #0f0b2d !default; //Info - or Mirage: #191c27
45
+ $spring_leaves: #59836a !default; //Success
46
+ $red_damask: #d67332 !default; //Warning - or Brandy Punch: #d3722f
47
+ $pomegranate: #f44336 !default; //Danger
48
+
49
+ // Bootstrap colors
50
+
51
+ $primary: $seance !default;
52
+ $secondary: $zcolor_secondary !default;
53
+ $success: $spring_leaves !default;
54
+ $info: $haiti !default;
55
+ $warning: $red_damask !default;
56
+ $danger: $pomegranate !default;
57
+ $light: $zcolor_light !default;
58
+ $dark: $zcolor_dark !default;
59
+ //
60
+ // // Options
61
+ //
62
+ // $enable-rounded: false !default;
63
+ //
64
+ // // Body
65
+ //
66
+ // $body-color: $gray-700 !default;
67
+ //
68
+ // // Links
69
+ //
70
+ // $link-hover-color: $primary !default;
71
+ //
72
+ // // Fonts
73
+ //
74
+ // $font-size-base: 0.875rem !default;
75
+ //
76
+ // // Tables
77
+ //
78
+ // $table-border-color: rgba(0, 0, 0, 0.05) !default;
79
+ //
80
+ // // Forms
81
+ //
82
+ // $input-focus-border-color: $primary !default;
83
+ //
84
+ // // Dropdowns
85
+ //
86
+ // $dropdown-link-color: $gray-700 !default;
87
+ // $dropdown-link-hover-color: $white !default;
88
+ // $dropdown-link-hover-bg: $primary !default;
89
+ //
90
+ // // Navs
91
+ //
92
+ // $nav-tabs-border-color: $gray-300 !default;
93
+ // $nav-tabs-link-hover-border-color: $primary !default;
94
+ //
95
+ // // Navbar
96
+ //
97
+ // $navbar-padding-y: 1.2rem !default;
98
+ //
99
+ // $navbar-dark-hover-color: rgba($white,.9) !default;
100
+ // $navbar-dark-active-color: rgba($white,.9) !default;
101
+ //
102
+ // $navbar-light-color: rgba($black,.4) !default;
103
+ // $navbar-light-active-color: rgba($black,.7) !default;
104
+ // $navbar-light-disabled-color: rgba($black,.2) !default;
105
+ //
106
+ // // Progress bars
107
+ //
108
+ // $progress-bg: $gray-300 !default;
109
+ // $progress-bar-bg: $primary !default;
110
+ //
111
+ // // List group
112
+ //
113
+ // $list-group-bg: $gray-900 !default;
114
+ // $list-group-border-color: transparent !default;
115
+ //
116
+ // $list-group-hover-bg: lighten($list-group-bg, 10%) !default;
117
+ // $list-group-active-color: $white !default;
118
+ // $list-group-active-bg: $list-group-bg !default;
119
+ //
120
+ // $list-group-disabled-color: lighten($list-group-bg, 30%) !default;
@@ -3,4 +3,44 @@ module ShopappHelper
3
3
  user_scopes = JSON.parse @current_user['scopes']
4
4
  user_scopes.include?('admin') || user_scopes.include?(scope.to_s)
5
5
  end
6
+
7
+ def main_menu_link(url_path, link_text: nil, icon: nil)
8
+ link_class_list = 'nav-link'
9
+ link_class_list << ' active' if request.original_url.include? url_path.to_s
10
+ link_text ||= url_path.to_s.capitalize
11
+
12
+ full_link_text = <<~HTML.html_safe
13
+ <i class="fa fa-#{icon}"></i>
14
+ #{link_text}
15
+ HTML
16
+ <<~HTML2.html_safe
17
+ <li class="nav-item">#{ link_to(full_link_text, url_path, class: link_class_list)}</li>
18
+ HTML2
19
+ end
20
+
21
+ def secondary_menu(title, &block)
22
+ <<~HTML2.html_safe
23
+ <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
24
+ <span>#{title}</span>
25
+ </h6>
26
+ <ul class="nav flex-column mb-2>
27
+ #{capture &block}
28
+ </ul>
29
+ HTML2
30
+ end
31
+
32
+ def secondary_menu_link(url_path, link_text: nil, icon: nil)
33
+ link_text ||= url_path.to_s.capitalize
34
+ link_class_list = 'nav-link'
35
+ link_class_list << ' active' if request.original_url.include? url_path.to_s
36
+
37
+ <<~HTML.html_safe
38
+ <li class="nav-item">
39
+ <a class="#{link_class_list}" href="#{url_path}">
40
+ <i class="fa fa-#{icon}"></i>
41
+ #{link_text}
42
+ </a>
43
+ </li>
44
+ HTML
45
+ end
6
46
  end
@@ -1,38 +1,51 @@
1
- .navbar.navbar-expand-md.navbar-light.bg-secondary
2
- .container-fluid
3
- = link_to(Rails.configuration.settings['shopapp_name'], '/', class: 'navbar-brand')
4
- %button.navbar-toggler(type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation")
5
- %span.navbar-toggler-icon
6
- #navbarSupportedContent.collapse.navbar-collapse.navbar-toggleable-xs
7
- - unless controller.class.do_hide_search_for_this_controller
8
- .w-75.mx-md-auto.mt-4.mt-md-0
9
- %form(action="#{controller.class.search_path || '/'}")
10
- .input-group
11
- %input#search.form-control(name="search" placeholder="Search" type="text" value=@search)
12
- %button.btn.btn-dark.input-group-addon(type="submit")
1
+ -# Generated with help of:
2
+ -# https://getbootstrap.com/docs/4.1/examples/dashboard/#
3
+ -# https://fontawesome.com/v4.7.0/icons/
4
+ %nav.navbar.navbar-dark.fixed-top.bg-dark.flex-md-nowrap.p-0.shadow.navbar-expand-md
5
+ = link_to(Rails.configuration.settings['shopapp_name'], '/', class: 'navbar-brand col-3 col-md-2 mr-0')
6
+ %button.navbar-toggler(type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation")
7
+ %span.navbar-toggler-icon
8
+ #navbarSupportedContent.collapse.navbar-collapse.navbar-toggleable-xs
9
+ - unless controller.class.do_hide_search_for_this_controller
10
+ .w-75.mx-md-auto.mt-4.mt-md-0.ml-3
11
+ %form(action="#{controller.class.search_path || '/'}")
12
+ .input-group.input-group-sm
13
+ %input#search.form-control(name="search" placeholder="Search" type="text" value=@search)
14
+ .input-group-append
15
+ %button.btn.btn-outline-light(type="submit")
13
16
  %i.fa.fa-search.mx-4(aria-hidden="true")
14
- %ul.navbar-nav.ml-auto
15
- = render 'layouts/header_menu'
16
- %li.nav-item.dropdown
17
- %a#navbarDropdown.nav-link.dropdown-toggle(href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false")
18
- %i.fa.fa-th(aria-hidden="true")
19
- .dropdown-menu.dropdown-menu-right(aria-labelledby="navbarDropdown")
20
- -(@current_user['company']['apps'] || []).each do |app|
21
- - if app['home'].present?
22
- %a.dropdown-item(href="#{app['home']}")=app['name']
23
- %li.nav-item.dropdown.ml-md-2
24
- %a#navbarDropdown.nav-link.dropdown-toggle(href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false")
25
- %i.fa.fa-user(aria-hidden="true")
26
- .dropdown-menu.dropdown-menu-right(aria-labelledby="navbarDropdown")
27
- .dropdown-header=@current_user['email']
28
- .dropdown-header
29
- %strong Company:
30
- =@current_user['company']['name']
31
- .dropdown-divider
32
- - (@current_user['memberships'] || []).reject { |c| @current_user['company']['code'] == c['code'] }.each do |c|
33
- = link_to(change_company_path(c['code']), method: :post, :class => 'dropdown-item') do
34
- Switch company to: #{c['name']}
35
- = link_to(logout_path, method: :delete, :class => 'dropdown-item') do
36
- Logout
37
- .container-fluid.mt-2
38
- = yield
17
+ %ul.navbar-nav.ml-auto
18
+ = render 'layouts/header_menu'
19
+ %li.nav-item.dropdown.ml-3
20
+ %a#navbarDropdown.nav-link.dropdown-toggle(href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false")
21
+ %i.fa.fa-th(aria-hidden="true")
22
+ .dropdown-menu.dropdown-menu-right(aria-labelledby="navbarDropdown")
23
+ -(@current_user['company']['apps'] || []).each do |app|
24
+ - if app['home'].present?
25
+ %a.dropdown-item(href="#{app['home']}")=app['name']
26
+ %li.nav-item.dropdown.ml-md-2.ml-3.mr-3
27
+ %a#navbarDropdown.nav-link.dropdown-toggle(href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false")
28
+ %i.fa.fa-user(aria-hidden="true")
29
+ .dropdown-menu.dropdown-menu-right(aria-labelledby="navbarDropdown")
30
+ .dropdown-header=@current_user['email']
31
+ .dropdown-header
32
+ %strong Company:
33
+ =@current_user['company']['name']
34
+ .dropdown-divider
35
+ - (@current_user['memberships'] || []).reject { |c| @current_user['company']['code'] == c['code'] }.each do |c|
36
+ = link_to(change_company_path(c['code']), method: :post, :class => 'dropdown-item') do
37
+ Switch company to: #{c['name']}
38
+ = link_to(logout_path, method: :delete, :class => 'dropdown-item') do
39
+ Logout
40
+ .container-fluid
41
+ - if lookup_context.exists? 'sidebar', 'layouts', true
42
+ .row
43
+ %nav.col-md-2.d-none.d-md-block.bg-light.sidebar
44
+ .sidebar-sticky
45
+ = render 'layouts/sidebar'
46
+ %main.col-md-10.ml-sm-auto.col-lg-10.px-4.mt-2{:role => "main"}
47
+ = yield
48
+ - else
49
+ .row
50
+ %main.col.px-4.mt-2{:role => "main"}
51
+ = yield
data/shopapp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopapp'
3
- s.version = '0.1.36'
4
- s.date = '2018-07-21'
3
+ s.version = '0.2.01'
4
+ s.date = '2018-09-10'
5
5
  s.summary = 'Do a shoplift.'
6
6
  s.description = 'Ha! Art thou Bedlam? Dost thou thirst base Trojan, to have me fold up Parca\'s fatal web? Hence!\
7
7
  I am qualmish at the smell of leek.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.36
4
+ version: 0.2.01
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-21 00:00:00.000000000 Z
11
+ date: 2018-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -155,6 +155,7 @@ files:
155
155
  - README.md
156
156
  - app/assets/javascripts/shopapp.js
157
157
  - app/assets/stylesheets/shopapp.scss
158
+ - app/assets/stylesheets/variables.scss
158
159
  - app/controllers/api_controller.rb
159
160
  - app/controllers/auth_controller.rb
160
161
  - app/controllers/concerns/shoplift_client.rb