handcart 0.0.3 → 0.0.4

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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/handcart/application.js +1 -1
  4. data/app/assets/stylesheets/handcart/{application.css → application.css.scss} +1 -2
  5. data/app/assets/stylesheets/handcart/layout.css.scss +9 -1
  6. data/app/controllers/handcart/application_controller.rb +0 -1
  7. data/app/controllers/handcart/ip_addresses_controller.rb +4 -4
  8. data/app/controllers/handcart/subdomains_controller.rb +2 -2
  9. data/app/helpers/handcart/bootstrap_flash_helper.rb +26 -0
  10. data/app/models/handcart/concerns/handcarts.rb +1 -1
  11. data/app/models/handcart/ip_address.rb +1 -0
  12. data/app/models/handcart/subdomain.rb +1 -0
  13. data/app/views/handcart/ip_addresses/_form.html.haml +9 -9
  14. data/app/views/handcart/ip_addresses/index.html.haml +15 -9
  15. data/app/views/handcart/ip_addresses/show.html.haml +37 -19
  16. data/app/views/handcart/subdomains/_form.html.haml +6 -6
  17. data/app/views/handcart/subdomains/index.html.haml +10 -8
  18. data/app/views/handcart/subdomains/show.html.haml +30 -19
  19. data/app/views/layouts/handcart/_navbar.html.haml +16 -15
  20. data/app/views/layouts/handcart/application.html.haml +12 -12
  21. data/config/locales/en.yml +2 -1
  22. data/lib/handcart.rb +2 -1
  23. data/lib/handcart/simple_form.rb +45 -16
  24. data/lib/handcart/simple_form_bootstrap.rb +86 -0
  25. data/lib/handcart/version.rb +1 -1
  26. data/spec/dummy/app/assets/javascripts/application.js +1 -1
  27. data/spec/dummy/app/assets/stylesheets/{application.css → application.css.scss} +1 -2
  28. data/spec/dummy/app/assets/stylesheets/layout.css.scss +1 -1
  29. data/spec/dummy/app/controllers/application_controller.rb +1 -0
  30. data/spec/dummy/app/controllers/master/companies_controller.rb +1 -1
  31. data/spec/dummy/app/views/kaminari/_first_page.html.haml +2 -0
  32. data/spec/dummy/app/views/kaminari/_gap.html.haml +2 -0
  33. data/spec/dummy/app/views/kaminari/_last_page.html.haml +2 -0
  34. data/spec/dummy/app/views/kaminari/_next_page.html.haml +2 -0
  35. data/spec/dummy/app/views/kaminari/_page.html.haml +2 -0
  36. data/spec/dummy/app/views/kaminari/_paginator.html.haml +11 -0
  37. data/spec/dummy/app/views/kaminari/_prev_page.html.haml +2 -0
  38. data/spec/dummy/app/views/layouts/_navbar.html.haml +7 -6
  39. data/spec/dummy/app/views/layouts/application.html.haml +13 -11
  40. data/spec/dummy/app/views/layouts/master.html.haml +12 -11
  41. data/spec/dummy/app/views/layouts/master/_navbar.html.haml +11 -9
  42. data/spec/dummy/app/views/layouts/public.html.haml +9 -8
  43. data/spec/dummy/app/views/master/companies/_form.html.haml +8 -8
  44. data/spec/dummy/app/views/master/companies/index.html.haml +6 -6
  45. data/spec/dummy/app/views/master/companies/show.html.haml +2 -2
  46. data/spec/dummy/log/development.log +13453 -0
  47. data/spec/dummy/log/test.log +18192 -0
  48. data/spec/dummy/spec/models/company_spec.rb +6 -0
  49. data/spec/dummy/tmp/cache/assets/development/sass/27d34b7cbcb5b92ab03220c4d4b91379cc64c2c0/layout.css.scssc +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/02ed06263710ce2efa1e60127f70b6c4 +0 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/0458ed7d0bd5ee8539da486da8f5991f +0 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/090db6be066f75d69551b3a136a9d6a3 +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/0a3f5e60a5dc08f80e83efe09ac998c7 +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/0d76367ded60510a66afc3dea891e76a +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/0f5003ddb4834b15069be849f782c9a3 +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/1060e80761812d7822e2da74c334dc4a +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/106c3f4e1fc71e9dc70abae55d432886 +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/18c826ba1d6dac1633cae2da25c0402a +0 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/2095ec690033cb1ebeb9a75f5d74005f +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/250f17d9e4ac44072b6f5a236fa8f532 +0 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/26e64189696f84c742152094a4784b64 +0 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/2860df473a6cf4c483cd6f251fea3ae0 +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/28ed8badf249567725127a10da4e24c2 +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/2f36066abfa51ffebd7981ba91d7047a +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/332b53959e1614821a9dc7237b1567d0 +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/350c8c72b1dbd7a84f85424b5cd4def1 +0 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/3521f0b3655f1332b216d6d3f2e49865 +0 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/3b1656b46a35a6120c3407b930d468ba +0 -0
  70. data/spec/dummy/tmp/cache/assets/development/sprockets/3bd3ea6a5530c1221765984d64fb7e76 +0 -0
  71. data/spec/dummy/tmp/cache/assets/development/sprockets/3d2dc454ff19bb6aa33d0495820578a5 +0 -0
  72. data/spec/dummy/tmp/cache/assets/development/sprockets/3fa878a57cb0b42be266336564609b18 +0 -0
  73. data/spec/dummy/tmp/cache/assets/development/sprockets/493ec40401d9f806f43e0cd72894205a +0 -0
  74. data/spec/dummy/tmp/cache/assets/development/sprockets/4a168813f7a26f6ba3b217833f53d99d +0 -0
  75. data/spec/dummy/tmp/cache/assets/development/sprockets/4b05c7ca81ce80200d0768e10b8de7a9 +0 -0
  76. data/spec/dummy/tmp/cache/assets/development/sprockets/4c17c77b444339bb3ab293047da0ff0d +0 -0
  77. data/spec/dummy/tmp/cache/assets/development/sprockets/4d770d1f61e86e7c8912f8b87e05354c +0 -0
  78. data/spec/dummy/tmp/cache/assets/development/sprockets/5d22162d2a10fcd9bf398f058fff6eb5 +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sprockets/5d650352320298b4007cec860189a5e9 +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sprockets/6051db87a0894bbf1adae79d3191b027 +0 -0
  81. data/spec/dummy/tmp/cache/assets/development/sprockets/60b75d9635ed84e08a0b9a245d8a3202 +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sprockets/646c9911e2f7dd2a16daeccc138b4352 +0 -0
  83. data/spec/dummy/tmp/cache/assets/development/sprockets/6e9d2e7aafa45c939731291fa453b8c2 +0 -0
  84. data/spec/dummy/tmp/cache/assets/development/sprockets/72bfe5ba0e1aa85b4a2ae83a28cd9edd +0 -0
  85. data/spec/dummy/tmp/cache/assets/development/sprockets/74131e27a9b7033cbda45ad068053a4e +0 -0
  86. data/spec/dummy/tmp/cache/assets/development/sprockets/793509e1419de327d1f96aa92521ab80 +0 -0
  87. data/spec/dummy/tmp/cache/assets/development/sprockets/806adcbf228e622f7d8dd5635da28bcc +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sprockets/8102cf6724f489a310fe3a6b764bb2e9 +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sprockets/8174fc2596c9877f60153bf482170c3b +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sprockets/85d3ba9967443e5dc18cc8e9ae5c2a67 +0 -0
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/89985f1bd1ce408bbb842b5e6714d344 +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/8aaac397ee93bf3a99ebbc8afa4ba8ba +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/8ab512c9b33ac90e699b73469d71f061 +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/903350b384a3ba2f4dab81256fe4a038 +0 -0
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/91b6a90bb461c0699041890b68172f24 +0 -0
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/9384399605ca755bddc0e0c50de99e75 +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/94a101a9134135c0b64ffb79d71a7961 +0 -0
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/9d31c08f7c2f9ea416313d439fbb90c6 +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/a7cf87387fa408a88cd78b7ea037bf3a +0 -0
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/a9e19eb45005fa24bc8b90b6a374089f +0 -0
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/aef2ed28dee632a906030c7d063ba481 +0 -0
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/af718c632887ccb6c1c35c4b65c61293 +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/b559f2694561fc6c44e3319f507de1e7 +0 -0
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/b78a1c1624e2aadfb2076a966c4f2708 +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/b7c36a1c00d7804d9e827d704c0dd811 +0 -0
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/bcca522c6302f184f12fe0e8a7d7e71a +0 -0
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/bd14e8a9bb4e8b09a327cc6fb637a4c9 +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/c13fc73ceafa45876a901b3e775b83ae +0 -0
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/c353816e1fa79580ecc2109ac87f6484 +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/c39832e77dfdde1759066bd4a2fd9df6 +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/c6dbb1be1e4b05a06fc6d87bf007884b +0 -0
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/cfc86dc4f1549fbc409ccbb7f29bf17f +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/d30e829917dfb45f19a36b8d71edaa7a +0 -0
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/d32fc7356f764b22ecbcebbcb9b47ee1 +0 -0
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/d379e86e6d88f4cd26a4a52e4dd0ef8b +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/d776667bae72eb3d582da5803fc931ca +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/e2bd103827e58881b0255df62c988c8a +0 -0
  119. data/spec/dummy/tmp/cache/assets/development/sprockets/e32ea0ebfd8befc578a5a8043b866754 +0 -0
  120. data/spec/dummy/tmp/cache/assets/development/sprockets/e7178f39a89e69212b764b69dac69528 +0 -0
  121. data/spec/dummy/tmp/cache/assets/development/sprockets/f2348b747b81ca6e3a24d5bd0b7023c4 +0 -0
  122. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  123. data/spec/dummy/tmp/cache/assets/development/sprockets/fbd7d96603edf8045193c8378a7913ce +0 -0
  124. data/spec/dummy/tmp/pids/server.pid +1 -0
  125. metadata +144 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb847b75e15d920aed108be9b5bb359f9a703ac2
