tramway-admin 1.13.0.4 → 1.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe6d56b90efcef39721bbb6898b57fc2eb6f24eb31128ea4527ab319df099871
4
- data.tar.gz: d6f121fa44dfc325910c94886e769e071c310a5cb0ca4ab342ae35a62be6b4ee
3
+ metadata.gz: 6770dd9696f66f480999f8a2aa55e503e87618563af8b2fca34295c449521e5c
4
+ data.tar.gz: 02b773188677c74b1fb36bd54c30979b8159a6208f69e7946b1dffb7c45a78bc
5
5
  SHA512:
6
- metadata.gz: 960cfd47ff1a72a53507bba9f352dbad646756b8b4666a9bb9fd910c4a13b225f563e3028152b6e7526aa2699652a0d0c3bc8cb76b2e200c05ddf04e1057b254
7
- data.tar.gz: 55da6b9d9edb8b0cd3ee7d3200f9ff02d66bc3d2683673941c5e7a84580c0e4694ffa1237d91df569e35afd70b82d6e0e70bbf0a57e7c854bda664c79c5359f5
6
+ metadata.gz: 7dc6a15d45cbe98322f30c9b0300f2875b347f54c28c19168de1077644df2efc18d09f6e77d495d4248f94f8e7d9203cda0e7d70653fe252456b828802818a11
7
+ data.tar.gz: 32603f1551f0b167f91cb409c79198bb7c92c057ca342bd7572ede0044ecc9a7b4563b70ddc8050c499e9ab525e3857a4d072b3a09b2f760c3c6b80860eb380d
@@ -0,0 +1,3 @@
1
+ class Tramway::Export::ApplicationController < Tramway::Core::ApplicationController
2
+ before_action :authenticate_admin!
3
+ end
@@ -53,13 +53,17 @@ module Tramway::Admin
53
53
  end
54
54
  end
55
55
 
56
+ def collection_human_name(model_name:, collection_name:)
57
+ if t("default.collections.#{collection_name}").include?('<span')
58
+ t("collections.#{model_name}.#{collection_name}").pluralize(:ru)
59
+ else
60
+ t("default.collections.#{collection_name}")
61
+ end
62
+ end
63
+
56
64
  def tab_title(model_class, tab, count, state_method = :state)
57
65
  model = model_class.name.underscore
58
- name = if t("default.collections.#{tab}").include?('<span')
59
- t("collections.#{model}.#{tab}").pluralize(:ru)
60
- else
61
- t("default.collections.#{tab}")
62
- end
66
+ name = collection_human_name model_name: model, collection_name: tab
63
67
  params[:filter].present? ? name : "#{name} / #{count}"
64
68
  end
65
69
 
@@ -9,6 +9,8 @@
9
9
  %h1
10
10
  = current_title
11
11
  = link_to fa_icon(:plus), new_current_model_record_path, class: 'btn btn-primary'
12
+ - if defined? Tramway::Export
13
+ = render 'tramway/export/button'
12
14
  = render 'search', model_class: model_class
13
15
  %hr
14
16
  %ul.nav.nav-tabs
data/config/routes.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  Tramway::Admin::Engine.routes.draw do
2
2
  mount Tramway::Auth::Engine, at: '/auth'
3
+ if defined? Tramway::Export
4
+ mount Tramway::Export::Engine, at: '/'
5
+ end
3
6
 
4
7
  root to: 'welcome#index'
5
8
 
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Admin
3
- VERSION = '1.13.0.4'
3
+ VERSION = '1.14'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0.4
4
+ version: '1.14'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-15 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views
@@ -239,6 +239,7 @@ files:
239
239
  - app/controllers/tramway/admin/records_controller.rb
240
240
  - app/controllers/tramway/admin/singletons_controller.rb
241
241
  - app/controllers/tramway/admin/welcome_controller.rb
242
+ - app/controllers/tramway/export/application_controller.rb
242
243
  - app/helpers/tramway/admin/additional_buttons_builder.rb
243
244
  - app/helpers/tramway/admin/application_helper.rb
244
245
  - app/helpers/tramway/admin/focus_generator_helper.rb