cybele 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/README.md +16 -2
  4. data/dump.rdb +1 -0
  5. data/lib/cybele/app_builder.rb +213 -220
  6. data/lib/cybele/generators/app_generator.rb +31 -20
  7. data/lib/cybele/version.rb +2 -2
  8. data/templates/.env.local.erb +11 -0
  9. data/templates/.env.production.erb +11 -0
  10. data/templates/.env.staging.erb +11 -0
  11. data/templates/README.md.erb +22 -0
  12. data/templates/app/assets/javascripts/application.js.coffee +63 -1
  13. data/templates/app/assets/javascripts/hq/application.js.coffee +93 -0
  14. data/templates/app/assets/stylesheets/application.css.sass +15 -4
  15. data/templates/app/assets/stylesheets/hq/application.css.sass +92 -0
  16. data/templates/app/controllers/application_controller.rb.erb +48 -0
  17. data/templates/app/controllers/concerns/basic_authentication.rb +18 -0
  18. data/templates/app/controllers/hq/admins_controller.rb +64 -0
  19. data/templates/app/controllers/hq/application_controller.rb +11 -0
  20. data/templates/app/controllers/hq/audits_controller.rb +16 -0
  21. data/templates/app/controllers/hq/cities_controller.rb +54 -0
  22. data/templates/app/controllers/hq/countries_controller.rb +54 -0
  23. data/templates/app/controllers/hq/dashboard_controller.rb +4 -1
  24. data/templates/app/controllers/hq/passwords_controller.rb +10 -0
  25. data/templates/app/controllers/hq/registrations_controller.rb +21 -0
  26. data/templates/app/controllers/hq/sessions_controller.rb +1 -1
  27. data/templates/app/controllers/hq/users_controller.rb +64 -0
  28. data/templates/app/controllers/user/dashboard_controller.rb +8 -0
  29. data/templates/app/controllers/user/passwords_controller.rb +10 -0
  30. data/templates/app/controllers/user/profiles_controller.rb +34 -0
  31. data/templates/app/controllers/user/registrations_controller.rb +20 -0
  32. data/templates/app/controllers/user/sessions_controller.rb +16 -0
  33. data/templates/app/controllers/user/user_application_controller.rb +20 -0
  34. data/templates/app/helpers/application_helper.rb.erb +27 -0
  35. data/templates/app/mailers/admin_mailer.rb +10 -0
  36. data/templates/app/mailers/base_mailer.rb +4 -0
  37. data/templates/app/mailers/user_mailer.rb +10 -0
  38. data/templates/app/models/admin.rb +51 -0
  39. data/templates/app/models/audit.rb +3 -0
  40. data/templates/app/models/city.rb +12 -0
  41. data/templates/app/models/country.rb +12 -0
  42. data/templates/app/models/user.rb +54 -0
  43. data/templates/app/views/admin_mailer/login_info.html.haml +13 -0
  44. data/templates/app/views/devise/confirmations/new.html.haml +6 -5
  45. data/templates/app/views/devise/mailer/confirmation_instructions.html.haml +5 -3
  46. data/templates/app/views/devise/mailer/reset_password_instructions.html.haml +2 -2
  47. data/templates/app/views/devise/passwords/edit.html.haml +3 -3
  48. data/templates/app/views/devise/passwords/new.html.haml +3 -3
  49. data/templates/app/views/devise/registrations/edit.html.haml +5 -11
  50. data/templates/app/views/devise/registrations/new.html.haml +18 -6
  51. data/templates/app/views/devise/sessions/new.html.haml +1 -1
  52. data/templates/app/views/devise/shared/_links.haml +3 -1
  53. data/templates/app/views/devise/unlocks/new.html.haml +4 -4
  54. data/templates/app/views/hq/admins/_admin.html.haml +21 -0
  55. data/templates/app/views/hq/admins/_blank.html.haml +9 -0
  56. data/templates/app/views/hq/admins/_filters.html.haml +20 -0
  57. data/templates/app/views/hq/admins/_form.html.haml +17 -0
  58. data/templates/app/views/hq/admins/_list.html.haml +15 -0
  59. data/templates/app/views/hq/admins/edit.html.haml +3 -0
  60. data/templates/app/views/hq/admins/index.html.haml +18 -0
  61. data/templates/app/views/hq/admins/new.html.haml +5 -0
  62. data/templates/app/views/hq/admins/show.html.haml +19 -0
  63. data/templates/app/views/hq/audits/_filters.html.haml +32 -0
  64. data/templates/app/views/hq/audits/_list.html.haml +37 -0
  65. data/templates/app/views/hq/audits/index.html.haml +5 -0
  66. data/templates/app/views/hq/audits/show.html.haml +5 -0
  67. data/templates/app/views/hq/cities/_blank.html.haml +9 -0
  68. data/templates/app/views/hq/cities/_city.html.haml +12 -0
  69. data/templates/app/views/hq/cities/_filters.html.haml +15 -0
  70. data/templates/app/views/hq/cities/_form.html.haml +15 -0
  71. data/templates/app/views/hq/cities/_list.html.haml +13 -0
  72. data/templates/app/views/hq/cities/edit.html.haml +3 -0
  73. data/templates/app/views/hq/cities/index.html.haml +18 -0
  74. data/templates/app/views/hq/cities/new.html.haml +3 -0
  75. data/templates/app/views/hq/cities/show.html.haml +13 -0
  76. data/templates/app/views/hq/countries/_blank.html.haml +9 -0
  77. data/templates/app/views/hq/countries/_country.html.haml +11 -0
  78. data/templates/app/views/hq/countries/_filters.html.haml +14 -0
  79. data/templates/app/views/hq/countries/_form.html.haml +14 -0
  80. data/templates/app/views/hq/countries/_list.html.haml +12 -0
  81. data/templates/app/views/hq/countries/edit.html.haml +3 -0
  82. data/templates/app/views/hq/countries/index.html.haml +18 -0
  83. data/templates/app/views/hq/countries/new.html.haml +3 -0
  84. data/templates/app/views/hq/countries/show.html.haml +14 -0
  85. data/templates/app/views/hq/dashboard/index.html.haml +8 -0
  86. data/templates/app/views/hq/passwords/edit.html.haml +12 -0
  87. data/templates/app/views/hq/passwords/new.html.haml +9 -0
  88. data/templates/app/views/hq/registrations/edit.html.haml +19 -0
  89. data/templates/app/views/hq/sessions/new.html.haml +7 -5
  90. data/templates/app/views/hq/users/_blank.html.haml +9 -0
  91. data/templates/app/views/hq/users/_filters.html.haml +20 -0
  92. data/templates/app/views/hq/users/_form.html.haml +18 -0
  93. data/templates/app/views/hq/users/_list.html.haml +15 -0
  94. data/templates/app/views/hq/users/_user.html.haml +20 -0
  95. data/templates/app/views/hq/users/edit.html.haml +3 -0
  96. data/templates/app/views/hq/users/index.html.haml +18 -0
  97. data/templates/app/views/hq/users/new.html.haml +5 -0
  98. data/templates/app/views/hq/users/show.html.haml +20 -0
  99. data/templates/app/views/layouts/application.html.haml.erb +16 -8
  100. data/templates/app/views/layouts/hq/application.html.haml.erb +55 -0
  101. data/templates/app/views/layouts/hq/login.html.haml.erb +35 -0
  102. data/templates/app/views/layouts/hq/partials/_dock.html.haml.erb +36 -0
  103. data/templates/app/views/layouts/hq/partials/_footer.html.haml.erb +0 -0
  104. data/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb +22 -0
  105. data/templates/app/views/layouts/hq/partials/_trackers.html.haml.erb +0 -0
  106. data/templates/app/views/layouts/mailer.html.haml.erb +321 -0
  107. data/templates/app/views/layouts/mailer.text.haml +1 -0
  108. data/templates/app/views/layouts/partials/_footer.html.haml.erb +0 -0
  109. data/templates/app/views/layouts/partials/_trackers.html.haml.erb +0 -0
  110. data/templates/app/views/layouts/partials/_warnings.html.haml.erb +3 -0
  111. data/templates/app/views/user/dashboard/index.html.haml +8 -0
  112. data/templates/app/views/user/passwords/edit.html.haml +12 -0
  113. data/templates/app/views/user/passwords/new.html.haml +10 -0
  114. data/templates/app/views/{user_profiles → user/profiles}/_form.html.haml +4 -5
  115. data/templates/app/views/user/profiles/edit.html.haml +3 -0
  116. data/templates/app/views/user/profiles/show.html.haml +15 -0
  117. data/templates/app/views/user/registrations/edit.html.haml +19 -0
  118. data/templates/app/views/user/sessions/new.html.haml +11 -0
  119. data/templates/app/views/user_mailer/login_info.html.haml +13 -0
  120. data/templates/app/views/welcome/index.html.haml.erb +4 -4
  121. data/templates/config/initializers/devise_async.rb +6 -0
  122. data/templates/config/initializers/sidekiq.rb +13 -0
  123. data/templates/config/locales/email.tr.yml +28 -0
  124. data/templates/config/locales/models.tr.yml +72 -41
  125. data/templates/config/locales/responders.tr.yml +4 -1
  126. data/templates/config/locales/show_for.tr.yml +1 -3
  127. data/templates/config/locales/simple_form.tr.yml +8 -22
  128. data/templates/config/locales/tr.yml +33 -2
  129. data/templates/config/locales/view.tr.yml +64 -18
  130. data/templates/config/routes.erb +51 -0
  131. data/templates/config/schedule.yml +16 -0
  132. data/templates/config/settings/production.yml +0 -17
  133. data/templates/config/settings/staging.yml +0 -17
  134. data/templates/config/sidekiq.yml +13 -0
  135. data/templates/cybele_Gemfile +42 -5
  136. data/templates/cybele_gitignore +3 -1
  137. data/templates/cybele_version.txt +1 -0
  138. data/templates/env.sample.erb +11 -0
  139. data/templates/lib/data/cities.yml +163 -0
  140. data/templates/lib/tasks/dev.rake +29 -5
  141. data/templates/lib/tasks/sidekiq.rake +26 -0
  142. data/templates/lib/templates/rails/responders_controller/controller.rb +27 -22
  143. data/templates/public/images/favicon.png +0 -0
  144. data/templates/public/images/mail-logo.png +0 -0
  145. data/templates/public/images/missing_cover.png +0 -0
  146. data/templates/public/images/missing_cover@2x.png +0 -0
  147. data/templates/public/images/missing_logo.png +0 -0
  148. data/templates/public/images/missing_logo@2x.png +0 -0
  149. data/templates/public/images/sprite.png +0 -0
  150. data/templates/ruby-version +1 -1
  151. data/templates/vendor/assets/javascripts/jquery.datetimepicker.js +1871 -0
  152. data/templates/vendor/assets/javascripts/jquery.maskedinput.min.js +7 -0
  153. data/templates/vendor/assets/javascripts/nprogress.js +491 -0
  154. data/templates/vendor/assets/javascripts/trix.js +25 -0
  155. data/templates/vendor/assets/stylesheets/jquery.datetimepicker.css +418 -0
  156. data/templates/vendor/assets/stylesheets/nprogress.css +74 -0
  157. data/templates/vendor/assets/stylesheets/trix.css +209 -0
  158. metadata +125 -24
  159. data/templates/app/controllers/application_controller.rb +0 -19
  160. data/templates/app/controllers/hq/admin_profiles_controller.rb +0 -56
  161. data/templates/app/controllers/user_profiles_controller.rb +0 -56
  162. data/templates/app/views/hq/admin_profiles/_form.html.haml +0 -15
  163. data/templates/app/views/hq/admin_profiles/edit.html.haml +0 -3
  164. data/templates/app/views/hq/admin_profiles/new.html.haml +0 -3
  165. data/templates/app/views/hq/admin_profiles/show.html.haml +0 -13
  166. data/templates/app/views/hq/dashboard/index.html.haml.erb +0 -3
  167. data/templates/app/views/user_profiles/edit.html.haml +0 -3
  168. data/templates/app/views/user_profiles/new.html.haml +0 -3
  169. data/templates/app/views/user_profiles/show.html.haml +0 -13
  170. data/templates/config/locales/en.yml +0 -2
  171. data/templates/config/locales/models.en.yml +0 -54
  172. data/templates/config/locales/responders.en.yml +0 -10
  173. data/templates/config/locales/show_for.en.yml +0 -7
  174. data/templates/config/locales/simple_form.en.yml +0 -30
  175. data/templates/config/locales/view.en.yml +0 -51
