express_admin 1.7.5 → 1.7.7
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/app/assets/javascripts/express_admin/components/command_button.js.coffee +25 -0
- data/app/assets/stylesheets/express_admin/components/_command_button.sass +6 -1
- data/app/assets/stylesheets/express_admin/globals/_variables.sass +2 -0
- data/app/assets/stylesheets/express_admin/plugins/_select2.sass +3 -0
- data/app/assets/stylesheets/express_admin/screen.sass +0 -2
- data/app/assets/stylesheets/express_admin/shared/_tables.sass +2 -0
- data/app/components/express_admin/command_button.rb +9 -3
- data/app/components/express_admin/definition_table.rb +1 -1
- data/app/components/express_admin/smart_table.rb +6 -0
- data/app/views/layouts/devise.html.erb +19 -0
- data/config/initializers/postgresql_trigram.rb +13 -0
- data/db/migrate/20150928044202_install_trigram.rb +18 -0
- data/lib/express_admin/engine.rb +4 -2
- data/lib/express_admin/search.rb +51 -0
- data/lib/express_admin/standard_actions.rb +18 -5
- data/lib/express_admin/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/test/components/command_button_test.rb +2 -2
- metadata +22 -160
- data/app/assets/stylesheets/express_admin/shared/_buttons.sass +0 -3
- data/app/assets/stylesheets/express_admin/shared/_tabs.sass +0 -25
- data/vendor/gems/express_templates/CHANGELOG.md +0 -12
- data/vendor/gems/express_templates/Gemfile +0 -16
- data/vendor/gems/express_templates/LICENSE +0 -21
- data/vendor/gems/express_templates/README.md +0 -133
- data/vendor/gems/express_templates/Rakefile +0 -32
- data/vendor/gems/express_templates/express_templates.gemspec +0 -32
- data/vendor/gems/express_templates/lib/arbre/patches.rb +0 -76
- data/vendor/gems/express_templates/lib/core_extensions/proc.rb +0 -103
- data/vendor/gems/express_templates/lib/core_extensions/string.rb +0 -25
- data/vendor/gems/express_templates/lib/express_templates/compiler.rb +0 -22
- data/vendor/gems/express_templates/lib/express_templates/components/all.rb +0 -28
- data/vendor/gems/express_templates/lib/express_templates/components/base.rb +0 -156
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/resourceful.rb +0 -213
- data/vendor/gems/express_templates/lib/express_templates/components/configurable.rb +0 -181
- data/vendor/gems/express_templates/lib/express_templates/components/container.rb +0 -45
- data/vendor/gems/express_templates/lib/express_templates/components/forms/basic_fields.rb +0 -52
- data/vendor/gems/express_templates/lib/express_templates/components/forms/checkbox.rb +0 -37
- data/vendor/gems/express_templates/lib/express_templates/components/forms/express_form.rb +0 -48
- data/vendor/gems/express_templates/lib/express_templates/components/forms/form_component.rb +0 -88
- data/vendor/gems/express_templates/lib/express_templates/components/forms/option_support.rb +0 -69
- data/vendor/gems/express_templates/lib/express_templates/components/forms/radio.rb +0 -65
- data/vendor/gems/express_templates/lib/express_templates/components/forms/select.rb +0 -126
- data/vendor/gems/express_templates/lib/express_templates/components/forms/select_collection.rb +0 -45
- data/vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb +0 -30
- data/vendor/gems/express_templates/lib/express_templates/components/forms.rb +0 -16
- data/vendor/gems/express_templates/lib/express_templates/components/tree_for.rb +0 -88
- data/vendor/gems/express_templates/lib/express_templates/components.rb +0 -11
- data/vendor/gems/express_templates/lib/express_templates/indenter.rb +0 -47
- data/vendor/gems/express_templates/lib/express_templates/interpolator.rb +0 -36
- data/vendor/gems/express_templates/lib/express_templates/renderer.rb +0 -9
- data/vendor/gems/express_templates/lib/express_templates/template/handler.rb +0 -32
- data/vendor/gems/express_templates/lib/express_templates/version.rb +0 -3
- data/vendor/gems/express_templates/lib/express_templates.rb +0 -18
- data/vendor/gems/express_templates/lib/tasks/express_templates.rake +0 -4
- data/vendor/gems/express_templates/test/compiler_test.rb +0 -9
- data/vendor/gems/express_templates/test/components/base_test.rb +0 -67
- data/vendor/gems/express_templates/test/components/capabilities/resourceful_test.rb +0 -63
- data/vendor/gems/express_templates/test/components/configurable_test.rb +0 -140
- data/vendor/gems/express_templates/test/components/forms/basic_fields_test.rb +0 -158
- data/vendor/gems/express_templates/test/components/forms/checkbox_test.rb +0 -51
- data/vendor/gems/express_templates/test/components/forms/express_form_test.rb +0 -62
- data/vendor/gems/express_templates/test/components/forms/radio_test.rb +0 -112
- data/vendor/gems/express_templates/test/components/forms/select_test.rb +0 -129
- data/vendor/gems/express_templates/test/components/forms/submit_test.rb +0 -36
- data/vendor/gems/express_templates/test/components/tree_for_test.rb +0 -70
- data/vendor/gems/express_templates/test/core_extensions/proc_test.rb +0 -90
- data/vendor/gems/express_templates/test/core_extensions/string_test.rb +0 -20
- data/vendor/gems/express_templates/test/dummy/Rakefile +0 -6
- data/vendor/gems/express_templates/test/dummy/app/assets/javascripts/application.js +0 -13
- data/vendor/gems/express_templates/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/vendor/gems/express_templates/test/dummy/app/controllers/application_controller.rb +0 -5
- data/vendor/gems/express_templates/test/dummy/app/controllers/hello_controller.rb +0 -5
- data/vendor/gems/express_templates/test/dummy/app/helpers/application_helper.rb +0 -2
- data/vendor/gems/express_templates/test/dummy/app/views/hello/show.html.et +0 -6
- data/vendor/gems/express_templates/test/dummy/app/views/layouts/application.html.et +0 -15
- data/vendor/gems/express_templates/test/dummy/bin/bundle +0 -3
- data/vendor/gems/express_templates/test/dummy/bin/rails +0 -4
- data/vendor/gems/express_templates/test/dummy/bin/rake +0 -4
- data/vendor/gems/express_templates/test/dummy/config/application.rb +0 -26
- data/vendor/gems/express_templates/test/dummy/config/boot.rb +0 -5
- data/vendor/gems/express_templates/test/dummy/config/environment.rb +0 -5
- data/vendor/gems/express_templates/test/dummy/config/environments/development.rb +0 -37
- data/vendor/gems/express_templates/test/dummy/config/environments/production.rb +0 -82
- data/vendor/gems/express_templates/test/dummy/config/environments/test.rb +0 -40
- data/vendor/gems/express_templates/test/dummy/config/initializers/assets.rb +0 -8
- data/vendor/gems/express_templates/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/vendor/gems/express_templates/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/vendor/gems/express_templates/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/vendor/gems/express_templates/test/dummy/config/initializers/inflections.rb +0 -16
- data/vendor/gems/express_templates/test/dummy/config/initializers/mime_types.rb +0 -4
- data/vendor/gems/express_templates/test/dummy/config/initializers/session_store.rb +0 -3
- data/vendor/gems/express_templates/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/vendor/gems/express_templates/test/dummy/config/locales/en.yml +0 -23
- data/vendor/gems/express_templates/test/dummy/config/routes.rb +0 -4
- data/vendor/gems/express_templates/test/dummy/config/secrets.yml +0 -22
- data/vendor/gems/express_templates/test/dummy/config.ru +0 -4
- data/vendor/gems/express_templates/test/dummy/public/404.html +0 -67
- data/vendor/gems/express_templates/test/dummy/public/422.html +0 -67
- data/vendor/gems/express_templates/test/dummy/public/500.html +0 -66
- data/vendor/gems/express_templates/test/dummy/public/favicon.ico +0 -0
- data/vendor/gems/express_templates/test/dummy/test/controllers/hello_controller_test.rb +0 -14
- data/vendor/gems/express_templates/test/dummy/test/helpers/hello_helper_test.rb +0 -4
- data/vendor/gems/express_templates/test/express_templates_test.rb +0 -23
- data/vendor/gems/express_templates/test/handler_test.rb +0 -148
- data/vendor/gems/express_templates/test/indenter_test.rb +0 -27
- data/vendor/gems/express_templates/test/interpolator_test.rb +0 -80
- data/vendor/gems/express_templates/test/performance_test.rb +0 -97
- data/vendor/gems/express_templates/test/test_helper.rb +0 -178
- data/vendor/gems/foundation_apps_styles/Gemfile +0 -4
- data/vendor/gems/foundation_apps_styles/LICENSE.txt +0 -21
- data/vendor/gems/foundation_apps_styles/README.md +0 -41
- data/vendor/gems/foundation_apps_styles/Rakefile +0 -13
- data/vendor/gems/foundation_apps_styles/bin/console +0 -14
- data/vendor/gems/foundation_apps_styles/bin/setup +0 -7
- data/vendor/gems/foundation_apps_styles/foundation_apps_styles.gemspec +0 -24
- data/vendor/gems/foundation_apps_styles/lib/foundation_apps_styles/version.rb +0 -3
- data/vendor/gems/foundation_apps_styles/lib/foundation_apps_styles.rb +0 -6
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/account.svg +0 -44
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/action.svg +0 -38
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/ban.svg +0 -17
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/bell.svg +0 -22
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/bookmark.svg +0 -14
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/cart.svg +0 -35
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/chevron.svg +0 -28
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/circle-check.svg +0 -25
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/circle-x.svg +0 -25
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/cog.svg +0 -17
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/comment-square.svg +0 -14
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/dashboard.svg +0 -38
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/document.svg +0 -28
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/envelope.svg +0 -44
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/flag.svg +0 -24
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/home.svg +0 -28
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/lock.svg +0 -55
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/magnifying-glass.svg +0 -26
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/person.svg +0 -62
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/reload.svg +0 -19
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/share-boxed.svg +0 -17
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/star.svg +0 -14
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/thumb.svg +0 -38
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/zoom.svg +0 -56
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/_global.scss +0 -131
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/_includes.scss +0 -33
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/_settings.scss +0 -614
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_accordion.scss +0 -72
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_action-sheet.scss +0 -265
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_block-list.scss +0 -360
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_button-group.scss +0 -197
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_button.scss +0 -205
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_card.scss +0 -93
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_extras.scss +0 -54
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_forms.scss +0 -460
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_grid.scss +0 -422
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_iconic.scss +0 -95
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_label.scss +0 -134
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_list.scss +0 -19
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_menu-bar.scss +0 -382
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_modal.scss +0 -129
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_motion.scss +0 -525
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_notification.scss +0 -207
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_off-canvas.scss +0 -169
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_panel.scss +0 -134
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_popup.scss +0 -68
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_switch.scss +0 -134
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_tabs.scss +0 -100
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_title-bar.scss +0 -135
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_typography.scss +0 -345
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_utilities.scss +0 -160
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/foundation-apps.css +0 -6146
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/foundation.scss +0 -50
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_breakpoints.scss +0 -154
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_functions.scss +0 -343
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_images.scss +0 -19
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_mixins.scss +0 -123
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/vendor/_normalize.scss +0 -424
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Add new inflection rules using the following format. Inflections
|
|
4
|
-
# are locale specific, and you may define rules for as many different
|
|
5
|
-
# locales as you wish. All of these examples are active by default:
|
|
6
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
7
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
|
8
|
-
# inflect.singular /^(ox)en/i, '\1'
|
|
9
|
-
# inflect.irregular 'person', 'people'
|
|
10
|
-
# inflect.uncountable %w( fish sheep )
|
|
11
|
-
# end
|
|
12
|
-
|
|
13
|
-
# These inflection rules are supported but not enabled by default:
|
|
14
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
15
|
-
# inflect.acronym 'RESTful'
|
|
16
|
-
# end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
|
4
|
-
# is enabled by default.
|
|
5
|
-
|
|
6
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
|
-
ActiveSupport.on_load(:action_controller) do
|
|
8
|
-
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# To enable root element in JSON for ActiveRecord objects.
|
|
12
|
-
# ActiveSupport.on_load(:active_record) do
|
|
13
|
-
# self.include_root_in_json = true
|
|
14
|
-
# end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Files in the config/locales directory are used for internationalization
|
|
2
|
-
# and are automatically loaded by Rails. If you want to use locales other
|
|
3
|
-
# than English, add the necessary files in this directory.
|
|
4
|
-
#
|
|
5
|
-
# To use the locales, use `I18n.t`:
|
|
6
|
-
#
|
|
7
|
-
# I18n.t 'hello'
|
|
8
|
-
#
|
|
9
|
-
# In views, this is aliased to just `t`:
|
|
10
|
-
#
|
|
11
|
-
# <%= t('hello') %>
|
|
12
|
-
#
|
|
13
|
-
# To use a different locale, set it with `I18n.locale`:
|
|
14
|
-
#
|
|
15
|
-
# I18n.locale = :es
|
|
16
|
-
#
|
|
17
|
-
# This would use the information in config/locales/es.yml.
|
|
18
|
-
#
|
|
19
|
-
# To learn more, please read the Rails Internationalization guide
|
|
20
|
-
# available at http://guides.rubyonrails.org/i18n.html.
|
|
21
|
-
|
|
22
|
-
en:
|
|
23
|
-
hello: "Hello world"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Your secret key is used for verifying the integrity of signed cookies.
|
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
-
|
|
6
|
-
# Make sure the secret is at least 30 characters and all random,
|
|
7
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
|
8
|
-
# You can use `rake secret` to generate a secure secret key.
|
|
9
|
-
|
|
10
|
-
# Make sure the secrets in this file are kept private
|
|
11
|
-
# if you're sharing your code publicly.
|
|
12
|
-
|
|
13
|
-
development:
|
|
14
|
-
secret_key_base: 45a9f53938adcc822eebd4fe830eb4d1ececa368826390b363e27c5a15e8ccd316513f9744453159f22d5d7588a63fb0cddfcf959d99ebce3194d7bb305cbe20
|
|
15
|
-
|
|
16
|
-
test:
|
|
17
|
-
secret_key_base: ca083d6e2f16c30410c4190f512478a3f19262f29e102927a137d93b5163e20dd785bdb9e0e55652cae3e1d020f82e16ff896d50b0f6b150bea3878400743612
|
|
18
|
-
|
|
19
|
-
# Do not keep production secrets in the repository,
|
|
20
|
-
# instead read values from the environment.
|
|
21
|
-
production:
|
|
22
|
-
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<style>
|
|
7
|
-
body {
|
|
8
|
-
background-color: #EFEFEF;
|
|
9
|
-
color: #2E2F30;
|
|
10
|
-
text-align: center;
|
|
11
|
-
font-family: arial, sans-serif;
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
div.dialog {
|
|
16
|
-
width: 95%;
|
|
17
|
-
max-width: 33em;
|
|
18
|
-
margin: 4em auto 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
div.dialog > div {
|
|
22
|
-
border: 1px solid #CCC;
|
|
23
|
-
border-right-color: #999;
|
|
24
|
-
border-left-color: #999;
|
|
25
|
-
border-bottom-color: #BBB;
|
|
26
|
-
border-top: #B00100 solid 4px;
|
|
27
|
-
border-top-left-radius: 9px;
|
|
28
|
-
border-top-right-radius: 9px;
|
|
29
|
-
background-color: white;
|
|
30
|
-
padding: 7px 12% 0;
|
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
h1 {
|
|
35
|
-
font-size: 100%;
|
|
36
|
-
color: #730E15;
|
|
37
|
-
line-height: 1.5em;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
div.dialog > p {
|
|
41
|
-
margin: 0 0 1em;
|
|
42
|
-
padding: 1em;
|
|
43
|
-
background-color: #F7F7F7;
|
|
44
|
-
border: 1px solid #CCC;
|
|
45
|
-
border-right-color: #999;
|
|
46
|
-
border-left-color: #999;
|
|
47
|
-
border-bottom-color: #999;
|
|
48
|
-
border-bottom-left-radius: 4px;
|
|
49
|
-
border-bottom-right-radius: 4px;
|
|
50
|
-
border-top-color: #DADADA;
|
|
51
|
-
color: #666;
|
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
55
|
-
</head>
|
|
56
|
-
|
|
57
|
-
<body>
|
|
58
|
-
<!-- This file lives in public/404.html -->
|
|
59
|
-
<div class="dialog">
|
|
60
|
-
<div>
|
|
61
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
|
62
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
|
63
|
-
</div>
|
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
-
</div>
|
|
66
|
-
</body>
|
|
67
|
-
</html>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<style>
|
|
7
|
-
body {
|
|
8
|
-
background-color: #EFEFEF;
|
|
9
|
-
color: #2E2F30;
|
|
10
|
-
text-align: center;
|
|
11
|
-
font-family: arial, sans-serif;
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
div.dialog {
|
|
16
|
-
width: 95%;
|
|
17
|
-
max-width: 33em;
|
|
18
|
-
margin: 4em auto 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
div.dialog > div {
|
|
22
|
-
border: 1px solid #CCC;
|
|
23
|
-
border-right-color: #999;
|
|
24
|
-
border-left-color: #999;
|
|
25
|
-
border-bottom-color: #BBB;
|
|
26
|
-
border-top: #B00100 solid 4px;
|
|
27
|
-
border-top-left-radius: 9px;
|
|
28
|
-
border-top-right-radius: 9px;
|
|
29
|
-
background-color: white;
|
|
30
|
-
padding: 7px 12% 0;
|
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
h1 {
|
|
35
|
-
font-size: 100%;
|
|
36
|
-
color: #730E15;
|
|
37
|
-
line-height: 1.5em;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
div.dialog > p {
|
|
41
|
-
margin: 0 0 1em;
|
|
42
|
-
padding: 1em;
|
|
43
|
-
background-color: #F7F7F7;
|
|
44
|
-
border: 1px solid #CCC;
|
|
45
|
-
border-right-color: #999;
|
|
46
|
-
border-left-color: #999;
|
|
47
|
-
border-bottom-color: #999;
|
|
48
|
-
border-bottom-left-radius: 4px;
|
|
49
|
-
border-bottom-right-radius: 4px;
|
|
50
|
-
border-top-color: #DADADA;
|
|
51
|
-
color: #666;
|
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
55
|
-
</head>
|
|
56
|
-
|
|
57
|
-
<body>
|
|
58
|
-
<!-- This file lives in public/422.html -->
|
|
59
|
-
<div class="dialog">
|
|
60
|
-
<div>
|
|
61
|
-
<h1>The change you wanted was rejected.</h1>
|
|
62
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
63
|
-
</div>
|
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
-
</div>
|
|
66
|
-
</body>
|
|
67
|
-
</html>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<style>
|
|
7
|
-
body {
|
|
8
|
-
background-color: #EFEFEF;
|
|
9
|
-
color: #2E2F30;
|
|
10
|
-
text-align: center;
|
|
11
|
-
font-family: arial, sans-serif;
|
|
12
|
-
margin: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
div.dialog {
|
|
16
|
-
width: 95%;
|
|
17
|
-
max-width: 33em;
|
|
18
|
-
margin: 4em auto 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
div.dialog > div {
|
|
22
|
-
border: 1px solid #CCC;
|
|
23
|
-
border-right-color: #999;
|
|
24
|
-
border-left-color: #999;
|
|
25
|
-
border-bottom-color: #BBB;
|
|
26
|
-
border-top: #B00100 solid 4px;
|
|
27
|
-
border-top-left-radius: 9px;
|
|
28
|
-
border-top-right-radius: 9px;
|
|
29
|
-
background-color: white;
|
|
30
|
-
padding: 7px 12% 0;
|
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
h1 {
|
|
35
|
-
font-size: 100%;
|
|
36
|
-
color: #730E15;
|
|
37
|
-
line-height: 1.5em;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
div.dialog > p {
|
|
41
|
-
margin: 0 0 1em;
|
|
42
|
-
padding: 1em;
|
|
43
|
-
background-color: #F7F7F7;
|
|
44
|
-
border: 1px solid #CCC;
|
|
45
|
-
border-right-color: #999;
|
|
46
|
-
border-left-color: #999;
|
|
47
|
-
border-bottom-color: #999;
|
|
48
|
-
border-bottom-left-radius: 4px;
|
|
49
|
-
border-bottom-right-radius: 4px;
|
|
50
|
-
border-top-color: #DADADA;
|
|
51
|
-
color: #666;
|
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
55
|
-
</head>
|
|
56
|
-
|
|
57
|
-
<body>
|
|
58
|
-
<!-- This file lives in public/500.html -->
|
|
59
|
-
<div class="dialog">
|
|
60
|
-
<div>
|
|
61
|
-
<h1>We're sorry, but something went wrong.</h1>
|
|
62
|
-
</div>
|
|
63
|
-
<p>If you are the application owner check the logs for more information.</p>
|
|
64
|
-
</div>
|
|
65
|
-
</body>
|
|
66
|
-
</html>
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
class HelloControllerTest < ActionController::TestCase
|
|
4
|
-
|
|
5
|
-
test "should get show" do
|
|
6
|
-
get :show
|
|
7
|
-
assert_response :success
|
|
8
|
-
# puts @response.body
|
|
9
|
-
assert_match /<h1>Hi there<\/h1>/, @response.body
|
|
10
|
-
assert_match /link rel="stylesheet" media="all" href="\/assets\/application.css" data-turbolinks-track="true" \/>/, @response.body
|
|
11
|
-
assert_no_match %Q(Dummy ShowDummy Show), @response.body
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
class ExpressTemplatesTest < ActiveSupport::TestCase
|
|
4
|
-
test "we have a module" do
|
|
5
|
-
assert_kind_of Module, ExpressTemplates
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def assigns
|
|
9
|
-
{}
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
test "ExpressTemplates.render renders a template" do
|
|
13
|
-
result = ExpressTemplates.render(self) do
|
|
14
|
-
ul {
|
|
15
|
-
li 'one'
|
|
16
|
-
li 'two'
|
|
17
|
-
li 'three'
|
|
18
|
-
}
|
|
19
|
-
end
|
|
20
|
-
assert_equal "<ul>\n <li>one</li>\n <li>two</li>\n <li>three</li>\n</ul>\n", result
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
end
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
class HandlerTest < ActiveSupport::TestCase
|
|
4
|
-
|
|
5
|
-
DEFAULT_DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">"
|
|
6
|
-
A_LINK = %Q(<a href="#">link</a>)
|
|
7
|
-
|
|
8
|
-
class LookupContext
|
|
9
|
-
def disable_cache
|
|
10
|
-
yield
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def find_template(*args)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
attr_accessor :formats
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
class Context
|
|
20
|
-
include ActionView::Context
|
|
21
|
-
include ActionView::Helpers::TagHelper
|
|
22
|
-
def initialize(*args)
|
|
23
|
-
@output_buffer = "original"
|
|
24
|
-
@virtual_path = nil
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def lookup_context
|
|
28
|
-
@lookup_context ||= LookupContext.new
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def concat(string)
|
|
32
|
-
@output_buffer << string
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def capture(&block)
|
|
36
|
-
block.call
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def assigns
|
|
40
|
-
{}
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def link_helper
|
|
44
|
-
A_LINK.html_safe
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def new_template(body = " h1 'Hello' ", details = { format: :html })
|
|
49
|
-
ActionView::Template.new(body, "hello template", details.fetch(:handler) { ExpressTemplates::Template::Handler.new }, {:virtual_path => "hello"}.merge!(details))
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def render(locals = {})
|
|
53
|
-
output = @template.render(@context, locals)
|
|
54
|
-
output
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def with_doctype(body, alt_doctype = nil)
|
|
58
|
-
"#{alt_doctype||DEFAULT_DOCTYPE}\n#{body}"
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def setup
|
|
62
|
-
controller = Object.new
|
|
63
|
-
class << controller
|
|
64
|
-
def view_context_class ; Context ; end
|
|
65
|
-
end
|
|
66
|
-
@context = Context.new(nil, {}, controller)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
test "our handler is registered" do
|
|
71
|
-
handler = ActionView::Template.registered_template_handler("et")
|
|
72
|
-
assert_equal ExpressTemplates::Template::Handler, handler
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
test "html generates <h1>Hello</h1> by default" do
|
|
76
|
-
@template = new_template
|
|
77
|
-
result = render
|
|
78
|
-
assert_equal "<h1>Hello</h1>\n", result
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
test "nesting elements with ruby block structure" do
|
|
82
|
-
@template = new_template("ul { li 'one' ; li 'two' ; li 'three' }")
|
|
83
|
-
assert_equal "<ul>\n <li>one</li>\n <li>two</li>\n <li>three</li>\n</ul>\n", render
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# TODO?: Does not work with arbre
|
|
87
|
-
# test "class names" do
|
|
88
|
-
# @template = new_template("p.whatever.another 'Lorum Ipsum' ")
|
|
89
|
-
# assert_equal "<p class=\"whatever another\">Lorum Ipsum</p>\n", render
|
|
90
|
-
# end
|
|
91
|
-
|
|
92
|
-
test "string in block works" do
|
|
93
|
-
@template = new_template "h1 { 'foo' } "
|
|
94
|
-
assert_equal "<h1>foo</h1>\n", render
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
# test "real document has doctype and newline" do
|
|
98
|
-
# @template = new_template("html { body { h1 \"hello\" } }")
|
|
99
|
-
# assert_equal with_doctype("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <body>\n <h1>hello</h1>\n </body>\n</html>\n"), render
|
|
100
|
-
# end
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
test "other attributes" do
|
|
104
|
-
@template = new_template("para('Lorum Ipsum', style: 'align: right;')")
|
|
105
|
-
assert_equal "<p style=\"align: right;\">Lorum Ipsum</p>\n", render
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
test "locals work" do
|
|
109
|
-
@template = new_template "h1 { my_title }"
|
|
110
|
-
@template.locals = [:my_title]
|
|
111
|
-
assert_equal "<h1>Foo</h1>\n", render(my_title: 'Foo')
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
test "helpers returning html when alone in a block" do
|
|
115
|
-
@template = new_template("li { link_helper } ")
|
|
116
|
-
assert_equal "<li>#{A_LINK}</li>\n", render
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
test "helpers returning html work in sequence within a block" do
|
|
120
|
-
@template = new_template("li { link_helper ; link_helper } ")
|
|
121
|
-
assert_equal "<li>\n#{A_LINK}#{A_LINK}</li>\n", render
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
test "raises warning if template has conditional logic" do
|
|
125
|
-
temp = "dd(class: 'date') {
|
|
126
|
-
if blog_post.publish_at
|
|
127
|
-
blog_post.publish_at
|
|
128
|
-
else
|
|
129
|
-
link_to('Edit', '#'')
|
|
130
|
-
end
|
|
131
|
-
}"
|
|
132
|
-
keywords = %w(if unless until case for do loop while)
|
|
133
|
-
tokens = []
|
|
134
|
-
|
|
135
|
-
if Ripper.lex(temp).select do |element|
|
|
136
|
-
element[1]==:on_kw
|
|
137
|
-
end.each { |match| tokens.push(match) if keywords.include? match[2] }
|
|
138
|
-
tokens.each do |first|
|
|
139
|
-
out, @err = capture_io do
|
|
140
|
-
warn 'foo'
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
assert_equal @err, "foo\n"
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
class IndenterTest < ActiveSupport::TestCase
|
|
4
|
-
|
|
5
|
-
Indenter = ExpressTemplates::Indenter
|
|
6
|
-
|
|
7
|
-
test ".for(:name) takes a block receiving whitespace" do
|
|
8
|
-
Indenter.for(:foo) do
|
|
9
|
-
assert_equal "\n ", Indenter.for(:foo) { |indent, indent_with_newline| indent_with_newline }
|
|
10
|
-
assert_equal " ", Indenter.for(:foo) { |indent, indent_with_newline| indent }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
test "nesting blocks increases whitespace accordingly" do
|
|
15
|
-
nested_whitespace = Indenter.for(:foo) do |ws1|
|
|
16
|
-
Indenter.for(:foo) do |ws2|
|
|
17
|
-
ws2
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
assert_equal " ", nested_whitespace
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
test ".for(:name) returns current indent without newline when block is not given" do
|
|
24
|
-
assert_equal "", Indenter.for(:foo) { |_| Indenter.for(:foo) }
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
require 'express_templates/interpolator'
|
|
3
|
-
require 'parslet/convenience'
|
|
4
|
-
|
|
5
|
-
class InterpolatorTest < ActiveSupport::TestCase
|
|
6
|
-
|
|
7
|
-
def parse(s)
|
|
8
|
-
parser = ExpressTemplates::Interpolator.new
|
|
9
|
-
parsed = parser.parse_with_debug(s)
|
|
10
|
-
pp parsed if ENV['DEBUG'].eql?('true')
|
|
11
|
-
parsed
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def transform(s)
|
|
15
|
-
trans = ExpressTemplates::Transformer.new
|
|
16
|
-
trans.apply(parse(s)).flatten.join
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
test "simplest expression parses" do
|
|
20
|
-
tree = parse("{{something}}")
|
|
21
|
-
expected = [{:interpolation=>{:expression=>[{:text=>"something"}]}}]
|
|
22
|
-
assert_equal expected, tree
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
test "simple expression with surrounding text parses" do
|
|
26
|
-
tree = parse('whatever {{something}} something else')
|
|
27
|
-
expected = [{:text=>"whatever "},
|
|
28
|
-
{:interpolation=>{:expression=>[{:text=>"something"}]}},
|
|
29
|
-
{:text=>" something else"}]
|
|
30
|
-
assert_equal expected, tree
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
test "nested without outer text parses" do
|
|
34
|
-
tree = parse('{{some {{thing}} foo}}')
|
|
35
|
-
expected = [{:interpolation=>
|
|
36
|
-
{:expression=>
|
|
37
|
-
[{:text=>"some "},
|
|
38
|
-
{:interpolation=>{:expression=>[{:text=>"thing"}]}},
|
|
39
|
-
{:text=>" foo"}]}}]
|
|
40
|
-
assert_equal expected, tree
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
test "nested with outer text parses" do
|
|
44
|
-
tree = parse('a lot of {{something {{good}}}}')
|
|
45
|
-
expected = [{:text=>"a lot of "},
|
|
46
|
-
{:interpolation=>
|
|
47
|
-
{:expression=>
|
|
48
|
-
[{:text=>"something "},
|
|
49
|
-
{:interpolation=>{:expression=>[{:text=>"good"}]}}]}}]
|
|
50
|
-
assert_equal expected, tree
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
test 'nested with multiple nested expressions parses' do
|
|
54
|
-
tree = parse(%q(%Q({{foo("{{xyz}}", "{{zyx}}", bar: "baz")}})))
|
|
55
|
-
expected = [{:text=>"%Q("},
|
|
56
|
-
{:interpolation=>
|
|
57
|
-
{:expression=>
|
|
58
|
-
[{:text=>"foo(\""},
|
|
59
|
-
{:interpolation=>{:expression=>[{:text=>"xyz"}]}},
|
|
60
|
-
{:text=>"\", \""},
|
|
61
|
-
{:interpolation=>{:expression=>[{:text=>"zyx"}]}},
|
|
62
|
-
{:text=>"\", bar: \"baz\")"}]}},
|
|
63
|
-
{:text=>")"}]
|
|
64
|
-
assert_equal expected, tree
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
test '"{{something}}" transforms to "#{something}"' do
|
|
69
|
-
assert_equal '#{something}', transform("{{something}}")
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
test '"{{some {{thing}} foo}}" transforms to "#{some #{thing} foo}"' do
|
|
73
|
-
assert_equal '#{some #{thing} foo}', transform("{{some {{thing}} foo}}")
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
test %('a lot of {{something "{{good}}"}}' transforms) do
|
|
77
|
-
assert_equal 'a lot of #{something "#{good}"}', transform('a lot of {{something "{{good}}"}}')
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
end
|