handcart 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/app/assets/stylesheets/handcart/application.css +2 -2
- data/app/controllers/handcart/application_controller.rb +1 -0
- data/app/views/handcart/ip_addresses/index.html.haml +1 -6
- data/config/locales/en.bootstrap.yml +18 -0
- data/lib/handcart/version.rb +1 -1
- data/lib/handcart.rb +1 -0
- data/spec/dummy/app/assets/stylesheets/layout.css.scss +4 -0
- data/spec/dummy/app/controllers/master/companies_controller.rb +1 -1
- data/spec/dummy/app/controllers/master_controller.rb +1 -0
- data/spec/dummy/app/controllers/public_controller.rb +4 -0
- data/spec/dummy/app/controllers/subdomain_controller.rb +1 -1
- data/spec/dummy/app/views/ip_addresses/index.html.haml +4 -2
- data/spec/dummy/app/views/layouts/_navbar.html.haml +1 -5
- data/spec/dummy/app/views/layouts/application.html.haml +2 -2
- data/spec/dummy/app/views/layouts/master/_navbar.html.haml +9 -0
- data/spec/dummy/app/views/layouts/master.html.haml +54 -0
- data/spec/dummy/app/views/layouts/public.html.haml +14 -17
- data/spec/dummy/app/views/master/companies/_form.html.haml +10 -18
- data/spec/dummy/app/views/master/companies/edit.html.haml +1 -5
- data/spec/dummy/app/views/master/companies/index.html.haml +30 -22
- data/spec/dummy/app/views/master/companies/new.html.haml +1 -3
- data/spec/dummy/app/views/master/companies/show.html.haml +20 -11
- data/spec/dummy/app/views/public/blocked.html.haml +3 -0
- data/spec/dummy/config/locales/en.yml +11 -0
- data/spec/dummy/config/routes.rb +4 -2
- data/spec/dummy/log/development.log +20053 -0
- data/spec/dummy/log/test.log +2358 -0
- data/spec/dummy/tmp/cache/assets/development/sass/dc98e44780f42e6521ebbf14c4db22f6a78c41ef/layout.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/00f08604d8f776c21ada846caa6bbdb0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0263bb05a0e6b1bbb810cd2f4d7673ec +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/029369cf8ac3e9e0b6dcd97be2f4c49f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/09f4c1aca54ad2a36967f2df2f81e8c4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0a87e84a465c32dab4ad98fc9c2a63a6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0b395be5ecda60a5af57d587f1141ab4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0f02e6ae06bc4a3cddeba71370b9725a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/106c3f4e1fc71e9dc70abae55d432886 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/159811a4b9b36a9fddf03e41ca8f9e77 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/17647e7d117bd32eab4e45df47ac67dd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1b59e740d598d1aa24b3715659ad75e4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1bfdad4d3fa050d80426d6303a2267ea +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/22eaff98c78726cf14701d84196b66d2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/26efc65ca6193b64fd767a821fb4b966 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2e705e0528152cd704e5c2735f9d504c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/350c8c72b1dbd7a84f85424b5cd4def1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3b1656b46a35a6120c3407b930d468ba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3b362be5f6b60c4800c552fde7b045eb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3e25506586171801c38ebc5dd9c47666 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3fa878a57cb0b42be266336564609b18 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/406e93ddf863a3e0af86de082236c986 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/41441c5b6158108c0a1546330ed56eef +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/45ab25244bc7a7b7bed42fe01caa6878 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/47e5dd3b45ba04424ecc42c81f015afe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/49d06f60db47faa83c8ce5def5ac20c9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4ebff88fcdd6819ef4b63c094176a00a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4f52964b54c90695a4b5d92bcf9bf535 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/52bd81a90f0de655ce390b5e352a756d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/55412c223bdc1ae2a172a96403d402b4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/58c9ead53e8c98abde8ba9f4c4862b06 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5a090729252c3b1a3ffa88f976d1ac9f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/605865fffcf6e4dc55c7cbcba3d4e01f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/63b0e0532e0484132e61fc894b29f918 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/69f7abb083a5343008bcba6c44de855b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6c6564ab3b132cc24a83e522c2876248 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6e9d2e7aafa45c939731291fa453b8c2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7266502e559c7ad7bbe585128999f415 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/750fa0bee9c70a91e72497d2f0787ed3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/76a356906034ebb7d3f1edea383df4df +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7a815a1a3d9620c5e03dfcdc0de24436 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7efdaf15bce3bf81ff3d63bcdc260ef1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8102cf6724f489a310fe3a6b764bb2e9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8306463fbe9a61679c7e29914fc30061 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8c924a4bf7fe2fc32f867164f98caf8f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/929de757bf766a6bb375bdf26e0a40c7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/995dfd030589cb8dafa38a482a964a6a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a2dde4b4f4a5869b431e268fc1b20fce +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a5846dde80b078842fb21cba47e4ba58 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a6a79bd215494799aaff25ea9664965f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/aaafe63e42e6d7dc3923e06a5aee0a34 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b66b48f9661f23aa3c5588d67d1fef2d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bacb89735f1c6bfe52a73e4d541a00f9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c1bf9e9fc1b3fa311ed5130bc8d26a56 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ca063dc0143516fea81c69d251791fbc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d1bec5a7c52bb09d51096ff25a14913b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d32fc7356f764b22ecbcebbcb9b47ee1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d5b06b4a3dab1db6e512605222dc5334 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d7799fbe35d038230ad7e1149c39256f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d822c4fab433c39caf65c804d7d845c1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d8309081cb7ed785135d35b9280cbef2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/eb5896a1cdcb574371c6341692bc0d15 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fc996723b5c9f2d40a14f420b65f0465 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fd074761725d9953f7e2605d65da4f90 +0 -0
- metadata +139 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb847b75e15d920aed108be9b5bb359f9a703ac2
|
4
|
+
data.tar.gz: a5597cab534cc5df286c77a117729caa44ee142b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff06fc331c819cdcb2089d16368152158869938f44a346b53c02b93eef10739b5950cb229392618cdbc73b156e49dcaf899ddf0244a0178205171107105f1063
|
7
|
+
data.tar.gz: cb817519edcc91c7430dbb48105c1a6a4cdc1fb4205c7b4e6f71c4dc4b2c80d786a159d98cbd629b56fad7faf1b2b11d76515ef3ec9052e1c2d853ac663bcafe
|
data/README.md
CHANGED
@@ -4,10 +4,18 @@
|
|
4
4
|
|
5
5
|
### Installation
|
6
6
|
|
7
|
+
###### RubyGems
|
8
|
+
|
7
9
|
```ruby
|
8
10
|
gem 'handcart'
|
9
11
|
```
|
10
12
|
|
13
|
+
###### Github
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'handcart', git: 'https://github.com/mark-d-holmberg/handcart'
|
17
|
+
```
|
18
|
+
|
11
19
|
### Copy Migrations
|
12
20
|
|
13
21
|
Handcart requires that you copy over its migrations in the following manner:
|
@@ -238,7 +246,7 @@ the franchisee:
|
|
238
246
|
|
239
247
|
```ruby
|
240
248
|
# app/controllers/sessions_controller.rb
|
241
|
-
enable_blocking("public#
|
249
|
+
enable_blocking("public#blocked")
|
242
250
|
```
|
243
251
|
|
244
252
|
The first argument indicates the controller and action which will be redirected to should the IP authorization strategy indicate
|
@@ -9,7 +9,7 @@
|
|
9
9
|
* compiled file, but it's generally better to create a new file per style scope.
|
10
10
|
*
|
11
11
|
*= require_self
|
12
|
-
*=require twitter-bootstrap-static/bootstrap
|
13
|
-
*=require twitter-bootstrap-static/fontawesome
|
12
|
+
*= require twitter-bootstrap-static/bootstrap
|
13
|
+
*= require twitter-bootstrap-static/fontawesome
|
14
14
|
*= require_tree .
|
15
15
|
*/
|
@@ -14,18 +14,13 @@
|
|
14
14
|
%th= Handcart::IpAddress.human_attribute_name(:blacklisted)
|
15
15
|
%th
|
16
16
|
%th
|
17
|
-
%th
|
18
17
|
%tbody
|
19
18
|
- @ip_addresses.each do |ip_address|
|
20
19
|
%tr
|
21
|
-
%td= ip_address.address
|
20
|
+
%td= link_to ip_address.address, ip_address, title: t(".view_ip_address")
|
22
21
|
%td= ip_address.subnet_mask
|
23
22
|
%td= ip_address.handcart
|
24
23
|
%td= ip_address.blacklisted? ? "Yes" : "No"
|
25
|
-
%td.action-button
|
26
|
-
.pull-right
|
27
|
-
= link_to ip_address, class: 'btn', title: t(".view_ip_address") do
|
28
|
-
%i.icon-eye-open
|
29
24
|
%td.action-button
|
30
25
|
.pull-right
|
31
26
|
= link_to edit_ip_address_path(ip_address), class: 'btn', title: t(".edit_ip_address") do
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
|
+
|
4
|
+
en:
|
5
|
+
helpers:
|
6
|
+
actions: "Actions"
|
7
|
+
links:
|
8
|
+
back: "Back"
|
9
|
+
cancel: "Cancel"
|
10
|
+
confirm: "Are you sure?"
|
11
|
+
destroy: "Delete"
|
12
|
+
new: "New"
|
13
|
+
edit: "Edit"
|
14
|
+
titles:
|
15
|
+
edit: "Edit %{model}"
|
16
|
+
save: "Save %{model}"
|
17
|
+
new: "New %{model}"
|
18
|
+
delete: "Delete %{model}"
|
data/lib/handcart/version.rb
CHANGED
data/lib/handcart.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
%table.table.table-striped
|
4
4
|
%thead
|
5
5
|
%tr
|
6
|
-
%th
|
7
|
-
%th
|
6
|
+
%th= Handcart::IpAddress.human_attribute_name(:address)
|
7
|
+
%th= Handcart::IpAddress.human_attribute_name(:subnet_mask)
|
8
|
+
%th= Handcart::IpAddress.human_attribute_name(:blacklisted)
|
8
9
|
%tbody
|
9
10
|
- @ip_addresses.each do |ip_address|
|
10
11
|
%tr
|
11
12
|
%td= ip_address.address
|
12
13
|
%td= ip_address.subnet_mask
|
14
|
+
%td= ip_address.blacklisted? ? "Yes" : "No"
|
@@ -1,11 +1,7 @@
|
|
1
1
|
%ul.nav
|
2
|
-
%li
|
3
|
-
= link_to handcart_path do
|
4
|
-
%i.icon-heart
|
5
|
-
Handcart
|
6
2
|
- unless (Handcart.ip_authorization.ip_authorization_strategy == :none)
|
7
3
|
%li{class: (params[:controller] == "ip_addresses") ? "active" : nil}
|
8
4
|
= link_to main_app.ip_addresses_path do
|
9
5
|
%i.icon-screenshot
|
10
|
-
IP Addresses
|
6
|
+
My IP Addresses
|
11
7
|
|
@@ -17,14 +17,14 @@
|
|
17
17
|
= javascript_include_tag "application"
|
18
18
|
|
19
19
|
%body
|
20
|
-
.navbar.navbar-fluid-top
|
20
|
+
.navbar.navbar-fluid-top
|
21
21
|
.navbar-inner
|
22
22
|
.container-fluid
|
23
23
|
%a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
|
24
24
|
%span.icon-bar
|
25
25
|
%span.icon-bar
|
26
26
|
%span.icon-bar
|
27
|
-
%a.brand(href=
|
27
|
+
%a.brand(href=subdomain_root_path) Dummy
|
28
28
|
= render "layouts/navbar"
|
29
29
|
|
30
30
|
.container-fluid
|
@@ -0,0 +1,54 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html(lang="en")
|
3
|
+
%head
|
4
|
+
%meta(charset="utf-8")
|
5
|
+
%meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
|
6
|
+
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
|
7
|
+
%title= content_for?(:title) ? t('.title', title: yield(:title)) : t('.default_title')
|
8
|
+
= csrf_meta_tags
|
9
|
+
/ Le HTML5 shim, for IE6-8 support of HTML elements
|
10
|
+
/[if lt IE 9]
|
11
|
+
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"
|
12
|
+
= stylesheet_link_tag "application", media: "all"
|
13
|
+
= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png', sizes: '144x144'
|
14
|
+
= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png', sizes: '114x114'
|
15
|
+
= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png', sizes: '72x72'
|
16
|
+
= favicon_link_tag 'apple-touch-icon-precomposed.png', rel: 'apple-touch-icon-precomposed', type: 'image/png'
|
17
|
+
= javascript_include_tag "application"
|
18
|
+
|
19
|
+
%body
|
20
|
+
.navbar.navbar-fluid-top.navbar-inverse
|
21
|
+
.navbar-inner
|
22
|
+
.container-fluid
|
23
|
+
%a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
|
24
|
+
%span.icon-bar
|
25
|
+
%span.icon-bar
|
26
|
+
%span.icon-bar
|
27
|
+
%a.brand(href=master_root_path)
|
28
|
+
Master Dummy Backend
|
29
|
+
= render "layouts/master/navbar"
|
30
|
+
|
31
|
+
.container-fluid
|
32
|
+
.row-fluid
|
33
|
+
- if content_for?(:sidebar)
|
34
|
+
.span9
|
35
|
+
%div.flash-message
|
36
|
+
= bootstrap_flash
|
37
|
+
- if content_for?(:sub_title)
|
38
|
+
.page-header
|
39
|
+
%h3.sub-title.inline= content_for?(:sub_title) ? yield(:sub_title) : t('.default_sub_title')
|
40
|
+
%div= yield
|
41
|
+
.span3
|
42
|
+
.well.sidebar-nav
|
43
|
+
%ul.nav.nav-list= yield(:sidebar)
|
44
|
+
- else
|
45
|
+
.span12
|
46
|
+
%div.flash-message
|
47
|
+
= bootstrap_flash
|
48
|
+
- if content_for?(:sub_title)
|
49
|
+
.page-header
|
50
|
+
%h3.sub-title.inline= content_for?(:sub_title) ? yield(:sub_title) : t('.default_sub_title')
|
51
|
+
%div= yield
|
52
|
+
|
53
|
+
%footer
|
54
|
+
%p © Handcart #{Date.today.year}
|
@@ -17,25 +17,22 @@
|
|
17
17
|
= javascript_include_tag "application"
|
18
18
|
|
19
19
|
%body
|
20
|
+
.navbar.navbar-fluid-top
|
21
|
+
.navbar-inner
|
22
|
+
.container-fluid
|
23
|
+
%a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
|
24
|
+
%span.icon-bar
|
25
|
+
%span.icon-bar
|
26
|
+
%span.icon-bar
|
27
|
+
%a.brand(href=root_url) Public Dummy Frontend
|
20
28
|
.container-fluid
|
21
29
|
.row-fluid
|
22
|
-
|
23
|
-
.
|
24
|
-
|
25
|
-
-
|
26
|
-
.
|
27
|
-
|
28
|
-
%div= yield
|
29
|
-
.span3
|
30
|
-
.well.sidebar-nav
|
31
|
-
%ul.nav.nav-list= yield(:sidebar)
|
32
|
-
- else
|
33
|
-
.span12
|
34
|
-
%div.flash-message= bootstrap_flash
|
35
|
-
- if content_for?(:sub_title)
|
36
|
-
.page-header
|
37
|
-
%h3.sub-title.inline= content_for?(:sub_title) ? yield(:sub_title) : t('.default_sub_title')
|
38
|
-
%div= yield
|
30
|
+
.span12
|
31
|
+
%div.flash-message= bootstrap_flash
|
32
|
+
- if content_for?(:sub_title)
|
33
|
+
.page-header
|
34
|
+
%h3.sub-title.inline= content_for?(:sub_title) ? yield(:sub_title) : t('.default_sub_title')
|
35
|
+
%div= yield
|
39
36
|
|
40
37
|
%footer
|
41
38
|
%p © Handcart #{Date.today.year}
|
@@ -1,19 +1,11 @@
|
|
1
|
-
=
|
2
|
-
|
3
|
-
#error_explanation
|
4
|
-
%h2= "#{pluralize(@company.errors.count, "error")} prohibited this company from being saved:"
|
5
|
-
%ul
|
6
|
-
- @company.errors.full_messages.each do |msg|
|
7
|
-
%li= msg
|
1
|
+
= simple_form_for @company, html: { class: 'form-horizontal' } do |f|
|
2
|
+
= f.error_notification
|
8
3
|
|
9
|
-
.
|
10
|
-
= f.
|
11
|
-
= f.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
= f.collection_select :subdomain_id, Handcart::Subdomain.unallocated_or_current(@company), :id, :name
|
18
|
-
.actions
|
19
|
-
= f.submit 'Save'
|
4
|
+
.form-inputs
|
5
|
+
= f.input :name
|
6
|
+
= f.association :subdomain, collection: f.object.new_record? ? Handcart::Subdomain.unallocated : Handcart::Subdomain.unallocated_or_current(@company)
|
7
|
+
= f.input :active, as: :select, include_blank: false
|
8
|
+
|
9
|
+
.form-actions
|
10
|
+
= f.button :submit, class: 'btn btn-primary'
|
11
|
+
= link_to 'Cancel', companies_path, class: 'btn'
|
@@ -1,25 +1,33 @@
|
|
1
|
-
|
1
|
+
- title "Companies", false
|
2
2
|
|
3
|
-
|
4
|
-
%
|
5
|
-
|
6
|
-
%
|
7
|
-
|
8
|
-
|
9
|
-
%th
|
3
|
+
.page-header
|
4
|
+
%h3.sub-title.inline
|
5
|
+
Companies
|
6
|
+
%span
|
7
|
+
= link_to new_company_path, class: 'btn btn-primary', title: 'New Company' do
|
8
|
+
%i.icon-plus
|
10
9
|
|
11
|
-
|
10
|
+
%table.table.table-striped.table-hover#companies_index
|
11
|
+
%thead
|
12
12
|
%tr
|
13
|
-
%
|
14
|
-
%
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
%
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
%th Name
|
14
|
+
%th Subdomain
|
15
|
+
%th Active
|
16
|
+
%th
|
17
|
+
%th
|
18
|
+
%tbody
|
19
|
+
- @companies.each do |company|
|
20
|
+
%tr
|
21
|
+
%td= link_to company.name, company
|
22
|
+
%td
|
23
|
+
- if company.subdomain
|
24
|
+
= link_to company.subdomain.name, handcart.subdomain_path(company.subdomain)
|
25
|
+
- else
|
26
|
+
None
|
27
|
+
%td= company.active? ? "Yes" : "No"
|
28
|
+
%td.action-button
|
29
|
+
= link_to edit_company_path(company), class: 'btn', title: "Edit Company" do
|
30
|
+
%i.icon-pencil
|
31
|
+
%td.action-button
|
32
|
+
= link_to company, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', title: "Remove Company" do
|
33
|
+
%i.icon-remove
|
@@ -1,12 +1,21 @@
|
|
1
|
-
|
1
|
+
- title "Company : #{@company.to_s}"
|
2
2
|
|
3
|
-
%
|
4
|
-
%
|
5
|
-
|
6
|
-
%
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
=
|
3
|
+
%table.table.table-striped
|
4
|
+
%thead
|
5
|
+
%tr
|
6
|
+
%th= Company.human_attribute_name(:name)
|
7
|
+
%th= Company.human_attribute_name(:subdomain)
|
8
|
+
%th= Company.human_attribute_name(:active)
|
9
|
+
%th
|
10
|
+
%tbody
|
11
|
+
%tr
|
12
|
+
%td= @company.name
|
13
|
+
%td
|
14
|
+
- if @company.subdomain.present?
|
15
|
+
= link_to @company.subdomain.name, handcart.subdomain_path(@company.subdomain)
|
16
|
+
- else
|
17
|
+
None
|
18
|
+
%td= @company.active? ? "Yes" : "No"
|
19
|
+
%td.action-button
|
20
|
+
= link_to edit_company_path(@company), class: 'btn', title: "Edit Company" do
|
21
|
+
%i.icon-pencil
|
@@ -1,5 +1,16 @@
|
|
1
1
|
en:
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
company:
|
5
|
+
name: "Name"
|
6
|
+
subdomain: "Subdomain"
|
2
7
|
layouts:
|
8
|
+
master:
|
9
|
+
navbar:
|
10
|
+
main_app: 'Master Dummy Backend'
|
11
|
+
default_title: 'Master Dummy Backend'
|
12
|
+
default_sub_title: ''
|
13
|
+
title: "Master Dummy Backend : %{title}"
|
3
14
|
application:
|
4
15
|
navbar:
|
5
16
|
main_app: 'Dummy'
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
2
|
|
3
|
-
mount Handcart::Engine => "/handcart"
|
4
|
-
|
5
3
|
constraints(subdomain: /master/) do
|
4
|
+
# Handcart is managed from the master backend
|
5
|
+
mount Handcart::Engine => "/handcart"
|
6
|
+
|
6
7
|
scope module: 'master' do
|
7
8
|
resources :companies
|
8
9
|
match '/', to: 'dashboard#index', via: [:get], as: :master_root
|
@@ -17,6 +18,7 @@ Rails.application.routes.draw do
|
|
17
18
|
|
18
19
|
constraints Handcart::DomainConstraint.default_constraint do
|
19
20
|
match '/forbidden', to: 'public#forbidden', as: :public_forbidden, via: [:get]
|
21
|
+
match '/blocked', to: 'public#blocked', as: :public_blocked, via: [:get]
|
20
22
|
root to: 'public#index'
|
21
23
|
end
|
22
24
|
|