4
- data.tar.gz: a5597cab534cc5df286c77a117729caa44ee142b
3
+ metadata.gz: 21e33478d7c882e5c4c97e20ea389784c2c368e8
4
+ data.tar.gz: 8a0f185ec1e3e7a31af4f23405ffb9bca7622764
5
5
  SHA512:
6
- metadata.gz: ff06fc331c819cdcb2089d16368152158869938f44a346b53c02b93eef10739b5950cb229392618cdbc73b156e49dcaf899ddf0244a0178205171107105f1063
7
- data.tar.gz: cb817519edcc91c7430dbb48105c1a6a4cdc1fb4205c7b4e6f71c4dc4b2c80d786a159d98cbd629b56fad7faf1b2b11d76515ef3ec9052e1c2d853ac663bcafe
6
+ metadata.gz: 6e16b0550dc3064a94057fbc2d1aaf9202983d915fc17315d38cb4b7ba9a683e3f3260aeda13db5aa63680e7edb5ab016edf3a172a3144b11efdc742773a8b0b
7
+ data.tar.gz: f75273742f9bc879d4988dcf847400e4aebec9cf82aaf4d898efb2f0f7d3f5ddea6d4d4818a21d334ae549d207116d425564fc322d2b729cbfa0be61cb560aec
data/README.md CHANGED
@@ -224,7 +224,7 @@ To have Handcart enable IP forwarding, the following method must be invoked in t
224
224
 