@@ -0,0 +1,9 @@
1
+ - if params[:q].present?
2
+ = render 'list'
3
+ - else
4
+ .alert.alert-warning
5
+ %p
6
+ %h3= t('view.there_is_no_data', resource: Admin.model_name.human.downcase)
7
+ = link_to new_hq_admin_path, class: 'btn btn-primary' do
8
+ = t('action_button.new', resource_name: Admin.model_name.human)
9
+ = t('btn.add')
@@ -0,0 +1,20 @@
1
+ .table-header.row
2
+ .col-lg-3
3
+ = link_to hq_admins_path(q: {is_active_true: 1}), class: 'btn btn-success' do
4
+ = t('view.active')
5
+ %span.badge= Admin.where(is_active: true).count
6
+ = link_to hq_admins_path(q: {is_active_false: 1}), class: 'btn btn-warning' do
7
+ = t('view.passive')
8
+ %span.badge= Admin.where(is_active: false).count
9
+ - if params[:q].present? && (params[:q][:is_active_true].present? || params[:q][:is_active_false].present? || params[:q][:name_or_surname_cont].present?)
10
+ = link_to hq_admins_path, class: 'btn btn-info' do
11
+ = t('view.all')
12
+ %span.badge= Admin.count
13
+ .col-lg-9
14
+ = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f|
15
+ .pull-right
16
+ .input-group
17
+ = f.input_field :name_or_surname_cont, label: false, class: 'form-control', placeholder: t('view.quick_search')
18
+ %span.input-group-btn
19
+ = button_tag( class: 'btn btn-primary') do
20
+ %i.icon-search
@@ -0,0 +1,17 @@
1
+ .panel.panel-default
2
+ .panel-heading
3
+ %i.icon-edit.icon-large
4
+ = yield :form_title
5
+ .panel-body
6
+ = simple_form_for([:hq, @admin]) do |f|
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ = f.input :name
11
+ = f.input :surname
12
+ = f.input :email
13
+
14
+ .form-actions
15
+ - text = @admin.id.present? ? t('btn.update') : t('btn.add')
16
+ = f.button :submit, text, class: 'btn btn-primary'
17
+ = link_to t('cancel'), hq_admins_path, class: 'btn'
@@ -0,0 +1,15 @@
1
+ .panel-body.filters
2
+ = render 'filters'
3
+ %table.table
4
+ %thead
5
+ %tr
6
+ %th= sort_link(@search, :id, t('activerecord.attributes.admin.id'))
7
+ %th= sort_link(@search, :name, t('activerecord.attributes.admin.name'))
8
+ %th= sort_link(@search, :email, t('activerecord.attributes.admin.email'))
9
+ %th= sort_link(@search, :current_sign_in_at, t('activerecord.attributes.admin.current_sign_in_at'))
10
+ %th= sort_link(@search, :last_sign_in_at, t('activerecord.attributes.admin.last_sign_in_at'))
11
+ %th= sort_link(@search, :is_active, t('activerecord.attributes.admin.is_active'))
12
+ %th.actions
13
+ = t('view.actions')
14
+ %tbody.admins
15
+ = render @admins
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.edit', resource_name: 'Yönetici bilgilerini')
3
+ = render 'form'
@@ -0,0 +1,18 @@
1
+ - content_for :toolbar do
2
+ = link_to new_hq_admin_path, class: 'btn btn-default' do
3
+ %i.icon-plus
4
+ = t('action_button.new', resource_name: Admin.model_name.human)
5
+
6
+ .panel.panel-default.grid
7
+ .panel-heading
8
+ %i.fa.fa-table.icon-large
9
+ = t('activerecord.models.admins')
10
+ .panel-tools
11
+ .btn-group
12
+ %a.btn{href: hq_admins_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
13
+ %i.fa.fa-refresh
14
+ .badge= @admins.total_entries
15
+ =blankable(@admins)
16
+ .panel-footer
17
+ .pagination.pagination-sm
18
+ = will_paginate @admins, renderer: BootstrapPagination::Rails, bootstrap: 3
@@ -0,0 +1,5 @@
1
+ - content_for :form_title do
2
+ = t('tt.new', resource_name: Admin.model_name.human)
3
+ .alert.alert-info
4
+ = t('view.create_resource_mail_info', resource: Admin.model_name.human.downcase)
5
+ = render 'form'
@@ -0,0 +1,19 @@
1
+ - content_for :toolbar do
2
+ = link_to edit_hq_admin_path(@admin ), class: 'btn btn-default' do
3
+ %i.icon-pencil
4
+ = t('action_button.edit')
5
+ .panel.panel-default
6
+ .panel-heading
7
+ %i.icon-edit.icon-large
8
+ = t('tt.show', resource_name: Admin.model_name.human)
9
+ .panel-body
10
+ = show_for @admin do |s|
11
+ = s.attribute :name
12
+ = s.attribute :surname
13
+ = s.attribute :email do
14
+ = mail_to @admin.email, @admin.email
15
+ = s.attribute :is_active
16
+ = s.attribute :current_sign_in_at
17
+ = s.attribute :last_sign_in_at
18
+ = s.attribute :created_at
19
+ = s.attribute :updated_at
@@ -0,0 +1,32 @@
1
+ .table-header.row
2
+ .col-lg-2
3
+ - if params[:q].present?
4
+ = link_to hq_audits_path, class: 'btn btn-info' do
5
+ = t('view.all')
6
+ %span.badge= Audit.count
7
+ .col-lg-10
8
+ .pull-right
9
+ = search_form_for @search, builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }}, url: hq_audits_path do |f|
10
+ .form-group
11
+ = f.label :user_type, label: t('activerecord.attributes.audits.user_type')
12
+ = f.input_field :user_type_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.user'), collection: get_audit_users, include_blank: t('view.select')
13
+
14
+ - if params[:q].present? and params[:q][:user_type_eq].present?
15
+ - type = params[:q][:user_type_eq]
16
+ - if type == 'Admin'
17
+ = f.label :user, label: t('activerecord.attributes.audits.user')
18
+ = f.input_field :user_id_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.user'), collection: get_admins, include_blank: t('view.select')
19
+ - elsif type == 'User'
20
+ = f.label :user, label: t('activerecord.attributes.audits.user')
21
+ = f.input_field :user_id_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.user'), collection: get_users, include_blank: t('view.select')
22
+
23
+ = f.label :auditable_type, label: t('activerecord.attributes.audits.auditable_type')
24
+ = f.input_field :auditable_type_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.auditable_type'), collection: @auditable_types.map{|a| [t("activerecord.models.#{a.auditable_type.try(:underscore)}"), a.auditable_type]}, include_blank: t('view.select')
25
+
26
+ = f.label :user, label: t('activerecord.attributes.audits.auditable_id')
27
+ = f.input_field :auditable_id_eq, label: false, class: 'form-control', placeholder: t('activerecord.attributes.audits.auditable_id')
28
+
29
+ = f.label :user, label: t('activerecord.attributes.audits.action')
30
+ = f.input_field :action_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.action'), collection: %w(create update destroy).map{|a| [t("actions.#{a}"), a]}, include_blank: t('view.select')
31
+ = button_tag( class: 'btn btn-success btn-group') do
32
+ %i.fa.fa-search
@@ -0,0 +1,37 @@
1
+ .panel-heading
2
+ %i.fa.fa-list
3
+ = t('activerecord.models.audits')
4
+ .panel-tools
5
+ .btn-group
6
+ %a.btn{href: hq_audits_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
7
+ %i.icon-refresh
8
+ .badge= @audits.total_entries
9
+ .panel-body.filters
10
+ = render 'filters'
11
+ .table-responsive
12
+ %table.table
13
+ %thead
14
+ %tr
15
+ %th= sort_link(@search, :id, t('activerecord.attributes.audits.id'))
16
+ %th= sort_link(@search, :user_type, t('activerecord.attributes.audits.user_type'))
17
+ %th= sort_link(@search, :user_id, t('activerecord.attributes.audits.user'))
18
+ %th= sort_link(@search, :auditable_type, t('activerecord.attributes.audits.auditable_type'))
19
+ %th= sort_link(@search, :auditable_id, t('activerecord.attributes.audits.auditable_id'))
20
+ %th= sort_link(@search, :auditable_id, t('activerecord.attributes.audits.created_at'))
21
+ %th= sort_link(@search, :action, t('activerecord.attributes.audits.action'))
22
+ %th.actions
23
+ = t('view.actions')
24
+ %tbody
25
+ - @audits.each do |audit|
26
+ %tr
27
+ %td= audit.id
28
+ %td
29
+ = t("activerecord.models.#{audit.try(:user_type).try(:downcase)}") if audit.try(:user_type).present?
30
+ %td= "#{audit.try(:user).try(:full_name)} - #{audit.try(:user).try(:email)}"
31
+ %td= t("activerecord.models.#{audit.try(:auditable_type).try(:underscore)}") if audit.try(:auditable_type).present?
32
+ %td= audit.auditable_id
33
+ %td= l audit.created_at
34
+ %td= t("actions.#{audit.action}")
35
+ %td.actions
36
+ = link_to(hq_audit_path(id: audit), class: 'btn btn-success btn-xs', 'data-toggle' => 'tooltip', title: t('tooltips.zoom')) do
37
+ %i.fa.fa-eye
@@ -0,0 +1,5 @@
1
+ .panel.panel-default.grid
2
+ = render 'list'
3
+ .panel-footer
4
+ .pagination.pagination-sm
5
+ = will_paginate @audits, renderer: BootstrapPagination::Rails, bootstrap: 3
@@ -0,0 +1,5 @@
1
+ - @audit.audited_changes.keys.each do |key|
2
+ %p
3
+ %strong
4
+ = t("activerecord.attributes.#{@audit.try(:auditable_type).try(:underscore)}.#{key}") if @audit.try(:auditable_type).present?
5
+ = @audit.audited_changes[key]
@@ -0,0 +1,9 @@
1
+ - if params[:q].present?
2
+ = render 'list'
3
+ - else
4
+ .alert.alert-warning
5
+ %p
6
+ %h3= t('view.there_is_no_data', resource: City.model_name.human.downcase)
7
+ = link_to new_hq_city_path, class: 'btn btn-primary' do
8
+ = t('action_button.new', resource_name: City.model_name.human)
9
+ = t('btn.add')
@@ -0,0 +1,12 @@
1
+ %tr
2
+ %td= city.id
3
+ %td= city.name
4
+ %td= city.country.name
5
+ %td=l city.created_at
6
+ %td.action
7
+ = link_to([:hq, city], class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom')) do
8
+ %i.icon-eye-open
9
+ = link_to(edit_hq_city_path(city) , class: 'btn btn-info') do
10
+ %i.icon-edit
11
+ = link_to([:hq, city], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure') }) do
12
+ %i.icon-trash
@@ -0,0 +1,15 @@
1
+ .table-header.row
2
+ .col-lg-3
3
+ - if params[:q].present? && (params[:q][:name_cont].present?)
4
+ = link_to hq_cities_path, class: 'btn btn-info' do
5
+ = t('view.all')
6
+ %span.badge= City.count
7
+ .col-lg-9
8
+ = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f|
9
+ .pull-right
10
+ = f.input :country_id_eq, label: false, collection: get_countries, include_blank: "#{t('activerecord.attributes.city.country')} #{t('view.select').downcase}", input_html: { class: 'chosen-select form-control'}
11
+ .input-group
12
+ = f.input_field :name_cont, label: false, class: 'form-control', placeholder: t('view.quick_search')
13
+ %span.input-group-btn
14
+ = button_tag( class: 'btn btn-primary') do
15
+ %i.icon-search
@@ -0,0 +1,15 @@
1
+ .panel.panel-default
2
+ .panel-heading
3
+ %i.icon-edit.icon-large
4
+ = yield :form_title
5
+ .panel-body
6
+ = simple_form_for([:hq, @city]) do |f|
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ = f.input :name
11
+ = f.input :country_id, collection: get_countries, include_blank: t('view.select'), input_html: { class: 'chosen-select' }
12
+
13
+ .form-actions
14
+ = f.button :submit, class: 'btn btn-primary'
15
+ = link_to t('cancel'), hq_cities_path, class: 'btn'
@@ -0,0 +1,13 @@
1
+ .panel-body.filters
2
+ = render 'filters'
3
+ %table.table
4
+ %thead
5
+ %tr
6
+ %th= sort_link(@search, :id, t('activerecord.attributes.city.id'))
7
+ %th= sort_link(@search, :name, t('activerecord.attributes.city.name'))
8
+ %th= sort_link(@search, :country_id, t('activerecord.attributes.city.country_id'))
9
+ %th= sort_link(@search, :created_at, t('activerecord.attributes.city.created_at'))
10
+ %th.actions
11
+ = t('view.actions')
12
+ %tbody
13
+ = render @cities
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.edit', resource_name: City.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,18 @@
1
+ - content_for :toolbar do
2
+ = link_to new_hq_city_path, class: 'btn btn-default' do
3
+ %i.icon-plus
4
+ = t('action_button.new', resource_name: City.model_name.human)
5
+
6
+ .panel.panel-default.grid
7
+ .panel-heading
8
+ %i.icon-table.icon-large
9
+ = t('tt.index', resource_name: City.model_name.human)
10
+ .panel-tools
11
+ .btn-group
12
+ %a.btn{href: hq_cities_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
13
+ %i.icon-refresh
14
+ .badge= @cities.count
15
+ =blankable(@cities)
16
+ .panel-footer
17
+ .pagination.pagination-sm
18
+ = will_paginate @cities, renderer: BootstrapPagination::Rails, bootstrap: 3
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.new', resource_name: City.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,13 @@
1
+ - content_for :toolbar do
2
+ = link_to edit_hq_city_path(@city ), class: 'btn btn-default' do
3
+ %i.icon-pencil
4
+ = t('action_button.edit')
5
+ .panel.panel-default
6
+ .panel-heading
7
+ %i.icon-edit.icon-large
8
+ = t('tt.show', resource_name: City.model_name.human)
9
+ .panel-body
10
+ = show_for @city do |s|
11
+ = s.attribute :id
12
+ = s.attribute :name
13
+ = s.attribute :name, in: :country
@@ -0,0 +1,9 @@
1
+ - if params[:q].present?
2
+ = render 'list'
3
+ - else
4
+ .alert.alert-warning
5
+ %p
6
+ %h3= t('view.there_is_no_data', resource: Country.model_name.human.downcase)
7
+ = link_to new_hq_country_path, class: 'btn btn-primary' do
8
+ = t('action_button.new', resource_name: Country.model_name.human)
9
+ = t('btn.add')
@@ -0,0 +1,11 @@
1
+ %tr
2
+ %td= country.id
3
+ %td= country.name
4
+ %td=l country.created_at
5
+ %td.action
6
+ = link_to([:hq, country], class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom')) do
7
+ %i.icon-eye-open
8
+ = link_to(edit_hq_country_path(country) , class: 'btn btn-info') do
9
+ %i.icon-edit
10
+ = link_to([:hq, country], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure') }) do
11
+ %i.icon-trash
@@ -0,0 +1,14 @@
1
+ .table-header.row
2
+ .col-lg-3
3
+ - if params[:q].present? && (params[:q][:name_cont].present?)
4
+ = link_to hq_countries_path, class: 'btn btn-info' do
5
+ = t('view.all')
6
+ %span.badge= Country.count
7
+ .col-lg-9
8
+ = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f|
9
+ .pull-right
10
+ .input-group
11
+ = f.input_field :name_cont, label: false, class: 'form-control', placeholder: t('view.quick_search')
12
+ %span.input-group-btn
13
+ = button_tag( class: 'btn btn-primary') do
14
+ %i.icon-search
@@ -0,0 +1,14 @@
1
+ .panel.panel-default
2
+ .panel-heading
3
+ %i.icon-edit.icon-large
4
+ = yield :form_title
5
+ .panel-body
6
+ = simple_form_for([:hq, @country]) do |f|
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ = f.input :name
11
+
12
+ .form-actions
13
+ = f.button :submit, class: 'btn btn-primary'
14
+ = link_to t('cancel'), hq_countries_path, class: 'btn'
@@ -0,0 +1,12 @@
1
+ .panel-body.filters
2
+ = render 'filters'
3
+ %table.table
4
+ %thead
5
+ %tr
6
+ %th= sort_link(@search, :id, t('activerecord.attributes.country.id'))
7
+ %th= sort_link(@search, :name, t('activerecord.attributes.country.name'))
8
+ %th= sort_link(@search, :created_at, t('activerecord.attributes.country.created_at'))
9
+ %th.actions
10
+ = t('view.actions')
11
+ %tbody
12
+ = render @countries
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.edit', resource_name: Country.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,18 @@
1
+ - content_for :toolbar do
2
+ = link_to new_hq_country_path, class: 'btn btn-default' do
3
+ %i.icon-plus
4
+ = t('action_button.new', resource_name: Country.model_name.human)
5
+
6
+ .panel.panel-default.grid
7
+ .panel-heading
8
+ %i.fa.fa-table.icon-large
9
+ = t('tt.index', resource_name: Country.model_name.human)
10
+ .panel-tools
11
+ .btn-group
12
+ %a.btn{href: hq_countries_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
13
+ %i.fa.fa-refresh
14
+ .badge= @countries.total_entries
15
+ =blankable(@countries)
16
+ .panel-footer
17
+ .pagination.pagination-sm
18
+ = will_paginate @countries, renderer: BootstrapPagination::Rails, bootstrap: 3
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.new', resource_name: Country.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,14 @@
1
+ - content_for :toolbar do
2
+ = link_to edit_hq_country_path(@country ), class: 'btn btn-default' do
3
+ %i.icon-pencil
4
+ = t('action_button.edit')
5
+ .panel.panel-default
6
+ .panel-heading
7
+ %i.icon-edit.icon-large
8
+ = t('tt.show', resource_name: Country.model_name.human)
9
+ .panel-body
10
+ = show_for @country do |s|
11
+ = s.attribute :id
12
+ = s.attribute :name
13
+ = s.attribute :created_at
14
+ = s.attribute :updated_at