tramway-sport_school 1.2.9.1 → 1.2.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -5
- data/app/controllers/tramway/sport_school/application_controller.rb +2 -0
- data/app/controllers/tramway/sport_school/web/welcome_controller.rb +3 -1
- data/app/decorators/tramway/sport_school/cards/document_decorator.rb +2 -0
- data/app/decorators/tramway/sport_school/cards/trainer_decorator.rb +3 -1
- data/app/decorators/tramway/sport_school/document_decorator.rb +4 -2
- data/app/decorators/tramway/sport_school/features/kind_sport_decorator.rb +2 -0
- data/app/decorators/tramway/sport_school/institution_decorator.rb +3 -1
- data/app/decorators/tramway/sport_school/kind_sport_decorator.rb +4 -2
- data/app/decorators/tramway/sport_school/organization_decorator.rb +4 -2
- data/app/decorators/tramway/sport_school/trainer_decorator.rb +4 -2
- data/app/forms/tramway/sport_school/document_form.rb +2 -0
- data/app/forms/tramway/sport_school/institution_form.rb +2 -0
- data/app/forms/tramway/sport_school/kind_sport_form.rb +2 -0
- data/app/forms/tramway/sport_school/organization_form.rb +2 -0
- data/app/forms/tramway/sport_school/trainer_form.rb +2 -0
- data/app/helpers/tramway/sport_school/application_helper.rb +2 -0
- data/app/helpers/tramway/sport_school/web/welcome_helper.rb +2 -0
- data/app/jobs/tramway/sport_school/application_job.rb +2 -0
- data/app/mailers/tramway/sport_school/application_mailer.rb +2 -0
- data/app/models/tramway/sport_school/document.rb +3 -1
- data/app/models/tramway/sport_school/institution.rb +2 -0
- data/app/models/tramway/sport_school/kind_sport.rb +2 -0
- data/app/models/tramway/sport_school/organization.rb +3 -1
- data/app/models/tramway/sport_school/trainer.rb +3 -1
- data/config/initializers/simple_form.rb +1 -0
- data/config/initializers/tramway.rb +23 -20
- data/config/routes.rb +3 -1
- data/db/migrate/20180117222018_create_tramway_user_users.rb +3 -1
- data/db/migrate/20180117222019_create_tramway_sport_school_kind_sports.rb +2 -0
- data/db/migrate/20180117222020_add_state_to_tramway_sport_school_kind_sports.rb +2 -0
- data/db/migrate/20180117222021_add_image_to_tramway_sport_school_kind_sports.rb +2 -0
- data/db/migrate/20180117222022_create_tramway_sport_school_trainers.rb +2 -0
- data/db/migrate/20180117223438_install_audited.rb +7 -5
- data/lib/tasks/tramway/sport_school_tasks.rake +2 -0
- data/lib/tramway/sport_school/engine.rb +2 -0
- data/lib/tramway/sport_school/generates/install_generator.rb +19 -17
- data/lib/tramway/sport_school/generates/templates/add_contacts_to_tramway_sport_school_institutions.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_degree_to_tramway_sport_school_trainers.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_description_to_tramway_sport_school_kind_sports.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_description_to_tramway_sport_school_trainers.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_document_type_to_tramway_sport_school_documents.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_found_date_to_tramway_sport_school_institutions.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_image_to_tramway_sport_school_kind_sports.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_ll_to_tramway_sport_school_institutions.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_state_to_tramway_sport_school_kind_sports.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/add_url_to_tramway_sport_school_institutions.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/create_tramway_sport_school_documents.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/create_tramway_sport_school_institutions.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/create_tramway_sport_school_kind_sports.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/create_tramway_sport_school_organizations.rb +2 -0
- data/lib/tramway/sport_school/generates/templates/create_tramway_sport_school_trainers.rb +2 -0
- data/lib/tramway/sport_school/version.rb +3 -1
- data/lib/tramway/sport_school.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3281e3f12ad1736cc55c612880fce0df9ee8de352d3bb2507264b818ae4d325
|
4
|
+
data.tar.gz: b5baa84a74a9d5755fb7733152a5a4679ce819d277d94db8962bdb804bbdfd33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f363e9b8c08fe6b1e02bb3e9e2ea32f355993eaa4f28dc3dca22105032017d5e09b2e4079ae4ebd7a0314d0ad56d2a996aab2d073d5b53f958bf561ec93cfc77
|
7
|
+
data.tar.gz: 4dfd2024c3561774217ed076ea1a2b0fdda48ad58236913cf5f0db326ffcdfe9a805dcaf8153ab7d563299704c1e5ec8396475fa8df6887026211a9bace9491c
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
begin
|
2
4
|
require 'bundler/setup'
|
3
5
|
rescue LoadError
|
@@ -14,14 +16,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
17
|
end
|
16
18
|
|
17
|
-
APP_RAKEFILE = File.expand_path(
|
19
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
18
20
|
load 'rails/tasks/engine.rake'
|
19
21
|
|
20
|
-
|
21
22
|
load 'rails/tasks/statistics.rake'
|
22
23
|
|
23
|
-
|
24
|
-
|
25
24
|
require 'bundler/gem_tasks'
|
26
25
|
|
27
26
|
require 'rake/testtask'
|
@@ -32,5 +31,4 @@ Rake::TestTask.new(:test) do |t|
|
|
32
31
|
t.verbose = false
|
33
32
|
end
|
34
33
|
|
35
|
-
|
36
34
|
task default: :test
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_dependency 'tramway/sport_school/application_controller'
|
2
4
|
|
3
5
|
class Tramway::SportSchool::Web::WelcomeController < ::Tramway::SportSchool::ApplicationController
|
4
6
|
def index
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::SportSchool::Cards::TrainerDecorator < ::Tramway::Landing::BlockTypes::CardsDecorator
|
2
4
|
def image
|
3
5
|
object.photo.card.url
|
4
6
|
end
|
5
|
-
|
7
|
+
|
6
8
|
def title
|
7
9
|
"#{object.last_name} #{object.first_name} #{object.patronymic}"
|
8
10
|
end
|
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::SportSchool::DocumentDecorator < ::Tramway::Core::ApplicationDecorator
|
2
4
|
class << self
|
3
5
|
def collections
|
4
|
-
[
|
6
|
+
[:all]
|
5
7
|
end
|
6
8
|
|
7
9
|
def list_attributes
|
8
|
-
[
|
10
|
+
[:view_state]
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::SportSchool::KindSportDecorator < ::Tramway::Core::ApplicationDecorator
|
2
4
|
class << self
|
3
5
|
def collections
|
4
|
-
[
|
6
|
+
%i[all published hidden]
|
5
7
|
end
|
6
8
|
|
7
9
|
def list_attributes
|
8
|
-
[
|
10
|
+
[:view_state]
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::SportSchool::OrganizationDecorator < ::Tramway::Core::ApplicationDecorator
|
2
4
|
class << self
|
3
5
|
def collections
|
4
|
-
[
|
6
|
+
[:all]
|
5
7
|
end
|
6
8
|
|
7
9
|
def list_attributes
|
8
|
-
[
|
10
|
+
[:view_state]
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::SportSchool::TrainerDecorator < ::Tramway::Core::ApplicationDecorator
|
2
4
|
class << self
|
3
5
|
def collections
|
4
|
-
[
|
6
|
+
[:all]
|
5
7
|
end
|
6
8
|
|
7
9
|
def list_attributes
|
8
|
-
[
|
10
|
+
[:view_state]
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tramway::SportSchool
|
2
4
|
class Document < ::Tramway::Core::ApplicationRecord
|
3
5
|
mount_uploader :file, FileUploader
|
4
6
|
|
5
|
-
enumerize :document_type, in: [
|
7
|
+
enumerize :document_type, in: %i[education school_info provision headers finance materially], default: :education
|
6
8
|
|
7
9
|
state_machine :view_state, initial: :published do
|
8
10
|
state :published
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::SportSchool::Organization < ::Tramway::Core::ApplicationRecord
|
2
4
|
mount_uploader :logo, PhotoUploader
|
3
5
|
|
4
|
-
enumerize :organization_type, in: [
|
6
|
+
enumerize :organization_type, in: %i[required partner sponsor], default: :required
|
5
7
|
|
6
8
|
state_machine :view_state, initial: :published do
|
7
9
|
state :published
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tramway::SportSchool
|
2
4
|
class Trainer < ::Tramway::Core::ApplicationRecord
|
3
|
-
enumerize :degree, in: [
|
5
|
+
enumerize :degree, in: %i[master_of_sport candidate_master_of_sports]
|
4
6
|
|
5
7
|
mount_uploader :photo, PhotoUploader
|
6
8
|
|
@@ -1,25 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
::Tramway::Auth.root_path = '/admin'
|
2
4
|
::Tramway::Admin.set_available_models(::Tramway::SportSchool::KindSport,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
::Tramway::SportSchool::Trainer,
|
6
|
+
::Tramway::SportSchool::Document,
|
7
|
+
::Tramway::SportSchool::Organization,
|
8
|
+
::Tramway::User::User,
|
9
|
+
project: :sport_school)
|
7
10
|
::Tramway::Admin.set_singleton_models(::Tramway::SportSchool::Institution, project: :sport_school)
|
8
11
|
::Tramway::Core.initialize_application model_class: ::Tramway::SportSchool::Institution
|
9
|
-
::Tramway::Profiles.records = [
|
12
|
+
::Tramway::Profiles.records = [::Tramway::SportSchool::Institution]
|
10
13
|
::Tramway::Admin.set_additional_buttons({ Tramway::SportSchool::Institution.to_s => {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}}, project: :sport_school)
|
14
|
+
show: ::Tramway::Profiles::SocialNetwork.network_name.values.map do |network|
|
15
|
+
{
|
16
|
+
action: :new,
|
17
|
+
model_name: Tramway::Profiles::SocialNetwork.to_s,
|
18
|
+
text: "Добавить профиль #{network}",
|
19
|
+
params: {
|
20
|
+
Tramway::Profiles::SocialNetwork.to_s.underscore => {
|
21
|
+
record_type: -> { model_name.name },
|
22
|
+
record_id: -> { id },
|
23
|
+
network_name: network
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
end
|
28
|
+
} }, project: :sport_school)
|
data/config/routes.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Tramway::SportSchool::Engine.routes.draw do
|
2
4
|
mount Tramway::Auth::Engine, at: '/auth'
|
3
5
|
mount Tramway::Admin::Engine, at: '/admin'
|
@@ -7,6 +9,6 @@ Tramway::SportSchool::Engine.routes.draw do
|
|
7
9
|
root to: 'web/welcome#index'
|
8
10
|
|
9
11
|
scope module: :web do
|
10
|
-
resource :session, only: [
|
12
|
+
resource :session, only: %i[new create destroy]
|
11
13
|
end
|
12
14
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class InstallAudited < ActiveRecord::Migration[5.1]
|
2
4
|
def self.up
|
3
|
-
create_table :audits, :
|
5
|
+
create_table :audits, force: true do |t|
|
4
6
|
t.column :auditable_id, :integer
|
5
7
|
t.column :auditable_type, :string
|
6
8
|
t.column :associated_id, :integer
|
@@ -10,16 +12,16 @@ class InstallAudited < ActiveRecord::Migration[5.1]
|
|
10
12
|
t.column :username, :string
|
11
13
|
t.column :action, :string
|
12
14
|
t.column :audited_changes, :text
|
13
|
-
t.column :version, :integer, :
|
15
|
+
t.column :version, :integer, default: 0
|
14
16
|
t.column :comment, :string
|
15
17
|
t.column :remote_address, :string
|
16
18
|
t.column :request_uuid, :string
|
17
19
|
t.column :created_at, :datetime
|
18
20
|
end
|
19
21
|
|
20
|
-
add_index :audits, [
|
21
|
-
add_index :audits, [
|
22
|
-
add_index :audits, [
|
22
|
+
add_index :audits, %i[auditable_id auditable_type], name: 'auditable_index'
|
23
|
+
add_index :audits, %i[associated_id associated_type], name: 'associated_index'
|
24
|
+
add_index :audits, %i[user_id user_type], name: 'user_index'
|
23
25
|
add_index :audits, :request_uuid
|
24
26
|
add_index :audits, :created_at
|
25
27
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails/generators'
|
2
4
|
require 'tramway/core/generators/install_generator'
|
3
5
|
|
4
6
|
module Tramway::SportSchool::Generators
|
5
7
|
class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
|
6
8
|
include Rails::Generators::Migration
|
7
|
-
source_root File.expand_path('
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
8
10
|
|
9
11
|
def run_other_generators
|
10
12
|
generate 'tramway:user:install'
|
@@ -21,22 +23,22 @@ module Tramway::SportSchool::Generators
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def copy_migrations
|
24
|
-
migrations = [
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
26
|
+
migrations = %i[
|
27
|
+
create_tramway_sport_school_kind_sports
|
28
|
+
add_state_to_tramway_sport_school_kind_sports
|
29
|
+
add_image_to_tramway_sport_school_kind_sports
|
30
|
+
create_tramway_sport_school_trainers
|
31
|
+
create_tramway_sport_school_documents
|
32
|
+
add_degree_to_tramway_sport_school_trainers
|
33
|
+
add_description_to_tramway_sport_school_trainers
|
34
|
+
create_tramway_sport_school_institutions
|
35
|
+
add_description_to_tramway_sport_school_kind_sports
|
36
|
+
create_tramway_sport_school_organizations
|
37
|
+
add_contacts_to_tramway_sport_school_institutions
|
38
|
+
add_ll_to_tramway_sport_school_institutions
|
39
|
+
add_document_type_to_tramway_sport_school_documents
|
40
|
+
add_url_to_tramway_sport_school_institutions
|
41
|
+
add_found_date_to_tramway_sport_school_institutions
|
40
42
|
]
|
41
43
|
migrations.each do |migration|
|
42
44
|
migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
|
data/lib/tramway/sport_school.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'tramway/sport_school/engine'
|
2
4
|
require 'tramway/sport_school/generates/install_generator'
|
3
5
|
require 'font-awesome-rails'
|
4
6
|
|
@@ -6,7 +8,7 @@ module Tramway
|
|
6
8
|
module SportSchool
|
7
9
|
class << self
|
8
10
|
def dependencies
|
9
|
-
[
|
11
|
+
%i[landing profiles news]
|
10
12
|
end
|
11
13
|
|
12
14
|
def application
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-sport_school
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.9.
|
4
|
+
version: 1.2.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|