225
225
  ```ruby
226
226
  # app/controllers/public_controller.rb
227
- enable_forwarding("subdomain#forwarding", "public#forbidden", only: [:index])
227
+ enable_forwarding("subdomain#index", "public#forbidden", only: [:index])
228
228
  ```
229
229
 
230
230
  The first argument indicates what controller and action should be invoked inside the franchisee namespace. The second
@@ -12,5 +12,5 @@
12
12
  //
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
- //= require twitter/bootstrap
15
+ //= require bootstrap
16
16
  //= require_tree .
@@ -9,7 +9,6 @@
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
14
12
  *= require_tree .
15
13
  */
14
+ @import "bootstrap";
@@ -4,7 +4,7 @@ footer p {
4
4
  }
5
5
 
6
6
  td.action-button {
7
- width: 2em;
7
+ width: 3em;
8
8
  }
9
9
 
10
10
  .page-header {
@@ -19,3 +19,11 @@ td.action-button {
19
19
  color: #FFFFFF;
20
20
  background-color: #424242;
21
21
  }
22
+
23
+ .well {
24
+ padding: 10px !important;
25
+ }
26
+
27
+ .no-margin-bottom {
28
+ margin-bottom: 0em !important;
29
+ }
@@ -1,5 +1,4 @@
1
1
  module Handcart
2
2
  class ApplicationController < ActionController::Base
3
- helper BootstrapFlashHelper
4
3
  end
5
4
  end
@@ -5,7 +5,7 @@ module Handcart
5
5
  before_action :set_ip_address, only: [:show, :edit, :update, :destroy]
6
6
 
7
7
  def index
8
- @ip_addresses = IpAddress.all
8
+ @ip_addresses = IpAddress.ordered.page(params[:page])
9
9
  end
10
10
 
11
11
  def show
@@ -22,7 +22,7 @@ module Handcart
22
22
  @ip_address = IpAddress.new(safe_params)
23
23
 
24
24
  if @ip_address.save
25
- redirect_to @ip_address, notice: 'Ip address was successfully created.'
25
+ redirect_to @ip_address, notice: 'IP Address was successfully created.'
26
26
  else
27
27
  render :new
28
28
  end
@@ -30,7 +30,7 @@ module Handcart
30
30
 
31
31
  def update
32
32
  if @ip_address.update(safe_params)
33
- redirect_to @ip_address, notice: 'Ip address was successfully updated.'
33
+ redirect_to @ip_address, notice: 'IP Address was successfully updated.'
34
34
  else
35
35
  render :edit
36
36
  end
@@ -38,7 +38,7 @@ module Handcart
38
38
 
39
39
  def destroy
40
40
  @ip_address.destroy
41
- redirect_to ip_addresses_url, notice: 'Ip address was successfully removed.'
41
+ redirect_to ip_addresses_url, notice: 'IP Address was successfully removed.'
42
42
  end
43
43
 
44
44
  private
@@ -5,7 +5,7 @@ module Handcart
5
5
  before_action :set_subdomain, only: [:show, :edit, :update, :destroy]
6
6
 
7
7
  def index
8
- @subdomains = Subdomain.all
8
+ @subdomains = Subdomain.ordered.page(params[:page])
9
9
  end
10
10
 
11
11
  def show
@@ -38,7 +38,7 @@ module Handcart
38
38
 
39
39
  def destroy
40
40
  @subdomain.destroy
41
- redirect_to subdomains_url, notice: 'Subdomain was successfully destroyed.'
41
+ redirect_to subdomains_url, notice: 'Subdomain was successfully removed.'
42
42
  end
43
43
 
44
44
  private
@@ -0,0 +1,26 @@
1
+ module Handcart
2
+ module BootstrapFlashHelper
3
+ ALERT_TYPES = [:danger, :info, :success, :warning] unless const_defined?(:ALERT_TYPES)
4
+
5
+ def bootstrap_flash
6
+ flash_messages = []
7
+ flash.each do |type, message|
8
+ # Skip empty messages, e.g. for devise messages set to nothing in a locale file.
9
+ next if message.blank?
10
+
11
+ type = type.to_sym
12
+ type = :success if type == :notice
13
+ type = :danger if type == :error
14
+ next unless ALERT_TYPES.include?(type)
15
+
16
+ Array(message).each do |msg|
17
+ text = content_tag(:div,
18
+ content_tag(:button, raw("&times;"), class: "close", "data-dismiss" => "alert") +
19
+ msg.html_safe, class: "alert fade in alert-#{type}")
20
+ flash_messages << text if msg
21
+ end
22
+ end
23
+ flash_messages.join("\n").html_safe
24
+ end
25
+ end
26
+ end
@@ -6,7 +6,7 @@ module Handcart::Concerns::Handcarts
6
6
  has_many :ip_addresses, dependent: :destroy, class_name: "Handcart::IpAddress", foreign_key: "handcart_id"
7
7
 
8
8
  # Nuke the subdomain
9
- before_destroy { |handcart| handcart.subdomain.destroy }
9
+ before_destroy { |handcart| handcart.subdomain.destroy if handcart.subdomain.present? }
10
10
  end
11
11
 
12
12
  module ClassMethods
@@ -14,5 +14,6 @@ module Handcart
14
14
  scope :blacklisted, -> { where(blacklisted: true) }
15
15
  scope :permitted, -> { where.not(blacklisted: true) }
16
16
  scope :with_handcart, lambda { |handcart| where(handcart_id: handcart.try(:id)) }
17
+ scope :ordered, -> { order("handcart_ip_addresses.address ASC") }
17
18
  end
18
19
  end
@@ -10,6 +10,7 @@ module Handcart
10
10
  scope :allocated, -> { Subdomain.includes(:handcart).where("#{Handcart.handcart_class.model_name.plural}.subdomain_id IS NOT NULL").references(:handcart) }
11
11
  scope :unallocated, -> { Subdomain.includes(:handcart).where("#{Handcart.handcart_class.model_name.plural}.subdomain_id IS NULL").references(:handcart) }
12
12
  scope :unallocated_or_current, lambda { |handcart| Subdomain.includes(:handcart).where("#{Handcart.handcart_class.model_name.plural}.subdomain_id IS NULL OR #{Handcart.handcart_class.model_name.plural}.subdomain_id IN (?)", handcart.try(:subdomain_id)).references(:handcart) }
13
+ scope :ordered, -> { order("handcart_subdomains.name ASC") }
13
14
 
14
15
  before_save :normalize_name
15
16
 
@@ -1,12 +1,12 @@
1
- = simple_form_for @ip_address, html: { class: 'form-horizontal' } do |f|
1
+ = simple_form_for @ip_address do |f|
2
2
  = f.error_notification
3
3
 
4
- .form-inputs
5
- = f.input :address
6
- = f.input :subnet_mask
7
- = f.association :handcart, collection: Company.all
8
- = f.input :blacklisted, as: :select, include_blank: false
4
+ = f.input :address
5
+ = f.input :subnet_mask
6
+ = f.association :handcart, collection: Handcart.handcart_class.all, label: Handcart.handcart_class.model_name.human
7
+ = f.input :blacklisted, as: :select, include_blank: false
9
8
 
10
- .form-actions
11
- = f.button :submit, class: 'btn btn-primary'
12
- = link_to 'Cancel', ip_addresses_path, class: 'btn'
9
+ .form-group
10
+ .col-sm-offset-2.col-sm-10
11
+ = f.button :submit, class: 'btn btn-primary'
12
+ = link_to 'Cancel', @ip_address.new_record? ? ip_addresses_path : ip_address_path(@ip_address), class: 'btn btn-default'
@@ -3,9 +3,11 @@
3
3
  - content_for(:toolbar) do
4
4
  .btn-group
5
5
  = link_to new_ip_address_path, class: 'btn btn-primary', title: t(".new_ip_address") do
6
- %i.icon-plus
6
+ %span.glyphicon.glyphicon-plus
7
7
 
8
- %table.table.table-striped
8
+ = paginate @ip_addresses
9
+
10
+ %table.table.table-striped.table-hover.table-condensed
9
11
  %thead
10
12
  %tr
11
13
  %th= Handcart::IpAddress.human_attribute_name(:address)
@@ -19,13 +21,17 @@
19
21
  %tr
20
22
  %td= link_to ip_address.address, ip_address, title: t(".view_ip_address")
21
23
  %td= ip_address.subnet_mask
22
- %td= ip_address.handcart
24
+ %td
25
+ - if ip_address.handcart.present?
26
+ = link_to ip_address.handcart.to_s, Handcart.handcart_class.handcart_show_path(ip_address.handcart)
27
+ - else
28
+ None
23
29
  %td= ip_address.blacklisted? ? "Yes" : "No"
24
30
  %td.action-button
25
- .pull-right
26
- = link_to edit_ip_address_path(ip_address), class: 'btn', title: t(".edit_ip_address") do
27
- %i.icon-pencil
31
+ = link_to edit_ip_address_path(ip_address), class: 'btn btn-xs btn-warning', title: t(".edit_ip_address") do
32
+ %span.glyphicon.glyphicon-edit
28
33
  %td.action-button
29
- .pull-right
30
- = link_to ip_address, method: :delete, data: { confirm: t(".confirm") }, class: 'btn btn-danger', title: t(".remove_ip_address") do
31
- %i.icon-remove
34
+ = link_to ip_address, method: :delete, data: { confirm: t(".confirm") }, class: 'btn btn-danger btn-xs', title: t(".remove_ip_address") do
35
+ %span.glyphicon.glyphicon-remove
36
+
37
+ = paginate @ip_addresses
@@ -1,20 +1,38 @@
1
- - title t(".title", address: @ip_address.address)
1
+ - title t(".title", address: @ip_address.address), false
2
2
 
3
- %table.table.table-striped
4
- %thead
5
- %tr
6
- %th= Handcart::IpAddress.human_attribute_name(:address)
7
- %th= Handcart::IpAddress.human_attribute_name(:subnet_mask)
8
- %th= Handcart::IpAddress.human_attribute_name(:handcart)
9
- %th= Handcart::IpAddress.human_attribute_name(:blacklisted)
10
- %th
11
- %tbody
12
- %tr
13
- %td= @ip_address.address
14
- %td= @ip_address.subnet_mask
15
- %td= @ip_address.handcart
16
- %td= @ip_address.blacklisted? ? "Yes" : "No"
17
- %td.action-button
18
- .pull-right
19
- = link_to edit_ip_address_path(@ip_address), class: 'btn', title: t(".edit_ip_address") do
20
- %i.icon-pencil
3
+ .page-header
4
+ %h3.sub-title.inline
5
+ = t(".title", address: @ip_address.address)
6
+ %span
7
+ = link_to edit_ip_address_path(@ip_address), class: 'btn btn-warning', title: t(".edit_ip_address") do
8
+ %span.glyphicon.glyphicon-edit
9
+
10
+ .row
11
+ .col-lg-3.well
12
+ %table.table.table-striped.table-condensed.table-hover.no-margin-bottom
13
+ %tbody
14
+ %tr
15
+ %th= Handcart::IpAddress.human_attribute_name(:address)
16
+ %td= @ip_address.address
17
+ %tr
18
+ %th= Handcart::IpAddress.human_attribute_name(:subnet_mask)
19
+ %td= @ip_address.subnet_mask
20
+ %tr
21
+ %th= Handcart::IpAddress.human_attribute_name(:handcart)
22
+ %td
23
+ - if @ip_address.handcart.present?
24
+ = link_to @ip_address.handcart.to_s, Handcart.handcart_class.handcart_show_path(@ip_address.handcart)
25
+ - else
26
+ None
27
+ %tr
28
+ %th= Handcart::IpAddress.human_attribute_name(:blacklisted)
29
+ %td= @ip_address.blacklisted? ? "Yes" : "No"
30
+ %tr
31
+ %th Created At
32
+ %td= l(@ip_address.created_at, format: :short)
33
+ %tr
34
+ %th Updated At
35
+ %td= l(@ip_address.updated_at, format: :short)
36
+
37
+ .col-lg-9
38
+ Other stuff here
@@ -1,9 +1,9 @@
1
- = simple_form_for @subdomain, html: { class: 'form-horizontal' } do |f|
1
+ = simple_form_for @subdomain do |f|
2
2
  = f.error_notification
3
3
 
4
- .form-inputs
5
- = f.input :name
4
+ = f.input :name
6
5
 
7
- .form-actions
8
- = f.button :submit, class: 'btn btn-primary'
9
- = link_to 'Cancel', subdomains_path, class: 'btn'
6
+ .form-group
7
+ .col-sm-offset-2.col-sm-10
8
+ = f.button :submit, class: 'btn btn-primary'
9
+ = link_to 'Cancel', @subdomain.new_record? ? subdomains_path : subdomain_path(@subdomain), class: 'btn btn-default'
@@ -3,9 +3,11 @@
3
3
  - content_for(:toolbar) do
4
4
  .btn-group
5
5
  = link_to new_subdomain_path, class: 'btn btn-primary', title: t(".new_subdomain") do
6
- %i.icon-plus
6
+ %span.glyphicon.glyphicon-plus
7
7
 
8
- %table.table.table-striped
8
+ = paginate @subdomains
9
+
10
+ %table.table.table-striped.table-hover.table-condensed
9
11
  %thead
10
12
  %tr
11
13
  %th= Handcart.subdomain_class.human_attribute_name(:name)
@@ -22,10 +24,10 @@
22
24
  - else
23
25
  None
24
26
  %td.action-button
25
- .pull-right
26
- = link_to edit_subdomain_path(subdomain), class: 'btn', title: t(".edit_subdomain") do
27
- %i.icon-pencil
27
+ = link_to edit_subdomain_path(subdomain), class: 'btn btn-warning btn-xs', title: t(".edit_subdomain") do
28
+ %span.glyphicon.glyphicon-edit
28
29
  %td.action-button
29
- .pull-right
30
- = link_to subdomain, method: :delete, data: { confirm: t(".confirm") }, class: 'btn btn-danger', title: t(".remove_subdomain") do
31
- %i.icon-remove
30
+ = link_to subdomain, method: :delete, data: { confirm: t(".confirm") }, class: 'btn btn-danger btn-xs', title: t(".remove_subdomain") do
31
+ %span.glyphicon.glyphicon-remove
32
+
33
+ = paginate @subdomains
@@ -1,20 +1,31 @@
1
- - title t(".title", subdomain: @subdomain.name)
1
+ - title t(".title", subdomain: @subdomain.name), false
2
2
 
3
- %table.table.table-striped
4
- %thead
5
- %tr
6
- %th= Handcart.subdomain_class.human_attribute_name(:name)
7
- %th= Handcart.handcart_class.model_name.human
8
- %th
9
- %tbody
10
- %tr
11
- %td= @subdomain.name
12
- %td
13
- - if @subdomain.handcart
14
- = link_to @subdomain.handcart.try(:to_s), Handcart.handcart_class.handcart_show_path(@subdomain.handcart)
15
- - else
16
- None
17
- %td.action-button
18
- .pull-right
19
- = link_to edit_subdomain_path(@subdomain), class: 'btn', title: t(".edit_subdomain") do
20
- %i.icon-pencil
3
+ .page-header
4
+ %h3.sub-title.inline
5
+ = t(".title", subdomain: @subdomain.name)
6
+ %span
7
+ = link_to edit_subdomain_path(@subdomain), class: 'btn btn-warning', title: t(".edit_subdomain") do
8
+ %span.glyphicon.glyphicon-edit
9
+
10
+ .row-fluid
11
+ .col-lg-3.well
12
+ %table.table.table-striped.table-hover.table-condensed.no-margin-bottom
13
+ %tbody
14
+ %tr
15
+ %th= Handcart.subdomain_class.human_attribute_name(:name)
16
+ %td= @subdomain.name
17
+ %tr
18
+ %th= Handcart.handcart_class.model_name.human
19
+ %td
20
+ - if @subdomain.handcart
21
+ = link_to @subdomain.handcart.try(:to_s), Handcart.handcart_class.handcart_show_path(@subdomain.handcart)
22
+ - else
23
+ None
24
+ %tr
25
+ %th Created At
26
+ %td= l(@subdomain.created_at, format: :short)
27
+ %tr
28
+ %th Updated At
29
+ %td= l(@subdomain.updated_at, format: :short)
30
+ .col-lg-9
31
+ Other stuff here
@@ -1,15 +1,16 @@
1
- %ul.nav
2
- %li
3
- = link_to main_app.root_path do
4
- %i.icon-arrow-left
5
- Back to
6
- = t(".main_app")
7
- %li{class: (params[:controller] == "handcart/subdomains") ? "active" : nil}
8
- = link_to handcart.root_path do
9
- %i.icon-th-list
10
- = t(".subdomains")
11
- - unless (Handcart.ip_authorization.ip_authorization_strategy == :none)
12
- %li{class: (params[:controller] == "handcart/ip_addresses") ? "active" : nil}
13
- = link_to handcart.ip_addresses_path do
14
- %i.icon-screenshot
15
- = t(".ip_addresses")
1
+ #navbar-collapse-1.collapse.navbar-collapse
2
+ %ul.nav.navbar-nav
3
+ %li
4
+ = link_to main_app.root_path do
5
+ %span.glyphicon.glyphicon-arrow-left
6
+ Back to
7
+ = t(".main_app")
8
+ %li{class: (params[:controller] == "handcart/subdomains") ? "active" : nil}
9
+ = link_to handcart.root_path do
10
+ %span.glyphicon.glyphicon-th-list
11
+ = t(".subdomains")
12
+ - unless (Handcart.ip_authorization.ip_authorization_strategy == :none)
13
+ %li{class: (params[:controller] == "handcart/ip_addresses") ? "active" : nil}
14
+ = link_to handcart.ip_addresses_path do
15
+ %span.glyphicon.glyphicon-screenshot
16
+ = t(".ip_addresses")
@@ -17,22 +17,22 @@
17
17
  = javascript_include_tag "handcart/application"
18
18
 
19
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")
20
+ %nav.navbar.navbar-inverse{role: "navigation"}
21
+ .container-fluid
22
+ .navbar-header
23
+ %button.navbar-toggle{"data-target" => "#navbar-collapse-1", "data-toggle" => "collapse", type: "button"}
24
24
  %span.icon-bar
25
25
  %span.icon-bar
26
26
  %span.icon-bar
27
- %a.brand(href= root_path)
28
- %i.icon-heart
27
+ %a.navbar-brand{href: root_path}
28
+ %span.glyphicon.glyphicon-heart
29
29
  = t(".handcart_brand")
30
- = render "layouts/handcart/navbar"
30
+ = render "layouts/handcart/navbar"
31
31
 
32
- .container-fluid
33
- .row-fluid
32
+ .container
33
+ .row
34
34
  - if content_for?(:sidebar)
35
- .span9
35
+ .col-lg-9
36
36
  %div.flash-message
37
37
  = bootstrap_flash
38
38
  - if content_for?(:sub_title)
@@ -41,11 +41,11 @@
41
41
  - if content_for?(:toolbar)
42
42
  %div#button-toolbar= yield(:toolbar)
43
43
  %div= yield
44
- .span3
44
+ .col-lg-3
45
45
  .well.sidebar-nav
46
46
  %ul.nav.nav-list= yield(:sidebar)
47
47
  - else
48
- .span12
48
+ .col-lg-12
49
49
  %div.flash-message
50
50
  = bootstrap_flash
51
51
  - if content_for?(:sub_title)