rails_admin_ui_layout_taris 1.2.7
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.md +2 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/rails_admin/custom/timer.js +135 -0
- data/app/assets/javascripts/rails_admin/custom/ui.js +98 -0
- data/app/assets/javascripts/rails_admin/ra.widgets.coffee +233 -0
- data/app/assets/stylesheets/rails_admin/custom/flashing.scss +28 -0
- data/app/assets/stylesheets/rails_admin/custom/theming.scss +189 -0
- data/app/assets/stylesheets/rails_admin/custom/togglable-sidebar.scss +112 -0
- data/app/views/layouts/rails_admin/_navigation.html.haml +13 -0
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +3 -0
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +4 -0
- data/app/views/layouts/rails_admin/_user_navigation.html.haml +7 -0
- data/app/views/layouts/rails_admin/application.html.haml +59 -0
- data/app/views/layouts/rails_admin/pjax.html.haml +24 -0
- data/app/views/rails_admin/main/_modal_interaction.html.erb +53 -0
- data/config/locales/en.main.yml +27 -0
- data/config/locales/it.main.yml +27 -0
- data/config/routes.rb +2 -0
- data/lib/rails_admin_ui_layout_taris.rb +6 -0
- data/lib/rails_admin_ui_layout_taris/engine.rb +6 -0
- data/lib/rails_admin_ui_layout_taris/version.rb +3 -0
- data/lib/tasks/rails_admin_ui_layout_taris_tasks.rake +4 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: '037944e24a8e2f914c6ae9be252416426f5ada8b'
|
4
|
+
data.tar.gz: 72e336d615ec6e20af7b91c2305a2b06f6fa853c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bfbef02842df1ba5caf983e0b8cbb7414c6125ad8575cba4fa00e947677d487cc64aa8f32dc8162f38d36db26f685eaac9d3b99da90c79278ac6608cbb032261
|
7
|
+
data.tar.gz: e94d732c4161c3b04324f872c039be2c5754325aee8769dd802a81d70474504e85f09a91780608592d40d5e64a3b5185b7a5813c995d67acf0129d11ddb90c74
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 Gabriele Tassoni
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'RailsAdminUiLayoutTaris'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1,135 @@
|
|
1
|
+
(function (root, factory) {
|
2
|
+
'use strict'
|
3
|
+
if (typeof define === 'function' && define.amd) define([], factory)
|
4
|
+
else if (typeof exports === 'object') module.exports = factory()
|
5
|
+
else root.Timer = factory()
|
6
|
+
}(this, function () {
|
7
|
+
'use strict'
|
8
|
+
|
9
|
+
var defaultOptions = {
|
10
|
+
tick : 1,
|
11
|
+
onstart : null,
|
12
|
+
ontick : null,
|
13
|
+
onpause : null,
|
14
|
+
onstop : null,
|
15
|
+
onend : null
|
16
|
+
}
|
17
|
+
|
18
|
+
var Timer = function (options) {
|
19
|
+
if (!(this instanceof Timer)) return new Timer(options)
|
20
|
+
this._ = {
|
21
|
+
id : +new Date,
|
22
|
+
options : {},
|
23
|
+
duration : 0,
|
24
|
+
status : 'initialized',
|
25
|
+
start : 0,
|
26
|
+
measures : []
|
27
|
+
}
|
28
|
+
for (var prop in defaultOptions) this._.options[prop] = defaultOptions[prop]
|
29
|
+
this.options(options)
|
30
|
+
}
|
31
|
+
|
32
|
+
Timer.prototype.start = function (duration) {
|
33
|
+
if (!+duration && !this._.duration) return this
|
34
|
+
duration && (duration *= 1000)
|
35
|
+
if (this._.timeout && this._.status === 'started') return this
|
36
|
+
this._.duration = duration || this._.duration
|
37
|
+
this._.timeout = setTimeout(end.bind(this), this._.duration)
|
38
|
+
if (typeof this._.options.ontick === 'function')
|
39
|
+
this._.interval = setInterval(function () {
|
40
|
+
trigger.call(this, 'ontick', this.getDuration())
|
41
|
+
}.bind(this), +this._.options.tick * 1000)
|
42
|
+
this._.start = +new Date
|
43
|
+
this._.status = 'started'
|
44
|
+
trigger.call(this, 'onstart', this.getDuration())
|
45
|
+
return this
|
46
|
+
}
|
47
|
+
|
48
|
+
Timer.prototype.pause = function () {
|
49
|
+
if (this._.status !== 'started') return this
|
50
|
+
this._.duration -= (+new Date - this._.start)
|
51
|
+
clear.call(this, false)
|
52
|
+
this._.status = 'paused'
|
53
|
+
trigger.call(this, 'onpause')
|
54
|
+
return this
|
55
|
+
}
|
56
|
+
|
57
|
+
Timer.prototype.stop = function () {
|
58
|
+
if (!/started|paused/.test(this._.status)) return this
|
59
|
+
clear.call(this, true)
|
60
|
+
this._.status = 'stopped'
|
61
|
+
trigger.call(this, 'onstop')
|
62
|
+
return this
|
63
|
+
}
|
64
|
+
|
65
|
+
Timer.prototype.getDuration = function () {
|
66
|
+
if (this._.status === 'started')
|
67
|
+
return this._.duration - (+new Date - this._.start)
|
68
|
+
if (this._.status === 'paused') return this._.duration
|
69
|
+
return 0
|
70
|
+
}
|
71
|
+
|
72
|
+
Timer.prototype.getStatus = function () {
|
73
|
+
return this._.status
|
74
|
+
}
|
75
|
+
|
76
|
+
Timer.prototype.options = function (option, value) {
|
77
|
+
if (option && value) this._.options[option] = value
|
78
|
+
if (!value && typeof option === 'object')
|
79
|
+
for (var prop in option)
|
80
|
+
if (this._.options.hasOwnProperty(prop))
|
81
|
+
this._.options[prop] = option[prop]
|
82
|
+
return this
|
83
|
+
}
|
84
|
+
|
85
|
+
Timer.prototype.on = function (option, value) {
|
86
|
+
if (typeof option !== 'string' || typeof value !== 'function') return this
|
87
|
+
if (!(/^on/).test(option))
|
88
|
+
option = 'on' + option
|
89
|
+
if (this._.options.hasOwnProperty(option))
|
90
|
+
this._.options[option] = value
|
91
|
+
return this
|
92
|
+
}
|
93
|
+
|
94
|
+
Timer.prototype.off = function (option) {
|
95
|
+
if (typeof option !== 'string') return this
|
96
|
+
option = option.toLowerCase()
|
97
|
+
if (option === 'all') {
|
98
|
+
this._.options = defaultOptions
|
99
|
+
return this
|
100
|
+
}
|
101
|
+
if (!(/^on/).test(option)) option = 'on' + option
|
102
|
+
if (this._.options.hasOwnProperty(option))
|
103
|
+
this._.options[option] = defaultOptions[option]
|
104
|
+
return this
|
105
|
+
}
|
106
|
+
|
107
|
+
Timer.prototype.measureStart = function (label) {
|
108
|
+
this._.measures[label || ''] = +new Date
|
109
|
+
return this
|
110
|
+
}
|
111
|
+
|
112
|
+
Timer.prototype.measureStop = function (label) {
|
113
|
+
return +new Date - this._.measures[label || '']
|
114
|
+
}
|
115
|
+
|
116
|
+
function end () {
|
117
|
+
clear.call(this)
|
118
|
+
this._.status = 'stopped'
|
119
|
+
trigger.call(this, 'onend')
|
120
|
+
}
|
121
|
+
|
122
|
+
function trigger (event) {
|
123
|
+
var callback = this._.options[event],
|
124
|
+
args = [].slice.call(arguments, 1)
|
125
|
+
typeof callback === 'function' && callback.apply(this, args)
|
126
|
+
}
|
127
|
+
|
128
|
+
function clear (clearDuration) {
|
129
|
+
clearTimeout(this._.timeout)
|
130
|
+
clearInterval(this._.interval)
|
131
|
+
if (clearDuration === true) this._.duration = 0
|
132
|
+
}
|
133
|
+
|
134
|
+
return Timer
|
135
|
+
}))
|
@@ -0,0 +1,98 @@
|
|
1
|
+
//= require selectize
|
2
|
+
//= require timer
|
3
|
+
//= require_tree .
|
4
|
+
|
5
|
+
$(document).on('ready pjax:success', function(e) {
|
6
|
+
handleActiveBase();
|
7
|
+
|
8
|
+
function handleActiveBase() {
|
9
|
+
$('.sub-menu').each(function() {
|
10
|
+
if ($(this).hasClass('active')) {
|
11
|
+
$(this).parent().prev().addClass('active');
|
12
|
+
$(this).parent().prev().addClass('open');
|
13
|
+
$(this).parent().slideDown();
|
14
|
+
}
|
15
|
+
});
|
16
|
+
}
|
17
|
+
// home dashboard dark theme
|
18
|
+
if ((new RegExp('app/$').test(e.currentTarget.URL) || new RegExp('app$').test(e.currentTarget.URL)) && !new RegExp('app/app').test(e.currentTarget.URL)) {
|
19
|
+
$('.page-header, .content').addClass('dashboard');
|
20
|
+
} else {
|
21
|
+
$('.page-header, .content').removeClass('dashboard');
|
22
|
+
}
|
23
|
+
|
24
|
+
// $(document).ready(function () {
|
25
|
+
// Hide and show the sidebar
|
26
|
+
// Make the sidebar button shine a bit
|
27
|
+
// setTimeout(function() {
|
28
|
+
// $('#sidebar-collapse').addClass("flash");
|
29
|
+
// }, 500);
|
30
|
+
// setTimeout(function() {
|
31
|
+
// if (!$('#wrapper').hasClass('toggled'))
|
32
|
+
// $('#wrapper').addClass('toggled');
|
33
|
+
// }, 1200);
|
34
|
+
// });
|
35
|
+
});
|
36
|
+
|
37
|
+
$(function() {
|
38
|
+
var array_menu = [];
|
39
|
+
var lvl_1 = null;
|
40
|
+
var count = 0;
|
41
|
+
|
42
|
+
$('.sidebar-nav li').each(function(index, item) {
|
43
|
+
if ($(item).hasClass('dropdown-header')) {
|
44
|
+
lvl_1 = count++;
|
45
|
+
array_menu[lvl_1] = []
|
46
|
+
} else {
|
47
|
+
$(item).addClass('sub-menu sub-menu-' + lvl_1);
|
48
|
+
}
|
49
|
+
});
|
50
|
+
|
51
|
+
for (var i = 0; i <= array_menu.length; i++) {
|
52
|
+
$('.sub-menu-' + i).wrapAll("<div class='sub-menu-container' />");
|
53
|
+
}
|
54
|
+
|
55
|
+
$('.sub-menu-container').hide();
|
56
|
+
|
57
|
+
handleActiveBase();
|
58
|
+
|
59
|
+
function handleActiveBase() {
|
60
|
+
$('.sub-menu').each(function() {
|
61
|
+
if ($(this).hasClass('active')) {
|
62
|
+
$(this).parent().prev().addClass('active');
|
63
|
+
$(this).parent().slideDown();
|
64
|
+
}
|
65
|
+
});
|
66
|
+
}
|
67
|
+
|
68
|
+
$('.dropdown-header').bind('click', function() {
|
69
|
+
$('.dropdown-header').removeClass('open'); //Rimuove tutte le classi open
|
70
|
+
$(this).toggleClass('open'); // Apre la corrente
|
71
|
+
// Se la corrente è già aperta, allora la chiude
|
72
|
+
|
73
|
+
$('.dropdown-header').removeClass('active');
|
74
|
+
$('.sub-menu-container').stop().slideUp();
|
75
|
+
$(this).toggleClass('active');
|
76
|
+
$(this).next('.sub-menu-container').stop().slideDown();
|
77
|
+
});
|
78
|
+
});
|
79
|
+
|
80
|
+
$(document).ready(function () {
|
81
|
+
// All pjax in sidebar-nav make the menu disappear when clicked
|
82
|
+
$(".sidebar-nav a[class=pjax]").on("click", function(){
|
83
|
+
$('#wrapper').toggleClass('toggled');
|
84
|
+
});
|
85
|
+
|
86
|
+
$('#sidebar-collapse').on('click', function() {
|
87
|
+
$('#wrapper').toggleClass('toggled');
|
88
|
+
});
|
89
|
+
// // Hide and show the sidebar
|
90
|
+
// // Make the sidebar button shine a bit
|
91
|
+
// setTimeout(function() {
|
92
|
+
// $('#sidebar-collapse').addClass("flash");
|
93
|
+
// }, 500);
|
94
|
+
// setTimeout(function() {
|
95
|
+
// if (!$('#wrapper').hasClass('toggled'))
|
96
|
+
// $('#wrapper').addClass('toggled');
|
97
|
+
// }, 1200);
|
98
|
+
});
|
@@ -0,0 +1,233 @@
|
|
1
|
+
$(document).on 'rails_admin.dom_ready', (e, content) ->
|
2
|
+
content = if content then content else $('form')
|
3
|
+
|
4
|
+
if content.length # don't waste time otherwise
|
5
|
+
|
6
|
+
# colorpicker
|
7
|
+
|
8
|
+
content.find('[data-color]').each ->
|
9
|
+
that = this
|
10
|
+
$(this).ColorPicker
|
11
|
+
color: $(that).val()
|
12
|
+
onShow: (el) ->
|
13
|
+
$(el).fadeIn(500)
|
14
|
+
false
|
15
|
+
onHide: (el) ->
|
16
|
+
$(el).fadeOut(500)
|
17
|
+
false
|
18
|
+
onChange: (hsb, hex, rgb) ->
|
19
|
+
$(that).val(hex)
|
20
|
+
$(that).css('backgroundColor', '#' + hex)
|
21
|
+
|
22
|
+
# datetime picker
|
23
|
+
$.fn.datetimepicker.defaults.icons =
|
24
|
+
time: 'fa fa-clock-o'
|
25
|
+
date: 'fa fa-calendar'
|
26
|
+
up: 'fa fa-chevron-up'
|
27
|
+
down: 'fa fa-chevron-down'
|
28
|
+
previous: 'fa fa-angle-double-left'
|
29
|
+
next: 'fa fa-angle-double-right'
|
30
|
+
today: 'fa fa-dot-circle-o'
|
31
|
+
clear: 'fa fa-trash'
|
32
|
+
close: 'fa fa-times'
|
33
|
+
|
34
|
+
content.find('[data-datetimepicker]').each ->
|
35
|
+
options = $(this).data('options')
|
36
|
+
$.extend(options, {locale: RailsAdmin.I18n.locale})
|
37
|
+
$(this).datetimepicker options
|
38
|
+
|
39
|
+
# enumeration
|
40
|
+
|
41
|
+
content.find('[data-enumeration]').each ->
|
42
|
+
if $(this).is('[multiple]')
|
43
|
+
$(this).filteringMultiselect $(this).data('options')
|
44
|
+
else
|
45
|
+
$(this).filteringSelect $(this).data('options')
|
46
|
+
|
47
|
+
# fileupload
|
48
|
+
|
49
|
+
content.find('[data-fileupload]').each ->
|
50
|
+
input = this
|
51
|
+
$(this).on 'click', ".delete input[type='checkbox']", ->
|
52
|
+
$(input).children('.toggle').toggle('slow')
|
53
|
+
|
54
|
+
# fileupload-preview
|
55
|
+
|
56
|
+
content.find('[data-fileupload]').change ->
|
57
|
+
input = this
|
58
|
+
image_container = $("#" + input.id).parent().children(".preview")
|
59
|
+
unless image_container.length
|
60
|
+
image_container = $("#" + input.id).parent().prepend($('<img />').addClass('preview').addClass('img-thumbnail')).find('img.preview')
|
61
|
+
image_container.parent().find('img:not(.preview)').hide()
|
62
|
+
ext = $("#" + input.id).val().split('.').pop().toLowerCase()
|
63
|
+
if input.files and input.files[0] and $.inArray(ext, ['gif', 'png', 'jpg', 'jpeg', 'bmp']) != -1
|
64
|
+
reader = new FileReader()
|
65
|
+
reader.onload = (e) ->
|
66
|
+
image_container.attr "src", e.target.result
|
67
|
+
reader.readAsDataURL input.files[0]
|
68
|
+
image_container.show()
|
69
|
+
else
|
70
|
+
image_container.hide()
|
71
|
+
|
72
|
+
# filtering-multiselect
|
73
|
+
|
74
|
+
content.find('[data-filteringmultiselect]').each ->
|
75
|
+
$(this).filteringMultiselect $(this).data('options')
|
76
|
+
if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
|
77
|
+
$(this).siblings('.btn').remove()
|
78
|
+
else
|
79
|
+
$(this).parents('.control-group').first().remoteForm()
|
80
|
+
|
81
|
+
# filtering-select
|
82
|
+
|
83
|
+
content.find('[data-filteringselect]').each ->
|
84
|
+
$(this).filteringSelect $(this).data('options')
|
85
|
+
if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
|
86
|
+
$(this).siblings('.btn').remove()
|
87
|
+
else
|
88
|
+
$(this).parents('.control-group').first().remoteForm()
|
89
|
+
|
90
|
+
# nested-many
|
91
|
+
|
92
|
+
content.find('[data-nestedmany]').each ->
|
93
|
+
field = $(this).parents('.control-group').first()
|
94
|
+
nav = field.find('> .controls > .nav')
|
95
|
+
tab_content = field.find('> .tab-content')
|
96
|
+
toggler = field.find('> .controls > .btn-group > .toggler')
|
97
|
+
# add each nested field to a tab-pane and reference it in the nav
|
98
|
+
tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
|
99
|
+
$(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random() * 100000)) # some elements are created on the same ms
|
100
|
+
nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
|
101
|
+
# only if no tab is set to active
|
102
|
+
if nav.find("> li.active").length == 0
|
103
|
+
# init first tab, toggler and tab_content/tabs visibility
|
104
|
+
nav.find("> li > a[data-toggle='tab']:first").tab('show')
|
105
|
+
if nav.children().length == 0
|
106
|
+
nav.hide()
|
107
|
+
tab_content.hide()
|
108
|
+
toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
|
109
|
+
else
|
110
|
+
if toggler.hasClass('active')
|
111
|
+
nav.show()
|
112
|
+
tab_content.show()
|
113
|
+
toggler.children('i').addClass('icon-chevron-down')
|
114
|
+
else
|
115
|
+
nav.hide()
|
116
|
+
tab_content.hide()
|
117
|
+
toggler.children('i').addClass('icon-chevron-right')
|
118
|
+
|
119
|
+
# nested-one
|
120
|
+
|
121
|
+
content.find('[data-nestedone]').each ->
|
122
|
+
field = $(this).parents('.control-group').first()
|
123
|
+
nav = field.find("> .controls > .nav")
|
124
|
+
tab_content = field.find("> .tab-content")
|
125
|
+
toggler = field.find('> .controls > .btn-group > .toggler')
|
126
|
+
tab_content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
|
127
|
+
# Convert the "add nested field" button to just showing the title of the new model
|
128
|
+
field.find('> .controls .add_nested_fields').removeClass('add_nested_fields').html($(this).children('.object-infos').data('object-label'))
|
129
|
+
nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
|
130
|
+
first_tab = nav.find("> li > a[data-toggle='tab']:first")
|
131
|
+
first_tab.tab('show')
|
132
|
+
field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
|
133
|
+
nav.hide()
|
134
|
+
if nav.children().length == 0
|
135
|
+
nav.hide()
|
136
|
+
tab_content.hide()
|
137
|
+
toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
|
138
|
+
else
|
139
|
+
if toggler.hasClass('active')
|
140
|
+
toggler.children('i').addClass('icon-chevron-down')
|
141
|
+
tab_content.show()
|
142
|
+
else
|
143
|
+
toggler.children('i').addClass('icon-chevron-right')
|
144
|
+
tab_content.hide()
|
145
|
+
|
146
|
+
# polymorphic-association
|
147
|
+
|
148
|
+
content.find('[data-polymorphic]').each ->
|
149
|
+
type_select = $(this)
|
150
|
+
field = type_select.parents('.control-group').first()
|
151
|
+
object_select = field.find('select').last()
|
152
|
+
urls = type_select.data('urls')
|
153
|
+
type_select.on 'change', (e) ->
|
154
|
+
if $(this).val() is ''
|
155
|
+
object_select.html('<option value=""></option>')
|
156
|
+
else
|
157
|
+
$.ajax
|
158
|
+
url: urls[type_select.val()]
|
159
|
+
data:
|
160
|
+
compact: true
|
161
|
+
all: true
|
162
|
+
beforeSend: (xhr) ->
|
163
|
+
xhr.setRequestHeader("Accept", "application/json")
|
164
|
+
success: (data, status, xhr) ->
|
165
|
+
html = $('<option></option>')
|
166
|
+
$(data).each (i, el) ->
|
167
|
+
option = $('<option></option>')
|
168
|
+
option.attr('value', el.id)
|
169
|
+
option.text(el.label)
|
170
|
+
html = html.add(option)
|
171
|
+
object_select.html(html)
|
172
|
+
|
173
|
+
# ckeditor
|
174
|
+
|
175
|
+
goCkeditors = ->
|
176
|
+
content.find('[data-richtext=ckeditor]').not('.ckeditored').each (index, domEle) ->
|
177
|
+
try
|
178
|
+
if instance = window.CKEDITOR.instances[this.id]
|
179
|
+
instance.destroy(true)
|
180
|
+
window.CKEDITOR.replace(this, $(this).data('options'))
|
181
|
+
$(this).addClass('ckeditored')
|
182
|
+
|
183
|
+
$editors = content.find('[data-richtext=ckeditor]').not('.ckeditored')
|
184
|
+
if $editors.length
|
185
|
+
if not window.CKEDITOR
|
186
|
+
options = $editors.first().data('options')
|
187
|
+
window.CKEDITOR_BASEPATH = options['base_location']
|
188
|
+
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
189
|
+
goCkeditors()
|
190
|
+
else
|
191
|
+
goCkeditors()
|
192
|
+
|
193
|
+
#codemirror
|
194
|
+
|
195
|
+
goCodeMirrors = (array) =>
|
196
|
+
array.each (index, domEle) ->
|
197
|
+
options = $(this).data('options')
|
198
|
+
textarea = this
|
199
|
+
$.getScript options['locations']['mode'], (script, textStatus, jqXHR) ->
|
200
|
+
$('head').append('<link href="' + options['locations']['theme'] + '" rel="stylesheet" media="all" type="text\/css">')
|
201
|
+
CodeMirror.fromTextArea(textarea, options['options'])
|
202
|
+
$(textarea).addClass('codemirrored')
|
203
|
+
|
204
|
+
array = content.find('[data-richtext=codemirror]').not('.codemirrored')
|
205
|
+
if array.length
|
206
|
+
@array = array
|
207
|
+
if not window.CodeMirror
|
208
|
+
options = $(array[0]).data('options')
|
209
|
+
$('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
|
210
|
+
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
211
|
+
goCodeMirrors(@array)
|
212
|
+
else
|
213
|
+
goCodeMirrors(@array)
|
214
|
+
|
215
|
+
# bootstrap_wysihtml5
|
216
|
+
|
217
|
+
goBootstrapWysihtml5s = (array, config_options) =>
|
218
|
+
array.each ->
|
219
|
+
$(@).addClass('bootstrap-wysihtml5ed')
|
220
|
+
$(@).closest('.controls').addClass('well')
|
221
|
+
$(@).wysihtml5(config_options)
|
222
|
+
|
223
|
+
array = content.find('[data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed')
|
224
|
+
if array.length
|
225
|
+
@array = array
|
226
|
+
options = $(array[0]).data('options')
|
227
|
+
config_options = $.parseJSON(options['config_options'])
|
228
|
+
if not window.wysihtml5
|
229
|
+
$('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
|
230
|
+
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
231
|
+
goBootstrapWysihtml5s(@array, config_options)
|
232
|
+
else
|
233
|
+
goBootstrapWysihtml5s(@array, config_options)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.flash {
|
2
|
+
-moz-animation: flash 1s ease-out;
|
3
|
+
-moz-animation-iteration-count: 1;
|
4
|
+
|
5
|
+
-webkit-animation: flash 1s ease-out;
|
6
|
+
-webkit-animation-iteration-count: 1;
|
7
|
+
|
8
|
+
-ms-animation: flash 1s ease-out;
|
9
|
+
-ms-animation-iteration-count: 1;
|
10
|
+
}
|
11
|
+
|
12
|
+
@-webkit-keyframes flash {
|
13
|
+
0% { background-color: none; }
|
14
|
+
50% { background-color: #fbf8b2; }
|
15
|
+
100% { background-color: none; }
|
16
|
+
}
|
17
|
+
|
18
|
+
@-moz-keyframes flash {
|
19
|
+
0% { background-color: none; }
|
20
|
+
50% { background-color: #fbf8b2; }
|
21
|
+
100% { background-color: none; }
|
22
|
+
}
|
23
|
+
|
24
|
+
@-ms-keyframes flash {
|
25
|
+
0% { background-color: none; }
|
26
|
+
50% { background-color: #fbf8b2; }
|
27
|
+
100% { background-color: none; }
|
28
|
+
}
|
@@ -0,0 +1,189 @@
|
|
1
|
+
@import "selectize";
|
2
|
+
@import "selectize.bootstrap3";
|
3
|
+
@import "togglable-sidebar";
|
4
|
+
@import "flashing";
|
5
|
+
@import 'font-awesome';
|
6
|
+
// @import 'rails_admin/bootstrap/_variables';
|
7
|
+
// @import "rails_admin/bootstrap-datetimepicker-build";
|
8
|
+
|
9
|
+
$RAprimary: #1c2c41;
|
10
|
+
$RAgreen: #37BC9B;
|
11
|
+
$RAblue: #3BAFDA;
|
12
|
+
$RAred: #E9573F;
|
13
|
+
$RAyellow: #F6BB42;
|
14
|
+
|
15
|
+
body {
|
16
|
+
background: rgb(59, 78, 89);
|
17
|
+
}
|
18
|
+
|
19
|
+
.page-header.dashboard {
|
20
|
+
border-color: $RAprimary;
|
21
|
+
}
|
22
|
+
|
23
|
+
.breadcrumb {
|
24
|
+
background: $RAblue;
|
25
|
+
.false a, .false:before {
|
26
|
+
color: darken($RAblue, 30%) !important;
|
27
|
+
}
|
28
|
+
.active, .active:before {
|
29
|
+
color: #FFF;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
.table-striped {
|
34
|
+
border-top-color: $RAblue;
|
35
|
+
.links ul li {
|
36
|
+
padding-right: 0;
|
37
|
+
a {
|
38
|
+
border-radius: 50%;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
.content {
|
44
|
+
margin: 0px 0 15px 0;
|
45
|
+
padding: 8px;
|
46
|
+
background: rgb(59, 78, 89);
|
47
|
+
&.dashboard {
|
48
|
+
background: rgb(59, 78, 89);
|
49
|
+
}
|
50
|
+
.page-header {
|
51
|
+
display: none;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
a.delete {
|
56
|
+
color: #FFF;
|
57
|
+
}
|
58
|
+
|
59
|
+
.box {
|
60
|
+
padding: 15px;
|
61
|
+
margin-bottom: 30px;
|
62
|
+
border: 1px solid $RAprimary;
|
63
|
+
position: relative;
|
64
|
+
min-height: 170px;
|
65
|
+
transition: all 0.3s ease;
|
66
|
+
color: rgba(255,255,255,0.7);
|
67
|
+
overflow: hidden;
|
68
|
+
&:hover, &:focus {
|
69
|
+
border-color: #FFF;
|
70
|
+
.icon-bg {
|
71
|
+
transform: scale(1.5) rotate(20deg);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
p {
|
75
|
+
min-height: 30px;
|
76
|
+
font-size: 15px;
|
77
|
+
font-weight: 600;
|
78
|
+
a.btn {
|
79
|
+
border-radius: 3px;
|
80
|
+
color: rgba(255,255,255,0.7) !important;
|
81
|
+
display: inline-block;
|
82
|
+
margin-bottom: 0;
|
83
|
+
font-weight: normal;
|
84
|
+
text-align: center;
|
85
|
+
vertical-align: middle;
|
86
|
+
cursor: pointer;
|
87
|
+
background-color: rgba(0, 0, 0, 0.19);
|
88
|
+
border: 1px solid transparent;
|
89
|
+
white-space: nowrap;
|
90
|
+
padding: 6px 12px;
|
91
|
+
font-size: 14px;
|
92
|
+
line-height: 1.42857143;
|
93
|
+
border-radius: 4px;
|
94
|
+
-webkit-user-select: none;
|
95
|
+
-moz-user-select: none;
|
96
|
+
-ms-user-select: none;
|
97
|
+
user-select: none;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
strong {
|
101
|
+
font-size: 36px;
|
102
|
+
font-weight: 600;
|
103
|
+
}
|
104
|
+
.icon-bg {
|
105
|
+
position: absolute;
|
106
|
+
right: 0;
|
107
|
+
bottom: 0;
|
108
|
+
font-size: 100px;
|
109
|
+
color: #000;
|
110
|
+
opacity: 0.08;
|
111
|
+
filter: alpha(opacity=8);
|
112
|
+
transition: all 1s ease;
|
113
|
+
}
|
114
|
+
&.bg-info {
|
115
|
+
background-color: $RAblue;
|
116
|
+
}
|
117
|
+
&.bg-success {
|
118
|
+
background-color: $RAgreen;
|
119
|
+
}
|
120
|
+
&.bg-warning {
|
121
|
+
background-color: $RAyellow;
|
122
|
+
}
|
123
|
+
&.bg-danger {
|
124
|
+
background-color: $RAred;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
/* User sign in and sign forms. */
|
129
|
+
.border-form-div {
|
130
|
+
max-width: 300px;
|
131
|
+
padding: 19px 29px 29px;
|
132
|
+
margin: 0 auto 20px;
|
133
|
+
background-color: #fff;
|
134
|
+
border: 1px solid #e5e5e5;
|
135
|
+
-webkit-border-radius: 5px;
|
136
|
+
-moz-border-radius: 5px;
|
137
|
+
border-radius: 5px;
|
138
|
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
139
|
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
140
|
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
141
|
+
}
|
142
|
+
.border-form-div .form-signin-heading,
|
143
|
+
.border-form-div .checkbox {
|
144
|
+
margin-bottom: 10px;
|
145
|
+
}
|
146
|
+
.border-form-div input[type="text"],
|
147
|
+
.border-form-div input[type="email"],
|
148
|
+
.border-form-div input[type="password"] {
|
149
|
+
font-size: 16px;
|
150
|
+
height: auto;
|
151
|
+
margin-bottom: 15px;
|
152
|
+
padding: 7px 9px;
|
153
|
+
}
|
154
|
+
|
155
|
+
#sidebar-collapse {
|
156
|
+
background-color: transparent;
|
157
|
+
background-image: none;
|
158
|
+
border: 1px solid transparent;
|
159
|
+
color: #888;
|
160
|
+
}
|
161
|
+
#sidebar-collapse:focus {
|
162
|
+
outline: 0;
|
163
|
+
}
|
164
|
+
#sidebar-collapse:hover {
|
165
|
+
color: white;
|
166
|
+
}
|
167
|
+
|
168
|
+
.exit-button {
|
169
|
+
padding-top: 9px;
|
170
|
+
padding-bottom: 9px;
|
171
|
+
margin-top: 8px;
|
172
|
+
margin-bottom: 8px;
|
173
|
+
margin-right: 7px;
|
174
|
+
}
|
175
|
+
|
176
|
+
#app-name {
|
177
|
+
font-size: 2em;
|
178
|
+
color: #888;
|
179
|
+
font-family: 'Raleway', sans-serif;
|
180
|
+
word-wrap: normal;
|
181
|
+
}
|
182
|
+
#app-name:hover {
|
183
|
+
color: white;
|
184
|
+
text-decoration: none;
|
185
|
+
}
|
186
|
+
|
187
|
+
body.rails_admin {
|
188
|
+
padding-top: 0px;
|
189
|
+
}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
/* Toggle Styles */
|
2
|
+
|
3
|
+
#wrapper {
|
4
|
+
padding-left: 0;
|
5
|
+
-webkit-transition: all 0.5s ease;
|
6
|
+
-moz-transition: all 0.5s ease;
|
7
|
+
-o-transition: all 0.5s ease;
|
8
|
+
transition: all 0.5s ease;
|
9
|
+
}
|
10
|
+
#wrapper.toggled {
|
11
|
+
padding-left: 250px;
|
12
|
+
}
|
13
|
+
#sidebar-wrapper {
|
14
|
+
z-index: 100;
|
15
|
+
position: fixed;
|
16
|
+
left: 250px;
|
17
|
+
width: 0;
|
18
|
+
height: 100%;
|
19
|
+
margin-left: -250px;
|
20
|
+
overflow-y: auto;
|
21
|
+
background: #000;
|
22
|
+
-webkit-transition: all 0.5s ease;
|
23
|
+
-moz-transition: all 0.5s ease;
|
24
|
+
-o-transition: all 0.5s ease;
|
25
|
+
transition: all 0.5s ease;
|
26
|
+
}
|
27
|
+
#wrapper.toggled #sidebar-wrapper {
|
28
|
+
width: 250px;
|
29
|
+
}
|
30
|
+
#page-content-wrapper {
|
31
|
+
z-index: 150;
|
32
|
+
width: 100%;
|
33
|
+
position: absolute;
|
34
|
+
padding: 15px;
|
35
|
+
background-color: rgb(59,78,89);
|
36
|
+
min-height: 100vh;
|
37
|
+
}
|
38
|
+
#wrapper.toggled #page-content-wrapper {
|
39
|
+
position: absolute;
|
40
|
+
margin-right: -250px;
|
41
|
+
background-color: rgb(59,78,89);
|
42
|
+
}
|
43
|
+
/* Sidebar Styles */
|
44
|
+
|
45
|
+
.sidebar-nav {
|
46
|
+
position: absolute;
|
47
|
+
top: 0;
|
48
|
+
width: 250px;
|
49
|
+
margin: 0;
|
50
|
+
padding: 0;
|
51
|
+
list-style: none;
|
52
|
+
}
|
53
|
+
.sidebar-nav li {
|
54
|
+
text-indent: 20px;
|
55
|
+
line-height: 40px;
|
56
|
+
}
|
57
|
+
.sidebar-nav li a {
|
58
|
+
display: block;
|
59
|
+
text-decoration: none;
|
60
|
+
color: #999999;
|
61
|
+
}
|
62
|
+
.sidebar-nav li a:hover {
|
63
|
+
text-decoration: none;
|
64
|
+
color: #fff;
|
65
|
+
background: rgba(255, 255, 255, 0.2);
|
66
|
+
}
|
67
|
+
.sidebar-nav li a:active,
|
68
|
+
.sidebar-nav li a:focus {
|
69
|
+
text-decoration: none;
|
70
|
+
}
|
71
|
+
.sidebar-nav > .sidebar-brand {
|
72
|
+
height: 65px;
|
73
|
+
font-size: 18px;
|
74
|
+
line-height: 60px;
|
75
|
+
}
|
76
|
+
.sidebar-nav > .sidebar-brand a {
|
77
|
+
color: #999999;
|
78
|
+
}
|
79
|
+
.sidebar-nav > .sidebar-brand a:hover {
|
80
|
+
color: #fff;
|
81
|
+
background: none;
|
82
|
+
}
|
83
|
+
|
84
|
+
body.rails_admin .sidebar-nav {
|
85
|
+
top: 0px;
|
86
|
+
}
|
87
|
+
// @media(min-width:768px) {
|
88
|
+
// #wrapper {
|
89
|
+
// padding-left: 250px;
|
90
|
+
// }
|
91
|
+
// #wrapper.toggled {
|
92
|
+
// padding-left: 0;
|
93
|
+
// }
|
94
|
+
// #sidebar-wrapper {
|
95
|
+
// width: 250px;
|
96
|
+
// z-index: 10000;
|
97
|
+
// }
|
98
|
+
// #wrapper.toggled #sidebar-wrapper {
|
99
|
+
// width: 0;
|
100
|
+
// z-index: 10000;
|
101
|
+
// }
|
102
|
+
// #page-content-wrapper {
|
103
|
+
// padding: 20px;
|
104
|
+
// position: absolute;
|
105
|
+
// z-index: 20000;
|
106
|
+
// }
|
107
|
+
// #wrapper.toggled #page-content-wrapper {
|
108
|
+
// position: absolute;
|
109
|
+
// margin-right: 0;
|
110
|
+
// z-index: 20000;
|
111
|
+
// }
|
112
|
+
// }
|
@@ -0,0 +1,13 @@
|
|
1
|
+
-# .container-fluid
|
2
|
+
-# .navbar-header
|
3
|
+
-# %button.navbar-toggle.collapsed{ type: 'button', data: { toggle: 'collapse', target: '#secondary-navigation' }, aria: {expanded: 'false', controls: 'navbar'} }
|
4
|
+
-# %span.sr-only= t('admin.toggle_navigation')
|
5
|
+
-# %span.icon-bar
|
6
|
+
-# %span.icon-bar
|
7
|
+
-# %span.icon-bar
|
8
|
+
-# - # Added support for app name setting (falling back if not existing to standard rails_admin behaviour)
|
9
|
+
-# %a.navbar-brand.pjax{href: dashboard_path}
|
10
|
+
-# = Settings.app_name rescue (_get_plugin_name[0] || 'Rails')
|
11
|
+
-# %small= _get_plugin_name[1] || 'Admin'
|
12
|
+
-# .navbar-collapse.collapse#secondary-navigation
|
13
|
+
-# = render partial: 'layouts/rails_admin/secondary_navigation'
|
@@ -0,0 +1,7 @@
|
|
1
|
+
- if _current_user
|
2
|
+
-# %ul.sidebar-nav
|
3
|
+
%li.dropdown-header=t :current_user
|
4
|
+
- if user_link = edit_user_link
|
5
|
+
%li.edit_user_root_link= user_link
|
6
|
+
- if logout_path.present?
|
7
|
+
%li=link_to content_tag('span', t('admin.misc.log_out'), class: 'label label-danger'), logout_path, method: logout_method
|
@@ -0,0 +1,59 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html{lang: I18n.locale}
|
3
|
+
%head
|
4
|
+
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}
|
5
|
+
%meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
|
6
|
+
%meta{name: "viewport", content: "width=device-width, initial-scale=1"}
|
7
|
+
%meta{content: "NONE,NOARCHIVE", name: "robots"}
|
8
|
+
= csrf_meta_tag
|
9
|
+
%style{media: "screen"}
|
10
|
+
div#sidebar-wrapper div.sidebar-nav li.dropdown-header { padding-left: 0px }
|
11
|
+
div.sub-menu-container li.sub-menu a.pjax { padding-left: 0px }
|
12
|
+
div#wrapper div#sidebar-wrapper { overflow: hidden }
|
13
|
+
|
14
|
+
= stylesheet_link_tag "rails_admin/rails_admin.css", media: :all
|
15
|
+
= javascript_include_tag "rails_admin/rails_admin.js"
|
16
|
+
|
17
|
+
= favicon_link_tag 'apple-touch-icon.png', rel: 'apple-touch-icon', sizes: "180x180"
|
18
|
+
= favicon_link_tag 'favicon-32x32.png', rel: 'icon', sizes: "32x32"
|
19
|
+
= favicon_link_tag 'favicon-16x16.png', rel: 'icon', sizes: "16x16"
|
20
|
+
= favicon_link_tag 'safari-pinned-tab.svg', rel: 'mask-icon', color: "#5bbad5"
|
21
|
+
%body.rails_admin
|
22
|
+
#admin-js{:'data-i18n-options' => I18n.t("admin.js").to_json}
|
23
|
+
-# Initialize JS simple i18n
|
24
|
+
:javascript
|
25
|
+
RailsAdmin.I18n.init('#{I18n.locale}', document.getElementById("admin-js").dataset.i18nOptions);
|
26
|
+
#loading.label.label-warning{style: 'display:none; position:fixed; right:20px; bottom:20px; z-index:100000'}= t('admin.loading')
|
27
|
+
-# %nav.navbar.navbar-default.navbar-fixed-top
|
28
|
+
-# = render "layouts/rails_admin/navigation"
|
29
|
+
#wrapper
|
30
|
+
#sidebar-wrapper
|
31
|
+
.sidebar-nav
|
32
|
+
= render "layouts/rails_admin/secondary_navigation"
|
33
|
+
= render "layouts/rails_admin/sidebar_navigation"
|
34
|
+
= render "layouts/rails_admin/user_navigation"
|
35
|
+
#page-content-wrapper
|
36
|
+
.container-fluid
|
37
|
+
.row
|
38
|
+
.col-lg-12
|
39
|
+
%button#sidebar-collapse{href: "#menu-toggle"}
|
40
|
+
%i.fa.fa-bars.fa-2x
|
41
|
+
-# %a#app-name.pjax{href: dashboard_path}
|
42
|
+
%span#app-name
|
43
|
+
= Settings.app_name rescue "Thecore"
|
44
|
+
.content{:'data-pjax-container' => true}
|
45
|
+
= render template: 'layouts/rails_admin/pjax'
|
46
|
+
= render "rails_admin/main/modal_interaction"
|
47
|
+
-# -# Initialize JS simple i18n
|
48
|
+
-# :javascript
|
49
|
+
-# RailsAdmin.I18n.init('#{I18n.locale}', JSON.parse("#{j I18n.t("admin.js").to_json}"))
|
50
|
+
-# %body.rails_admin
|
51
|
+
-# #loading.label.label-warning{style: 'display:none; position:fixed; right:20px; bottom:20px; z-index:100000'}= t('admin.loading')
|
52
|
+
-# %nav.navbar.navbar-default.navbar-fixed-top
|
53
|
+
-# = render "layouts/rails_admin/navigation"
|
54
|
+
-# .container-fluid
|
55
|
+
-# .row
|
56
|
+
-# .col-sm-3.col-md-2.sidebar-nav
|
57
|
+
-# = render "layouts/rails_admin/sidebar_navigation"
|
58
|
+
-# .col-sm-9.col-sm-offset-3.col-md-10.col-md-offset-2
|
59
|
+
-# .content{:'data-pjax-container' => true}= render template: 'layouts/rails_admin/pjax'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
:javascript
|
2
|
+
$('.nav.nav-pills li.active').removeClass('active');
|
3
|
+
$('.nav.nav-pills li[data-model="#{@abstract_model.to_param}"]').addClass('active');
|
4
|
+
|
5
|
+
- # Integration of the rails_admin_settings gem, if not available, it rescues to the normal naming
|
6
|
+
%title= "#{(@abstract_model.try(:pretty_name) || @page_name)} | #{Settings.app_name rescue ([_get_plugin_name[0] || 'Rails', _get_plugin_name[1] || 'Admin'].join(' '))}"
|
7
|
+
.page-header
|
8
|
+
%h1= @page_name
|
9
|
+
- flash && flash.each do |key, value|
|
10
|
+
.alert.alert-dismissible{class: flash_alert_class(key)}
|
11
|
+
%button.close{type: 'button', :'data-dismiss' => "alert"} ×
|
12
|
+
= value
|
13
|
+
- # if it's and abstract model, then is not a root model for sure (like the dashboard)
|
14
|
+
- # these actions (root ones) are the actions listed at the same level as the dashboard (not related to a model)
|
15
|
+
- if @abstract_model
|
16
|
+
= breadcrumb
|
17
|
+
.well.well-sm
|
18
|
+
%ul.nav.nav-pills
|
19
|
+
= menu_for((@abstract_model ? (@object.try(:persisted?) ? :member : :collection) : :root), @abstract_model, @object)
|
20
|
+
= content_for :contextual_tabs
|
21
|
+
.well.well-sm
|
22
|
+
= yield
|
23
|
+
- else
|
24
|
+
= yield
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<div id="modal-interaction" class="modal fade" tabindex="-1" role="dialog">
|
2
|
+
<div class="modal-dialog" role="document">
|
3
|
+
<div class="modal-content">
|
4
|
+
<div class="modal-header">
|
5
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
6
|
+
<span aria-hidden="true">×</span>
|
7
|
+
</button>
|
8
|
+
<h4 class="modal-title" id="modal-interaction-label"> </h4>
|
9
|
+
</div>
|
10
|
+
<div class="modal-body" id="modal-interaction-body">
|
11
|
+
|
12
|
+
</div>
|
13
|
+
<div class="modal-footer" id="modal-interaction-footer">
|
14
|
+
<button type="button" class="btn btn-default" data-dismiss="modal" id="modal-interaction-secondary"> </button>
|
15
|
+
<button type="button" class="btn btn-primary" id="modal-interaction-primary"> </button>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<!-- /.modal-content -->
|
19
|
+
</div>
|
20
|
+
<!-- /.modal-dialog -->
|
21
|
+
</div>
|
22
|
+
<!-- /.modal -->
|
23
|
+
|
24
|
+
<script>
|
25
|
+
function openModal(title, message, buttonPrimary, buttonSecondary) {
|
26
|
+
$('#modal-interaction-label').html(title);
|
27
|
+
$('#modal-interaction-body').html(message);
|
28
|
+
if (buttonPrimary != null) {
|
29
|
+
$('#modal-interaction-primary').html(buttonPrimary.lbl);
|
30
|
+
$('#modal-interaction-primary').on('click', buttonPrimary.func);
|
31
|
+
$('#modal-interaction-primary').show();
|
32
|
+
}
|
33
|
+
if (buttonSecondary != null) {
|
34
|
+
$('#modal-interaction-secondary').html(buttonSecondary.lbl);
|
35
|
+
$('#modal-interaction-secondary').on('click', buttonSecondary.func);
|
36
|
+
$('#modal-interaction-secondary').show();
|
37
|
+
}
|
38
|
+
(buttonPrimary != null || buttonSecondary != null) ? $("#modal-interaction-footer").show() : $("#modal-interaction-footer").hide();
|
39
|
+
$('#modal-interaction').modal('show');
|
40
|
+
}
|
41
|
+
function closeModal() {
|
42
|
+
$('#modal-interaction').modal('hide');
|
43
|
+
$('#modal-interaction-label').html(" ");
|
44
|
+
$('#modal-interaction-body').html(" ");
|
45
|
+
$('#modal-interaction-primary').html(" ");
|
46
|
+
$('#modal-interaction-secondary').html(" ");
|
47
|
+
$('#modal-interaction-primary').hide();
|
48
|
+
$('#modal-interaction-secondary').hide();
|
49
|
+
$("#modal-interaction-footer").hide();
|
50
|
+
$('#modal-interaction-primary').off();
|
51
|
+
$('#modal-interaction-secondary').off();
|
52
|
+
}
|
53
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
it:
|
2
|
+
yes: Yes
|
3
|
+
no: Cancel
|
4
|
+
error: Error
|
5
|
+
question: Question
|
6
|
+
root_actions: Root Actions
|
7
|
+
admin:
|
8
|
+
js:
|
9
|
+
true: True
|
10
|
+
false: False
|
11
|
+
is_present: Is present
|
12
|
+
is_blank: Is blank
|
13
|
+
date: Date ...
|
14
|
+
between_and_: Between ... and ...
|
15
|
+
today: Today
|
16
|
+
yesterday: Yesterday
|
17
|
+
this_week: This week
|
18
|
+
last_week: Last week
|
19
|
+
number: Number ...
|
20
|
+
contains: Contains
|
21
|
+
is_exactly: Is exactly
|
22
|
+
starts_with: Starts with
|
23
|
+
ends_with: Ends with
|
24
|
+
too_many_objects: "Too many objects, use search box above"
|
25
|
+
no_objects: "No objects found"
|
26
|
+
loading: "Loading..."
|
27
|
+
toggle_navigation: Toggle navigation
|
@@ -0,0 +1,27 @@
|
|
1
|
+
it:
|
2
|
+
yes: Si
|
3
|
+
no: Annulla
|
4
|
+
error: Errore
|
5
|
+
question: Domanda
|
6
|
+
root_actions: "Operazioni"
|
7
|
+
admin:
|
8
|
+
js:
|
9
|
+
true: Vero
|
10
|
+
false: Falso
|
11
|
+
is_present: Is present
|
12
|
+
is_blank: Is blank
|
13
|
+
date: Date ...
|
14
|
+
between_and_: Between ... and ...
|
15
|
+
today: Today
|
16
|
+
yesterday: Yesterday
|
17
|
+
this_week: This week
|
18
|
+
last_week: Last week
|
19
|
+
number: Number ...
|
20
|
+
contains: Contains
|
21
|
+
is_exactly: Is exactly
|
22
|
+
starts_with: Starts with
|
23
|
+
ends_with: Ends with
|
24
|
+
too_many_objects: "Too many objects, use search box above"
|
25
|
+
no_objects: "No objects found"
|
26
|
+
loading: "Loading..."
|
27
|
+
toggle_navigation: Toggle navigation
|
data/config/routes.rb
ADDED
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_admin_ui_layout_taris
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.7
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gabriele Tassoni
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thecore
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: selectize-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.11'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.11'
|
41
|
+
description: Custom layouts.
|
42
|
+
email:
|
43
|
+
- gabrieletassoni@taris.it
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- app/assets/javascripts/rails_admin/custom/timer.js
|
52
|
+
- app/assets/javascripts/rails_admin/custom/ui.js
|
53
|
+
- app/assets/javascripts/rails_admin/ra.widgets.coffee
|
54
|
+
- app/assets/stylesheets/rails_admin/custom/flashing.scss
|
55
|
+
- app/assets/stylesheets/rails_admin/custom/theming.scss
|
56
|
+
- app/assets/stylesheets/rails_admin/custom/togglable-sidebar.scss
|
57
|
+
- app/views/layouts/rails_admin/_navigation.html.haml
|
58
|
+
- app/views/layouts/rails_admin/_secondary_navigation.html.haml
|
59
|
+
- app/views/layouts/rails_admin/_sidebar_navigation.html.haml
|
60
|
+
- app/views/layouts/rails_admin/_user_navigation.html.haml
|
61
|
+
- app/views/layouts/rails_admin/application.html.haml
|
62
|
+
- app/views/layouts/rails_admin/pjax.html.haml
|
63
|
+
- app/views/rails_admin/main/_modal_interaction.html.erb
|
64
|
+
- config/locales/en.main.yml
|
65
|
+
- config/locales/it.main.yml
|
66
|
+
- config/routes.rb
|
67
|
+
- lib/rails_admin_ui_layout_taris.rb
|
68
|
+
- lib/rails_admin_ui_layout_taris/engine.rb
|
69
|
+
- lib/rails_admin_ui_layout_taris/version.rb
|
70
|
+
- lib/tasks/rails_admin_ui_layout_taris_tasks.rake
|
71
|
+
homepage: https://www.taris.it
|
72
|
+
licenses:
|
73
|
+
- MIT
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.6.14
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: Layout for Rails Admin customized by Taris.
|
95
|
+
test_files: []
|