Skip to content

Commit

Permalink
fix(table): fixed export error & improve row selector
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Mar 8, 2020
1 parent 121621f commit 5e8f888
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 91 deletions.
64 changes: 32 additions & 32 deletions adminlte/resource/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func resourceAssetsDistCssAllMinCss() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/all.min.css", size: 498161, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/all.min.css", size: 498161, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -134,7 +134,7 @@ func resourceAssetsDistCssBluePng() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/blue.png", size: 1132, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/blue.png", size: 1132, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -154,7 +154,7 @@ func resourceAssetsDistCssBlue2xPng() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/[email protected]", size: 1410, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/[email protected]", size: 1410, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -174,7 +174,7 @@ func resourceAssetsDistCssFonts6xk3dsbykcsvLcoeqqfx1ryoo3qok7gTtf() (*asset, err
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7g.ttf", size: 39456, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7g.ttf", size: 39456, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -194,7 +194,7 @@ func resourceAssetsDistCssFonts6xkydsbykcsvLcoeqqfx1ryoo3i54rwlxdrTtf() (*asset,
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdr.ttf", size: 39084, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdr.ttf", size: 39084, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -214,7 +214,7 @@ func resourceAssetsDistCssFonts6xkydsbykcsvLcoeqqfx1ryoo3ig4vwlxdrTtf() (*asset,
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdr.ttf", size: 39128, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdr.ttf", size: 39128, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -234,7 +234,7 @@ func resourceAssetsDistCssFonts6xkydsbykcsvLcoeqqfx1ryoo3ik4zwlxdrTtf() (*asset,
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdr.ttf", size: 39656, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/css/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdr.ttf", size: 39656, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -254,7 +254,7 @@ func resourceAssetsDistFonts6xk1dsbykcsvLcoeqqfx1ryoo3qpz7nsdcTtf() (*asset, err
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDc.ttf", size: 36616, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDc.ttf", size: 36616, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -274,7 +274,7 @@ func resourceAssetsDistFonts6xkwdsbykcsvLcoeqqfx1ryoo3qpzy4lcds18eTtf() (*asset,
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCds18E.ttf", size: 36536, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCds18E.ttf", size: 36536, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -294,7 +294,7 @@ func resourceAssetsDistFonts6xkwdsbykcsvLcoeqqfx1ryoo3qpzzmkids18eTtf() (*asset,
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkids18E.ttf", size: 36932, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkids18E.ttf", size: 36932, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -314,7 +314,7 @@ func resourceAssetsDistFontsFontawesomeOtf() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/FontAwesome.otf", size: 134808, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/FontAwesome.otf", size: 134808, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -334,7 +334,7 @@ func resourceAssetsDistFontsFontawesomeWebfontEot() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.eot", size: 165742, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.eot", size: 165742, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -354,7 +354,7 @@ func resourceAssetsDistFontsFontawesomeWebfontSvg() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.svg", size: 444379, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.svg", size: 444379, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -374,7 +374,7 @@ func resourceAssetsDistFontsFontawesomeWebfontTtf() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.ttf", size: 165548, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.ttf", size: 165548, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -394,7 +394,7 @@ func resourceAssetsDistFontsFontawesomeWebfontWoff() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.woff", size: 98024, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.woff", size: 98024, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -414,7 +414,7 @@ func resourceAssetsDistFontsFontawesomeWebfontWoff2() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.woff2", size: 77160, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/fontawesome-webfont.woff2", size: 77160, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -434,7 +434,7 @@ func resourceAssetsDistFontsGlyphiconsHalflingsRegularEot() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.eot", size: 20127, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.eot", size: 20127, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -454,7 +454,7 @@ func resourceAssetsDistFontsGlyphiconsHalflingsRegularSvg() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.svg", size: 108738, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.svg", size: 108738, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -474,7 +474,7 @@ func resourceAssetsDistFontsGlyphiconsHalflingsRegularTtf() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.ttf", size: 45404, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.ttf", size: 45404, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -494,7 +494,7 @@ func resourceAssetsDistFontsGlyphiconsHalflingsRegularWoff() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.woff", size: 23424, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.woff", size: 23424, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -514,7 +514,7 @@ func resourceAssetsDistFontsGlyphiconsHalflingsRegularWoff2() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.woff2", size: 18028, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/glyphicons-halflings-regular.woff2", size: 18028, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -534,7 +534,7 @@ func resourceAssetsDistFontsIoniconsTtf() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/ionicons.ttf", size: 188508, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/ionicons.ttf", size: 188508, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -554,7 +554,7 @@ func resourceAssetsDistFontsIoniconsWoff() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/fonts/ionicons.woff", size: 67904, mode: os.FileMode(493), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/fonts/ionicons.woff", size: 67904, mode: os.FileMode(493), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -574,7 +574,7 @@ func resourceAssetsDistImgAvatar04Png() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/img/avatar04.png", size: 8582, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/img/avatar04.png", size: 8582, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -594,7 +594,7 @@ func resourceAssetsDistImgClearPng() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/img/clear.png", size: 509, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/img/clear.png", size: 509, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -614,7 +614,7 @@ func resourceAssetsDistImgLoadingGif() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/img/loading.gif", size: 1849, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/img/loading.gif", size: 1849, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -634,7 +634,7 @@ func resourceAssetsDistJsAllMinJs() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/js/all.min.js", size: 388118, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/js/all.min.js", size: 388118, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -654,7 +654,7 @@ func resourceAssetsDistJsAll_2MinJs() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/js/all_2.min.js", size: 603443, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/js/all_2.min.js", size: 603443, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -674,7 +674,7 @@ func resourceAssetsDistJsContentMinJs() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/js/content.min.js", size: 31024, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/js/content.min.js", size: 31024, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -694,7 +694,7 @@ func resourceAssetsDistJsFormMinJs() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/js/form.min.js", size: 250177, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/js/form.min.js", size: 250177, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -714,7 +714,7 @@ func resourceAssetsDistJsHtml5shivMinJs() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/js/html5shiv.min.js", size: 2730, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/js/html5shiv.min.js", size: 2730, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand All @@ -734,7 +734,7 @@ func resourceAssetsDistJsRespondMinJs() (*asset, error) {
return nil, err
}

info := bindataFileInfo{name: "resource/assets/dist/js/respond.min.js", size: 4377, mode: os.FileMode(420), modTime: time.Unix(1583670092, 0)}
info := bindataFileInfo{name: "resource/assets/dist/js/respond.min.js", size: 4377, mode: os.FileMode(420), modTime: time.Unix(1583678953, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
Expand Down
30 changes: 21 additions & 9 deletions adminlte/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ var TemplateList = map[string]string{"admin_panel":`{{define "admin_panel"}}
iCheck(items);
iCheck($('.grid-row-checkbox'));
let columns = getQueryVariable("__columns");
if (columns === "") {
if (columns === -1) {
items.iCheck('check');
} else {
let columnsArr = columns.split(",");
Expand Down Expand Up @@ -1218,7 +1218,7 @@ var TemplateList = map[string]string{"admin_panel":`{{define "admin_panel"}}
let sort = getQueryVariable("__sort");
let sort_type = getQueryVariable("__sort_type");
if (sort !== "" && sort_type !== "") {
if (sort !== -1 && sort_type !== -1) {
let sortFa = $('#sort-' + sort);
if (sort_type === 'asc') {
sortFa.attr('href', '?__sort=' + sort + "&__sort_type=desc")
Expand All @@ -1237,14 +1237,20 @@ var TemplateList = map[string]string{"admin_panel":`{{define "admin_panel"}}
{{if ne .IsHideRowSelector true}}
$('.column-select-all').on('click', function () {
$('.column-select-item').iCheck('check');
if ($(this).data('check') === '') {
$('.column-select-item').iCheck('check');
$(this).data('check', 'true')
} else {
$('.column-select-item').iCheck('uncheck');
$(this).data('check', '')
}
});
$('.column-select-submit').on('click', function () {
let param = new Map();
param.set("__columns", selectedAllFieldsRows().join(","));
param.set(noAnimation, "true");
param.set('__columns', selectedAllFieldsRows().join(','));
param.set(noAnimation, 'true');
$.pjax({
url: addParameterToURL(param),
Expand All @@ -1267,7 +1273,10 @@ var TemplateList = map[string]string{"admin_panel":`{{define "admin_panel"}}
{{if .ExportUrl}}
$('.grid-batch-1').on('click', function () {
ExportAll(selectedRows().join())
let rows = selectedRows();
if (rows.length > 0) {
ExportAll(rows.join())
}
});
function ExportAll(id) {
Expand Down Expand Up @@ -1303,7 +1312,10 @@ var TemplateList = map[string]string{"admin_panel":`{{define "admin_panel"}}
});
$('.grid-batch-0').on('click', function () {
DeletePost(selectedRows().join())
let rows = selectedRows();
if (rows.length > 0) {
DeletePost(rows.join())
}
});
function DeletePost(id) {
Expand Down Expand Up @@ -1377,14 +1389,14 @@ var TemplateList = map[string]string{"admin_panel":`{{define "admin_panel"}}
return pair[1];
}
}
return "";
return -1;
}
function addParameterToURL(params) {
let newUrl = location.href.replace("#", "");
for (let [field, value] of params) {
if (getQueryVariable(field) !== '') {
if (getQueryVariable(field) !== -1) {
newUrl = replaceParamVal(newUrl, field, value);
} else {
if (newUrl.indexOf("?") > 0) {
Expand Down
Loading

0 comments on commit 5e8f888

Please sign in to comment.