tramway-core 0.2 → 1.0
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 +4 -4
- data/README.md +24 -15
- data/app/uploaders/photo_uploader.rb +11 -1
- data/lib/tramway/core/application.rb +3 -0
- data/lib/tramway/core/version.rb +1 -1
- data/lib/tramway/core.rb +13 -0
- metadata +4 -38
- data/app/controllers/tramway/core/application_controller.rb +0 -7
- data/app/controllers/tramway/core/web/application_controller.rb +0 -4
- data/app/helpers/tramway/core/application_helper.rb +0 -6
- data/app/helpers/tramway/core/web/application_helper.rb +0 -4
- data/app/jobs/tramway/core/application_job.rb +0 -6
- data/app/mailers/tramway/core/application_mailer.rb +0 -8
- data/app/views/layouts/tramway/core/application.html.erb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfd6033a88454598b04b674d5533289b18d128c4f4011b47f312dfedbdcc49e0
|
4
|
+
data.tar.gz: c850087d3845cf990ac1ef8da5c874f53f2dfd7c2d5bb94fa17a663976a31098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7cb2c5f6daeac2cf88b66725956a24e8386400d8a0e764c7c3c61a367ecfac2bdc000b015e35f157eb7998f08e3b9c5f2e53b0651c0baf1ea625e9fbfbbecf1
|
7
|
+
data.tar.gz: 6ff73a44b73b9e1b9b38ae8f3ade5a0a38992f8dc24885be6b813036c17d4c75553e7059cab82598bad6ec535d224d41d1ca645673a618bd72d6c8e4ee243c5a
|
data/README.md
CHANGED
@@ -1,26 +1,35 @@
|
|
1
1
|
# Tramway::Core
|
2
|
-
Short description and motivation.
|
3
2
|
|
4
|
-
|
5
|
-
How to use my plugin.
|
3
|
+
*If you need translation of this Readme, please message us kalashnikov@ulmic.ru. We'll translate for you and post to this page*
|
6
4
|
|
7
|
-
|
8
|
-
Add this line to your application's Gemfile:
|
5
|
+
tramway-core - это ядро проекта [tramway](https://github.com/ulmic/tramway)
|
9
6
|
|
10
|
-
|
11
|
-
gem 'tramway-core'
|
12
|
-
```
|
7
|
+
Этот гем предоставляет базовые классы и реализации для других шаблонов Tramway. Как правило, каждый шаблон Tramway должен иметь в зависимостях последнюю версию гема `tramway-core`.
|
13
8
|
|
14
|
-
|
15
|
-
```bash
|
16
|
-
$ bundle
|
17
|
-
```
|
9
|
+
# Installation
|
18
10
|
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
```shell
|
12
|
+
gem install tramway-core
|
13
|
+
rails g tramway:core:install
|
22
14
|
```
|
23
15
|
|
16
|
+
# Базовые классы
|
17
|
+
|
18
|
+
* ApplicationDecorator - Базовый класс декоратора. В него по умолчанию включены `ActionView::Helpers` и `ActionView::Context` и `FontAwesome`. `FontAwesome` считается в `Tramway` основным шрифтом для иконок.
|
19
|
+
* ApplicationForm - наследованный от Reform::Form класс форм.
|
20
|
+
* ApplicationRecord - базовый класс для AR моделей
|
21
|
+
* ApplicationUploader - базовый класс для Carrierwave аплоадеров.
|
22
|
+
* FileUploader - базовый класс для загрузки файлов
|
23
|
+
* PhotoUploader - базовый класс для загрузки фотографий
|
24
|
+
* Вьюха `_messages` - предоставляет отображение ошибок в форме. Совместима с AR и Reform
|
25
|
+
|
26
|
+
# Локализация
|
27
|
+
|
28
|
+
* dates - правила локализации даты
|
29
|
+
* helpers - часто используемые в формах слова
|
30
|
+
* models - часто используемые в моделях слова
|
31
|
+
* state_machines - локализация состояний
|
32
|
+
|
24
33
|
## Contributing
|
25
34
|
Contribution directions go here.
|
26
35
|
|
@@ -6,7 +6,7 @@ class PhotoUploader < ApplicationUploader
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def url
|
9
|
-
if File.exist?
|
9
|
+
if file.present? && File.exist?(file.file)
|
10
10
|
file.file.match(/\/system\/uploads\/.*/).to_s
|
11
11
|
else
|
12
12
|
"/assets/tramway/core/mona_lisa_from_prado_square.jpg"
|
@@ -21,6 +21,16 @@ class PhotoUploader < ApplicationUploader
|
|
21
21
|
process :resize_to_fill => [100, 100]
|
22
22
|
end
|
23
23
|
|
24
|
+
# FIXME move to tramway-landing uploader
|
25
|
+
version :card do
|
26
|
+
process resize_to_fill: [400, 400, 'North']
|
27
|
+
end
|
28
|
+
|
29
|
+
# FIXME move to tramway-landing uploader
|
30
|
+
version :horizontal do
|
31
|
+
process resize_to_fill: [800, 350, 'North']
|
32
|
+
end
|
33
|
+
|
24
34
|
attr_reader :width, :height
|
25
35
|
|
26
36
|
before :cache, :capture_size
|
data/lib/tramway/core/version.rb
CHANGED
data/lib/tramway/core.rb
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
require "tramway/core/engine"
|
2
2
|
require 'tramway/core/generators/install_generator'
|
3
|
+
require 'tramway/core/application'
|
3
4
|
|
4
5
|
module Tramway
|
5
6
|
module Core
|
7
|
+
class << self
|
8
|
+
def initialize_application(**options)
|
9
|
+
@application ||= Tramway::Core::Application.new
|
10
|
+
options.each do |attr, value|
|
11
|
+
@application.send "#{attr}=", value
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def application
|
16
|
+
@application
|
17
|
+
end
|
18
|
+
end
|
6
19
|
end
|
7
20
|
end
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rails
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 5.1.4
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 5.1.4
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pg
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
11
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
41
13
|
description: Core for all Tramway Rails Engines
|
42
14
|
email:
|
43
15
|
- kalashnikovisme@gmail.com
|
@@ -54,21 +26,14 @@ files:
|
|
54
26
|
- app/assets/javascripts/tramway/core/application.js.coffee
|
55
27
|
- app/assets/javascripts/tramway/core/web/application.js
|
56
28
|
- app/assets/stylesheets/tramway/core/application.css.sass
|
57
|
-
- app/controllers/tramway/core/application_controller.rb
|
58
|
-
- app/controllers/tramway/core/web/application_controller.rb
|
59
29
|
- app/decorators/tramway/core/application_decorated_collection.rb
|
60
30
|
- app/decorators/tramway/core/application_decorator.rb
|
61
31
|
- app/forms/tramway/core/application_form.rb
|
62
|
-
- app/helpers/tramway/core/application_helper.rb
|
63
|
-
- app/helpers/tramway/core/web/application_helper.rb
|
64
|
-
- app/jobs/tramway/core/application_job.rb
|
65
|
-
- app/mailers/tramway/core/application_mailer.rb
|
66
32
|
- app/models/tramway/core/application_record.rb
|
67
33
|
- app/uploaders/application_uploader.rb
|
68
34
|
- app/uploaders/file_uploader.rb
|
69
35
|
- app/uploaders/image_defaults.rb
|
70
36
|
- app/uploaders/photo_uploader.rb
|
71
|
-
- app/views/layouts/tramway/core/application.html.erb
|
72
37
|
- app/views/tramway/core/shared/_messages.html.haml
|
73
38
|
- config/locales/ru/dates.yml
|
74
39
|
- config/locales/ru/helpers.yml
|
@@ -77,6 +42,7 @@ files:
|
|
77
42
|
- config/routes.rb
|
78
43
|
- lib/tasks/tramway/core_tasks.rake
|
79
44
|
- lib/tramway/core.rb
|
45
|
+
- lib/tramway/core/application.rb
|
80
46
|
- lib/tramway/core/engine.rb
|
81
47
|
- lib/tramway/core/generators/install_generator.rb
|
82
48
|
- lib/tramway/core/generators/templates/initializers/simple_form.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Tramway core</title>
|
5
|
-
<%= stylesheet_link_tag "tramway/core/application", media: "all" %>
|
6
|
-
<%= javascript_include_tag "tramway/core/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|