5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 13:26:22 +00:00

arrastrar y soltar posts

This commit is contained in:
f 2018-04-27 16:46:21 -03:00
parent 442a75da5d
commit 61e9378524
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
6 changed files with 88 additions and 2 deletions

View file

@ -22,4 +22,5 @@
//= require bootstrap-markdown/js/bootstrap-markdown //= require bootstrap-markdown/js/bootstrap-markdown
//= require markdown-it/dist/markdown-it //= require markdown-it/dist/markdown-it
//= require select2/dist/js/select2 //= require select2/dist/js/select2
//= require table-dragger/dist/table-dragger.js
//= require_tree . //= require_tree .

View file

@ -0,0 +1,7 @@
$(document).on('turbolinks:load', function() {
tableDragger(document.querySelector('.table-draggable'), {
mode: 'row',
onlyBody: true,
dragHandler: '.handle'
});
});

View file

@ -2,6 +2,7 @@
@import "bootstrap-markdown/css/bootstrap-markdown.min"; @import "bootstrap-markdown/css/bootstrap-markdown.min";
@import "font-awesome"; @import "font-awesome";
@import "select2/dist/css/select2"; @import "select2/dist/css/select2";
@import "dragula-with-animation/dist/dragula.css";
$footer-height: 60px; $footer-height: 60px;
@ -101,3 +102,7 @@ textarea.post-content {
.inline { .inline {
display: inline; display: inline;
} }
.sindu_dragger table {
background: transparent !important;
}

View file

@ -19,7 +19,7 @@
.row .row
.col .col
- if @posts.present? - if @posts.present?
%table.table.table-condensed.table-striped %table.table.table-condensed.table-striped.table-draggable
%tbody %tbody
- @posts.each do |post| - @posts.each do |post|
- if @category - if @category
@ -29,6 +29,8 @@
-# establecer la direccion del texto -# establecer la direccion del texto
- direction = post.get_front_matter(:dir) - direction = post.get_front_matter(:dir)
%tr %tr
%td
= fa_icon 'arrows-v', class: 'handle'
%td{class: direction} %td{class: direction}
= link_to post.title, site_post_path(@site, post, lang: @lang) = link_to post.title, site_post_path(@site, post, lang: @lang)
%br %br

View file

@ -9,6 +9,7 @@
"markdown-it": "^8.4.0", "markdown-it": "^8.4.0",
"marked": "^0.3.12", "marked": "^0.3.12",
"popper.js": "^1.12.9", "popper.js": "^1.12.9",
"select2": "^4.0.6-rc.1" "select2": "^4.0.6-rc.1",
"table-dragger": "^1.0.2"
} }
} }

View file

@ -16,10 +16,59 @@ argparse@^1.0.7:
dependencies: dependencies:
sprintf-js "~1.0.2" sprintf-js "~1.0.2"
atoa@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/atoa/-/atoa-1.0.0.tgz#0cc0e91a480e738f923ebc103676471779b34a49"
babel-runtime@^6.20.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.11.0"
"bootstrap-markdown@https://0xacab.org/itacate-kefir/bootstrap-markdown.git": "bootstrap-markdown@https://0xacab.org/itacate-kefir/bootstrap-markdown.git":
version "2.10.0" version "2.10.0"
resolved "https://0xacab.org/itacate-kefir/bootstrap-markdown.git#580184dc214ea2364fca0fdcb70e3c5e08bd5605" resolved "https://0xacab.org/itacate-kefir/bootstrap-markdown.git#580184dc214ea2364fca0fdcb70e3c5e08bd5605"
contra@1.9.4:
version "1.9.4"
resolved "https://registry.yarnpkg.com/contra/-/contra-1.9.4.tgz#f53bde42d7e5b5985cae4d99a8d610526de8f28d"
dependencies:
atoa "1.0.0"
ticky "1.0.1"
core-js@^2.4.0:
version "2.5.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b"
crossvent@1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/crossvent/-/crossvent-1.5.4.tgz#da2c4f8f40c94782517bf2beec1044148194ab92"
dependencies:
custom-event "1.0.0"
crossvent@^1.5.5:
version "1.5.5"
resolved "https://registry.yarnpkg.com/crossvent/-/crossvent-1.5.5.tgz#ad20878e4921e9be73d9d6976f8b2ecd0f71a0b1"
dependencies:
custom-event "^1.0.0"
custom-event@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.0.tgz#2e4628be19dc4b214b5c02630c5971e811618062"
custom-event@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425"
dragula-with-animation@^3.7.2:
version "3.7.2"
resolved "https://registry.yarnpkg.com/dragula-with-animation/-/dragula-with-animation-3.7.2.tgz#9b992db2a274324325c70bb0cb752e77e1faa8af"
dependencies:
contra "1.9.4"
crossvent "1.5.4"
entities@~1.1.1: entities@~1.1.1:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
@ -76,6 +125,14 @@ popper.js@^1.12.9:
version "1.12.9" version "1.12.9"
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.12.9.tgz#0dfbc2dff96c451bb332edcfcfaaf566d331d5b3" resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.12.9.tgz#0dfbc2dff96c451bb332edcfcfaaf566d331d5b3"
regenerator-runtime@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
rx@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"
select2@^4.0.6-rc.1: select2@^4.0.6-rc.1:
version "4.0.6-rc.1" version "4.0.6-rc.1"
resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.6-rc.1.tgz#aa6c3038a7f0f2e91ffade38f0a21c15e1813276" resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.6-rc.1.tgz#aa6c3038a7f0f2e91ffade38f0a21c15e1813276"
@ -87,6 +144,19 @@ sprintf-js@~1.0.2:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
table-dragger@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/table-dragger/-/table-dragger-1.0.2.tgz#981f46c62fd2899b3fc5e644055ea72831949707"
dependencies:
babel-runtime "^6.20.0"
crossvent "^1.5.5"
dragula-with-animation "^3.7.2"
rx "^4.1.0"
ticky@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ticky/-/ticky-1.0.1.tgz#b7cfa71e768f1c9000c497b9151b30947c50e46d"
uc.micro@^1.0.1, uc.micro@^1.0.3: uc.micro@^1.0.1, uc.micro@^1.0.3:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376"