ckpages 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/ckpages/application.coffee +9 -0
- data/app/assets/javascripts/ckpages/ckeditor_basepath.js +1 -0
- data/app/assets/javascripts/ckpages/ckeditor_init.js.erb +1 -0
- data/app/assets/javascripts/ckpages/ckeditor_replace.js.erb +16 -0
- data/app/assets/javascripts/ckpages/pages.js.coffee +39 -0
- data/app/assets/javascripts/ckpages/plugin_uploads.js.coffee +5 -0
- data/app/assets/stylesheets/ckpages/application.scss +34 -0
- data/app/controllers/ckpages/application_controller.rb +4 -0
- data/app/controllers/ckpages/ascendant404_controller.rb +13 -0
- data/app/controllers/ckpages/ascendant_controller.rb +19 -0
- data/app/controllers/ckpages/pages_controller.rb +66 -0
- data/app/controllers/ckpages/parts_controller.rb +63 -0
- data/app/controllers/ckpages/plugin_uploads_controller.rb +24 -0
- data/app/controllers/ckpages/uploads_controller.rb +41 -0
- data/app/helpers/ckpages/application_helper.rb +27 -0
- data/app/models/ckpages/page.rb +17 -0
- data/app/models/ckpages/part.rb +4 -0
- data/app/models/ckpages/upload.rb +5 -0
- data/app/uploaders/ckpages/application_uploader.rb +51 -0
- data/app/views/application/_ckpart.html.erb +1 -0
- data/app/views/ckpages/pages/_form.html.erb +35 -0
- data/app/views/ckpages/pages/edit.html.erb +5 -0
- data/app/views/ckpages/pages/index.html.erb +52 -0
- data/app/views/ckpages/pages/new.html.erb +5 -0
- data/app/views/ckpages/pages/show.html.erb +96 -0
- data/app/views/ckpages/parts/_form.html.erb +14 -0
- data/app/views/ckpages/parts/edit.html.erb +6 -0
- data/app/views/ckpages/parts/index.html.erb +44 -0
- data/app/views/ckpages/parts/new.html.erb +6 -0
- data/app/views/ckpages/parts/show.html.erb +21 -0
- data/app/views/ckpages/plugin_uploads/index.html.erb +23 -0
- data/app/views/ckpages/public/show.html.erb +19 -0
- data/app/views/ckpages/public404/show.html.erb +19 -0
- data/app/views/ckpages/uploads/index.html.erb +35 -0
- data/app/views/ckpages/uploads/show.html.erb +13 -0
- data/app/views/layouts/ckpages/application.html.erb +24 -0
- data/config/initializers/carrierwave.rb +1 -0
- data/config/initializers/simple_form.rb +166 -0
- data/config/initializers/simple_form_bootstrap.rb +136 -0
- data/config/locales/ru.yml +42 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +29 -0
- data/db/migrate/20150424201308_create_ckpages_pages.rb +15 -0
- data/db/migrate/20150425115824_create_ckpages_uploads.rb +9 -0
- data/db/migrate/20150425152740_add_breadcrumb_to_ckpages_pages.rb +14 -0
- data/db/migrate/20150511111424_create_ckpages_parts.rb +10 -0
- data/db/migrate/20150819230152_add_columns_to_ckpages_uploads.rb +7 -0
- data/lib/ckpages.rb +12 -0
- data/lib/ckpages/engine.rb +8 -0
- data/lib/ckpages/version.rb +3 -0
- data/lib/tasks/ckpages_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/ckpages/public404_controller.rb +3 -0
- data/test/dummy/app/controllers/ckpages/public_controller.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/ckpages/public/show.html.erb +1 -0
- data/test/dummy/app/views/layouts/application.html.erb +35 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/ckpages.rb +1 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/locales/ru.yml +257 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/schema.rb +61 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.js +0 -0
- data/test/dummy/public/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css +16 -0
- data/test/dummy/public/assets/bootstrap/glyphicons-halflings-regular-13634da87d9e23f8c3ed9108ce1724d183a39ad072e73e1b3d8cbf646d2d0407.eot +0 -0
- data/test/dummy/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa42abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg +288 -0
- data/test/dummy/public/assets/bootstrap/glyphicons-halflings-regular-a26394f7ede100ca118eff2eda08596275a9839b959c226e15439557a5a80742.woff +0 -0
- data/test/dummy/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf +0 -0
- data/test/dummy/public/assets/bootstrap/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff2 +0 -0
- data/test/dummy/public/assets/ckpages/application-7743f5f42fc250d6d26375695a35e216ffb9f55bc3b9136f2ab0397aed2e91aa.css +5659 -0
- data/test/dummy/public/assets/ckpages/application-7a1ae892892ee8f88dc20d562ed46adc99be442a63038ba9be56d42c27dea964.js +121 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fixtures/ckpages/pages.yml +21 -0
- data/test/integration/ckpages/public_test.rb +37 -0
- data/test/models/ckpages/page_test.rb +34 -0
- data/test/models/ckpages/upload_test.rb +9 -0
- data/test/test_helper.rb +20 -0
- metadata +334 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
<div class="page-header">
|
2
|
+
<h1>Список загрузок</h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="alert alert-info" role="alert"><%= notice %></div>
|
6
|
+
|
7
|
+
<%= paginate @uploads %>
|
8
|
+
|
9
|
+
<div style="margin-top:20px"></div>
|
10
|
+
|
11
|
+
<div class="row">
|
12
|
+
<div class="col-md-9">
|
13
|
+
<% @uploads.each do |upload| %>
|
14
|
+
<div class="well">
|
15
|
+
<div>
|
16
|
+
<dl class="dl-horizontal">
|
17
|
+
<%= dt_dd(upload, "id") %>
|
18
|
+
<%= dt_dd(upload, "file") %>
|
19
|
+
<%= dt_dd(upload, "created_at", lambda{|val| l(val)}) %>
|
20
|
+
<%= dt_dd(upload, "updated_at", lambda{|val| l(val)}) %>
|
21
|
+
</dl>
|
22
|
+
<div class="text-center">
|
23
|
+
<%= link_to 'Служебный просмотр', upload, class: 'btn btn-primary' %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
<%= paginate @uploads %>
|
29
|
+
</div>
|
30
|
+
<div class="col-md-3">
|
31
|
+
<div class="well">
|
32
|
+
Тут будут фильтры
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="page-header">
|
2
|
+
<h1>Служебный просмотр</h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
|
6
|
+
<div class="alert alert-info" role="alert"><%= notice %></div>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>File:</strong>
|
10
|
+
<%= image_tag @upload.file.url %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<%= link_to 'К списку загрузок', uploads_path, class: 'btn btn-default btn-lg' %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Ckpages</title>
|
5
|
+
<%= stylesheet_link_tag "ckpages/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "ckpages/application" %>
|
7
|
+
<%= javascript_include_tag "/ckeditor/ckeditor.js" %>
|
8
|
+
<%= javascript_tag do %>
|
9
|
+
var ckpages_uploads_path = '<%= ckpages.uploads_path %>';
|
10
|
+
<% end %>
|
11
|
+
<%= csrf_meta_tags %>
|
12
|
+
</head>
|
13
|
+
<body style='margin-bottom: 10px;'>
|
14
|
+
|
15
|
+
<div class="container">
|
16
|
+
<div class="row">
|
17
|
+
<div class="col-lg-12">
|
18
|
+
<%= yield %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/
|
@@ -0,0 +1,166 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input,
|
9
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
43
|
+
b.use :label_input
|
44
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
45
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
46
|
+
|
47
|
+
## full_messages_for
|
48
|
+
# If you want to display the full error message for the attribute, you can
|
49
|
+
# use the component :full_error, like:
|
50
|
+
#
|
51
|
+
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
52
|
+
end
|
53
|
+
|
54
|
+
# The default wrapper to be used by the FormBuilder.
|
55
|
+
config.default_wrapper = :default
|
56
|
+
|
57
|
+
# Define the way to render check boxes / radio buttons with labels.
|
58
|
+
# Defaults to :nested for bootstrap config.
|
59
|
+
# inline: input + label
|
60
|
+
# nested: label > input
|
61
|
+
config.boolean_style = :nested
|
62
|
+
|
63
|
+
# Default class for buttons
|
64
|
+
config.button_class = 'btn'
|
65
|
+
|
66
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
67
|
+
# :first lists the first message for each field.
|
68
|
+
# Use :to_sentence to list all errors for each field.
|
69
|
+
# config.error_method = :first
|
70
|
+
|
71
|
+
# Default tag used for error notification helper.
|
72
|
+
config.error_notification_tag = :div
|
73
|
+
|
74
|
+
# CSS class to add for error notification helper.
|
75
|
+
config.error_notification_class = 'error_notification'
|
76
|
+
|
77
|
+
# ID to add for error notification helper.
|
78
|
+
# config.error_notification_id = nil
|
79
|
+
|
80
|
+
# Series of attempts to detect a default label method for collection.
|
81
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
82
|
+
|
83
|
+
# Series of attempts to detect a default value method for collection.
|
84
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
85
|
+
|
86
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
87
|
+
# config.collection_wrapper_tag = nil
|
88
|
+
|
89
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
90
|
+
# config.collection_wrapper_class = nil
|
91
|
+
|
92
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
93
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
94
|
+
# SimpleForm will force this option to be a label.
|
95
|
+
# config.item_wrapper_tag = :span
|
96
|
+
|
97
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
98
|
+
# config.item_wrapper_class = nil
|
99
|
+
|
100
|
+
# How the label text should be generated altogether with the required text.
|
101
|
+
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
102
|
+
|
103
|
+
# You can define the class to use on all labels. Default is nil.
|
104
|
+
# config.label_class = nil
|
105
|
+
|
106
|
+
# You can define the default class to be used on forms. Can be overriden
|
107
|
+
# with `html: { :class }`. Defaulting to none.
|
108
|
+
# config.default_form_class = nil
|
109
|
+
|
110
|
+
# You can define which elements should obtain additional classes
|
111
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
112
|
+
|
113
|
+
# Whether attributes are required by default (or not). Default is true.
|
114
|
+
# config.required_by_default = true
|
115
|
+
|
116
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
117
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
118
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
119
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
120
|
+
# change this configuration to true.
|
121
|
+
config.browser_validations = false
|
122
|
+
|
123
|
+
# Collection of methods to detect if a file type was given.
|
124
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
125
|
+
|
126
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
127
|
+
# to match as key, and the input type that will be used when the field name
|
128
|
+
# matches the regexp as value.
|
129
|
+
# config.input_mappings = { /count/ => :integer }
|
130
|
+
|
131
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
132
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
133
|
+
# config.wrapper_mappings = { string: :prepend }
|
134
|
+
|
135
|
+
# Namespaces where SimpleForm should look for custom input classes that
|
136
|
+
# override default inputs.
|
137
|
+
# config.custom_inputs_namespaces << "CustomInputs"
|
138
|
+
|
139
|
+
# Default priority for time_zone inputs.
|
140
|
+
# config.time_zone_priority = nil
|
141
|
+
|
142
|
+
# Default priority for country inputs.
|
143
|
+
# config.country_priority = nil
|
144
|
+
|
145
|
+
# When false, do not use translations for labels.
|
146
|
+
# config.translate_labels = true
|
147
|
+
|
148
|
+
# Automatically discover new inputs in Rails' autoload path.
|
149
|
+
# config.inputs_discovery = true
|
150
|
+
|
151
|
+
# Cache SimpleForm inputs discovery
|
152
|
+
# config.cache_discovery = !Rails.env.development?
|
153
|
+
|
154
|
+
# Default class for inputs
|
155
|
+
# config.input_class = nil
|
156
|
+
|
157
|
+
# Define the default class of the input wrapper of the boolean input.
|
158
|
+
config.boolean_label_class = 'checkbox'
|
159
|
+
|
160
|
+
# Defines if the default input wrapper class should be included in radio
|
161
|
+
# collection wrappers.
|
162
|
+
# config.include_default_input_wrapper_class = true
|
163
|
+
|
164
|
+
# Defines which i18n scope will be used in Simple Form.
|
165
|
+
# config.i18n_scope = 'simple_form'
|
166
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
config.error_notification_class = 'alert alert-danger'
|
4
|
+
config.button_class = 'btn btn-default'
|
5
|
+
config.boolean_label_class = nil
|
6
|
+
|
7
|
+
config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
8
|
+
b.use :html5
|
9
|
+
b.use :placeholder
|
10
|
+
b.optional :maxlength
|
11
|
+
b.optional :pattern
|
12
|
+
b.optional :min_max
|
13
|
+
b.optional :readonly
|
14
|
+
b.use :label, class: 'control-label'
|
15
|
+
|
16
|
+
b.use :input, class: 'form-control'
|
17
|
+
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
18
|
+
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
19
|
+
end
|
20
|
+
|
21
|
+
config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
22
|
+
b.use :html5
|
23
|
+
b.use :placeholder
|
24
|
+
b.optional :maxlength
|
25
|
+
b.optional :readonly
|
26
|
+
b.use :label, class: 'control-label'
|
27
|
+
|
28
|
+
b.use :input
|
29
|
+
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
30
|
+
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
31
|
+
end
|
32
|
+
|
33
|
+
config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
34
|
+
b.use :html5
|
35
|
+
b.optional :readonly
|
36
|
+
|
37
|
+
b.wrapper tag: 'div', class: 'checkbox' do |ba|
|
38
|
+
ba.use :label_input
|
39
|
+
end
|
40
|
+
|
41
|
+
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
42
|
+
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
43
|
+
end
|
44
|
+
|
45
|
+
config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
46
|
+
b.use :html5
|
47
|
+
b.optional :readonly
|
48
|
+
b.use :label, class: 'control-label'
|
49
|
+
b.use :input
|
50
|
+
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
51
|
+
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
52
|
+
end
|
53
|
+
|
54
|
+
config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
55
|
+
b.use :html5
|
56
|
+
b.use :placeholder
|
57
|
+
b.optional :maxlength
|
58
|
+
b.optional :pattern
|
59
|
+
b.optional :min_max
|
60
|
+
b.optional :readonly
|
61
|
+
b.use :label, class: 'col-sm-3 control-label'
|
62
|
+
|
63
|
+
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
|
64
|
+
ba.use :input, class: 'form-control'
|
65
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
66
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
71
|
+
b.use :html5
|
72
|
+
b.use :placeholder
|
73
|
+
b.optional :maxlength
|
74
|
+
b.optional :readonly
|
75
|
+
b.use :label, class: 'col-sm-3 control-label'
|
76
|
+
|
77
|
+
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
|
78
|
+
ba.use :input
|
79
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
80
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
85
|
+
b.use :html5
|
86
|
+
b.optional :readonly
|
87
|
+
|
88
|
+
b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
|
89
|
+
wr.wrapper tag: 'div', class: 'checkbox' do |ba|
|
90
|
+
ba.use :label_input, class: 'col-sm-9'
|
91
|
+
end
|
92
|
+
|
93
|
+
wr.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
94
|
+
wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
99
|
+
b.use :html5
|
100
|
+
b.optional :readonly
|
101
|
+
|
102
|
+
b.use :label, class: 'col-sm-3 control-label'
|
103
|
+
|
104
|
+
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
|
105
|
+
ba.use :input
|
106
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
107
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
112
|
+
b.use :html5
|
113
|
+
b.use :placeholder
|
114
|
+
b.optional :maxlength
|
115
|
+
b.optional :pattern
|
116
|
+
b.optional :min_max
|
117
|
+
b.optional :readonly
|
118
|
+
b.use :label, class: 'sr-only'
|
119
|
+
|
120
|
+
b.use :input, class: 'form-control'
|
121
|
+
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
122
|
+
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
123
|
+
end
|
124
|
+
|
125
|
+
# Wrappers for forms and inputs using the Bootstrap toolkit.
|
126
|
+
# Check the Bootstrap docs (http://getbootstrap.com)
|
127
|
+
# to learn about the different styles for forms and inputs,
|
128
|
+
# buttons and other elements.
|
129
|
+
config.default_wrapper = :vertical_form
|
130
|
+
config.wrapper_mappings = {
|
131
|
+
check_boxes: :vertical_radio_and_checkboxes,
|
132
|
+
radio_buttons: :vertical_radio_and_checkboxes,
|
133
|
+
file: :vertical_file_input,
|
134
|
+
boolean: :vertical_boolean,
|
135
|
+
}
|
136
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
ru:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
ckpages/page: Страница
|
5
|
+
attributes:
|
6
|
+
ckpages/page:
|
7
|
+
description: Описание SEO
|
8
|
+
keywords: Ключевые слова SEO
|
9
|
+
robots: Запрет индексации и следования
|
10
|
+
title: Заголовок
|
11
|
+
path: Путь
|
12
|
+
redirect_url: Переадресация
|
13
|
+
content: Содержание
|
14
|
+
title1: Заголовок №1
|
15
|
+
url1: Адрес №1
|
16
|
+
title2: Заголовок №2
|
17
|
+
url2: Адрес №2
|
18
|
+
title3: Заголовок №3
|
19
|
+
url3: Адрес №3
|
20
|
+
title4: Заголовок №4
|
21
|
+
url4: Адрес №4
|
22
|
+
title5: Заголовок №5
|
23
|
+
url5: Адрес №5
|
24
|
+
simple_form:
|
25
|
+
hints:
|
26
|
+
page:
|
27
|
+
title: Не допустимо использовать теги, крайне рекомендуется не использовать прописные ("заглавные) буквы, за исключением слов - акронимов (аббревиатур") типа ГУМ, СССР и т.д.<title>...</title>
|
28
|
+
description: 2-3 предложения максимально описывающих содержимое страницы. <meta name="Description" content="..."/>
|
29
|
+
keywords: Список ключевых слов через запятую, используемые в тексте страницы. <meta name="Keywords" content="..." />
|
30
|
+
robots: Можете запретить страницу от индексации используя noindex или запретить следовать по ссылкам, расположенным на этой странице используя nofollow <meta name="robots" content="index, follow">
|
31
|
+
path: Допускаются буквы английского и русского языков, а так же "-", "/" и "?"
|
32
|
+
redirect_url: Адрес на который будет произведена переадресация должен начинаться с "/", "http://" или "https://" и не должен совпадать с адресом страницы, с которой производится переадресация.
|
33
|
+
title1: Заголовок хлебной крошки 1
|
34
|
+
url1: Адрес хлебной крошки 1
|
35
|
+
title2: Заголовок хлебной крошки 2
|
36
|
+
url2: Адрес хлебной крошки 2
|
37
|
+
title3: Заголовок хлебной крошки 3
|
38
|
+
url3: Адрес хлебной крошки 3
|
39
|
+
title4: Заголовок хлебной крошки 4
|
40
|
+
url4: Адрес хлебной крошки 4
|
41
|
+
title5: Заголовок хлебной крошки 5
|
42
|
+
url5: Адрес хлебной крошки 5
|
@@ -0,0 +1,31 @@
|
|
1
|
+
en:
|
2
|
+
simple_form:
|
3
|
+
"yes": 'Yes'
|
4
|
+
"no": 'No'
|
5
|
+
required:
|
6
|
+
text: 'required'
|
7
|
+
mark: '*'
|
8
|
+
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
|
+
# When using html, text and mark won't be used.
|
10
|
+
# html: '<abbr title="required">*</abbr>'
|
11
|
+
error_notification:
|
12
|
+
default_message: "Please review the problems below:"
|
13
|
+
# Examples
|
14
|
+
# labels:
|
15
|
+
# defaults:
|
16
|
+
# password: 'Password'
|
17
|
+
# user:
|
18
|
+
# new:
|
19
|
+
# email: 'E-mail to sign in.'
|
20
|
+
# edit:
|
21
|
+
# email: 'E-mail.'
|
22
|
+
# hints:
|
23
|
+
# defaults:
|
24
|
+
# username: 'User name to sign in.'
|
25
|
+
# password: 'No special characters, please.'
|
26
|
+
# include_blanks:
|
27
|
+
# defaults:
|
28
|
+
# age: 'Rather not say'
|
29
|
+
# prompts:
|
30
|
+
# defaults:
|
31
|
+
# age: 'Select your age'
|