active_administration 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +2 -1
  4. data/active_administration.gemspec +2 -1
  5. data/app/assets/javascripts/active_administration/README.md +0 -0
  6. data/app/assets/javascripts/active_administration/metro-accordion.js +70 -0
  7. data/app/assets/javascripts/active_administration/metro-button-set.js +88 -0
  8. data/app/assets/javascripts/active_administration/metro-calendar.js +437 -0
  9. data/app/assets/javascripts/active_administration/metro-carousel.js +304 -0
  10. data/app/assets/javascripts/active_administration/metro-core.js +39 -0
  11. data/app/assets/javascripts/active_administration/metro-countdown.js +200 -0
  12. data/app/assets/javascripts/active_administration/metro-date-format.js +137 -0
  13. data/app/assets/javascripts/active_administration/metro-datepicker.js +138 -0
  14. data/app/assets/javascripts/active_administration/metro-dialog.js +221 -0
  15. data/app/assets/javascripts/active_administration/metro-drag-tile.js +46 -0
  16. data/app/assets/javascripts/active_administration/metro-dropdown.js +112 -0
  17. data/app/assets/javascripts/active_administration/metro-fluentmenu.js +57 -0
  18. data/app/assets/javascripts/active_administration/metro-global.js +4 -0
  19. data/app/assets/javascripts/active_administration/metro-hint.js +104 -0
  20. data/app/assets/javascripts/active_administration/metro-initiator.js +271 -0
  21. data/app/assets/javascripts/active_administration/metro-input-control.js +318 -0
  22. data/app/assets/javascripts/active_administration/metro-listview.js +53 -0
  23. data/app/assets/javascripts/active_administration/metro-live-tile.js +162 -0
  24. data/app/assets/javascripts/active_administration/metro-loader.js +46 -0
  25. data/app/assets/javascripts/active_administration/metro-locale.js +132 -0
  26. data/app/assets/javascripts/active_administration/metro-notify.js +120 -0
  27. data/app/assets/javascripts/active_administration/metro-panel.js +41 -0
  28. data/app/assets/javascripts/active_administration/metro-plugin-template.js +21 -0
  29. data/app/assets/javascripts/active_administration/metro-progressbar.js +97 -0
  30. data/app/assets/javascripts/active_administration/metro-pull.js +38 -0
  31. data/app/assets/javascripts/active_administration/metro-rating.js +99 -0
  32. data/app/assets/javascripts/active_administration/metro-scroll.js +756 -0
  33. data/app/assets/javascripts/active_administration/metro-slider.js +304 -0
  34. data/app/assets/javascripts/active_administration/metro-stepper.js +105 -0
  35. data/app/assets/javascripts/active_administration/metro-streamer.js +214 -0
  36. data/app/assets/javascripts/active_administration/metro-tab-control.js +96 -0
  37. data/app/assets/javascripts/active_administration/metro-table.js +74 -0
  38. data/app/assets/javascripts/active_administration/metro-tile-transform.js +65 -0
  39. data/app/assets/javascripts/active_administration/metro-times.js +190 -0
  40. data/app/assets/javascripts/active_administration/metro-touch-handler.js +65 -0
  41. data/app/assets/javascripts/active_administration/metro-treeview.js +64 -0
  42. data/app/assets/javascripts/active_administration/metro-wizard.js +148 -0
  43. data/app/assets/stylesheets/active_administration/accordion.less +64 -0
  44. data/app/assets/stylesheets/active_administration/balloon.less +88 -0
  45. data/app/assets/stylesheets/active_administration/breadcrumbs.less +118 -0
  46. data/app/assets/stylesheets/active_administration/buttons.less +383 -0
  47. data/app/assets/stylesheets/active_administration/calendar.less +123 -0
  48. data/app/assets/stylesheets/active_administration/carousel.less +118 -0
  49. data/app/assets/stylesheets/active_administration/colors.less +589 -0
  50. data/app/assets/stylesheets/active_administration/countdown.less +57 -0
  51. data/app/assets/stylesheets/active_administration/dataTables.less +134 -0
  52. data/app/assets/stylesheets/active_administration/fluent-menu.less +231 -0
  53. data/app/assets/stylesheets/active_administration/forms.less +414 -0
  54. data/app/assets/stylesheets/active_administration/funcs.less +178 -0
  55. data/app/assets/stylesheets/active_administration/grid.less +91 -0
  56. data/app/assets/stylesheets/active_administration/hint.less +120 -0
  57. data/app/assets/stylesheets/active_administration/iconFont-content.less +1353 -0
  58. data/app/assets/stylesheets/active_administration/iconFont.less +47 -0
  59. data/app/assets/stylesheets/active_administration/icons.less +10 -0
  60. data/app/assets/stylesheets/active_administration/images.less +75 -0
  61. data/app/assets/stylesheets/active_administration/layout.less +137 -0
  62. data/app/assets/stylesheets/active_administration/lists.less +258 -0
  63. data/app/assets/stylesheets/active_administration/menus.less +469 -0
  64. data/app/assets/stylesheets/active_administration/metro-bootstrap-responsive.less +300 -0
  65. data/app/assets/stylesheets/active_administration/metro-bootstrap.less +68 -0
  66. data/app/assets/stylesheets/active_administration/misc.less +72 -0
  67. data/app/assets/stylesheets/active_administration/navigation-bar.less +317 -0
  68. data/app/assets/stylesheets/active_administration/notice.less +52 -0
  69. data/app/assets/stylesheets/active_administration/notify.less +43 -0
  70. data/app/assets/stylesheets/active_administration/pagination.less +83 -0
  71. data/app/assets/stylesheets/active_administration/panels.less +38 -0
  72. data/app/assets/stylesheets/active_administration/progress-bar.less +25 -0
  73. data/app/assets/stylesheets/active_administration/rating.less +103 -0
  74. data/app/assets/stylesheets/active_administration/reset.less +219 -0
  75. data/app/assets/stylesheets/active_administration/scroll.less +141 -0
  76. data/app/assets/stylesheets/active_administration/sidebar.less +158 -0
  77. data/app/assets/stylesheets/active_administration/slider.less +106 -0
  78. data/app/assets/stylesheets/active_administration/stepper.less +80 -0
  79. data/app/assets/stylesheets/active_administration/streamer.less +250 -0
  80. data/app/assets/stylesheets/active_administration/tab-control.less +79 -0
  81. data/app/assets/stylesheets/active_administration/tables.less +170 -0
  82. data/app/assets/stylesheets/active_administration/tiles.less +599 -0
  83. data/app/assets/stylesheets/active_administration/transform.less +23 -0
  84. data/app/assets/stylesheets/active_administration/treeview.less +96 -0
  85. data/app/assets/stylesheets/active_administration/typography.less +382 -0
  86. data/app/assets/stylesheets/active_administration/utils.less +180 -0
  87. data/app/assets/stylesheets/active_administration/variables.less +250 -0
  88. data/app/assets/stylesheets/active_administration/window.less +225 -0
  89. data/app/assets/stylesheets/active_administration/wizard.less +53 -0
  90. data/lib/active_admin/version.rb +1 -1
  91. metadata +103 -10
