iatelier 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +119 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/iatelier-0.1.1.gem +0 -0
- data/iatelier.gemspec +43 -0
- data/lib/iatelier/Users/captainhusaynpinguin/Documents/ruby/iatelier/public/assets/js/analog.js +15347 -0
- data/lib/iatelier/Users/captainhusaynpinguin/Documents/ruby/iatelier/public/assets/js/selectize.js +12672 -0
- data/lib/iatelier/application.rb +317 -0
- data/lib/iatelier/assets/favicon.ico +0 -0
- data/lib/iatelier/assets/images/.gitkeep +0 -0
- data/lib/iatelier/assets/javascripts/iatelier-analog.js +15347 -0
- data/lib/iatelier/assets/javascripts/selectize.js +12672 -0
- data/lib/iatelier/assets/js/iatelier-analog.js +26 -0
- data/lib/iatelier/assets/js/selectize.js +3 -0
- data/lib/iatelier/assets/sass/backend.scss +4 -0
- data/lib/iatelier/assets/sass/blaze/blaze.colors.scss +30 -0
- data/lib/iatelier/assets/sass/blaze/blaze.scss +42 -0
- data/lib/iatelier/assets/sass/blaze/components.addresses.scss +12 -0
- data/lib/iatelier/assets/sass/blaze/components.alerts.scss +59 -0
- data/lib/iatelier/assets/sass/blaze/components.avatars.scss +36 -0
- data/lib/iatelier/assets/sass/blaze/components.badges.scss +60 -0
- data/lib/iatelier/assets/sass/blaze/components.breadcrumbs.scss +20 -0
- data/lib/iatelier/assets/sass/blaze/components.bubbles.scss +49 -0
- data/lib/iatelier/assets/sass/blaze/components.buttons.scss +77 -0
- data/lib/iatelier/assets/sass/blaze/components.calendars.scss +69 -0
- data/lib/iatelier/assets/sass/blaze/components.cards.scss +213 -0
- data/lib/iatelier/assets/sass/blaze/components.headings.scss +14 -0
- data/lib/iatelier/assets/sass/blaze/components.hints.scss +27 -0
- data/lib/iatelier/assets/sass/blaze/components.input-groups.scss +163 -0
- data/lib/iatelier/assets/sass/blaze/components.inputs.scss +144 -0
- data/lib/iatelier/assets/sass/blaze/components.links.scss +31 -0
- data/lib/iatelier/assets/sass/blaze/components.lists.scss +60 -0
- data/lib/iatelier/assets/sass/blaze/components.navs.scss +126 -0
- data/lib/iatelier/assets/sass/blaze/components.overlays.scss +26 -0
- data/lib/iatelier/assets/sass/blaze/components.pagination.scss +42 -0
- data/lib/iatelier/assets/sass/blaze/components.progress.scss +51 -0
- data/lib/iatelier/assets/sass/blaze/components.ranges.scss +114 -0
- data/lib/iatelier/assets/sass/blaze/components.tables.scss +88 -0
- data/lib/iatelier/assets/sass/blaze/components.tabs.scss +72 -0
- data/lib/iatelier/assets/sass/blaze/components.tags.scss +42 -0
- data/lib/iatelier/assets/sass/blaze/components.toggles.scss +74 -0
- data/lib/iatelier/assets/sass/blaze/components.tooltips.scss +96 -0
- data/lib/iatelier/assets/sass/blaze/components.trees.scss +47 -0
- data/lib/iatelier/assets/sass/blaze/components.typography.scss +94 -0
- data/lib/iatelier/assets/sass/blaze/generics.global.scss +13 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.alerts.scss +6 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.badges.scss +8 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.buttons.scss +83 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.inputs.scss +45 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.links.scss +22 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.lists.scss +10 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.navs.scss +29 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.ranges.scss +89 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.tabs.scss +5 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.toggles.scss +6 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_components.typography.scss +25 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_objects.containers.scss +10 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_objects.grid.scss +113 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_settings.global.scss +864 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_tools.mediaqueries.scss +73 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_utilities.alignment.scss +24 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_utilities.boxing.scss +125 -0
- data/lib/iatelier/assets/sass/blaze/mixins/_utilities.visibility.scss +47 -0
- data/lib/iatelier/assets/sass/blaze/objects.containers.scss +29 -0
- data/lib/iatelier/assets/sass/blaze/objects.drawers.scss +80 -0
- data/lib/iatelier/assets/sass/blaze/objects.forms.scss +25 -0
- data/lib/iatelier/assets/sass/blaze/objects.grid.responsive.scss +124 -0
- data/lib/iatelier/assets/sass/blaze/objects.grid.scss +70 -0
- data/lib/iatelier/assets/sass/blaze/objects.images.scss +5 -0
- data/lib/iatelier/assets/sass/blaze/objects.media.scss +36 -0
- data/lib/iatelier/assets/sass/blaze/objects.modals.scss +58 -0
- data/lib/iatelier/assets/sass/blaze/objects.panels.scss +27 -0
- data/lib/iatelier/assets/sass/blaze/themes/blaze.example.scss +7 -0
- data/lib/iatelier/assets/sass/blaze/utilities.alignment.scss +22 -0
- data/lib/iatelier/assets/sass/blaze/utilities.boxing.scss +101 -0
- data/lib/iatelier/assets/sass/blaze/utilities.elevation.scss +19 -0
- data/lib/iatelier/assets/sass/blaze/utilities.sizes.scss +25 -0
- data/lib/iatelier/assets/sass/blaze/utilities.visibility.scss +45 -0
- data/lib/iatelier/assets/sass/iatelier.scss +30 -0
- data/lib/iatelier/assets/sass/selectize.scss +394 -0
- data/lib/iatelier/assets/sass/views/master.scss +5 -0
- data/lib/iatelier/assets/stylesheets/iatelier.css +534 -0
- data/lib/iatelier/assets/stylesheets/selectize.css +420 -0
- data/lib/iatelier/config/routes.rb +14 -0
- data/lib/iatelier/controllers/.gitkeep +0 -0
- data/lib/iatelier/controllers/books/create.rb +15 -0
- data/lib/iatelier/controllers/books/edit.rb +13 -0
- data/lib/iatelier/controllers/books/manage.rb +13 -0
- data/lib/iatelier/controllers/books/new.rb +15 -0
- data/lib/iatelier/controllers/books/update.rb +16 -0
- data/lib/iatelier/controllers/ileaf.rb +23 -0
- data/lib/iatelier/mix-manifest.json +6 -0
- data/lib/iatelier/models/.gitkeep +0 -0
- data/lib/iatelier/models/application_record.rb +3 -0
- data/lib/iatelier/models/book.rb +176 -0
- data/lib/iatelier/models/dimension.rb +28 -0
- data/lib/iatelier/models/dimensions/description.rb +4 -0
- data/lib/iatelier/models/dimensions/slug.rb +13 -0
- data/lib/iatelier/models/dimensions/subtitle.rb +4 -0
- data/lib/iatelier/models/dimensions/thumbnail.rb +4 -0
- data/lib/iatelier/models/dimensions/timestamp.rb +4 -0
- data/lib/iatelier/models/dimensions/title.rb +5 -0
- data/lib/iatelier/models/grouping.rb +28 -0
- data/lib/iatelier/models/keyword.rb +8 -0
- data/lib/iatelier/models/people.rb +11 -0
- data/lib/iatelier/models/transi_.php +262 -0
- data/lib/iatelier/package.json +35 -0
- data/lib/iatelier/templates/application.html.erb +65 -0
- data/lib/iatelier/templates/books/_engine.html.haml +31 -0
- data/lib/iatelier/templates/books/edit.html.haml +8 -0
- data/lib/iatelier/templates/books/grouping/_bundles.html.haml +0 -0
- data/lib/iatelier/templates/books/grouping/_keywords.html.haml +5 -0
- data/lib/iatelier/templates/books/grouping/_peoples.html.haml +7 -0
- data/lib/iatelier/templates/books/manage.html.haml +12 -0
- data/lib/iatelier/templates/books/new.html.haml +7 -0
- data/lib/iatelier/templates/books/update.html.haml +0 -0
- data/lib/iatelier/version.rb +3 -0
- data/lib/iatelier/views/application_layout.rb +7 -0
- data/lib/iatelier/views/books/create.rb +9 -0
- data/lib/iatelier/views/books/edit.rb +9 -0
- data/lib/iatelier/views/books/manage.rb +9 -0
- data/lib/iatelier/views/books/new.rb +9 -0
- data/lib/iatelier/views/books/update.rb +9 -0
- data/lib/iatelier/webpack.mix.js +19 -0
- data/lib/iatelier.rb +325 -0
- metadata +250 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
%div
|
2
|
+
.todo adding errors here!
|
3
|
+
%form{:class => "atelier-main-form pure-form pure-form-aligned", :action => "/iatelier/analog/#{book.class.name.downcase}/#{book.id}", :method => "POST", :enctype => "multipart/form-data"}
|
4
|
+
.form-actions
|
5
|
+
<button type="submit" class="btn btn-default">Edit</button>
|
6
|
+
<input type="hidden" name="_method" value="PATCH">
|
7
|
+
%div
|
8
|
+
= render :partial => 'engine'
|
File without changes
|
@@ -0,0 +1,5 @@
|
|
1
|
+
%div{:class => "c-card__item c-card__item--divider"}
|
2
|
+
.span Keyword
|
3
|
+
%div{:class => "c-card__item"}
|
4
|
+
%input{:id => "keywords", :name => "keywords", :value => book.keywords.pluck(:word).join(", ")}
|
5
|
+
%div{:id => "keywords-field", :name => "keywords", :type => "text", :style => "width: 100%; display: block;"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
%div{:class => ".c-card__item c-card__item--divider"} People related data
|
2
|
+
- book.roles.each do |role|
|
3
|
+
.c-card__item
|
4
|
+
.os-form-group
|
5
|
+
%label #{role}:
|
6
|
+
%input{:id => role, :name => "people[#{role}]", :type => "text", :value => book.individuals(role).to_a.pluck(:identifier).join(', ')}
|
7
|
+
%div{:id => "#{role}-field", :class => "form-control select-correction"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
%div
|
2
|
+
.todo adding errors here!
|
3
|
+
%form{:class => "atelier-main-form pure-form pure-form-aligned", :action => "/iatelier/analog/#{book.class.name.downcase}/#{book.id}", :method => "POST", :enctype => "multipart/form-data"}
|
4
|
+
.form-actions
|
5
|
+
<button type="submit" class="btn btn-default">Create</button>
|
6
|
+
%div
|
7
|
+
= render :partial => 'engine'
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
const mix = require('laravel-mix');
|
2
|
+
|
3
|
+
/*
|
4
|
+
|--------------------------------------------------------------------------
|
5
|
+
| Mix Asset Management
|
6
|
+
|--------------------------------------------------------------------------
|
7
|
+
|
|
8
|
+
| Mix provides a clean, fluent API for defining some Webpack build steps
|
9
|
+
| for your Laravel application. By default, we are compiling the Sass
|
10
|
+
| file for the application as well as bundling up all the JS files.
|
11
|
+
|
|
12
|
+
*/
|
13
|
+
// mix.options({ processCssUrls: false })
|
14
|
+
mix.js('assets/js/iatelier-analog.js', 'assets/javascripts')
|
15
|
+
.js('assets/js/selectize.js', 'assets/javascripts')
|
16
|
+
.sass('assets/sass/selectize.scss', 'assets/stylesheets')
|
17
|
+
.sass('assets/sass/iatelier.scss', 'assets/stylesheets');
|
18
|
+
|
19
|
+
// mix.copy('node_modules/css-oldschool/src/fonts', 'public/fonts');
|
data/lib/iatelier.rb
ADDED
@@ -0,0 +1,325 @@
|
|
1
|
+
require "iatelier/version"
|
2
|
+
|
3
|
+
# module Iatelier
|
4
|
+
# class Error < StandardError; end
|
5
|
+
# # Your code goes here...
|
6
|
+
# end
|
7
|
+
|
8
|
+
require 'hanami'
|
9
|
+
require 'hanami/helpers'
|
10
|
+
require 'hanami/assets'
|
11
|
+
# require 'rack'
|
12
|
+
|
13
|
+
module Iatelier
|
14
|
+
class Application < Hanami::Application
|
15
|
+
configure do
|
16
|
+
##
|
17
|
+
# BASIC
|
18
|
+
#
|
19
|
+
|
20
|
+
# Define the root path of this application.
|
21
|
+
# All paths specified in this configuration are relative to path below.
|
22
|
+
#
|
23
|
+
root __dir__
|
24
|
+
|
25
|
+
# Relative load paths where this application will recursively load the
|
26
|
+
# code.
|
27
|
+
#
|
28
|
+
# When you add new directories, remember to add them here.
|
29
|
+
#
|
30
|
+
load_paths << [
|
31
|
+
'iatelier/controllers',
|
32
|
+
'iatelier/views'
|
33
|
+
]
|
34
|
+
|
35
|
+
# Handle exceptions with HTTP statuses (true) or don't catch them (false).
|
36
|
+
# Defaults to true.
|
37
|
+
# See: http://www.rubydoc.info/gems/hanami-controller/#Exceptions_management
|
38
|
+
#
|
39
|
+
# handle_exceptions true
|
40
|
+
|
41
|
+
##
|
42
|
+
# HTTP
|
43
|
+
#
|
44
|
+
|
45
|
+
# Routes definitions for this application
|
46
|
+
# See: http://www.rubydoc.info/gems/hanami-router#Usage
|
47
|
+
#
|
48
|
+
routes 'iatelier/config/routes'
|
49
|
+
|
50
|
+
# URI scheme used by the routing system to generate absolute URLs
|
51
|
+
# Defaults to "http"
|
52
|
+
#
|
53
|
+
# scheme 'https'
|
54
|
+
|
55
|
+
# URI host used by the routing system to generate absolute URLs
|
56
|
+
# Defaults to "localhost"
|
57
|
+
#
|
58
|
+
# host 'example.org'
|
59
|
+
|
60
|
+
# URI port used by the routing system to generate absolute URLs
|
61
|
+
# Argument: An object coercible to integer, defaults to 80 if the scheme
|
62
|
+
# is http and 443 if it's https
|
63
|
+
#
|
64
|
+
# This should only be configured if app listens to non-standard ports
|
65
|
+
#
|
66
|
+
# port 443
|
67
|
+
|
68
|
+
# Enable cookies
|
69
|
+
# Argument: boolean to toggle the feature
|
70
|
+
# A Hash with options
|
71
|
+
#
|
72
|
+
# Options:
|
73
|
+
# :domain - The domain (String - nil by default, not required)
|
74
|
+
# :path - Restrict cookies to a relative URI
|
75
|
+
# (String - nil by default)
|
76
|
+
# :max_age - Cookies expiration expressed in seconds
|
77
|
+
# (Integer - nil by default)
|
78
|
+
# :secure - Restrict cookies to secure connections
|
79
|
+
# (Boolean - Automatically true when using HTTPS)
|
80
|
+
# See #scheme and #ssl?
|
81
|
+
# :httponly - Prevent JavaScript access (Boolean - true by default)
|
82
|
+
#
|
83
|
+
# cookies true
|
84
|
+
# or
|
85
|
+
# cookies max_age: 300
|
86
|
+
|
87
|
+
# Enable sessions
|
88
|
+
# Argument: Symbol the Rack session adapter
|
89
|
+
# A Hash with options
|
90
|
+
#
|
91
|
+
# See: http://www.rubydoc.info/gems/rack/Rack/Session/Cookie
|
92
|
+
#
|
93
|
+
# sessions :cookie, secret: ENV['ATELIER_SESSIONS_SECRET']
|
94
|
+
|
95
|
+
# Configure Rack middleware for this application
|
96
|
+
#
|
97
|
+
# middleware.use Rack::Protection
|
98
|
+
middleware.use Rack::Auth::Basic, 'Welcome' do |username, password|
|
99
|
+
username == 'ScrappyNobody' && password == 'Fenster7'
|
100
|
+
end
|
101
|
+
|
102
|
+
# Default format for the requests that don't specify an HTTP_ACCEPT header
|
103
|
+
# Argument: A symbol representation of a mime type, defaults to :html
|
104
|
+
#
|
105
|
+
# default_request_format :html
|
106
|
+
|
107
|
+
# Default format for responses that don't consider the request format
|
108
|
+
# Argument: A symbol representation of a mime type, defaults to :html
|
109
|
+
#
|
110
|
+
# default_response_format :html
|
111
|
+
|
112
|
+
##
|
113
|
+
# TEMPLATES
|
114
|
+
#
|
115
|
+
|
116
|
+
# The layout to be used by all views
|
117
|
+
#
|
118
|
+
layout :application # It will load Iatelier::Views::ApplicationLayout
|
119
|
+
|
120
|
+
# The relative path to templates
|
121
|
+
#
|
122
|
+
templates 'iatelier/templates'
|
123
|
+
|
124
|
+
##
|
125
|
+
# ASSETS
|
126
|
+
#
|
127
|
+
assets do
|
128
|
+
# JavaScript compressor
|
129
|
+
#
|
130
|
+
# Supported engines:
|
131
|
+
#
|
132
|
+
# * :builtin
|
133
|
+
# * :uglifier
|
134
|
+
# * :yui
|
135
|
+
# * :closure
|
136
|
+
#
|
137
|
+
# See: https://guides.hanamirb.org/assets/compressors
|
138
|
+
#
|
139
|
+
# In order to skip JavaScript compression comment the following line
|
140
|
+
javascript_compressor :builtin
|
141
|
+
|
142
|
+
# Stylesheet compressor
|
143
|
+
#
|
144
|
+
# Supported engines:
|
145
|
+
#
|
146
|
+
# * :builtin
|
147
|
+
# * :yui
|
148
|
+
# * :sass
|
149
|
+
#
|
150
|
+
# See: https://guides.hanamirb.org/assets/compressors
|
151
|
+
#
|
152
|
+
# In order to skip stylesheet compression comment the following line
|
153
|
+
stylesheet_compressor :builtin
|
154
|
+
|
155
|
+
# Specify sources for assets
|
156
|
+
#
|
157
|
+
sources << [
|
158
|
+
'iatelier/assets'
|
159
|
+
]
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# SECURITY
|
164
|
+
#
|
165
|
+
|
166
|
+
# X-Frame-Options is a HTTP header supported by modern browsers.
|
167
|
+
# It determines if a web page can or cannot be included via <frame> and
|
168
|
+
# <iframe> tags by untrusted domains.
|
169
|
+
#
|
170
|
+
# Web applications can send this header to prevent Clickjacking attacks.
|
171
|
+
#
|
172
|
+
# Read more at:
|
173
|
+
#
|
174
|
+
# * https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options
|
175
|
+
# * https://www.owasp.org/index.php/Clickjacking
|
176
|
+
#
|
177
|
+
security.x_frame_options 'DENY'
|
178
|
+
|
179
|
+
# X-Content-Type-Options prevents browsers from interpreting files as
|
180
|
+
# something else than declared by the content type in the HTTP headers.
|
181
|
+
#
|
182
|
+
# Read more at:
|
183
|
+
#
|
184
|
+
# * https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#X-Content-Type-Options
|
185
|
+
# * https://msdn.microsoft.com/en-us/library/gg622941%28v=vs.85%29.aspx
|
186
|
+
# * https://blogs.msdn.microsoft.com/ie/2008/09/02/ie8-security-part-vi-beta-2-update
|
187
|
+
#
|
188
|
+
security.x_content_type_options 'nosniff'
|
189
|
+
|
190
|
+
# X-XSS-Protection is a HTTP header to determine the behavior of the
|
191
|
+
# browser in case an XSS attack is detected.
|
192
|
+
#
|
193
|
+
# Read more at:
|
194
|
+
#
|
195
|
+
# * https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)
|
196
|
+
# * https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#X-XSS-Protection
|
197
|
+
#
|
198
|
+
security.x_xss_protection '1; mode=block'
|
199
|
+
|
200
|
+
# Content-Security-Policy (CSP) is a HTTP header supported by modern
|
201
|
+
# browsers. It determines trusted sources of execution for dynamic
|
202
|
+
# contents (JavaScript) or other web related assets: stylesheets, images,
|
203
|
+
# fonts, plugins, etc.
|
204
|
+
#
|
205
|
+
# Web applications can send this header to mitigate Cross Site Scripting
|
206
|
+
# (XSS) attacks.
|
207
|
+
#
|
208
|
+
# The default value allows images, scripts, AJAX, fonts and CSS from the
|
209
|
+
# same origin, and does not allow any other resources to load (eg object,
|
210
|
+
# frame, media, etc).
|
211
|
+
#
|
212
|
+
# Inline JavaScript is NOT allowed. To enable it, please use:
|
213
|
+
# "script-src 'unsafe-inline'".
|
214
|
+
#
|
215
|
+
# Content Security Policy introduction:
|
216
|
+
#
|
217
|
+
# * http://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
218
|
+
# * https://www.owasp.org/index.php/Content_Security_Policy
|
219
|
+
# * https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
|
220
|
+
#
|
221
|
+
# Inline and eval JavaScript risks:
|
222
|
+
#
|
223
|
+
# * http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful
|
224
|
+
# * http://www.html5rocks.com/en/tutorials/security/content-security-policy/#eval-too
|
225
|
+
#
|
226
|
+
# Content Security Policy usage:
|
227
|
+
#
|
228
|
+
# * http://content-security-policy.com/
|
229
|
+
# * https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy
|
230
|
+
#
|
231
|
+
# Content Security Policy references:
|
232
|
+
#
|
233
|
+
# * https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives
|
234
|
+
#
|
235
|
+
security.content_security_policy %{
|
236
|
+
form-action 'self';
|
237
|
+
frame-ancestors 'self';
|
238
|
+
base-uri 'self';
|
239
|
+
default-src 'none';
|
240
|
+
script-src 'self';
|
241
|
+
connect-src 'self';
|
242
|
+
img-src 'self' https: data:;
|
243
|
+
style-src 'self' 'unsafe-inline' https:;
|
244
|
+
font-src 'self';
|
245
|
+
object-src 'none';
|
246
|
+
plugin-types application/pdf;
|
247
|
+
child-src 'self';
|
248
|
+
frame-src 'self';
|
249
|
+
media-src 'self'
|
250
|
+
}
|
251
|
+
|
252
|
+
##
|
253
|
+
# FRAMEWORKS
|
254
|
+
#
|
255
|
+
|
256
|
+
# Configure the code that will yield each time Iatelier::Action is included
|
257
|
+
# This is useful for sharing common functionality
|
258
|
+
#
|
259
|
+
# See: http://www.rubydoc.info/gems/hanami-controller#Configuration
|
260
|
+
controller.prepare do
|
261
|
+
# include MyAuthentication # included in all the actions
|
262
|
+
# before :authenticate! # run an authentication before callback
|
263
|
+
end
|
264
|
+
|
265
|
+
# Configure the code that will yield each time Iatelier::View is included
|
266
|
+
# This is useful for sharing common functionality
|
267
|
+
#
|
268
|
+
# See: http://www.rubydoc.info/gems/hanami-view#Configuration
|
269
|
+
view.prepare do
|
270
|
+
include Hanami::Helpers
|
271
|
+
include Iatelier::Assets::Helpers
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
##
|
276
|
+
# DEVELOPMENT
|
277
|
+
#
|
278
|
+
configure :development do
|
279
|
+
# Don't handle exceptions, render the stack trace
|
280
|
+
handle_exceptions false
|
281
|
+
end
|
282
|
+
|
283
|
+
##
|
284
|
+
# TEST
|
285
|
+
#
|
286
|
+
configure :test do
|
287
|
+
# Don't handle exceptions, render the stack trace
|
288
|
+
handle_exceptions false
|
289
|
+
end
|
290
|
+
|
291
|
+
##
|
292
|
+
# PRODUCTION
|
293
|
+
#
|
294
|
+
configure :production do
|
295
|
+
# scheme 'https'
|
296
|
+
# host 'example.org'
|
297
|
+
# port 443
|
298
|
+
|
299
|
+
assets do
|
300
|
+
# Don't compile static assets in production mode (eg. Sass, ES6)
|
301
|
+
#
|
302
|
+
# See: http://www.rubydoc.info/gems/hanami-assets#Configuration
|
303
|
+
compile false
|
304
|
+
|
305
|
+
# Use fingerprint file name for asset paths
|
306
|
+
#
|
307
|
+
# See: https://guides.hanamirb.org/assets/overview
|
308
|
+
fingerprint true
|
309
|
+
|
310
|
+
# Content Delivery Network (CDN)
|
311
|
+
#
|
312
|
+
# See: https://guides.hanamirb.org/assets/content-delivery-network
|
313
|
+
#
|
314
|
+
# scheme 'https'
|
315
|
+
# host 'cdn.example.org'
|
316
|
+
# port 443
|
317
|
+
|
318
|
+
# Subresource Integrity
|
319
|
+
#
|
320
|
+
# See: https://guides.hanamirb.org/assets/content-delivery-network/#subresource-integrity
|
321
|
+
subresource_integrity :sha256
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|