redde 0.0.8 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.travis.yml +10 -0
- data/Gemfile +3 -3
- data/LICIENSE.md +21 -0
- data/README.md +53 -14
- data/lib/generators/redde/layout/layout_generator.rb +7 -4
- data/lib/generators/redde/layout/templates/assets/images/admin/error-label-triangle.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/favicon.png +0 -0
- data/lib/generators/redde/layout/templates/assets/javascripts/admin.js +9 -76
- data/lib/generators/redde/layout/templates/assets/redactor/images/.keep +0 -0
- data/lib/generators/redde/layout/templates/assets/redactor/images/redactor/icons.png +0 -0
- data/lib/generators/redde/layout/templates/assets/redactor/javascripts/jquery-migrate-1.2.1.js +521 -0
- data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/redactor.js.erb +9 -21
- data/lib/generators/redde/layout/templates/assets/{images/admin/redactor/css/redactor.css → redactor/stylesheets/redactor/redactor.css.scss} +1 -1
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/error-msg.sass +47 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/paginate.sass +28 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/pagination.scss +28 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/phead-tabs.sass +27 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/default.scss +0 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/input.sass +35 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/header.sass +50 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/launchbar.sass +23 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/main.sass +39 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/page-header.sass +19 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/page-sidebar.sass +22 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/sidebar.sass +30 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/reset.sass +33 -0
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin.scss +9 -9
- data/lib/generators/redde/layout/templates/base/_header.html.haml +12 -0
- data/lib/generators/redde/layout/templates/base/_launchbar.html.haml +11 -0
- data/lib/generators/redde/layout/templates/base/_sidebar.html.haml +15 -0
- data/lib/generators/redde/layout/templates/base/_validate.haml +8 -0
- data/lib/generators/redde/layout/templates/base/welcome.haml +2 -0
- data/lib/generators/redde/layout/templates/controllers/base_controller.rb +5 -0
- data/lib/generators/redde/layout/templates/layouts/admin.html.haml +14 -15
- data/lib/generators/redde/scaffold/scaffold_generator.rb +8 -0
- data/lib/generators/redde/scaffold/templates/edit.html.haml +2 -6
- data/lib/generators/redde/scaffold/templates/index.html.haml +1 -1
- data/lib/redde/version.rb +1 -1
- data/lib/redde.rb +3 -0
- data/redde.gemspec +11 -10
- data/spec/dummy/.rspec +1 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +14 -0
- data/spec/dummy/app/assets/stylesheets/application.css.scss +0 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/articles_controller.rb +12 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/article.rb +3 -0
- data/spec/dummy/app/models/article_category.rb +2 -0
- data/spec/dummy/app/views/articles/show.html.haml +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +33 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +36 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20130908123351_create_articles.rb +9 -0
- data/spec/dummy/db/migrate/20140128152208_create_article_categories.rb +11 -0
- data/spec/dummy/db/schema.rb +29 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/log/development.log +26606 -0
- data/spec/dummy/log/test.log +53411 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/{deploy_generator_spec.rb → generators/deploy_generator_spec.rb} +1 -1
- data/spec/{layout_generator_spec.rb → generators/layout_generator_spec.rb} +5 -5
- data/spec/generators/scaffold_generator_spec.rb +59 -0
- data/spec/spec_helper.rb +53 -4
- metadata +187 -155
- data/LICENSE +0 -22
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/docstyle.css +0 -123
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/style.css +0 -119
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/img/icons.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/by.js +0 -72
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/de.js +0 -75
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/es.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/fr.js +0 -74
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/hu.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/it.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ja.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/lv.js +0 -74
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/nl.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pl.js +0 -75
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pt_br.js +0 -81
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/sq.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/tr.js +0 -76
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ua.js +0 -75
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/zh_cn.js +0 -77
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/redactor.min.js +0 -1
- data/lib/generators/redde/layout/templates/assets/images/admin/redactor/toolbars/mini.js +0 -103
- data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/_jquery.reddebox.js.erb +0 -214
- data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/close.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.js.erb +0 -246
- data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.scss +0 -31
- data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/next.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/prev.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/change-log.txt +0 -19
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/check-exists.php +0 -15
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/index.php +0 -50
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.js +0 -888
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.min.js +0 -6
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/license-standard.txt +0 -71
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-cancel.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-image-only.php +0 -66
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.css +0 -100
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.php +0 -33
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/#swfobject.js +0 -4
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/cancel.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/jquery.uploadify.min.js +0 -315
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify-cancel.png +0 -0
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.css +0 -66
- data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.swf +0 -0
- data/lib/generators/redde/layout/templates/assets/javascripts/admin/swfobject.js +0 -4
- data/lib/generators/redde/layout/templates/assets/javascripts/admin/zen_textarea.min.js +0 -17
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/_reset.scss +0 -32
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/_input.scss +0 -43
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_header.scss +0 -57
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_launchbar.scss +0 -35
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_main.scss +0 -59
- data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_sidebar.scss +0 -35
- data/lib/generators/redde/layout/templates/shared/_header.html.haml +0 -13
- data/lib/generators/redde/layout/templates/shared/_launchbar.html.haml +0 -9
- data/lib/generators/redde/layout/templates/shared/_sidebar.html.haml +0 -9
- data/spec/scaffold_generator_spec.rb +0 -25
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/file.html +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/image.html +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/image_edit.html +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/link.html +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/table.html +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/video.html +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/langs/en.js +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/langs/ru.js +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/toolbars/default.js +0 -0
- /data/lib/generators/redde/layout/templates/assets/{images/admin/redactor/css → redactor/stylesheets/redactor}/wym.css +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_list.scss → list.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_notice.scss → notice.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_orders.scss → orders.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_partners.scss → partners.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_photos.scss → photos.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_sortable.scss → sortable.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/{_table.scss → table.scss} +0 -0
- /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/{_login.scss → login.scss} +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cc3d7f424511a702d9e9bf16a094083f3ebefd8e
|
4
|
+
data.tar.gz: ecc04dd48b7cb5f90b05019174078e9deb83ff1a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bdb1a73599c050b7321d6100e631a7b9419c02de0dbeab87e2013449359e2c4b720c764e6828155e5f9d94eba9ae7bd4b502f28ac5f3fa93482e482d51649206
|
7
|
+
data.tar.gz: ae25347849265d4e437814c42b88a0997cf253bbaa685424fb914064d5e6cdfb3c646e9d28d0dfb5e6a5ee7038f48c8aacbcbad4892a568c5d011b133dbfaa5e
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/LICIENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) [2013] [redde]
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# Redde
|
2
|
+
[![Build Status](https://secure.travis-ci.org/redde/redde.png)](http://travis-ci.org/redde/redde)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/redde/redde.png)](https://codeclimate.com/github/redde/redde)
|
2
4
|
|
3
|
-
|
5
|
+
Admin generator for redde projects
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
8
10
|
|
9
|
-
gem 'redde'
|
11
|
+
gem 'redde'
|
10
12
|
|
11
13
|
And then execute:
|
12
14
|
|
@@ -34,24 +36,61 @@ To set admin login layout you need to modify application controller:
|
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
37
|
-
To generate admin views and controller for model
|
39
|
+
To generate admin views and controller for a model, enter:
|
38
40
|
|
39
41
|
rails g redde:scaffold ModelNames
|
40
42
|
|
41
|
-
Add
|
43
|
+
Add `admin.scss` and `admin.js` to assets precompilation in config/production.rb:
|
42
44
|
|
43
45
|
config.assets.precompile += %w( admin.js admin.css )
|
46
|
+
|
47
|
+
## Gemset dependenсies
|
48
|
+
|
49
|
+
Somehow, some dependencies are not initialized inside rails apps. If you get error about missing gems, add these gems to your Gemfile:
|
50
|
+
|
51
|
+
gem 'autoprefixer-rails'
|
52
|
+
gem 'jquery-ui-rails'
|
53
|
+
gem 'haml-rails'
|
54
|
+
gem 'russian'
|
55
|
+
gem 'devise'
|
56
|
+
|
57
|
+
Its highly possible, that you will not have any problems with gems
|
58
|
+
|
59
|
+
## Autoprefixer note for development mode
|
60
|
+
|
61
|
+
Its neccessary to have joined asset files, change assets debug to false in `config/environments/development.rb`:
|
62
|
+
|
63
|
+
config.assets.debug = false
|
64
|
+
|
65
|
+
## Localization's example
|
66
|
+
|
67
|
+
ru:
|
68
|
+
activerecord:
|
69
|
+
models:
|
70
|
+
product:
|
71
|
+
one: Продукт
|
72
|
+
acc: продукт (винительный падеж)
|
73
|
+
other: Продукты
|
74
|
+
attributes:
|
75
|
+
product:
|
76
|
+
name: Название
|
77
|
+
descr: Описание
|
78
|
+
|
79
|
+
## WYSIWYG editor note
|
80
|
+
|
81
|
+
To use styles for the WYSIWYG editor, add its styles to precompile in `config/production.rb`:
|
82
|
+
|
83
|
+
config.assets.precompile += %w( redactor/wym.css )
|
44
84
|
|
45
|
-
##
|
46
|
-
|
85
|
+
## Sortable
|
86
|
+
|
87
|
+
If you have field `position` of integer type in your model, generator will add special column as a hook for sort.
|
88
|
+
You should add POST `sort` action to you routes:
|
47
89
|
|
48
|
-
|
49
|
-
|
90
|
+
resources :article_categories do
|
91
|
+
post 'sort', on: :collection
|
92
|
+
end
|
50
93
|
|
51
|
-
##
|
94
|
+
## Visible
|
52
95
|
|
53
|
-
|
54
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
55
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
56
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
57
|
-
5. Create new Pull Request
|
96
|
+
If you have field `visible` of boolean type in your model, generator will add small eye column for toggling visiblity
|
@@ -15,10 +15,8 @@ module Redde
|
|
15
15
|
template "layouts/#{layout}#{ext}", "app/views/layouts/#{layout}#{ext}"
|
16
16
|
end
|
17
17
|
|
18
|
-
# copy
|
19
|
-
|
20
|
-
template "shared/_#{shared}#{ext}", "app/views/admin/shared/_#{shared}#{ext}"
|
21
|
-
end
|
18
|
+
# copy base
|
19
|
+
directory "base", "app/views/admin/base"
|
22
20
|
|
23
21
|
# copy js
|
24
22
|
%w{ admin.js }.each do |js|
|
@@ -32,6 +30,11 @@ module Redde
|
|
32
30
|
end
|
33
31
|
directory "assets/stylesheets/admin", "app/assets/stylesheets/admin"
|
34
32
|
|
33
|
+
# copy redactor
|
34
|
+
|
35
|
+
directory "assets/redactor", "app/assets"
|
36
|
+
|
37
|
+
|
35
38
|
# copy helpers
|
36
39
|
template "helpers/admin_helper.rb", "app/helpers/admin_helper.rb"
|
37
40
|
|
Binary file
|
@@ -1,88 +1,21 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
-
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
-
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
-
// the compiled file.
|
6
|
-
//
|
7
1
|
//= require jquery
|
8
2
|
//= require jquery_ujs
|
9
|
-
//= require jquery.ui.all
|
10
|
-
//= require admin/swfobject
|
11
|
-
//= require admin/uploadify/jquery.uploadify.min
|
12
|
-
//= require admin/uploadifive/jquery.uploadifive
|
13
3
|
//= require admin/lightbox/js/jquery.lightbox-0.5
|
14
|
-
//= require admin/jquery.ui.nestedSortable
|
15
|
-
//= require admin/zen_textarea.min
|
16
|
-
//= require admin/redactor/redactor
|
17
|
-
//= require admin/redactor/langs/ru
|
18
|
-
//= require admin/redactor/toolbars/default
|
19
4
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
};
|
5
|
+
//= require jquery-migrate-1.2.1
|
6
|
+
//= require redactor/redactor
|
7
|
+
//= require redactor/langs/ru
|
8
|
+
//= require redactor/toolbars/default
|
25
9
|
|
26
|
-
|
27
|
-
|
28
|
-
function remove_fields(link) {
|
29
|
-
$(link).prev("input[type=hidden]").val("1");
|
30
|
-
$(link).closest("div").hide();
|
31
|
-
}
|
32
|
-
|
33
|
-
function remove_fields_gal(link) {
|
34
|
-
$(link).prev("input[type=hidden]").val("1");
|
35
|
-
hideElem($(link).closest("tr"));
|
36
|
-
function hideElem(el) {
|
37
|
-
el.hide();
|
38
|
-
el.hasClass("bot") ? el.hide() : hideElem(el.next("tr"));
|
39
|
-
};
|
40
|
-
}
|
41
|
-
|
42
|
-
function add_fields(link, association, content) {
|
43
|
-
var new_id = new Date().getTime();
|
44
|
-
var regexp = new RegExp("new_" + association, "g")
|
45
|
-
var innerPrint = $(link).before(content.replace(regexp, new_id));
|
46
|
-
}
|
47
|
-
|
48
|
-
function add_fields_gal(link, association, content) {
|
49
|
-
var new_id = new Date().getTime();
|
50
|
-
var regexp = new RegExp("new_" + association, "g")
|
51
|
-
var innerPrint = $(link).closest("tfoot").prev("tbody").append(content.replace(regexp, new_id));
|
52
|
-
}
|
10
|
+
//= require jquery.ui.sortable
|
11
|
+
//=# require admin/jquery.ui.nestedSortable
|
53
12
|
|
54
|
-
|
55
|
-
el.checked ? $(el).closest("tr").addClass("selected") : $(el).closest("tr").removeClass("selected");
|
56
|
-
}
|
57
|
-
|
58
|
-
function selectLang(el) {
|
59
|
-
var show_lang = el.removeClass("selected").attr("class");
|
60
|
-
$("tr, tbody").filter("."+show_lang).show();
|
61
|
-
var hide_lang = el.siblings("a").removeClass("selected").attr("class");
|
62
|
-
$("tr, tbody").filter("."+hide_lang).hide();
|
63
|
-
el.addClass("selected");
|
64
|
-
}
|
13
|
+
var lightBox;
|
65
14
|
|
66
15
|
$(function(){
|
67
|
-
|
68
|
-
$("#onchange-submit").find("select, input").change(function(){
|
69
|
-
$(this).closest("form").submit();
|
70
|
-
});
|
71
|
-
|
16
|
+
|
72
17
|
lightBox = $("ul.photos:not(.no-lb) a:not(.del)").lightBox();
|
73
18
|
|
74
|
-
|
75
|
-
path: '/assets/redactor',
|
76
|
-
load: false
|
77
|
-
});
|
78
|
-
|
79
|
-
setTimeout(function(){
|
80
|
-
selectLang($("tr.lang").find("a.selected"));
|
81
|
-
}, 500);
|
82
|
-
;
|
83
|
-
$('a.ru_lang, a.en_lang').click(function(e) {
|
84
|
-
selectLang($(this));
|
85
|
-
e.preventDefault();
|
86
|
-
});
|
19
|
+
$('textarea:not(.nowred)').redactor();
|
87
20
|
|
88
21
|
});
|
File without changes
|