@@ -0,0 +1,46 @@
1
+ var plugins = [
2
+ 'global',
3
+ 'core',
4
+ 'locale',
5
+ 'touch-handler',
6
+
7
+ 'accordion',
8
+ 'button-set',
9
+ 'date-format',
10
+ 'calendar',
11
+ 'datepicker',
12
+ 'carousel',
13
+ 'countdown',
14
+ 'dropdown',
15
+ 'input-control',
16
+ 'live-tile',
17
+
18
+ 'progressbar',
19
+ 'rating',
20
+ 'slider',
21
+ 'tab-control',
22
+ 'table',
23
+ 'times',
24
+ 'dialog',
25
+ 'notify',
26
+ 'listview',
27
+ 'treeview',
28
+ 'fluentmenu',
29
+ 'hint',
30
+ 'streamer',
31
+ 'stepper',
32
+ 'drag-tile',
33
+ 'scroll',
34
+ 'pull',
35
+ 'wizard',
36
+ 'panel',
37
+ 'tile-transform',
38
+
39
+ 'initiator'
40
+
41
+
42
+ ];
43
+
44
+ $.each(plugins, function(i, plugin){
45
+ $("<script/>").attr('src', 'js/metro/metro-'+plugin+'.js').appendTo($('head'));
46
+ });
@@ -0,0 +1,132 @@
1
+ (function($){
2
+ $.Metro.currentLocale = 'en';
3
+
4
+ if (METRO_LOCALE != undefined) $.Metro.currentLocale = METRO_LOCALE; else $.Metro.currentLocale = 'en';
5
+ //console.log(METRO_LOCALE, $.Metro.currentLocale);
6
+
7
+ $.Metro.Locale = {
8
+ 'en': {
9
+ months: [
10
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December",
11
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
12
+ ],
13
+ days: [
14
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
15
+ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"
16
+ ],
17
+ buttons: [
18
+ "Today", "Clear", "Cancel", "Help", "Prior", "Next", "Finish"
19
+ ]
20
+ },
21
+ 'fr': {
22
+ months: [
23
+ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre",
24
+ "Jan", "Fév", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc"
25
+ ],
26
+ days: [
27
+ "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi",
28
+ "Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"
29
+ ],
30
+ buttons: [
31
+ "Aujourd'hui", "Effacer", "Annuler", "Aide", "Précedent", "Suivant", "Fin"
32
+ ]
33
+ },
34
+ 'nl': {
35
+ months: [
36
+ "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December",
37
+ "Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"
38
+ ],
39
+ days: [
40
+ "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag",
41
+ "Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"
42
+ ],
43
+ buttons: [
44
+ "Vandaag", "Verwijderen", "Annuleren", "Hulp", "Vorige", "Volgende", "Einde"
45
+ ]
46
+ },
47
+ 'ua': {
48
+ months: [
49
+ "Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень",
50
+ "Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"
51
+ ],
52
+ days: [
53
+ "Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П’ятниця", "Субота",
54
+ "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
55
+ ],
56
+ buttons: [
57
+ "Сьогодні", "Очистити", "Скасувати", "Допомога", "Назад", "Вперед", "Готово"
58
+ ]
59
+ },
60
+ 'ru': {
61
+ months: [
62
+ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь",
63
+ "Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"
64
+ ],
65
+ days: [
66
+ "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота",
67
+ "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
68
+ ],
69
+ buttons: [
70
+ "Сегодня", "Очистить", "Отменить", "Помощь", "Назад", "Вперед", "Готово"
71
+ ]
72
+ },
73
+ /** By NoGrief (nogrief@gmail.com) */
74
+ 'zhCN': {
75
+ months: [
76
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月",
77
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
78
+ ],
79
+ days: [
80
+ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六",
81
+ "日", "一", "二", "三", "四", "五", "六"
82
+ ],
83
+ buttons: [
84
+ "今日", "清除", "Cancel", "Help", "Prior", "Next", "Finish"
85
+ ]
86
+ },
87
+ 'it': {
88
+ months: [
89
+ 'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre',
90
+ 'Gen',' Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'
91
+ ],
92
+ days: [
93
+ 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato', 'Domenica',
94
+ 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab', 'Dom'
95
+ ],
96
+ buttons: [
97
+ "Oggi", "Cancella", "Cancel", "Help", "Prior", "Next", "Finish"
98
+ ]
99
+ },
100
+ 'de': {
101
+ months: [
102
+ "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember",
103
+ "Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"
104
+ ],
105
+ days: [
106
+ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag",
107
+ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
108
+ ],
109
+ buttons: [
110
+ "Heute", "Zurücksetzen", "Abbrechen", "Hilfe", "Früher", "Später", "Fertig"
111
+ ]
112
+ },
113
+ /** By Javier Rodríguez (javier.rodriguez at fjrodriguez.com) */
114
+ 'es': {
115
+ months: [
116
+ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre",
117
+ "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sept", "Oct", "Nov", "Dic"
118
+ ],
119
+ days: [
120
+ "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado",
121
+ "Do", "Lu", "Mar", "Mié", "Jue", "Vi", "Sáb"
122
+ ],
123
+ buttons: [
124
+ "Hoy", "Limpiar", "Cancel", "Help", "Prior", "Next", "Finish"
125
+ ]
126
+ }
127
+ };
128
+
129
+ $.Metro.setLocale = function(locale, data){
130
+ $.Metro.Locale[locale] = data;
131
+ };
132
+ })(jQuery);
@@ -0,0 +1,120 @@
1
+ (function($) {
2
+ var _notify_container = false;
3
+ var _notifies = [];
4
+
5
+ var Notify = {
6
+
7
+ _container: null,
8
+ _notify: null,
9
+ _timer: null,
10
+ options: {
11
+ icon: '', // to be implemented
12
+ caption: '',
13
+ content: '',
14
+ shadow: true,
15
+ width: 'auto',
16
+ height: 'auto',
17
+ style: false, // {background: '', color: ''}
18
+ position: 'right', //right, left
19
+ timeout: 3000
20
+ },
21
+
22
+ init: function(options) {
23
+ this.options = $.extend({}, this.options, options);
24
+ this._build();
25
+ return this;
26
+ },
27
+
28
+ _build: function() {
29
+ this._container = _notify_container || $("<div/>").addClass("metro notify-container").appendTo('body');
30
+ _notify_container = this._container;
31
+ var o = this.options;
32
+
33
+ if (o.content == '' || o.content == undefined) return false;
34
+
35
+ this._notify = $("<div/>").addClass("notify");
36
+
37
+ if (o.shadow) this._notify.addClass("shadow");
38
+ if (o.style && o.style.background != undefined) this._notify.css("background-color", o.style.background);
39
+ if (o.style && o.style.color != undefined) this._notify.css("color", o.style.color);
40
+
41
+ // add title
42
+ if (o.caption != '' && o.caption != undefined) {
43
+ $("<div/>").addClass("caption").html(o.caption).appendTo(this._notify);
44
+ }
45
+ // add content
46
+ if (o.content != '' && o.content != undefined) {
47
+ $("<div/>").addClass("content").html(o.content).appendTo(this._notify);
48
+ }
49
+
50
+ if (o.width != 'auto') this._notify.css('min-width', o.width);
51
+ if (o.height != 'auto') this._notify.css('min-height', o.height);
52
+
53
+ this._notify.hide().appendTo(this._container).fadeIn('slow');
54
+ _notifies.push(this._notify);
55
+
56
+ this.close(o.timeout);
57
+
58
+ },
59
+
60
+ close: function(timeout) {
61
+ this.clear();
62
+ if(timeout == parseInt(timeout)) {
63
+ var self = this
64
+ this._timer = setTimeout(function() {
65
+ self._timer = null;
66
+ self._hide();
67
+ }, timeout);
68
+ return this;
69
+ } else if(timeout == undefined) {
70
+ return this._hide();
71
+ }
72
+ return this;
73
+ },
74
+
75
+ clear: function() {
76
+ if(this._timer != null) {
77
+ clearTimeout(this._timer);
78
+ this._timer = null;
79
+ return this;
80
+ } else {
81
+ return false;
82
+ }
83
+ },
84
+
85
+ _hide: function() {
86
+ this.clear();
87
+
88
+ if(this._notify != undefined) {
89
+ this._notify.hide('slow', function() {
90
+ this.remove();
91
+ _notifies.splice(_notifies.indexOf(this._notify), 1);
92
+ });
93
+ return this;
94
+ } else {
95
+ return false;
96
+ }
97
+ },
98
+
99
+ closeAll: function() {
100
+ _notifies.forEach(function(notEntry) {
101
+ notEntry.hide('slow', function() {
102
+ notEntry.remove();
103
+ _notifies.splice(_notifies.indexOf(notEntry), 1);
104
+ });
105
+ });
106
+ return this;
107
+ }
108
+ };
109
+
110
+ $.Notify = function(options) {
111
+ return Object.create(Notify).init(options);
112
+ }
113
+ $.Notify.show = function(message, title) {
114
+ return $.Notify({
115
+ content: message,
116
+ caption: title
117
+ });
118
+ };
119
+
120
+ })(jQuery);
@@ -0,0 +1,41 @@
1
+ (function( $ ) {
2
+ $.widget("metro.panel", {
3
+
4
+ version: "1.0.0",
5
+
6
+ options: {
7
+ onCollapse: function(){},
8
+ onExpand: function(){}
9
+ },
10
+
11
+ _create: function(){
12
+ var element = this.element, o = this.options,
13
+ header = element.children('.panel-header'),
14
+ content = element.children('.panel-content');
15
+
16
+ header.on('click', function(){
17
+ content.slideToggle(
18
+ 'fast',
19
+ function(){
20
+ element.toggleClass('collapsed');
21
+ if (element.hasClass('collapsed')) {
22
+ o.onCollapse();
23
+ } else {
24
+ o.onExpand();
25
+ }
26
+ }
27
+ );
28
+ });
29
+ },
30
+
31
+ _destroy: function(){
32
+
33
+ },
34
+
35
+ _setOption: function(key, value){
36
+ this._super('_setOption', key, value);
37
+ }
38
+ })
39
+ })( jQuery );
40
+
41
+
@@ -0,0 +1,21 @@
1
+ (function( $ ) {
2
+ $.widget("metro.widget", {
3
+
4
+ version: "1.0.0",
5
+
6
+ options: {
7
+ },
8
+
9
+ _create: function(){
10
+ },
11
+
12
+ _destroy: function(){
13
+
14
+ },
15
+
16
+ _setOption: function(key, value){
17
+ this._super('_setOption', key, value);
18
+ }
19
+ })
20
+ })( jQuery );
21
+
@@ -0,0 +1,97 @@
1
+ (function( $ ) {
2
+ $.widget("metro.progressbar", {
3
+
4
+ version: "1.0.1",
5
+
6
+ options: {
7
+ value: 0,
8
+ color: "bg-cyan",
9
+ animate: false,
10
+ max: 100,
11
+ onchange: function(val){}
12
+ },
13
+
14
+ _create: function(){
15
+ var that = this,
16
+ element = this.element,
17
+ o = this.options;
18
+
19
+ if (element.data('value') != undefined) {
20
+ this.value(element.data('value')+'%');
21
+ }
22
+
23
+ if (element.data('color') != undefined) {
24
+ o.color = element.data('color');
25
+ }
26
+
27
+ if (element.data('animate') != undefined) {
28
+ o.animate = element.data('animate');
29
+ }
30
+
31
+ if (element.data('max') != undefined) {
32
+ o.max = element.data('max');
33
+ }
34
+ o.max = o.max < 0 ? 0 : o.max;
35
+ o.max = o.max > 100 ? 100 : o.max;
36
+
37
+ this._showBar();
38
+ },
39
+
40
+ _showBar: function(newVal){
41
+ //Default parameters
42
+ newVal = newVal || this.options.value;
43
+
44
+ var element = this.element;
45
+
46
+ element.html('');
47
+
48
+ var bar = $("<div />");
49
+ bar.addClass("bar");
50
+ if (this.options.color.indexOf("bg-")+1)
51
+ bar.addClass(this.options.color);
52
+ else {
53
+ bar.css('background', this.options.color);
54
+ }
55
+ bar.appendTo(element);
56
+ if (this.options.animate) {
57
+ bar.css('width', this.value() + '%').animate({ width: newVal + '%' });
58
+ } else {
59
+ bar.css('width', newVal + '%');
60
+ }
61
+
62
+ this.options.onchange(this.value());
63
+ },
64
+
65
+ value: function(val){
66
+ if (val != undefined) {
67
+ var parsedVal = parseInt(val);
68
+ parsedVal = parsedVal > this.max ? this.max : parsedVal;
69
+ parsedVal = parsedVal < 0 ? 0 : parsedVal;
70
+ this._showBar(parsedVal);
71
+ this.options.value = parsedVal;
72
+ } else {
73
+ return parseInt(this.options.value);
74
+ }
75
+ },
76
+
77
+ color: function(color){
78
+ this.options.color = color;
79
+
80
+ if (this.options.color.indexOf("bg-")+1)
81
+ this.element.find(".bar").addClass(this.options.color);
82
+ else {
83
+ this.element.find(".bar").css('background', this.options.color);
84
+ }
85
+ this._showBar();
86
+ },
87
+
88
+ _destroy: function(){
89
+
90
+ },
91
+
92
+ _setOption: function(key, value){
93
+ this._super('_setOption', key, value);
94
+ }
95
+ })
96
+ })( jQuery );
97
+