ab_admin 0.8.3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +11 -5
- data/app/assets/javascripts/ab_admin/components/admin_assets.js.coffee +0 -25
- data/app/assets/javascripts/ab_admin/components/google_translate.js.coffee +3 -5
- data/app/assets/javascripts/ab_admin/components/in_place_edit.js.coffee +33 -25
- data/app/assets/javascripts/ab_admin/core/batch_actions.js.coffee +1 -1
- data/app/assets/javascripts/ab_admin/core/columns_hider.js.coffee +24 -23
- data/app/assets/javascripts/ab_admin/core/init.js.coffee +7 -2
- data/app/assets/javascripts/ab_admin/core/search_form.js.coffee +1 -7
- data/app/assets/javascripts/ab_admin/core/ui_utils.js.coffee +23 -7
- data/app/assets/javascripts/ab_admin/core/utils.js.coffee +16 -2
- data/app/assets/javascripts/ab_admin/inputs/datetime_input.js.coffee +1 -0
- data/app/assets/javascripts/ab_admin/main.js +3 -4
- data/app/assets/stylesheets/ab_admin/bootstrap_and_overrides.scss +71 -25
- data/app/assets/stylesheets/ab_admin/components/_base.scss +21 -1
- data/app/assets/stylesheets/ab_admin/components/_colored_tabs.scss +1 -1
- data/app/assets/stylesheets/ab_admin/components/_form.scss +16 -18
- data/app/assets/stylesheets/ab_admin/components/_grid_view.scss +2 -2
- data/app/assets/stylesheets/ab_admin/components/_locale_tabs.scss +11 -23
- data/app/assets/stylesheets/ab_admin/components/_navigation.scss +7 -11
- data/app/assets/stylesheets/ab_admin/components/_table_view.scss +85 -11
- data/app/assets/stylesheets/ab_admin/components/_tooltip.scss +81 -0
- data/app/assets/stylesheets/ab_admin/components/_tree_view.scss +1 -1
- data/app/assets/stylesheets/ab_admin/devise.scss +2 -2
- data/app/assets/stylesheets/ab_admin/fileupload.scss +2 -9
- data/app/assets/stylesheets/ab_admin/main.scss +1 -2
- data/app/controllers/admin/assets_controller.rb +1 -1
- data/app/controllers/admin/base_controller.rb +133 -149
- data/app/controllers/admin/dashboards_controller.rb +2 -2
- data/app/controllers/admin/locators_controller.rb +8 -6
- data/app/controllers/admin/manager_controller.rb +19 -49
- data/app/controllers/admin/static_pages_controller.rb +0 -4
- data/app/controllers/admin/structures_controller.rb +2 -2
- data/app/views/ab_admin/devise/sessions/new.html.slim +2 -0
- data/app/views/admin/assets/batch_edit.html.slim +3 -2
- data/app/views/admin/base/_search_layout.html.slim +7 -6
- data/app/views/admin/base/create.js.erb +6 -3
- data/app/views/admin/base/edit.js.erb +1 -1
- data/app/views/admin/base/index.html.slim +4 -4
- data/app/views/admin/base/new.js.erb +1 -1
- data/app/views/admin/base/update.js.erb +7 -2
- data/app/views/admin/fileupload/_asset_templates.html.slim +1 -2
- data/app/views/admin/fileupload/_image.html.slim +1 -2
- data/app/views/admin/locators/edit.html.slim +7 -6
- data/app/views/admin/manager/_map.html.slim +4 -0
- data/app/views/admin/manager/_show_table.html.slim +1 -1
- data/app/views/admin/manager/_stats.html.slim +4 -0
- data/app/views/admin/manager/_table.html.slim +7 -4
- data/app/views/admin/shared/_content_actions.html.slim +35 -30
- data/app/views/admin/shared/_flash.html.slim +5 -4
- data/app/views/admin/shared/_locale_tabs.html.slim +2 -2
- data/app/views/admin/shared/_main_menu.html.slim +1 -1
- data/app/views/admin/shared/_save_buttons.html.slim +10 -1
- data/app/views/admin/structures/_form.html.slim +1 -1
- data/app/views/admin/users/_form.html.slim +3 -3
- data/app/views/admin/users/_search_form.html.slim +1 -1
- data/app/views/layouts/admin/_footer.html.slim +0 -1
- data/app/views/layouts/admin/_navigation.html.slim +1 -1
- data/app/views/layouts/admin/application.html.slim +2 -2
- data/config/locales/de.yml +1 -2
- data/config/locales/en.yml +9 -15
- data/config/locales/it.yml +1 -0
- data/config/locales/ru.yml +0 -1
- data/config/locales/uk.yml +0 -1
- data/db/migrate/20130101000001_create_users.rb +1 -4
- data/db/migrate/20130101000003_create_assets.rb +1 -1
- data/db/migrate/20130101000004_create_headers.rb +5 -5
- data/db/migrate/20130101000005_create_static_pages.rb +2 -5
- data/db/migrate/20130101000006_create_structures.rb +1 -1
- data/db/migrate/20130101000007_base_translations.rb +43 -12
- data/db/migrate/20130101000008_create_admin_comments.rb +2 -7
- data/db/migrate/20130101000009_create_tracks.rb +4 -8
- data/lib/ab_admin/abstract_resource.rb +6 -5
- data/lib/ab_admin/carrierwave/base_uploader.rb +87 -75
- data/lib/ab_admin/carrierwave/glue.rb +0 -5
- data/lib/ab_admin/concerns/admin_addition.rb +15 -27
- data/lib/ab_admin/concerns/translations_macro.rb +97 -0
- data/lib/ab_admin/concerns/utilities.rb +2 -2
- data/lib/ab_admin/config/base.rb +27 -4
- data/lib/ab_admin/controllers/callbacks.rb +3 -26
- data/lib/ab_admin/core_ext/array.rb +1 -50
- data/lib/ab_admin/core_ext/hash.rb +2 -31
- data/lib/ab_admin/core_ext/other.rb +0 -6
- data/lib/ab_admin/core_ext/string.rb +1 -86
- data/lib/ab_admin/devise.rb +7 -0
- data/lib/ab_admin/engine.rb +2 -1
- data/lib/ab_admin/hooks/ckeditor_lazy.rb +13 -0
- data/lib/ab_admin/hooks/will_paginate_id_prefetch.rb +8 -6
- data/lib/ab_admin/hooks/will_paginate_no_uri.rb +1 -1
- data/lib/ab_admin/i18n_tools/google_translate.rb +3 -1
- data/lib/ab_admin/i18n_tools/model_translator.rb +1 -1
- data/lib/ab_admin/menu/base_group.rb +0 -1
- data/lib/ab_admin/menu/group.rb +2 -4
- data/lib/ab_admin/menu/item.rb +4 -8
- data/lib/ab_admin/models/asset.rb +7 -10
- data/lib/ab_admin/models/header.rb +2 -2
- data/lib/ab_admin/models/locator.rb +29 -3
- data/lib/ab_admin/models/settings.rb +2 -2
- data/lib/ab_admin/models/structure.rb +3 -3
- data/lib/ab_admin/models/track.rb +15 -3
- data/lib/ab_admin/models/user.rb +12 -48
- data/lib/ab_admin/utils/csv_document.rb +8 -6
- data/lib/ab_admin/utils/eval_helpers.rb +0 -13
- data/lib/ab_admin/utils/logger.rb +12 -2
- data/lib/ab_admin/utils/mysql.rb +2 -3
- data/lib/ab_admin/utils/xls_document.rb +18 -18
- data/lib/ab_admin/utils.rb +0 -5
- data/lib/ab_admin/version.rb +1 -1
- data/lib/ab_admin/views/admin_helpers.rb +43 -28
- data/lib/ab_admin/views/admin_navigation_helpers.rb +18 -16
- data/lib/ab_admin/views/form_builder.rb +7 -5
- data/lib/ab_admin/views/helpers.rb +0 -9
- data/lib/ab_admin/views/inputs/ckeditor_input.rb +1 -5
- data/lib/ab_admin/views/manager_helpers.rb +15 -6
- data/lib/ab_admin/views/search_form_builder.rb +13 -13
- data/lib/ab_admin/views/will_paginate_bootstrap_renderer.rb +60 -0
- data/lib/ab_admin.rb +44 -32
- data/lib/generators/ab_admin/glob/glob_generator.rb +4 -5
- data/lib/generators/ab_admin/glob/templates/migration.erb +10 -7
- data/lib/generators/ab_admin/install/templates/config/ab_admin.rb.erb +1 -1
- data/lib/generators/ab_admin/install/templates/models/user.rb +1 -13
- data/lib/generators/ab_admin/install/templates/spec/spec_helper.rb +0 -1
- data/lib/generators/ab_admin/install/templates/spec/support/database_cleaner.rb +8 -11
- data/lib/generators/ab_admin/install/templates/uploaders/attachment_file_uploader.rb +1 -1
- data/lib/generators/ab_admin/install/templates/uploaders/avatar_uploader.rb +1 -1
- data/lib/generators/ab_admin/install/templates/uploaders/picture_uploader.rb +16 -3
- data/lib/generators/ab_admin/model/model_generator.rb +3 -4
- data/lib/generators/ab_admin/model/templates/resource.erb +5 -2
- data/lib/generators/ab_admin/resource/resource_generator.rb +0 -4
- data/lib/generators/ab_admin/resource/templates/controller.erb +2 -9
- data/lib/tasks/assets.rake +5 -5
- metadata +45 -85
- data/app/assets/images/admin/Jcrop.gif +0 -0
- data/app/assets/images/admin/flags/de.png +0 -0
- data/app/assets/images/admin/flags/en.png +0 -0
- data/app/assets/images/admin/flags/es.png +0 -0
- data/app/assets/images/admin/flags/fr.png +0 -0
- data/app/assets/images/admin/flags/it.png +0 -0
- data/app/assets/images/admin/flags/ja.png +0 -0
- data/app/assets/images/admin/flags/pl.png +0 -0
- data/app/assets/images/admin/flags/ru.png +0 -0
- data/app/assets/images/admin/flags/uk.png +0 -0
- data/app/assets/javascripts/ab_admin/components/croppable_image.js.coffee +0 -33
- data/app/assets/stylesheets/ab_admin/components/_columns_hider.scss +0 -5
- data/app/assets/stylesheets/ab_admin/components/_perms.scss +0 -39
- data/app/views/admin/shared/_columns_hider.html.slim +0 -9
- data/lib/ab_admin/hooks/globalize_locale_suffix_accessors.rb +0 -25
- data/lib/ab_admin/hooks/globalize_valid_locale.rb +0 -9
- data/lib/generators/ab_admin/ckeditor_assets/ckeditor_assets_generator.rb +0 -19
- data/lib/generators/template.rb +0 -96
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e4cff3af876fcd7ea0ee9a0a340b10ceb31d22c2a3728910692c0048c8f0e6c
|
4
|
+
data.tar.gz: 7c66e65f59261910436f0c4d18cf069e1f94e42cec845c39bb5d7ee07de434e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c5926ca259601ec0369db9588748dc3c6b34fca63816ea9ef2adda4a238f45eb26f2f215d2337a38fe7a5061e870e0bdae466dcd46b5f51c7b0f2118e3e9084
|
7
|
+
data.tar.gz: 8ecd6b3078af74eee5d0135eb8fe1764d27f2dbd623c6e0f663d5e9b8e4e808323e968e6c87955e4f4f0c9ad7431743307b364a22a870fda1874b5a3fd9942e3
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -4,13 +4,19 @@ Simple and real-life tested Rails::Engine admin interface based on slim, bootstr
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
gem 'simple_slug'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install simple_slug
|
12
18
|
|
13
|
-
|
19
|
+
Run generators
|
14
20
|
|
15
21
|
```bash
|
16
22
|
rails generate devise:install
|
@@ -5,13 +5,6 @@
|
|
5
5
|
#= require fileupload/jquery.fileupload-validate
|
6
6
|
#= require ab_admin/components/base_assets
|
7
7
|
|
8
|
-
#q= require ab_admin/jquery.Jcrop
|
9
|
-
#q= require ab_admin/components/croppable_image
|
10
|
-
|
11
|
-
#q=require fileupload/jquery.fileupload-image
|
12
|
-
#q=require fileupload/jquery.fileupload-audio
|
13
|
-
#q=require fileupload/jquery.fileupload-video
|
14
|
-
|
15
8
|
class window.AdminAssets extends BaseAssets
|
16
9
|
showErrors: (e, data) ->
|
17
10
|
errors = _.map(data.files,(file) ->
|
@@ -20,29 +13,11 @@ class window.AdminAssets extends BaseAssets
|
|
20
13
|
|
21
14
|
initDisabled: ->
|
22
15
|
super
|
23
|
-
@initFancybox() if $.fn.fancybox
|
24
16
|
|
25
17
|
initHandlers: ->
|
26
18
|
super
|
27
|
-
@initFancybox() if $.fn.fancybox
|
28
|
-
@initCrop() if @options.crop
|
29
19
|
@initEditMeta() if @options.edit_meta
|
30
20
|
|
31
|
-
initFancybox: =>
|
32
|
-
@list.find("a.fancybox")
|
33
|
-
.click (e) ->
|
34
|
-
e.preventDefault()
|
35
|
-
.fancybox
|
36
|
-
afterShow: =>
|
37
|
-
@crop?.fancyboxHandler()
|
38
|
-
helpers:
|
39
|
-
overlay:
|
40
|
-
locked: false
|
41
|
-
|
42
|
-
initCrop: ->
|
43
|
-
return unless $.fn.Jcrop
|
44
|
-
@crop = new CroppableImage(@el, @options.crop)
|
45
|
-
|
46
21
|
initEditMeta: ->
|
47
22
|
@el.find('.fileupload-edit-button').show().click =>
|
48
23
|
ids = @el.find('.fileupload-list .fileupload-asset').map(-> $(this).data('id')).get()
|
@@ -20,8 +20,7 @@ window.translate = (text, element, from, to) ->
|
|
20
20
|
window.google_t = (text, element, from, to) ->
|
21
21
|
return '' unless $.trim(text)
|
22
22
|
opts = {q: text, from: from, to: to}
|
23
|
-
$.post '/admin/translate', opts, ((data) =>
|
24
|
-
element.inputVal $.unescape(data.text).replace(/%\s{/g, ' %{')), 'json'
|
23
|
+
$.post '/admin/translate', opts, ((data) => element.inputVal $.unescape(data.text)), 'json'
|
25
24
|
|
26
25
|
# get value of text field or CKEDITOR area
|
27
26
|
$.fn.inputVal = (v = null) ->
|
@@ -45,13 +44,12 @@ $.fn.inputVal = (v = null) ->
|
|
45
44
|
$el.val()
|
46
45
|
|
47
46
|
class window.GoogleLocaleTabs
|
48
|
-
@locales = ['ru', 'en', 'it']
|
49
47
|
constructor: ->
|
50
|
-
@locales =
|
48
|
+
@locales = $('.locale_tabs:first .nav-tabs a').map(-> $(this).attr('href').replace('#', '') ).get()
|
51
49
|
@limit = 10000
|
52
50
|
html = '<div class="t_locales">'
|
53
51
|
for l in @locales
|
54
|
-
html += "<div class='t_locale t_locale_#{l}'
|
52
|
+
html += "<div class='t_locale t_locale_#{l}'>#{localeToFlag(l)}</div>"
|
55
53
|
html += '</div>'
|
56
54
|
@html = $(html)
|
57
55
|
$('.locale_tabs:not(".no_translate") .tab-pane').prepend(@html)
|
@@ -6,7 +6,10 @@ EditableForm.prototype.saveWithUrlHook = (value) ->
|
|
6
6
|
originalUrl.call(@options.scope, params)
|
7
7
|
else
|
8
8
|
params[@options.model] ||= {}
|
9
|
-
|
9
|
+
if _.isString(params.value) && params.value.match(/@\d+/)
|
10
|
+
params[@options.model][params.name] = params.value.replace('@', '')
|
11
|
+
else
|
12
|
+
params[@options.model][params.name] = params.value
|
10
13
|
params._method = 'PATCH'
|
11
14
|
ajax_opts =
|
12
15
|
url: originalUrl
|
@@ -26,30 +29,35 @@ EditableForm.prototype.saveWithUrlHook = (value) ->
|
|
26
29
|
EditableForm.prototype.saveWithoutUrlHook = EditableForm.prototype.save
|
27
30
|
EditableForm.prototype.save = EditableForm.prototype.saveWithUrlHook
|
28
31
|
|
29
|
-
|
30
|
-
$('.editable').
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
32
|
+
window.initInPlaceEditable = ->
|
33
|
+
$('.editable').each ->
|
34
|
+
$el = $(this)
|
35
|
+
$el.editable
|
36
|
+
onblur: 'submit'
|
37
|
+
placement: 'bottom'
|
38
|
+
emptytext: $el.attr('placeholder') || I18n.t('admin.js.empty') || 'Empty'
|
39
|
+
error: (response) ->
|
40
|
+
if response.status == 422
|
41
|
+
Object.entries(response.responseJSON.errors).map((i) -> i.join(': ')).join(', ')
|
42
|
+
else
|
43
|
+
response.responseText
|
44
|
+
success: (response) ->
|
45
|
+
if response && $(this).data().options?.accept == 'script'
|
46
|
+
$.globalEval(response.responseText)
|
47
|
+
datetimepicker:
|
48
|
+
format: "dd.mm.yyyy hh:ii"
|
49
|
+
autoclose: true
|
50
|
+
todayBtn: true
|
51
|
+
language: I18n.locale
|
52
|
+
ajaxOptions:
|
53
|
+
xhrFields:
|
54
|
+
withCredentials: true
|
55
|
+
headers:
|
56
|
+
Accept: 'application/json'
|
57
|
+
|
58
|
+
|
59
|
+
$(document).on 'admin:init', initInPlaceEditable
|
60
|
+
|
53
61
|
$ ->
|
54
62
|
_.each $('.editable'), (el) ->
|
55
63
|
$el = $(el)
|
@@ -1,18 +1,36 @@
|
|
1
1
|
class window.ColumnsHider
|
2
2
|
constructor: ->
|
3
3
|
@store_key = 'cols'
|
4
|
-
@data_el = $('#columns_hider_data')
|
5
4
|
@column_names = @columnNames()
|
6
5
|
@collection_name = window.location.href.match(/admin\/(\w+)/)?[1]
|
7
6
|
return unless @collection_name
|
8
7
|
@data = @getData()
|
9
|
-
@initDefaults()
|
10
8
|
@initButtons()
|
11
9
|
@initHandlers()
|
12
10
|
@refreshColumns()
|
13
11
|
|
14
|
-
|
15
|
-
|
12
|
+
initHandlers: ->
|
13
|
+
$(document).on 'pjax:end admin:list_init', =>
|
14
|
+
@initButtons()
|
15
|
+
@refreshColumns()
|
16
|
+
|
17
|
+
$(document).on 'click', '#columns_hider_wrap label', (e) =>
|
18
|
+
e.preventDefault()
|
19
|
+
e.stopPropagation()
|
20
|
+
$input = $(e.currentTarget).find('input')
|
21
|
+
$input.prop('checked', !$input.is(':checked'))
|
22
|
+
colIds = _.map $('#columns_hider_wrap .dropdown-menu input:not(:checked)'), (el) -> parseInt($(el).val())
|
23
|
+
@data[@collection_name] = colIds
|
24
|
+
@refreshColumns()
|
25
|
+
@setData()
|
26
|
+
|
27
|
+
initButtons: ->
|
28
|
+
$menu = $('#columns_hider_wrap .dropdown-menu')
|
29
|
+
$menu.empty()
|
30
|
+
for col, i in @column_names
|
31
|
+
isActive = !_.include(@data[@collection_name], i)
|
32
|
+
html = "<label class='checkbox'><input type='checkbox' #{'checked' if isActive} value='#{i}'>#{col.name}</label>"
|
33
|
+
$menu.append(html)
|
16
34
|
|
17
35
|
setData: ->
|
18
36
|
res = {}
|
@@ -33,27 +51,10 @@ class window.ColumnsHider
|
|
33
51
|
data[@collection_name].push(i) if col.disabled
|
34
52
|
data
|
35
53
|
|
36
|
-
initButtons: ->
|
37
|
-
@data_el.empty()
|
38
|
-
for col, i in @column_names
|
39
|
-
css_class = if _.include(@data[@collection_name], i) then 'active' else ''
|
40
|
-
html = "<button class='btn btn-primary #{css_class}' data-val='#{i}'>#{col.name}</button>"
|
41
|
-
@data_el.append(html)
|
42
|
-
|
43
54
|
columnNames: ->
|
44
55
|
_.map $('#list > thead > tr > th'), (el) ->
|
45
56
|
$el = $(el)
|
46
|
-
{disabled: $el.hasClass('hide_cell'), name: $.trim($el.text().replace(/[▼▲]/g, ''))}
|
47
|
-
|
48
|
-
initHandlers: ->
|
49
|
-
$('#submit_columns_hider').click =>
|
50
|
-
col_ids = _.map $('#columns_hider_data .active'), (el) -> $(el).data('val')
|
51
|
-
@data[@collection_name] = col_ids
|
52
|
-
$('#columns_hider').modal('hide')
|
53
|
-
@refreshColumns()
|
54
|
-
@setData()
|
55
|
-
$(document).on 'pjax:end admin:list_init', =>
|
56
|
-
@refreshColumns()
|
57
|
+
{disabled: $el.hasClass('hide_cell'), name: $.trim($el.text().replace(/[▼▲]/g, '')) || ' - '}
|
57
58
|
|
58
59
|
refreshColumns: ->
|
59
60
|
if @data[@collection_name]
|
@@ -69,4 +70,4 @@ class window.ColumnsHider
|
|
69
70
|
$("#list > thead > tr > th, #list > tbody > tr > td").show()
|
70
71
|
|
71
72
|
$ ->
|
72
|
-
window.
|
73
|
+
window.columnsHider = new ColumnsHider()
|
@@ -23,14 +23,13 @@ $ ->
|
|
23
23
|
e.preventDefault()
|
24
24
|
$(this).closest('tr').remove()
|
25
25
|
|
26
|
-
$(document).on 'admin:init', ->
|
27
26
|
$form = $('form.simple_form')
|
28
27
|
window.resource_id = $form.data('id')
|
29
28
|
$form.trigger('admin:form_init')
|
30
29
|
|
31
30
|
$(document).on 'admin:list_init', ->
|
32
31
|
initPopover()
|
33
|
-
|
32
|
+
initInPlaceEditable()
|
34
33
|
|
35
34
|
$(document).on 'admin:form_init', 'form', ->
|
36
35
|
initEditor()
|
@@ -58,3 +57,9 @@ $ ->
|
|
58
57
|
$('body').css('background-color', "##{window.fv.bg_color.replace(/^#/, '')}")
|
59
58
|
|
60
59
|
initHotkeys() if window.fv?.hotkeys
|
60
|
+
|
61
|
+
clipboard = new Clipboard('.js-copy')
|
62
|
+
clipboard.on 'success', (e) ->
|
63
|
+
$el = $(e.trigger)
|
64
|
+
$el.addClass('js-copy-popup')
|
65
|
+
setTimeout((-> $el.removeClass('js-copy-popup')), 1200)
|
@@ -4,12 +4,6 @@ $ ->
|
|
4
4
|
$el = $(this)
|
5
5
|
$el.next('input').attr('name', "q[#{$el.val()}]")
|
6
6
|
|
7
|
-
|
8
|
-
# $("#search_form [name$='_at_gteq]']").val (i, v) ->
|
9
|
-
# v + " 00:00" if v
|
10
|
-
# $("#search_form [name$='_at_lteq]']").val (i, v) ->
|
11
|
-
# v + " 23:59" if v
|
12
|
-
|
13
|
-
$('#search_cancel').click (e) ->
|
7
|
+
$('.js-search-cancel').click (e) ->
|
14
8
|
e.preventDefault()
|
15
9
|
window.location.search = ""
|
@@ -22,16 +22,12 @@ window.initAcFileds = ->
|
|
22
22
|
maxHeight: 400
|
23
23
|
width: 220
|
24
24
|
|
25
|
-
window.initTooltip = ->
|
26
|
-
$('.js-tooltip').tooltip
|
27
|
-
animation: false
|
28
|
-
|
29
25
|
window.initEditor = (baseSelector='form') ->
|
30
26
|
return if fv.test
|
31
27
|
$("#{baseSelector} .do_wysihtml5").each ->
|
32
28
|
$el = $(this)
|
33
29
|
return if $el.hasClass('wysihtml5_done')
|
34
|
-
editor = $el.wysihtml5({html: true, locale: '
|
30
|
+
editor = $el.wysihtml5({html: true, locale: 'en'}).data('wysihtml5').editor
|
35
31
|
resizeIframe = -> editor.composer.iframe.style.height = editor.composer.element.scrollHeight + "px"
|
36
32
|
editor.on "load", ->
|
37
33
|
if editor.composer
|
@@ -50,7 +46,7 @@ window.inputBtnClose = ->
|
|
50
46
|
$(this).closest('.close-wrap').remove()
|
51
47
|
|
52
48
|
window.flash = (message, type='notice') ->
|
53
|
-
$("<div class='alert alert-#{type}'><a class='close' data-dismiss='alert'>×</a>#{message}</div>").
|
49
|
+
$("<div class='alert alert-#{type}'><a class='close' data-dismiss='alert'>×</a>#{message}</div>").prependTo $('#flash')
|
54
50
|
|
55
51
|
window.focusInput = (scope=null) ->
|
56
52
|
scope ||= $('form.simple_form:first')
|
@@ -89,4 +85,24 @@ window.initNestedFields = (opts={}) ->
|
|
89
85
|
window.initFancySelect() unless opts.skip_fancy
|
90
86
|
window.initPickers() unless opts.skip_pickers
|
91
87
|
window.initEditor() unless opts.skip_editor
|
92
|
-
opts.callback.call(e) if opts.callback
|
88
|
+
opts.callback.call(e) if opts.callback
|
89
|
+
|
90
|
+
window.initCkeditor = (dom_id, options={}) ->
|
91
|
+
if window.CKEDITOR
|
92
|
+
CKEDITOR.replace(dom_id, options) unless CKEDITOR.instances[dom_id]
|
93
|
+
else
|
94
|
+
$.getScript $("##{dom_id}").data('cdnUrl'), ->
|
95
|
+
CKEDITOR.replaceClass = null;
|
96
|
+
CKEDITOR.replace(dom_id, options) unless CKEDITOR.instances[dom_id]
|
97
|
+
|
98
|
+
window.lazyInitCkeditor = (dom_id, options={}) ->
|
99
|
+
$el = $("##{dom_id}")
|
100
|
+
$form = $el.closest('form')
|
101
|
+
height = options.height || 200
|
102
|
+
height += if options.toolbar == 'mini' then 34 else 67
|
103
|
+
$el.height(height)
|
104
|
+
callback = (intersectionRatio) ->
|
105
|
+
initCkeditor(dom_id, options) if intersectionRatio
|
106
|
+
window.ckeditorVisibilityObserver = new IntersectionObserver (entries, observer) =>
|
107
|
+
entries.forEach(((entry) => callback(entry.intersectionRatio)), {root: $form[0]})
|
108
|
+
window.ckeditorVisibilityObserver.observe document.getElementById(dom_id)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
window.fv ||= {}
|
2
2
|
window.I18n ||= {}
|
3
|
-
I18n.locale = window.fv.locale || '
|
4
|
-
window.locale_path = if I18n.locale == '
|
3
|
+
I18n.locale = window.fv.locale || 'en'
|
4
|
+
window.locale_path = if I18n.locale == 'en' then '' else "/#{I18n.locale}"
|
5
5
|
|
6
6
|
_.sum = (obj) ->
|
7
7
|
return 0 if not $.isArray(obj) or obj.length is 0
|
@@ -168,3 +168,17 @@ window.storeData = (key, data) ->
|
|
168
168
|
|
169
169
|
window.fetchData = (key) ->
|
170
170
|
window.localStorage?[key] or $.cookie(key)
|
171
|
+
|
172
|
+
window.localeToFlag = (l) ->
|
173
|
+
l = l.toUpperCase()
|
174
|
+
l = {'JA': 'JP', 'EN': 'GB', 'UK': 'UA'}[l] || l
|
175
|
+
chars = {"A":"🇦","B":"🇧","C":"🇨","D":"🇩","E":"🇪","F":"🇫","G":"🇬","H":"🇭","I":"🇮","J":"🇯","K":"🇰","L":"🇱","M":"🇲","N":"🇳","O":"🇴","P":"🇵","Q":"🇶","R":"🇷","S":"🇸","T":"🇹","U":"🇺","V":"🇻","W":"🇼","X":"🇽","Y":"🇾","Z":"🇿"}
|
176
|
+
l.replace /[A-Z]/g, (m) -> chars[m]
|
177
|
+
|
178
|
+
window.I18n ||= {}
|
179
|
+
window.I18n.locale = 'en'
|
180
|
+
window.I18n.translations ||= {}
|
181
|
+
I18n.t = (key) ->
|
182
|
+
keys = key.split('.')
|
183
|
+
keys.unshift(I18n.locale)
|
184
|
+
_.get(I18n.translations, keys)
|
@@ -7,6 +7,7 @@ $ ->
|
|
7
7
|
viewSelect: 'month'
|
8
8
|
minView: 'day'
|
9
9
|
language: I18n.locale
|
10
|
+
weekStart: 1
|
10
11
|
|
11
12
|
search_form_options = _.defaults({pickerPosition: "bottom-left datetimepicker-bottom-left-custom"}, base_options)
|
12
13
|
search_form_options_gt = _.defaults({initialDate: new Date(new Date().setHours(0,0,0,0))}, search_form_options)
|
@@ -1,4 +1,3 @@
|
|
1
|
-
//= require i18n
|
2
1
|
//= require i18n/translations
|
3
2
|
//= require jquery.min
|
4
3
|
//= require jquery_ujs
|
@@ -7,7 +6,7 @@
|
|
7
6
|
//= require jquery.cookie
|
8
7
|
//= require jquery.pjax
|
9
8
|
//= require jquery.hotkeys
|
10
|
-
//= require bootstrap
|
9
|
+
//= require bootstrap_2_3_2/bootstrap
|
11
10
|
//= require ab_admin/jquery_nested_form
|
12
11
|
//= require ab_admin/bootstrap-tab-multi
|
13
12
|
//= require ab_admin/bootstrap-datetimepicker/bootstrap-datetimepicker
|
@@ -17,10 +16,10 @@
|
|
17
16
|
//= require moment.min
|
18
17
|
//= require ab_admin/bootstrap-editable
|
19
18
|
//= require ab_admin/bootbox.min
|
20
|
-
//= require select2
|
21
|
-
//= require fancybox
|
19
|
+
//= require select2_3_5_2/select2
|
22
20
|
//= require ab_admin/jquery-ui-1.10.3.custom.min
|
23
21
|
//= require jquery.ui.nestedSortable
|
22
|
+
//= require clipboard.min
|
24
23
|
//= require ab_admin/components/sortable_tree
|
25
24
|
//= require ab_admin/components/google_translate
|
26
25
|
//= require ab_admin/components/locator
|
@@ -1,8 +1,8 @@
|
|
1
1
|
$baseFontSize: 13px !default;
|
2
2
|
$baseLineHeight: 18px !default;
|
3
3
|
|
4
|
-
@import "bootstrap";
|
5
|
-
@import "bootstrap-responsive";
|
4
|
+
@import "bootstrap_2_3_2/bootstrap";
|
5
|
+
@import "bootstrap_2_3_2/bootstrap-responsive";
|
6
6
|
@import "ab_admin/components/base";
|
7
7
|
@import "ab_admin/components/navigation";
|
8
8
|
@import "ab_admin/components/table_view";
|
@@ -13,11 +13,10 @@ $baseLineHeight: 18px !default;
|
|
13
13
|
@import "ab_admin/components/colored_tabs";
|
14
14
|
@import "ab_admin/components/locale_tabs";
|
15
15
|
@import "ab_admin/components/translations";
|
16
|
-
@import "ab_admin/components/perms";
|
17
16
|
@import "ab_admin/components/admin_comments";
|
18
17
|
@import "ab_admin/components/geo_input";
|
19
18
|
@import "ab_admin/components/view_layout";
|
20
|
-
@import "ab_admin/components/
|
19
|
+
@import "ab_admin/components/tooltip";
|
21
20
|
|
22
21
|
img {
|
23
22
|
max-width: none;
|
@@ -89,6 +88,15 @@ ul.nav li.dropdown:hover ul.dropdown-menu {
|
|
89
88
|
width: auto;
|
90
89
|
}
|
91
90
|
|
91
|
+
.label a {
|
92
|
+
color: white;
|
93
|
+
font-size: 12px;
|
94
|
+
font-weight: 500;
|
95
|
+
text-decoration: none;
|
96
|
+
border: none;
|
97
|
+
line-height: 1.4;
|
98
|
+
}
|
99
|
+
|
92
100
|
.label-primary, .badge-primary {
|
93
101
|
background-color: #05C;
|
94
102
|
}
|
@@ -130,6 +138,7 @@ label.input_set, label.label-large, .label.label-large {
|
|
130
138
|
font-size: 15px;
|
131
139
|
padding: 4px 10px 6px;
|
132
140
|
display: block;
|
141
|
+
text-align: center;
|
133
142
|
}
|
134
143
|
|
135
144
|
label.label-med {
|
@@ -145,42 +154,79 @@ label.control-label.label-reset {
|
|
145
154
|
text-align: left;
|
146
155
|
}
|
147
156
|
|
148
|
-
.
|
149
|
-
|
150
|
-
|
157
|
+
.js-copy-popup {
|
158
|
+
position: relative;
|
159
|
+
&:before {
|
160
|
+
content: none;
|
151
161
|
}
|
152
|
-
|
153
|
-
|
154
|
-
|
162
|
+
&:after {
|
163
|
+
background-color: transparent;
|
164
|
+
padding: 0;
|
165
|
+
animation: text-pop-up-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
166
|
+
content: 'Copied!';
|
167
|
+
position: absolute;
|
168
|
+
color: #468847;
|
169
|
+
font-size: 14px;
|
170
|
+
left: -5px;
|
171
|
+
top: -5px;
|
155
172
|
}
|
173
|
+
}
|
156
174
|
|
157
|
-
|
158
|
-
|
175
|
+
.pulse.badge-important {
|
176
|
+
cursor: pointer;
|
177
|
+
box-shadow: 0 0 0 rgba(185, 74, 72, 0.7);
|
178
|
+
animation: pulse-important 1s infinite;
|
179
|
+
}
|
180
|
+
.pulse:hover {
|
181
|
+
animation: none;
|
182
|
+
}
|
183
|
+
@keyframes pulse-important {
|
184
|
+
0% {
|
185
|
+
box-shadow: 0 0 0 0 rgba(185, 74, 72, 0.7);
|
159
186
|
}
|
160
|
-
|
161
|
-
|
162
|
-
background-color: #ededed;
|
187
|
+
70% {
|
188
|
+
box-shadow: 0 0 0 10px rgba(185, 74, 72, 0);
|
163
189
|
}
|
164
|
-
|
165
|
-
|
166
|
-
background-color: #d9edf7;
|
190
|
+
100% {
|
191
|
+
box-shadow: 0 0 0 0 rgba(185, 74, 72, 0);
|
167
192
|
}
|
168
193
|
}
|
169
194
|
|
170
|
-
|
171
|
-
|
172
|
-
|
195
|
+
@keyframes text-pop-up-top {
|
196
|
+
0% {
|
197
|
+
transform: translateY(0);
|
198
|
+
transform-origin: 50% 50%;
|
199
|
+
}
|
200
|
+
95% {
|
201
|
+
opacity: 0.9;
|
202
|
+
}
|
203
|
+
100% {
|
204
|
+
transform: translateY(-30px);
|
205
|
+
transform-origin: 50% 50%;
|
206
|
+
opacity: 0;
|
207
|
+
}
|
173
208
|
}
|
209
|
+
|
174
210
|
.clear {
|
175
211
|
clear: both;
|
176
212
|
}
|
177
|
-
|
178
|
-
|
179
|
-
}
|
180
|
-
.white-space-nowrap {
|
213
|
+
|
214
|
+
.white-space-nowrap, .wsn {
|
181
215
|
white-space: nowrap;
|
182
216
|
}
|
183
217
|
|
218
|
+
.text-pink {
|
219
|
+
color: #F52887;
|
220
|
+
}
|
221
|
+
|
222
|
+
.text-violet {
|
223
|
+
color: #BA55D3;
|
224
|
+
}
|
225
|
+
|
226
|
+
.text-turquoise {
|
227
|
+
color: #07d3d3;
|
228
|
+
}
|
229
|
+
|
184
230
|
@media (max-width: 767px) {
|
185
231
|
body, .container-fluid {
|
186
232
|
padding: 0;
|
@@ -21,7 +21,10 @@ html, body {
|
|
21
21
|
margin: 0 0 20px -253px;
|
22
22
|
float: left;
|
23
23
|
&.well {
|
24
|
-
width:
|
24
|
+
width: 240px;
|
25
|
+
}
|
26
|
+
&.well-tiny {
|
27
|
+
padding: 5px;
|
25
28
|
}
|
26
29
|
}
|
27
30
|
.content_with_sidebar {
|
@@ -39,6 +42,23 @@ html, body {
|
|
39
42
|
}
|
40
43
|
}
|
41
44
|
|
45
|
+
#flash {
|
46
|
+
position: fixed;
|
47
|
+
bottom: 0;
|
48
|
+
right: 0;
|
49
|
+
padding: 15px;
|
50
|
+
opacity: 0.9;
|
51
|
+
min-width: 25%;
|
52
|
+
max-width: 400px;
|
53
|
+
z-index: 5;
|
54
|
+
.alert {
|
55
|
+
margin-bottom: 5px;
|
56
|
+
&:last-child {
|
57
|
+
margin-bottom: 0;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
42
62
|
#push {
|
43
63
|
height: 40px;
|
44
64
|
}
|