dynamic_scaffold 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +465 -0
- data/Rakefile +32 -0
- data/app/assets/config/dynamic_scaffold_manifest.js +0 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/README.md +9 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/angle-double-down.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/angle-double-up.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/chevron-down.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/chevron-left.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/chevron-right.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/chevron-up.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/exclamation-circle.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/hdd.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/pencil-alt.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/plus.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/step-backward.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/step-forward.svg +1 -0
- data/app/assets/images/dynamic_scaffold/fontawesome/times.svg +1 -0
- data/app/assets/javascripts/dynamic_scaffold/common.js +95 -0
- data/app/assets/javascripts/dynamic_scaffold/delete.js +57 -0
- data/app/assets/javascripts/dynamic_scaffold/pagination.js +26 -0
- data/app/assets/javascripts/dynamic_scaffold/sorter.js +120 -0
- data/app/assets/javascripts/dynamic_scaffold.js +4 -0
- data/app/assets/stylesheets/dynamic_scaffold/bootstrap3.scss +22 -0
- data/app/assets/stylesheets/dynamic_scaffold/bootstrap4.scss +34 -0
- data/app/assets/stylesheets/dynamic_scaffold/common.scss +130 -0
- data/app/assets/stylesheets/dynamic_scaffold/resplist.scss +155 -0
- data/app/views/dynamic_scaffold/bootstrap/_edit.html.erb +1 -0
- data/app/views/dynamic_scaffold/bootstrap/_form.html.erb +53 -0
- data/app/views/dynamic_scaffold/bootstrap/_list.html.erb +88 -0
- data/app/views/dynamic_scaffold/bootstrap/_new.html.erb +1 -0
- data/app/views/dynamic_scaffold/bootstrap/_pagination.html.erb +5 -0
- data/app/views/dynamic_scaffold/bootstrap/_save_order.html.erb +7 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_first_page.html.erb +7 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_gap.html.erb +3 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_last_page.html.erb +7 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_next_page.html.erb +7 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_page.html.erb +9 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_paginator.html.erb +17 -0
- data/app/views/dynamic_scaffold/bootstrap/kaminari/_prev_page.html.erb +7 -0
- data/config/locales/en.yml +19 -0
- data/config/locales/ja.yml +28 -0
- data/config/routes.rb +2 -0
- data/lib/dynamic_scaffold/config.rb +263 -0
- data/lib/dynamic_scaffold/controller.rb +116 -0
- data/lib/dynamic_scaffold/controller_utilities.rb +115 -0
- data/lib/dynamic_scaffold/engine.rb +18 -0
- data/lib/dynamic_scaffold/error/base.rb +6 -0
- data/lib/dynamic_scaffold/error/controller.rb +6 -0
- data/lib/dynamic_scaffold/error/invalid_icon.rb +6 -0
- data/lib/dynamic_scaffold/form/item/base.rb +106 -0
- data/lib/dynamic_scaffold/form/item/block.rb +16 -0
- data/lib/dynamic_scaffold/form/item/single_option.rb +21 -0
- data/lib/dynamic_scaffold/form/item/two_options.rb +28 -0
- data/lib/dynamic_scaffold/form/item/two_options_with_block.rb +19 -0
- data/lib/dynamic_scaffold/icons/fontawesome.rb +47 -0
- data/lib/dynamic_scaffold/list/item.rb +35 -0
- data/lib/dynamic_scaffold/routes.rb +23 -0
- data/lib/dynamic_scaffold/version.rb +3 -0
- data/lib/dynamic_scaffold.rb +12 -0
- data/lib/generators/dynamic_scaffold/USAGE +19 -0
- data/lib/generators/dynamic_scaffold/dynamic_scaffold_generator.rb +25 -0
- data/lib/generators/dynamic_scaffold/templates/controller.erb +100 -0
- data/lib/generators/dynamic_scaffold/templates/views/edit.erb +1 -0
- data/lib/generators/dynamic_scaffold/templates/views/index.erb +1 -0
- data/lib/generators/dynamic_scaffold/templates/views/new.erb +1 -0
- data/lib/tasks/dynamic_scaffold_tasks.rake +4 -0
- metadata +355 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
//closest
|
2
|
+
if (window.Element && !Element.prototype.closest) {
|
3
|
+
Element.prototype.closest =
|
4
|
+
function(s) {
|
5
|
+
var matches = (this.document || this.ownerDocument).querySelectorAll(s),
|
6
|
+
i,
|
7
|
+
el = this;
|
8
|
+
do {
|
9
|
+
i = matches.length;
|
10
|
+
while (--i >= 0 && matches.item(i) !== el) {};
|
11
|
+
} while ((i < 0) && (el = el.parentElement));
|
12
|
+
return el;
|
13
|
+
};
|
14
|
+
}
|
15
|
+
|
16
|
+
(function(){
|
17
|
+
var fireEvent = function(){
|
18
|
+
var event = document.createEvent("HTMLEvents");
|
19
|
+
event.initEvent('dynamic_scaffold:load', false, false)
|
20
|
+
document.dispatchEvent(event)
|
21
|
+
}
|
22
|
+
|
23
|
+
document.addEventListener('DOMContentLoaded', fireEvent)
|
24
|
+
document.addEventListener('turbolinks:load', function(e){
|
25
|
+
// Not fire after the initial page load
|
26
|
+
if (e.data.timing.visitEnd) fireEvent()
|
27
|
+
})
|
28
|
+
})()
|
29
|
+
|
30
|
+
// promise polyfill
|
31
|
+
// IE 11 has no Promise? Are you kidding?
|
32
|
+
// https://github.com/taylorhakes/promise-polyfill
|
33
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(0,function(){"use strict";function e(){}function n(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,f._immediateFn(function(){var i=1===e._state?n.onFulfilled:n.onRejected;if(null!==i){var r;try{r=i(e._value)}catch(e){return void o(n.promise,e)}t(n.promise,r)}else(1===e._state?t:o)(n.promise,e._value)})):e._deferreds.push(n)}function t(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if(n instanceof f)return e._state=3,e._value=n,void i(e);if("function"==typeof t)return void r(function(e,n){return function(){e.apply(n,arguments)}}(t,n),e)}e._state=1,e._value=n,i(e)}catch(n){o(e,n)}}function o(e,n){e._state=2,e._value=n,i(e)}function i(e){2===e._state&&0===e._deferreds.length&&f._immediateFn(function(){e._handled||f._unhandledRejectionFn(e._value)});for(var t=0,o=e._deferreds.length;o>t;t++)n(e,e._deferreds[t]);e._deferreds=null}function r(e,n){var i=!1;try{e(function(e){i||(i=!0,t(n,e))},function(e){i||(i=!0,o(n,e))})}catch(e){if(i)return;i=!0,o(n,e)}}function f(e){if(!(this instanceof f))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],r(e,this)}var u=setTimeout,c=f.prototype;c.catch=function(e){return this.then(null,e)},c.then=function(t,o){var i=new this.constructor(e);return n(this,new function(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}(t,o,i)),i},f.all=function(e){return new f(function(n,t){function o(e,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(n){o(e,n)},t)}i[e]=f,0==--r&&n(i)}catch(e){t(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return n([]);for(var r=i.length,f=0;i.length>f;f++)o(f,i[f])})},f.resolve=function(e){return e&&"object"==typeof e&&e.constructor===f?e:new f(function(n){n(e)})},f.reject=function(e){return new f(function(n,t){t(e)})},f.race=function(e){return new f(function(n,t){for(var o=0,i=e.length;i>o;o++)e[o].then(n,t)})},f._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){u(e,0)},f._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==a)return a;throw Error("unable to locate global object")}();a.Promise||(a.Promise=f)});
|
34
|
+
|
35
|
+
//DynamicScaffold
|
36
|
+
window.DynamicScaffold = window.DynamicScaffold || {}
|
37
|
+
|
38
|
+
|
39
|
+
//createElement
|
40
|
+
window.DynamicScaffold.createElement = function(tagName, attributes, style, innerText){
|
41
|
+
const elem = document.createElement(tagName)
|
42
|
+
|
43
|
+
if(attributes){
|
44
|
+
for(var key in attributes){
|
45
|
+
elem.setAttribute(key, attributes[key])
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
if(style){
|
50
|
+
Object.assign(elem.style, style);
|
51
|
+
}
|
52
|
+
|
53
|
+
if(innerText){
|
54
|
+
elem.innerText = innerText
|
55
|
+
}
|
56
|
+
|
57
|
+
return elem
|
58
|
+
}
|
59
|
+
|
60
|
+
//confirm
|
61
|
+
;(function(){
|
62
|
+
window.DynamicScaffold.confirm = function(options){
|
63
|
+
const exists = document.querySelector('.dynamicScaffold-overlay')
|
64
|
+
if(exists){
|
65
|
+
return
|
66
|
+
}
|
67
|
+
|
68
|
+
const overlay = DynamicScaffold.createElement('div', {class: 'dynamicScaffold-overlay'})
|
69
|
+
const confirm = DynamicScaffold.createElement('div', {class: 'dynamicScaffold-confirm'})
|
70
|
+
const inner = DynamicScaffold.createElement('div', {class: 'dynamicScaffold-confirm-inner'})
|
71
|
+
overlay.appendChild(confirm)
|
72
|
+
confirm.appendChild(inner)
|
73
|
+
|
74
|
+
const message = DynamicScaffold.createElement('div', {class: 'dynamicScaffold-confirm-message'}, null, options.message)
|
75
|
+
inner.appendChild(message)
|
76
|
+
|
77
|
+
const ok = DynamicScaffold.createElement('button', {class: options.ok.class}, {}, options.ok.text)
|
78
|
+
const cancel = DynamicScaffold.createElement('button', {class: options.cancel.class}, {}, options.cancel.text)
|
79
|
+
const buttons = DynamicScaffold.createElement('div', {class: 'dynamicScaffold-confirm-buttons'})
|
80
|
+
buttons.appendChild(cancel)
|
81
|
+
buttons.appendChild(ok)
|
82
|
+
inner.appendChild(buttons)
|
83
|
+
document.body.appendChild(overlay)
|
84
|
+
|
85
|
+
ok.addEventListener('click', function(){
|
86
|
+
options.ok.action()
|
87
|
+
overlay.remove()
|
88
|
+
})
|
89
|
+
|
90
|
+
cancel.addEventListener('click', function(){
|
91
|
+
options.cancel.action()
|
92
|
+
overlay.remove()
|
93
|
+
})
|
94
|
+
}
|
95
|
+
})()
|
@@ -0,0 +1,57 @@
|
|
1
|
+
document.addEventListener('dynamic_scaffold:load', function (){
|
2
|
+
const csrfParam = document.querySelector('.authenticity_param_name')
|
3
|
+
if(!csrfParam) return
|
4
|
+
const csrfParamName = csrfParam.value
|
5
|
+
function submit(button){
|
6
|
+
const form = DynamicScaffold.createElement('form', {
|
7
|
+
method: 'post',
|
8
|
+
action: button.getAttribute('data-action'),
|
9
|
+
style: 'display: none;'
|
10
|
+
})
|
11
|
+
|
12
|
+
form.appendChild(DynamicScaffold.createElement('input', {
|
13
|
+
type: 'hidden',
|
14
|
+
name: csrfParamName,
|
15
|
+
value: document.querySelector('input[name=' + csrfParamName + ']').value
|
16
|
+
}))
|
17
|
+
|
18
|
+
form.appendChild(DynamicScaffold.createElement('input', {
|
19
|
+
type: 'hidden',
|
20
|
+
name: '_method',
|
21
|
+
value: 'delete'
|
22
|
+
}))
|
23
|
+
|
24
|
+
document.body.appendChild(form)
|
25
|
+
|
26
|
+
form.submit()
|
27
|
+
}
|
28
|
+
|
29
|
+
const buttons = document.querySelectorAll('.dynamicScaffoldJs-destory')
|
30
|
+
if(buttons.length === 0) return
|
31
|
+
|
32
|
+
const wrapper = buttons[0].closest('.dynamicScaffoldJs-item-wrapper')
|
33
|
+
Array.prototype.forEach.call(buttons, function(button){
|
34
|
+
const row = button.closest('.dynamicScaffoldJs-item-row')
|
35
|
+
button.addEventListener('click', function(e){
|
36
|
+
e.preventDefault()
|
37
|
+
row.classList.add('dynamicScaffold-destorying')
|
38
|
+
DynamicScaffold.confirm({
|
39
|
+
message: button.getAttribute('data-confirm-message'),
|
40
|
+
ok: {
|
41
|
+
text: wrapper.getAttribute('data-confirm-ok'),
|
42
|
+
class: wrapper.getAttribute('data-confirm-ok-class'),
|
43
|
+
action: function(){
|
44
|
+
submit(button)
|
45
|
+
}
|
46
|
+
},
|
47
|
+
cancel: {
|
48
|
+
text: wrapper.getAttribute('data-confirm-cancel'),
|
49
|
+
class: wrapper.getAttribute('data-confirm-cancel-class'),
|
50
|
+
action: function(){
|
51
|
+
row.classList.remove("dynamicScaffold-destorying")
|
52
|
+
}
|
53
|
+
}
|
54
|
+
})
|
55
|
+
})
|
56
|
+
})
|
57
|
+
})
|
@@ -0,0 +1,26 @@
|
|
1
|
+
document.addEventListener('dynamic_scaffold:load', function(){
|
2
|
+
function handlePagination(pagination){
|
3
|
+
const itemCount = pagination.children.lenth
|
4
|
+
const items = Array.prototype.filter.call(pagination.children, function(li){
|
5
|
+
return li.classList.contains('dynamicScaffoldJs-page-item')
|
6
|
+
})
|
7
|
+
|
8
|
+
const currentIndex = items.findIndex(function(li){
|
9
|
+
return li.classList.contains('current')
|
10
|
+
})
|
11
|
+
|
12
|
+
let distance = currentIndex - items.length + 1
|
13
|
+
items.forEach(function(li, index){
|
14
|
+
if(
|
15
|
+
distance != 0
|
16
|
+
){
|
17
|
+
li.classList.add('away-' + Math.abs(distance))
|
18
|
+
}
|
19
|
+
++distance
|
20
|
+
})
|
21
|
+
}
|
22
|
+
|
23
|
+
Array.prototype.forEach.call(document.querySelectorAll('.dynamicScaffoldJs-pagination'), function(pagination){
|
24
|
+
handlePagination(pagination)
|
25
|
+
})
|
26
|
+
})
|
@@ -0,0 +1,120 @@
|
|
1
|
+
document.addEventListener('dynamic_scaffold:load', function(){
|
2
|
+
const promises = []
|
3
|
+
const allButtons = []
|
4
|
+
|
5
|
+
function swapAnimation(promises, source, target){
|
6
|
+
promises.push(new Promise(function(resolve){
|
7
|
+
source.dynamicScaffoldSortingResolver = resolve
|
8
|
+
sourceRect = source.getBoundingClientRect()
|
9
|
+
targetRect = target.getBoundingClientRect()
|
10
|
+
|
11
|
+
//Calculate the duration according to the moving distance.
|
12
|
+
const distance = targetRect.top - sourceRect.top
|
13
|
+
const durationBase = 200
|
14
|
+
const durationFactor = Math.abs(distance) * 0.03
|
15
|
+
const duration = Math.min(durationBase + durationFactor, 600)
|
16
|
+
|
17
|
+
source.style.transition = 'all ' + duration + 'ms cubic-bezier(1.0, 0, 0.25, 1.0)'
|
18
|
+
source.style.transform = 'translateY(' + distance + 'px)'
|
19
|
+
}))
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
*
|
24
|
+
* @param NodeList button elements.
|
25
|
+
* @param Function Function that returns the element to move to.
|
26
|
+
* @param Function Function to register animation other than the source element.
|
27
|
+
* @param Function Function for swapping elements.
|
28
|
+
*/
|
29
|
+
function addClickEvent(buttons, getTarget, otherSideAnimation, swapElement){
|
30
|
+
Array.prototype.forEach.call(buttons, function(button){
|
31
|
+
allButtons.push(button)
|
32
|
+
button.addEventListener('click', function(e){
|
33
|
+
e.preventDefault()
|
34
|
+
|
35
|
+
// Ignore while animating
|
36
|
+
if(promises.length) return
|
37
|
+
|
38
|
+
const source = button.closest('.dynamicScaffoldJs-item-row')
|
39
|
+
source.style.position = 'relative'
|
40
|
+
source.style.zIndex = 1000
|
41
|
+
|
42
|
+
// Top or bottom.
|
43
|
+
const target = getTarget(source)
|
44
|
+
if(!target) return
|
45
|
+
|
46
|
+
// Start animation source to target
|
47
|
+
if(source != target){
|
48
|
+
swapAnimation(promises, source, target)
|
49
|
+
}
|
50
|
+
|
51
|
+
otherSideAnimation(promises, source, target)
|
52
|
+
|
53
|
+
if(promises.length){
|
54
|
+
allButtons.forEach(function(btn){ btn.disabled = true })
|
55
|
+
}
|
56
|
+
|
57
|
+
// When both animations are finished
|
58
|
+
Promise.all(promises).then(function(values){
|
59
|
+
source.style.zIndex = ''
|
60
|
+
source.style.position = ''
|
61
|
+
values.forEach(function(row){
|
62
|
+
row.style.transition = 'none'
|
63
|
+
row.style.transform = 'translateY(0px)'
|
64
|
+
})
|
65
|
+
swapElement(source, target)
|
66
|
+
promises.length = 0
|
67
|
+
allButtons.forEach(function(btn){ btn.disabled = false })
|
68
|
+
})
|
69
|
+
})
|
70
|
+
})
|
71
|
+
}
|
72
|
+
|
73
|
+
function otherSideAnimationForUp(promises, source, target){
|
74
|
+
while(true){
|
75
|
+
if(target == source) break
|
76
|
+
swapAnimation(promises, target, target.nextElementSibling)
|
77
|
+
target = target.nextElementSibling
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
function otherSideAnimationForDown(promises, source, target){
|
82
|
+
while(true){
|
83
|
+
if(target == source) break
|
84
|
+
swapAnimation(promises, target, target.previousElementSibling)
|
85
|
+
target = target.previousElementSibling
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
// Register `transitionend` event in all the rows.
|
90
|
+
Array.prototype.forEach.call(document.querySelectorAll('.dynamicScaffoldJs-item-row'), function(row){
|
91
|
+
row.addEventListener('transitionend', function(e){
|
92
|
+
if(e.target == row) row.dynamicScaffoldSortingResolver(row)
|
93
|
+
})
|
94
|
+
})
|
95
|
+
|
96
|
+
// Register events on each button.
|
97
|
+
addClickEvent(document.querySelectorAll('.dynamicScaffoldJs-sorter-top'), function(source){
|
98
|
+
return document.querySelector('.dynamicScaffoldJs-item-row:first-child')
|
99
|
+
}, otherSideAnimationForUp, function(source, target){
|
100
|
+
source.parentNode.insertBefore(source, target)
|
101
|
+
})
|
102
|
+
|
103
|
+
addClickEvent(document.querySelectorAll('.dynamicScaffoldJs-sorter-up'), function(source){
|
104
|
+
return source.previousElementSibling
|
105
|
+
}, otherSideAnimationForUp, function(source, target){
|
106
|
+
source.parentNode.insertBefore(source, target)
|
107
|
+
})
|
108
|
+
|
109
|
+
addClickEvent(document.querySelectorAll('.dynamicScaffoldJs-sorter-down'), function(source){
|
110
|
+
return source.nextElementSibling
|
111
|
+
}, otherSideAnimationForDown, function(source, target){
|
112
|
+
source.parentNode.insertBefore(target, source)
|
113
|
+
})
|
114
|
+
|
115
|
+
addClickEvent(document.querySelectorAll('.dynamicScaffoldJs-sorter-bottom'), function(source){
|
116
|
+
return document.querySelector('.dynamicScaffoldJs-item-row:last-child')
|
117
|
+
}, otherSideAnimationForDown, function(source, target){
|
118
|
+
source.parentNode.insertBefore(source, null)
|
119
|
+
})
|
120
|
+
})
|
@@ -0,0 +1,22 @@
|
|
1
|
+
@import 'common';
|
2
|
+
@import 'resplist';
|
3
|
+
|
4
|
+
.btn-default path{
|
5
|
+
fill: #333;
|
6
|
+
}
|
7
|
+
|
8
|
+
.btn-primary path{
|
9
|
+
fill: #fff;
|
10
|
+
}
|
11
|
+
|
12
|
+
.btn-warning path{
|
13
|
+
fill: #fff;
|
14
|
+
}
|
15
|
+
|
16
|
+
.page-item .page-link path{
|
17
|
+
fill: #337ab7;
|
18
|
+
}
|
19
|
+
|
20
|
+
.page-item.disabled .page-link path{
|
21
|
+
fill: #777;
|
22
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@import 'common';
|
2
|
+
@import 'resplist';
|
3
|
+
|
4
|
+
.btn-outline-primary path{
|
5
|
+
fill: #007bff;
|
6
|
+
}
|
7
|
+
|
8
|
+
.btn-outline-primary:hover path {
|
9
|
+
fill: #fff;
|
10
|
+
}
|
11
|
+
|
12
|
+
.btn-outline-secondary path{
|
13
|
+
fill: #868e96;
|
14
|
+
}
|
15
|
+
|
16
|
+
.btn-outline-secondary:hover path{
|
17
|
+
fill: #fff;
|
18
|
+
}
|
19
|
+
|
20
|
+
.btn-outline-warning path{
|
21
|
+
fill: #ffc107;
|
22
|
+
}
|
23
|
+
|
24
|
+
.btn-outline-warning:hover path{
|
25
|
+
fill: #fff;
|
26
|
+
}
|
27
|
+
|
28
|
+
.page-item .page-link path{
|
29
|
+
fill: #007bff;
|
30
|
+
}
|
31
|
+
|
32
|
+
.page-item.disabled .page-link path{
|
33
|
+
fill: #868e96;
|
34
|
+
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
.dynamicScaffold-row{
|
2
|
+
margin-bottom: 10px
|
3
|
+
}
|
4
|
+
|
5
|
+
.dynamicScaffold-error-message{
|
6
|
+
color: #dc3545;
|
7
|
+
|
8
|
+
}
|
9
|
+
|
10
|
+
.dynamicScaffold-error-message path{
|
11
|
+
fill: #dc3545;
|
12
|
+
}
|
13
|
+
|
14
|
+
.dynamicScaffold-destorying{
|
15
|
+
background-color: #fdd8df !important;
|
16
|
+
opacity: 0.6;
|
17
|
+
}
|
18
|
+
|
19
|
+
.dynamicScaffold-svg-icon{
|
20
|
+
width: 15px;
|
21
|
+
height: 15px;
|
22
|
+
vertical-align: baseline;
|
23
|
+
transform: translate(0, 3px);
|
24
|
+
}
|
25
|
+
|
26
|
+
@media (max-width: 1920px) {
|
27
|
+
.pagination .page-item.away-15 { display:none; }
|
28
|
+
}
|
29
|
+
|
30
|
+
@media (max-width: 1810px) {
|
31
|
+
.pagination .page-item.away-14 { display:none; }
|
32
|
+
}
|
33
|
+
|
34
|
+
@media (max-width: 1700px) {
|
35
|
+
.pagination .page-item.away-13 { display:none; }
|
36
|
+
}
|
37
|
+
|
38
|
+
@media (max-width: 1590px) {
|
39
|
+
.pagination .page-item.away-12 { display:none; }
|
40
|
+
}
|
41
|
+
|
42
|
+
@media (max-width: 1480px) {
|
43
|
+
.pagination .page-item.away-11 { display:none; }
|
44
|
+
}
|
45
|
+
|
46
|
+
@media (max-width: 1370px) {
|
47
|
+
.pagination .page-item.away-10 { display:none; }
|
48
|
+
}
|
49
|
+
|
50
|
+
@media (max-width: 1260px) {
|
51
|
+
.pagination .page-item.away-9 { display:none; }
|
52
|
+
}
|
53
|
+
|
54
|
+
@media (max-width: 1150px) {
|
55
|
+
.pagination .page-item.away-8 { display:none; }
|
56
|
+
}
|
57
|
+
|
58
|
+
@media (max-width: 1040px) {
|
59
|
+
.pagination .page-item.away-7 { display:none; }
|
60
|
+
}
|
61
|
+
|
62
|
+
@media (max-width: 930px) {
|
63
|
+
.pagination .page-item.away-6 { display:none; }
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
@media (max-width: 820px) {
|
68
|
+
.pagination .page-item.away-5 { display:none; }
|
69
|
+
}
|
70
|
+
|
71
|
+
@media (max-width: 710px) {
|
72
|
+
.pagination .page-item.away-4 { display:none; }
|
73
|
+
}
|
74
|
+
|
75
|
+
@media (max-width: 600px) {
|
76
|
+
.pagination .page-item.away-3 { display:none; }
|
77
|
+
}
|
78
|
+
|
79
|
+
@media (max-width: 490px) {
|
80
|
+
.pagination .page-item.away-2 { display:none; }
|
81
|
+
}
|
82
|
+
|
83
|
+
@media (max-width: 380px) {
|
84
|
+
.pagination .page-item.away-1 { display:none; }
|
85
|
+
}
|
86
|
+
|
87
|
+
.btn-danger path{
|
88
|
+
fill: #fff;
|
89
|
+
}
|
90
|
+
|
91
|
+
.dynamicScaffold-overlay{
|
92
|
+
position: fixed;
|
93
|
+
top: 0;
|
94
|
+
left: 0;
|
95
|
+
width: 100%;
|
96
|
+
height: 100%;
|
97
|
+
z-index: 10000;
|
98
|
+
background-color: rgba(0,0,0,0.2);
|
99
|
+
}
|
100
|
+
|
101
|
+
.dynamicScaffold-confirm{
|
102
|
+
position: fixed;
|
103
|
+
top: 40px;
|
104
|
+
width: 100%;
|
105
|
+
}
|
106
|
+
|
107
|
+
.dynamicScaffold-confirm-inner{
|
108
|
+
background-color: #fff;
|
109
|
+
border-radius: 10px;
|
110
|
+
box-shadow: 3px 3px 3px rgba(0,0,0,0.3);
|
111
|
+
border: 1px solid #ddd;
|
112
|
+
padding: 20px;
|
113
|
+
max-width: 380px;
|
114
|
+
width: 92%;
|
115
|
+
height: 140px;
|
116
|
+
margin: 0 auto;
|
117
|
+
}
|
118
|
+
|
119
|
+
.dynamicScaffold-confirm-message{
|
120
|
+
height: 68px;
|
121
|
+
font-size: 16px;
|
122
|
+
}
|
123
|
+
|
124
|
+
.dynamicScaffold-confirm-buttons{
|
125
|
+
text-align: right;
|
126
|
+
}
|
127
|
+
|
128
|
+
.dynamicScaffold-confirm-buttons .btn{
|
129
|
+
margin-left: 10px;
|
130
|
+
}
|
@@ -0,0 +1,155 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*<ul id="access-list" class="resplist resplist-striped">
|
3
|
+
<li class="resplist-row">
|
4
|
+
<div class="resplist-heading">Some Title</div>
|
5
|
+
<div class="resplist-items">
|
6
|
+
<div class="resplist-item resplist-item-xs">
|
7
|
+
<div class="resplist-label">ID</div>
|
8
|
+
<div class="resplist-value">1</div>
|
9
|
+
</div>
|
10
|
+
<div class="resplist-item resplist-item-md">
|
11
|
+
<div class="resplist-label">Name</div>
|
12
|
+
<div class="resplist-value">Micheal Jackson</div>
|
13
|
+
</div>
|
14
|
+
<div class="resplist-item resplist-item-md">
|
15
|
+
<div class="resplist-label">Born</div>
|
16
|
+
<div class="resplist-value">1958/8/29</div>
|
17
|
+
</div>
|
18
|
+
<div class="resplist-item resplist-item-md">
|
19
|
+
<div class="resplist-label">Died</div>
|
20
|
+
<div class="resplist-value">2009/6/25</div>
|
21
|
+
</div>
|
22
|
+
<div class="resplist-item resplist-item-md">
|
23
|
+
<div class="resplist-label">Occupations</div>
|
24
|
+
<div class="resplist-value">Musician, singer-songwriter, arranger, dancer, entertainer, choreographer, actor, businessman, philanthropist</div>
|
25
|
+
</div>
|
26
|
+
<div class="resplist-item pull-right">
|
27
|
+
<div class="resplist-value">
|
28
|
+
<div class="btn-group">
|
29
|
+
<a href="#" class="btn btn-primary">編集</a>
|
30
|
+
</div>
|
31
|
+
<div class="btn-group">
|
32
|
+
<button class="btn btn-default up-button"><i class="icon-chevron-up"></i></button>
|
33
|
+
<button class="btn btn-default down-button"><i class="icon-chevron-down"></i></button>
|
34
|
+
</div>
|
35
|
+
<div class="btn-group">
|
36
|
+
<button type="submit" class="btn btn-danger delete-button"><i class="icon-remove"></i></button>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div class="resplist-footer">Some Footer</div>
|
42
|
+
</li>
|
43
|
+
</ul>*/
|
44
|
+
.resplist-items:before, .resplist-item:before, .resplist-row:before, .resplist-items:after, .resplist-item:after, .resplist-row:after {
|
45
|
+
content: " ";
|
46
|
+
display: table;
|
47
|
+
}
|
48
|
+
.resplist-items:after, .resplist-item:after, .resplist-row:after {
|
49
|
+
clear: both;
|
50
|
+
}
|
51
|
+
|
52
|
+
ul.resplist {
|
53
|
+
list-style: none;
|
54
|
+
padding: 0;
|
55
|
+
border-collapse: separate;
|
56
|
+
}
|
57
|
+
|
58
|
+
.resplist-striped .resplist-row:nth-child(odd) {
|
59
|
+
background-color: #f9f9f9;
|
60
|
+
}
|
61
|
+
|
62
|
+
.resplist-heading {
|
63
|
+
font-weight: bold;
|
64
|
+
padding: 8px 20px;
|
65
|
+
overflow: hidden;
|
66
|
+
white-space: nowrap;
|
67
|
+
border-bottom: 1px dotted #dfdfdf;
|
68
|
+
max-width: 100%;
|
69
|
+
}
|
70
|
+
|
71
|
+
.resplist-footer {
|
72
|
+
padding: 8px 20px;
|
73
|
+
}
|
74
|
+
|
75
|
+
.resplist-label {
|
76
|
+
overflow: hidden;
|
77
|
+
white-space: nowrap;
|
78
|
+
font-size: 11px;
|
79
|
+
color: #888;
|
80
|
+
display: table;
|
81
|
+
padding: 0 20px;
|
82
|
+
height: 15px;
|
83
|
+
line-height: 15px;
|
84
|
+
}
|
85
|
+
|
86
|
+
.resplist-label-hidden {
|
87
|
+
background-color: transparent;
|
88
|
+
}
|
89
|
+
|
90
|
+
.resplist-value {
|
91
|
+
overflow: hidden;
|
92
|
+
white-space: nowrap;
|
93
|
+
font-size: 14px;
|
94
|
+
padding: 0 20px;
|
95
|
+
height: 38px;
|
96
|
+
display: table-cell;
|
97
|
+
vertical-align: middle;
|
98
|
+
}
|
99
|
+
|
100
|
+
.resplist-label + .resplist-value {
|
101
|
+
height: 22px;
|
102
|
+
line-height: 22px;
|
103
|
+
}
|
104
|
+
|
105
|
+
.resplist-item {
|
106
|
+
float: left;
|
107
|
+
max-width: 100%;
|
108
|
+
margin: 8px 0;
|
109
|
+
padding: 0;
|
110
|
+
overflow: hidden;
|
111
|
+
}
|
112
|
+
|
113
|
+
.resplist-row {
|
114
|
+
background-color: #fff;
|
115
|
+
border-top: 1px solid #dddddd;
|
116
|
+
padding: 0;
|
117
|
+
}
|
118
|
+
|
119
|
+
.resplist-item-xs {
|
120
|
+
width: 60px;
|
121
|
+
}
|
122
|
+
|
123
|
+
.resplist-item-sm {
|
124
|
+
width: 120px;
|
125
|
+
}
|
126
|
+
|
127
|
+
.resplist-item-md {
|
128
|
+
width: 180px;
|
129
|
+
}
|
130
|
+
|
131
|
+
.resplist-item-lg {
|
132
|
+
width: 240px;
|
133
|
+
}
|
134
|
+
|
135
|
+
@media (max-width: 768px) {
|
136
|
+
.resplist-heading {
|
137
|
+
padding: 8px 12px;
|
138
|
+
}
|
139
|
+
|
140
|
+
.resplist-footer {
|
141
|
+
padding: 8px 12px;
|
142
|
+
}
|
143
|
+
|
144
|
+
.resplist-item {
|
145
|
+
margin: 4px 0;
|
146
|
+
}
|
147
|
+
|
148
|
+
.resplist-label {
|
149
|
+
padding: 0 12px;
|
150
|
+
}
|
151
|
+
|
152
|
+
.resplist-value {
|
153
|
+
padding: 0 12px;
|
154
|
+
}
|
155
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'dynamic_scaffold/bootstrap/form', method: :patch, url: dynamic_scaffold_path(:update) %>
|