tramway-partner 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7b819637828eac714335ff735b7a6a15f50af749b819bf057fe75967cb346527
4
+ data.tar.gz: e828c8fb17df52db114b2f88e1475d5bfc884d6cf178d1040680d34dec93fa9c
5
+ SHA512:
6
+ metadata.gz: 58bf72d5525bb9dea06a85772a929971a2da29504276d9f3ae618b3274797b61ef652982207d710d821856e419cc64f1744fbf1b64cd5794e5847bc2ab9ba9d4
7
+ data.tar.gz: 9795bad803b0cf88eac3984172359961ccc925a8857ccc13099a8fd1ae8e9e2974184bb3ba86c4e83cf2455974ff63861a0d2fe1ea78d697d9f8f1b769322585
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2018 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::Partner
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-partner'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install tramway-partner
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](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,36 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Tramway::Partner'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ require 'bundler/gem_tasks'
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'test'
31
+ t.pattern = 'test/**/*_test.rb'
32
+ t.verbose = false
33
+ end
34
+
35
+
36
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/tramway/partner .js
2
+ //= link_directory ../stylesheets/tramway/partner .css
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,7 @@
1
+ module Tramway
2
+ module Partner
3
+ class ApplicationController < ActionController::Base
4
+ protect_from_forgery with: :exception
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class Tramway::Partner::OrganizationDecorator < ::Tramway::Core::ApplicationDecorator
2
+ class << self
3
+ def collections
4
+ [ :all ]
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ class Tramway::Partner::OrganizationForm < ::Tramway::Core::ApplicationForm
2
+ properties :title, :logo, :url
3
+
4
+ def initialize(object)
5
+ form_object = super object
6
+ form_properties title: :string,
7
+ logo: :file,
8
+ url: :string
9
+ form_object
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ module Tramway
2
+ module Partner
3
+ module ApplicationHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Tramway
2
+ module Partner
3
+ class ApplicationJob < ActiveJob::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module Tramway
2
+ module Partner
3
+ class ApplicationMailer < ActionMailer::Base
4
+ default from: 'from@example.com'
5
+ layout 'mailer'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module Tramway
2
+ module Partner
3
+ class ApplicationRecord < ::Tramway::Core::ApplicationRecord
4
+ self.abstract_class = true
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module Tramway
2
+ module Partner
3
+ class Organization < ::Tramway::Partner::ApplicationRecord
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Tramway partner</title>
5
+ <%= stylesheet_link_tag "tramway/partner/application", media: "all" %>
6
+ <%= javascript_include_tag "tramway/partner/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1 @@
1
+ ::Tramway::Admin.set_available_models(::Tramway::Partner::Organization, project: :partner)
@@ -0,0 +1,13 @@
1
+ ru:
2
+ activerecord:
3
+ models:
4
+ tramway/partner/organization: Партнёр
5
+ attributes:
6
+ tramway/partner/organization:
7
+ title: Название
8
+ logo: Логотип
9
+ url: Ссылка на сайт
10
+ cases:
11
+ tramway/partner/organization:
12
+ plural: партнёры
13
+ genitive: партнёра
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Tramway::Partner::Engine.routes.draw do
2
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :tramway_partner do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require "tramway/partner/engine"
2
+ require 'tramway/partner/generators/install_generator'
3
+
4
+ module Tramway
5
+ module Partner
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Tramway
2
+ module Partner
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace Tramway::Partner
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,26 @@
1
+ require 'rails/generators'
2
+ require 'tramway/core/generators/install_generator'
3
+
4
+ module Tramway::Partner::Generators
5
+ class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
6
+ include Rails::Generators::Migration
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ def run_other_generators
10
+ end
11
+
12
+ def self.next_migration_number(path)
13
+ next_migration_number = current_migration_number(path) + 1
14
+ ActiveRecord::Migration.next_migration_number next_migration_number
15
+ end
16
+
17
+ def copy_migrations
18
+ migrations = [
19
+ :create_tramway_partner_organizations
20
+ ]
21
+ migrations.each do |migration|
22
+ migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,12 @@
1
+ class CreateTramwayPartnerOrganizations < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :tramway_partner_organizations do |t|
4
+ t.text :title
5
+ t.text :logo
6
+ t.text :url
7
+ t.text :state, default: :active
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Tramway
2
+ module Partner
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tramway-partner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pavel Kalashnikov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Rails engine for partners
14
+ email:
15
+ - kalashnikovisme@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - MIT-LICENSE
21
+ - README.md
22
+ - Rakefile
23
+ - app/assets/config/tramway_partner_manifest.js
24
+ - app/assets/javascripts/tramway/partner/application.js
25
+ - app/assets/stylesheets/tramway/partner/application.css
26
+ - app/controllers/tramway/partner/application_controller.rb
27
+ - app/decorators/tramway/partner/organization_decorator.rb
28
+ - app/forms/tramway/partner/organization_form.rb
29
+ - app/helpers/tramway/partner/application_helper.rb
30
+ - app/jobs/tramway/partner/application_job.rb
31
+ - app/mailers/tramway/partner/application_mailer.rb
32
+ - app/models/tramway/partner/application_record.rb
33
+ - app/models/tramway/partner/organization.rb
34
+ - app/views/layouts/tramway/partner/application.html.erb
35
+ - config/initializers/tramway.rb
36
+ - config/locales/models.yml
37
+ - config/routes.rb
38
+ - lib/tasks/tramway/partner_tasks.rake
39
+ - lib/tramway/partner.rb
40
+ - lib/tramway/partner/engine.rb
41
+ - lib/tramway/partner/generators/install_generator.rb
42
+ - lib/tramway/partner/generators/templates/create_tramway_partner_organizations.rb
43
+ - lib/tramway/partner/version.rb
44
+ homepage: https://github.com/ulmic/tramway-partner
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.7.6
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Rails engine for partners
68
+ test_files: []