tramway-site 0.1.0 → 0.1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +34 -0
- data/app/assets/config/tramway_site_manifest.js +2 -0
- data/app/assets/javascripts/tramway/site/application.js +2 -0
- data/app/assets/stylesheets/tramway/site/application.css +4 -0
- data/app/controllers/tramway/site/application_controller.rb +15 -0
- data/app/controllers/tramway/site/web/application_controller.rb +4 -0
- data/app/controllers/tramway/site/web/welcome_controller.rb +7 -0
- data/app/decorators/tramway/site/person_decorator.rb +23 -0
- data/app/forms/tramway/site/person_form.rb +22 -0
- data/app/helpers/tramway/site/application_helper.rb +8 -0
- data/app/jobs/tramway/site/application_job.rb +8 -0
- data/app/mailers/tramway/site/application_mailer.rb +10 -0
- data/app/models/tramway/site/application_record.rb +9 -0
- data/app/models/tramway/site/person.rb +12 -0
- data/app/views/tramway/site/web/welcome/index.html.haml +33 -0
- data/config/initializers/tramway.rb +4 -0
- data/config/locales/models.yml +13 -0
- data/config/locales/ru.yml +3 -0
- data/config/routes.rb +8 -0
- data/lib/tramway/site.rb +18 -0
- data/lib/tramway/site/engine.rb +9 -0
- data/lib/tramway/site/generates/install_generator.rb +32 -0
- data/lib/tramway/site/generates/templates/add_main_image_tramway_site_people.rb +8 -0
- data/lib/tramway/site/generates/templates/create_tramway_site_people.rb +16 -0
- data/lib/tramway/site/version.rb +7 -0
- metadata +31 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bf2097c6d4a77b3da1941bed8176d1c3724dde7bbe12430e2c748fd035ae735
|
4
|
+
data.tar.gz: fb0bcbe038d3c49f67d223359cbd8054c45d6a49398c22d3cf0f52a4acdf8a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa3f892acc54a220b59285dc630cb51245797b7f74fbe0dfc5a30d5b68f6881000a51b94aa6c098c0670dba014418f6afe4d04bd36231feff3bab79edef21cc
|
7
|
+
data.tar.gz: 24933cc8f4209bf4b5e6e173302bced1871a0ebff60755ff448927dd5138d9c41688248a6665720fc8f0fd0ba63785c3a6eec33fb1eb742458cd912c41698526
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2019 Pavel Kalashnikov
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Tramway::Site
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'tramway-site'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install tramway-site
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'rdoc/task'
|
10
|
+
|
11
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
12
|
+
rdoc.rdoc_dir = 'rdoc'
|
13
|
+
rdoc.title = 'Tramway::Site'
|
14
|
+
rdoc.options << '--line-numbers'
|
15
|
+
rdoc.rdoc_files.include('README.md')
|
16
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
17
|
+
end
|
18
|
+
|
19
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
20
|
+
load 'rails/tasks/engine.rake'
|
21
|
+
|
22
|
+
load 'rails/tasks/statistics.rake'
|
23
|
+
|
24
|
+
require 'bundler/gem_tasks'
|
25
|
+
|
26
|
+
require 'rake/testtask'
|
27
|
+
|
28
|
+
Rake::TestTask.new(:test) do |t|
|
29
|
+
t.libs << 'test'
|
30
|
+
t.pattern = 'test/**/*_test.rb'
|
31
|
+
t.verbose = false
|
32
|
+
end
|
33
|
+
|
34
|
+
task default: :test
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Tramway
|
4
|
+
module Site
|
5
|
+
class ApplicationController < Tramway::Core::ApplicationController
|
6
|
+
layout 'tramway/landing/application'
|
7
|
+
protect_from_forgery with: :exception
|
8
|
+
before_action :application
|
9
|
+
|
10
|
+
def application
|
11
|
+
@application = ::Tramway::Core.application.model_class.first
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Tramway::Site::PersonDecorator < Tramway::Core::ApplicationDecorator
|
4
|
+
class << self
|
5
|
+
def show_attributes
|
6
|
+
%i[full_name short_bio bio photo]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
delegate :short_bio, to: :object
|
11
|
+
|
12
|
+
def full_name
|
13
|
+
object.names.join ' '
|
14
|
+
end
|
15
|
+
|
16
|
+
def bio
|
17
|
+
raw object.bio
|
18
|
+
end
|
19
|
+
|
20
|
+
def photo
|
21
|
+
image_view object.photo
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Tramway::Site::PersonForm < Tramway::Core::ExtendedApplicationForm
|
4
|
+
properties :full_name, :photo, :short_bio, :bio
|
5
|
+
|
6
|
+
def initialize(object)
|
7
|
+
super(object).tap do
|
8
|
+
form_properties full_name: :string,
|
9
|
+
photo: :file,
|
10
|
+
short_bio: :string,
|
11
|
+
bio: :ckeditor
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def full_name=(value)
|
16
|
+
model.names = value.split ' '
|
17
|
+
end
|
18
|
+
|
19
|
+
def full_name
|
20
|
+
model.names.join ' '
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
= content_for :head_content do
|
2
|
+
= stylesheet_link_tag 'tramway/site/application', media: 'all'
|
3
|
+
= javascript_include_tag 'tramway/site/application'
|
4
|
+
|
5
|
+
= content_for :application_name do
|
6
|
+
= @application&.title || t('application.name')
|
7
|
+
|
8
|
+
= content_for :title do
|
9
|
+
= @application&.title || t('application.name')
|
10
|
+
|
11
|
+
= content_for :application_tagline do
|
12
|
+
= @application&.tagline || t('application.tagline')
|
13
|
+
|
14
|
+
= content_for :address do
|
15
|
+
= @unity&.address
|
16
|
+
|
17
|
+
= content_for :phone do
|
18
|
+
= @unity&.phone
|
19
|
+
|
20
|
+
= content_for :footer_links do
|
21
|
+
= nil
|
22
|
+
|
23
|
+
= content_for :footer_logos do
|
24
|
+
= nil
|
25
|
+
|
26
|
+
= content_for :latitude do
|
27
|
+
= @unity&.latitude
|
28
|
+
|
29
|
+
= content_for :longtitude do
|
30
|
+
= @unity&.longtitude
|
31
|
+
|
32
|
+
- content_for :main_image do
|
33
|
+
= request.protocol + request.host_with_port + @blocks.select { |block| block.model.block_type.header? }.first.background.url
|
data/config/routes.rb
ADDED
data/lib/tramway/site.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'tramway/site/engine'
|
4
|
+
require 'tramway/site/generates/install_generator'
|
5
|
+
|
6
|
+
module Tramway
|
7
|
+
module Site
|
8
|
+
class << self
|
9
|
+
def dependencies
|
10
|
+
%i[landing profiles]
|
11
|
+
end
|
12
|
+
|
13
|
+
def application
|
14
|
+
:person
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
require 'tramway/core/generators/install_generator'
|
5
|
+
|
6
|
+
module Tramway::Site::Generators
|
7
|
+
class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
|
8
|
+
include Rails::Generators::Migration
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
10
|
+
|
11
|
+
def run_other_generators
|
12
|
+
generate 'tramway:user:install'
|
13
|
+
generate 'tramway:landing:install'
|
14
|
+
generate 'tramway:profiles:install'
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.next_migration_number(path)
|
18
|
+
next_migration_number = current_migration_number(path) + 1
|
19
|
+
ActiveRecord::Migration.next_migration_number next_migration_number
|
20
|
+
end
|
21
|
+
|
22
|
+
def copy_migrations
|
23
|
+
migrations = [
|
24
|
+
:create_tramway_site_people,
|
25
|
+
:add_main_image_tramway_site_people
|
26
|
+
]
|
27
|
+
migrations.each do |migration_name|
|
28
|
+
migration_template "#{migration_name}.rb", "db/migrate/#{migration_name}.rb"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateTramwaySitePeople < ActiveRecord::Migration[5.1]
|
4
|
+
def change
|
5
|
+
create_table :tramway_site_people do |t|
|
6
|
+
t.text :names, array: true
|
7
|
+
t.text :short_bio
|
8
|
+
t.text :bio
|
9
|
+
t.text :photo
|
10
|
+
|
11
|
+
t.text :state, default: :active
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-site
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0.5
|
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-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for person site
|
14
14
|
email:
|
@@ -16,7 +16,34 @@ email:
|
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
|
-
files:
|
19
|
+
files:
|
20
|
+
- MIT-LICENSE
|
21
|
+
- README.md
|
22
|
+
- Rakefile
|
23
|
+
- app/assets/config/tramway_site_manifest.js
|
24
|
+
- app/assets/javascripts/tramway/site/application.js
|
25
|
+
- app/assets/stylesheets/tramway/site/application.css
|
26
|
+
- app/controllers/tramway/site/application_controller.rb
|
27
|
+
- app/controllers/tramway/site/web/application_controller.rb
|
28
|
+
- app/controllers/tramway/site/web/welcome_controller.rb
|
29
|
+
- app/decorators/tramway/site/person_decorator.rb
|
30
|
+
- app/forms/tramway/site/person_form.rb
|
31
|
+
- app/helpers/tramway/site/application_helper.rb
|
32
|
+
- app/jobs/tramway/site/application_job.rb
|
33
|
+
- app/mailers/tramway/site/application_mailer.rb
|
34
|
+
- app/models/tramway/site/application_record.rb
|
35
|
+
- app/models/tramway/site/person.rb
|
36
|
+
- app/views/tramway/site/web/welcome/index.html.haml
|
37
|
+
- config/initializers/tramway.rb
|
38
|
+
- config/locales/models.yml
|
39
|
+
- config/locales/ru.yml
|
40
|
+
- config/routes.rb
|
41
|
+
- lib/tramway/site.rb
|
42
|
+
- lib/tramway/site/engine.rb
|
43
|
+
- lib/tramway/site/generates/install_generator.rb
|
44
|
+
- lib/tramway/site/generates/templates/add_main_image_tramway_site_people.rb
|
45
|
+
- lib/tramway/site/generates/templates/create_tramway_site_people.rb
|
46
|
+
- lib/tramway/site/version.rb
|
20
47
|
homepage: https://github.com/ulmic/tramway-dev
|
21
48
|
licenses:
|
22
49
|
- MIT
|
@@ -36,8 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
63
|
- !ruby/object:Gem::Version
|
37
64
|
version: '0'
|
38
65
|
requirements: []
|
39
|
-
|
40
|
-
rubygems_version: 2.7.6
|
66
|
+
rubygems_version: 3.1.2
|
41
67
|
signing_key:
|
42
68
|
specification_version: 4
|
43
69
|
summary: Rails engine for person site
|