@saltcorn/server 0.6.2-beta.1 → 0.6.2-beta.5
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.
- package/app.js +9 -13
- package/auth/admin.js +8 -24
- package/auth/roleadmin.js +6 -16
- package/auth/routes.js +113 -59
- package/locales/en.json +30 -1
- package/markup/admin.js +17 -0
- package/package.json +17 -8
- package/public/ckeditor/adapters/jquery.js +10 -0
- package/public/ckeditor/ckeditor.js +1286 -0
- package/public/ckeditor/config.js +38 -0
- package/public/ckeditor/contents.css +208 -0
- package/public/ckeditor/lang/af.js +5 -0
- package/public/ckeditor/lang/ar.js +5 -0
- package/public/ckeditor/lang/az.js +5 -0
- package/public/ckeditor/lang/bg.js +5 -0
- package/public/ckeditor/lang/bn.js +5 -0
- package/public/ckeditor/lang/bs.js +5 -0
- package/public/ckeditor/lang/ca.js +5 -0
- package/public/ckeditor/lang/cs.js +5 -0
- package/public/ckeditor/lang/cy.js +5 -0
- package/public/ckeditor/lang/da.js +5 -0
- package/public/ckeditor/lang/de-ch.js +5 -0
- package/public/ckeditor/lang/de.js +5 -0
- package/public/ckeditor/lang/el.js +5 -0
- package/public/ckeditor/lang/en-au.js +5 -0
- package/public/ckeditor/lang/en-ca.js +5 -0
- package/public/ckeditor/lang/en-gb.js +5 -0
- package/public/ckeditor/lang/en.js +5 -0
- package/public/ckeditor/lang/eo.js +5 -0
- package/public/ckeditor/lang/es-mx.js +5 -0
- package/public/ckeditor/lang/es.js +5 -0
- package/public/ckeditor/lang/et.js +5 -0
- package/public/ckeditor/lang/eu.js +5 -0
- package/public/ckeditor/lang/fa.js +5 -0
- package/public/ckeditor/lang/fi.js +5 -0
- package/public/ckeditor/lang/fo.js +5 -0
- package/public/ckeditor/lang/fr-ca.js +5 -0
- package/public/ckeditor/lang/fr.js +5 -0
- package/public/ckeditor/lang/gl.js +5 -0
- package/public/ckeditor/lang/gu.js +5 -0
- package/public/ckeditor/lang/he.js +5 -0
- package/public/ckeditor/lang/hi.js +5 -0
- package/public/ckeditor/lang/hr.js +5 -0
- package/public/ckeditor/lang/hu.js +5 -0
- package/public/ckeditor/lang/id.js +5 -0
- package/public/ckeditor/lang/is.js +5 -0
- package/public/ckeditor/lang/it.js +5 -0
- package/public/ckeditor/lang/ja.js +5 -0
- package/public/ckeditor/lang/ka.js +5 -0
- package/public/ckeditor/lang/km.js +5 -0
- package/public/ckeditor/lang/ko.js +5 -0
- package/public/ckeditor/lang/ku.js +5 -0
- package/public/ckeditor/lang/lt.js +5 -0
- package/public/ckeditor/lang/lv.js +5 -0
- package/public/ckeditor/lang/mk.js +5 -0
- package/public/ckeditor/lang/mn.js +5 -0
- package/public/ckeditor/lang/ms.js +5 -0
- package/public/ckeditor/lang/nb.js +5 -0
- package/public/ckeditor/lang/nl.js +5 -0
- package/public/ckeditor/lang/no.js +5 -0
- package/public/ckeditor/lang/oc.js +5 -0
- package/public/ckeditor/lang/pl.js +5 -0
- package/public/ckeditor/lang/pt-br.js +5 -0
- package/public/ckeditor/lang/pt.js +5 -0
- package/public/ckeditor/lang/ro.js +5 -0
- package/public/ckeditor/lang/ru.js +5 -0
- package/public/ckeditor/lang/si.js +5 -0
- package/public/ckeditor/lang/sk.js +5 -0
- package/public/ckeditor/lang/sl.js +5 -0
- package/public/ckeditor/lang/sq.js +5 -0
- package/public/ckeditor/lang/sr-latn.js +5 -0
- package/public/ckeditor/lang/sr.js +5 -0
- package/public/ckeditor/lang/sv.js +5 -0
- package/public/ckeditor/lang/th.js +5 -0
- package/public/ckeditor/lang/tr.js +5 -0
- package/public/ckeditor/lang/tt.js +5 -0
- package/public/ckeditor/lang/ug.js +5 -0
- package/public/ckeditor/lang/uk.js +5 -0
- package/public/ckeditor/lang/vi.js +5 -0
- package/public/ckeditor/lang/zh-cn.js +5 -0
- package/public/ckeditor/lang/zh.js +5 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/af.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/az.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/de-ch.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/en-au.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/en-gb.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/es-mx.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/eu.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/fo.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +10 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/oc.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +13 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/si.js +10 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/tt.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +12 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +11 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +9 -0
- package/public/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +9 -0
- package/public/ckeditor/plugins/about/dialogs/about.js +8 -0
- package/public/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- package/public/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- package/public/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- package/public/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- package/public/ckeditor/plugins/dialog/styles/dialog.css +18 -0
- package/public/ckeditor/plugins/icons.png +0 -0
- package/public/ckeditor/plugins/icons_hidpi.png +0 -0
- package/public/ckeditor/plugins/image/dialogs/image.js +44 -0
- package/public/ckeditor/plugins/image/images/noimage.png +0 -0
- package/public/ckeditor/plugins/link/dialogs/anchor.js +8 -0
- package/public/ckeditor/plugins/link/dialogs/link.js +30 -0
- package/public/ckeditor/plugins/link/images/anchor.png +0 -0
- package/public/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- package/public/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
- package/public/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
- package/public/ckeditor/plugins/magicline/images/icon-rtl.png +0 -0
- package/public/ckeditor/plugins/magicline/images/icon.png +0 -0
- package/public/ckeditor/plugins/pastefromgdocs/filter/default.js +8 -0
- package/public/ckeditor/plugins/pastefromlibreoffice/filter/default.js +11 -0
- package/public/ckeditor/plugins/pastefromword/filter/default.js +42 -0
- package/public/ckeditor/plugins/pastetools/filter/common.js +24 -0
- package/public/ckeditor/plugins/pastetools/filter/image.js +12 -0
- package/public/ckeditor/plugins/scayt/CHANGELOG.md +4 -0
- package/public/ckeditor/plugins/scayt/LICENSE.md +28 -0
- package/public/ckeditor/plugins/scayt/README.md +81 -0
- package/public/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
- package/public/ckeditor/plugins/scayt/dialogs/options.js +32 -0
- package/public/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
- package/public/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +25 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/af.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ar.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/az.js +10 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/bg.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ca.js +14 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/da.js +11 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/de-ch.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/en-au.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/en-ca.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/en-gb.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/es-mx.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/es.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/et.js +11 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/eu.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/fr-ca.js +10 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/fr.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/gl.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/he.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/hu.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/id.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ja.js +9 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/km.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ko.js +10 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/lt.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/oc.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/pt.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ro.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ru.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/si.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/sl.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/sq.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/sr-latn.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/sr.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/tt.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/uk.js +12 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/vi.js +14 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
- package/public/ckeditor/plugins/specialchar/dialogs/lang/zh.js +9 -0
- package/public/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
- package/public/ckeditor/plugins/table/dialogs/table.js +22 -0
- package/public/ckeditor/plugins/tableselection/styles/tableselection.css +36 -0
- package/public/ckeditor/plugins/tabletools/dialogs/tableCell.js +18 -0
- package/public/ckeditor/plugins/widget/images/handle.png +0 -0
- package/public/ckeditor/plugins/wsc/LICENSE.md +28 -0
- package/public/ckeditor/plugins/wsc/README.md +84 -0
- package/public/ckeditor/plugins/wsc/dialogs/ciframe.html +66 -0
- package/public/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- package/public/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
- package/public/ckeditor/plugins/wsc/dialogs/wsc.js +90 -0
- package/public/ckeditor/plugins/wsc/dialogs/wsc_ie.js +11 -0
- package/public/ckeditor/plugins/wsc/icons/hidpi/spellchecker.png +0 -0
- package/public/ckeditor/plugins/wsc/icons/spellchecker.png +0 -0
- package/public/ckeditor/plugins/wsc/lang/af.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ar.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/bg.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/bn.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/bs.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ca.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/cs.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/cy.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/da.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/de.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/el.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/en-au.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/en-ca.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/en-gb.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/en.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/eo.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/es.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/et.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/eu.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/fa.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/fi.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/fo.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/fr-ca.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/fr.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/gl.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/gu.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/he.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/hi.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/hr.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/hu.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/is.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/it.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ja.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ka.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/km.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ko.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ku.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/lt.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/lv.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/mk.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/mn.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ms.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/nb.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/nl.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/no.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/pl.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/pt-br.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/pt.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ro.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ru.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/sk.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/sl.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/sr-latn.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/sr.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/sv.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/th.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/tr.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/ug.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/uk.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/vi.js +2 -0
- package/public/ckeditor/plugins/wsc/lang/zh-cn.js +1 -0
- package/public/ckeditor/plugins/wsc/lang/zh.js +1 -0
- package/public/ckeditor/plugins/wsc/plugin.js +5 -0
- package/public/ckeditor/plugins/wsc/skins/moono-lisa/wsc.css +43 -0
- package/public/ckeditor/skins/moono-lisa/dialog.css +5 -0
- package/public/ckeditor/skins/moono-lisa/dialog_ie.css +5 -0
- package/public/ckeditor/skins/moono-lisa/dialog_ie8.css +5 -0
- package/public/ckeditor/skins/moono-lisa/dialog_iequirks.css +5 -0
- package/public/ckeditor/skins/moono-lisa/editor.css +5 -0
- package/public/ckeditor/skins/moono-lisa/editor_gecko.css +5 -0
- package/public/ckeditor/skins/moono-lisa/editor_ie.css +5 -0
- package/public/ckeditor/skins/moono-lisa/editor_ie8.css +5 -0
- package/public/ckeditor/skins/moono-lisa/editor_iequirks.css +5 -0
- package/public/ckeditor/skins/moono-lisa/icons.png +0 -0
- package/public/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/arrow.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/close.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/hidpi/close.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/hidpi/lock.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/hidpi/refresh.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/lock-open.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/lock.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/refresh.png +0 -0
- package/public/ckeditor/skins/moono-lisa/images/spinner.gif +0 -0
- package/public/ckeditor/skins/moono-lisa/readme.md +46 -0
- package/public/ckeditor/styles.js +137 -0
- package/public/ckeditor/vendor/promise.js +13 -0
- package/public/saltcorn.css +20 -3
- package/public/saltcorn.js +3 -0
- package/restart_watcher.js +12 -2
- package/routes/actions.js +1 -15
- package/routes/admin.js +6 -23
- package/routes/api.js +51 -60
- package/routes/config.js +0 -1
- package/routes/crashlog.js +1 -4
- package/routes/delete.js +1 -2
- package/routes/edit.js +1 -2
- package/routes/eventlog.js +2 -15
- package/routes/events.js +0 -1
- package/routes/fields.js +1 -9
- package/routes/files.js +144 -64
- package/routes/homepage.js +3 -0
- package/routes/infoarch.js +12 -19
- package/routes/library.js +1 -4
- package/routes/list.js +50 -6
- package/routes/menu.js +118 -32
- package/routes/packs.js +2 -8
- package/routes/page.js +1 -7
- package/routes/pageedit.js +18 -30
- package/routes/plugins.js +21 -34
- package/routes/scapi.js +155 -184
- package/routes/search.js +6 -10
- package/routes/settings.js +1 -2
- package/routes/tables.js +1 -22
- package/routes/tenant.js +1 -9
- package/routes/utils.js +19 -19
- package/routes/view.js +7 -5
- package/routes/viewedit.js +18 -29
- package/s3storage.js +167 -0
- package/tests/admin.test.js +4 -2
- package/wrapper.js +5 -1
package/routes/files.js
CHANGED
|
@@ -8,6 +8,7 @@ const Router = require("express-promise-router");
|
|
|
8
8
|
const File = require("@saltcorn/data/models/file");
|
|
9
9
|
const User = require("@saltcorn/data/models/user");
|
|
10
10
|
const { getState } = require("@saltcorn/data/db/state");
|
|
11
|
+
const s3storage = require("../s3storage");
|
|
11
12
|
|
|
12
13
|
const {
|
|
13
14
|
mkTable,
|
|
@@ -16,7 +17,7 @@ const {
|
|
|
16
17
|
post_btn,
|
|
17
18
|
post_delete_btn,
|
|
18
19
|
} = require("@saltcorn/markup");
|
|
19
|
-
const {
|
|
20
|
+
const { isAdmin, error_catcher } = require("./utils.js");
|
|
20
21
|
const {
|
|
21
22
|
span,
|
|
22
23
|
h5,
|
|
@@ -37,6 +38,11 @@ const {
|
|
|
37
38
|
const { csrfField } = require("./utils");
|
|
38
39
|
const { editRoleForm, fileUploadForm } = require("../markup/forms.js");
|
|
39
40
|
const { strictParseInt } = require("@saltcorn/data/plugin-helper");
|
|
41
|
+
const {
|
|
42
|
+
send_files_page,
|
|
43
|
+
config_fields_form,
|
|
44
|
+
save_config_from_form,
|
|
45
|
+
} = require("../markup/admin");
|
|
40
46
|
|
|
41
47
|
/**
|
|
42
48
|
* @type {object}
|
|
@@ -49,9 +55,9 @@ const router = new Router();
|
|
|
49
55
|
module.exports = router;
|
|
50
56
|
|
|
51
57
|
/**
|
|
52
|
-
* @param {*} file
|
|
53
|
-
* @param {*} roles
|
|
54
|
-
* @param {*} req
|
|
58
|
+
* @param {*} file
|
|
59
|
+
* @param {*} roles
|
|
60
|
+
* @param {*} req
|
|
55
61
|
* @returns {Form}
|
|
56
62
|
*/
|
|
57
63
|
const editFileRoleForm = (file, roles, req) =>
|
|
@@ -70,61 +76,53 @@ const editFileRoleForm = (file, roles, req) =>
|
|
|
70
76
|
*/
|
|
71
77
|
router.get(
|
|
72
78
|
"/",
|
|
73
|
-
setTenant,
|
|
74
79
|
isAdmin,
|
|
75
80
|
error_catcher(async (req, res) => {
|
|
76
81
|
const rows = await File.find({}, { orderBy: "filename" });
|
|
77
82
|
const roles = await User.get_roles();
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
rows,
|
|
122
|
-
{ hover: true }
|
|
123
|
-
),
|
|
124
|
-
fileUploadForm(req),
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
],
|
|
83
|
+
send_files_page({
|
|
84
|
+
res,
|
|
85
|
+
req,
|
|
86
|
+
active_sub: "Files",
|
|
87
|
+
contents: {
|
|
88
|
+
type: "card",
|
|
89
|
+
contents: [
|
|
90
|
+
mkTable(
|
|
91
|
+
[
|
|
92
|
+
{
|
|
93
|
+
label: req.__("Filename"),
|
|
94
|
+
key: (r) =>
|
|
95
|
+
div(
|
|
96
|
+
{ "data-inline-edit-dest-url": `/files/setname/${r.id}` },
|
|
97
|
+
r.filename
|
|
98
|
+
),
|
|
99
|
+
},
|
|
100
|
+
{ label: req.__("Size (KiB)"), key: "size_kb", align: "right" },
|
|
101
|
+
{ label: req.__("Media type"), key: (r) => r.mimetype },
|
|
102
|
+
{
|
|
103
|
+
label: req.__("Role to access"),
|
|
104
|
+
key: (r) => editFileRoleForm(r, roles, req),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: req.__("Link"),
|
|
108
|
+
key: (r) => link(`/files/serve/${r.id}`, req.__("Link")),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: req.__("Download"),
|
|
112
|
+
key: (r) => link(`/files/download/${r.id}`, req.__("Download")),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: req.__("Delete"),
|
|
116
|
+
key: (r) =>
|
|
117
|
+
post_delete_btn(`/files/delete/${r.id}`, req, r.filename),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
rows,
|
|
121
|
+
{ hover: true }
|
|
122
|
+
),
|
|
123
|
+
fileUploadForm(req),
|
|
124
|
+
],
|
|
125
|
+
},
|
|
128
126
|
});
|
|
129
127
|
})
|
|
130
128
|
);
|
|
@@ -137,7 +135,6 @@ router.get(
|
|
|
137
135
|
*/
|
|
138
136
|
router.get(
|
|
139
137
|
"/download/:id",
|
|
140
|
-
setTenant,
|
|
141
138
|
error_catcher(async (req, res) => {
|
|
142
139
|
const role = req.isAuthenticated() ? req.user.role_id : 10;
|
|
143
140
|
const user_id = req.user && req.user.id;
|
|
@@ -145,7 +142,8 @@ router.get(
|
|
|
145
142
|
const file = await File.findOne({ id });
|
|
146
143
|
if (role <= file.min_role_read || (user_id && user_id === file.user_id)) {
|
|
147
144
|
res.type(file.mimetype);
|
|
148
|
-
|
|
145
|
+
if (file.s3_store) s3storage.serveObject(file, res, true);
|
|
146
|
+
else res.download(file.location, file.filename);
|
|
149
147
|
} else {
|
|
150
148
|
req.flash("warning", req.__("Not authorized"));
|
|
151
149
|
res.redirect("/");
|
|
@@ -161,7 +159,6 @@ router.get(
|
|
|
161
159
|
*/
|
|
162
160
|
router.get(
|
|
163
161
|
"/serve/:id",
|
|
164
|
-
setTenant,
|
|
165
162
|
error_catcher(async (req, res) => {
|
|
166
163
|
const role = req.isAuthenticated() ? req.user.role_id : 10;
|
|
167
164
|
const user_id = req.user && req.user.id;
|
|
@@ -181,7 +178,8 @@ router.get(
|
|
|
181
178
|
res.type(file.mimetype);
|
|
182
179
|
const cacheability = file.min_role_read === 10 ? "public" : "private";
|
|
183
180
|
res.set("Cache-Control", `${cacheability}, max-age=86400`);
|
|
184
|
-
|
|
181
|
+
if (file.s3_store) s3storage.serveObject(file, res, false);
|
|
182
|
+
else res.sendFile(file.location);
|
|
185
183
|
} else {
|
|
186
184
|
req.flash("warning", req.__("Not authorized"));
|
|
187
185
|
res.redirect("/");
|
|
@@ -197,7 +195,6 @@ router.get(
|
|
|
197
195
|
*/
|
|
198
196
|
router.post(
|
|
199
197
|
"/setrole/:id",
|
|
200
|
-
setTenant,
|
|
201
198
|
isAdmin,
|
|
202
199
|
error_catcher(async (req, res) => {
|
|
203
200
|
const { id } = req.params;
|
|
@@ -225,7 +222,6 @@ router.post(
|
|
|
225
222
|
*/
|
|
226
223
|
router.post(
|
|
227
224
|
"/setname/:id",
|
|
228
|
-
setTenant,
|
|
229
225
|
isAdmin,
|
|
230
226
|
error_catcher(async (req, res) => {
|
|
231
227
|
const { id } = req.params;
|
|
@@ -244,7 +240,6 @@ router.post(
|
|
|
244
240
|
*/
|
|
245
241
|
router.post(
|
|
246
242
|
"/upload",
|
|
247
|
-
setTenant,
|
|
248
243
|
error_catcher(async (req, res) => {
|
|
249
244
|
let jsonResp = {};
|
|
250
245
|
const min_role_upload = getState().getConfig("min_role_upload", 1);
|
|
@@ -297,12 +292,18 @@ router.post(
|
|
|
297
292
|
*/
|
|
298
293
|
router.post(
|
|
299
294
|
"/delete/:id",
|
|
300
|
-
setTenant,
|
|
301
295
|
isAdmin,
|
|
302
296
|
error_catcher(async (req, res) => {
|
|
303
297
|
const { id } = req.params;
|
|
304
298
|
const f = await File.findOne({ id });
|
|
305
|
-
|
|
299
|
+
if (!f) {
|
|
300
|
+
req.flash("error", "File not found");
|
|
301
|
+
res.redirect("/files");
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const result = await f.delete(
|
|
305
|
+
f.s3_store ? s3storage.unlinkObject : undefined
|
|
306
|
+
);
|
|
306
307
|
if (result && result.error) {
|
|
307
308
|
req.flash("error", result.error);
|
|
308
309
|
} else {
|
|
@@ -311,3 +312,82 @@ router.post(
|
|
|
311
312
|
res.redirect(`/files`);
|
|
312
313
|
})
|
|
313
314
|
);
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Storage settings form definition
|
|
318
|
+
* @param {object} req request
|
|
319
|
+
* @returns {Promise<Form>} form
|
|
320
|
+
*/
|
|
321
|
+
const storage_form = async (req) => {
|
|
322
|
+
const form = await config_fields_form({
|
|
323
|
+
req,
|
|
324
|
+
field_names: [
|
|
325
|
+
"storage_s3_enabled",
|
|
326
|
+
"storage_s3_bucket",
|
|
327
|
+
"storage_s3_path_prefix",
|
|
328
|
+
"storage_s3_endpoint",
|
|
329
|
+
"storage_s3_region",
|
|
330
|
+
"storage_s3_access_key",
|
|
331
|
+
"storage_s3_access_secret",
|
|
332
|
+
"storage_s3_secure",
|
|
333
|
+
],
|
|
334
|
+
action: "/files/storage",
|
|
335
|
+
});
|
|
336
|
+
form.submitButtonClass = "btn-outline-primary";
|
|
337
|
+
form.submitLabel = req.__("Save");
|
|
338
|
+
form.onChange = "remove_outline(this)";
|
|
339
|
+
return form;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @name get/storage
|
|
344
|
+
* @function
|
|
345
|
+
* @memberof module:routes/admin~routes/adminRouter
|
|
346
|
+
*/
|
|
347
|
+
router.get(
|
|
348
|
+
"/storage",
|
|
349
|
+
isAdmin,
|
|
350
|
+
error_catcher(async (req, res) => {
|
|
351
|
+
const form = await storage_form(req);
|
|
352
|
+
send_files_page({
|
|
353
|
+
res,
|
|
354
|
+
req,
|
|
355
|
+
active_sub: "Storage",
|
|
356
|
+
contents: {
|
|
357
|
+
type: "card",
|
|
358
|
+
title: req.__("Storage settings"),
|
|
359
|
+
contents: [renderForm(form, req.csrfToken())],
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
})
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @name post/email
|
|
367
|
+
* @function
|
|
368
|
+
* @memberof module:routes/admin~routes/adminRouter
|
|
369
|
+
*/
|
|
370
|
+
router.post(
|
|
371
|
+
"/storage",
|
|
372
|
+
isAdmin,
|
|
373
|
+
error_catcher(async (req, res) => {
|
|
374
|
+
const form = await storage_form(req);
|
|
375
|
+
form.validate(req.body);
|
|
376
|
+
if (form.hasErrors) {
|
|
377
|
+
send_admin_page({
|
|
378
|
+
res,
|
|
379
|
+
req,
|
|
380
|
+
active_sub: "Storage",
|
|
381
|
+
contents: {
|
|
382
|
+
type: "card",
|
|
383
|
+
title: req.__("Storage settings"),
|
|
384
|
+
contents: [renderForm(form, req.csrfToken())],
|
|
385
|
+
},
|
|
386
|
+
});
|
|
387
|
+
} else {
|
|
388
|
+
await save_config_from_form(form);
|
|
389
|
+
req.flash("success", req.__("Storage settings updated"));
|
|
390
|
+
res.redirect("/files/storage");
|
|
391
|
+
}
|
|
392
|
+
})
|
|
393
|
+
);
|
package/routes/homepage.js
CHANGED
|
@@ -19,6 +19,7 @@ const { get_latest_npm_version } = require("@saltcorn/data/models/config");
|
|
|
19
19
|
const packagejson = require("../package.json");
|
|
20
20
|
const Trigger = require("@saltcorn/data/models/trigger");
|
|
21
21
|
const { fileUploadForm } = require("../markup/forms");
|
|
22
|
+
const { get_base_url } = require("./utils.js");
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* @param {*} tables
|
|
@@ -224,6 +225,8 @@ const usersTab = async (req, users, roleMap) => {
|
|
|
224
225
|
* @returns {Promise<div>}
|
|
225
226
|
*/
|
|
226
227
|
const actionsTab = async (req, triggers) => {
|
|
228
|
+
const base_url = get_base_url(req);
|
|
229
|
+
|
|
227
230
|
return div(
|
|
228
231
|
{ class: "pb-3" },
|
|
229
232
|
triggers.length <= 1 &&
|
package/routes/infoarch.js
CHANGED
|
@@ -35,7 +35,6 @@ module.exports = router;
|
|
|
35
35
|
*/
|
|
36
36
|
router.get(
|
|
37
37
|
"/",
|
|
38
|
-
setTenant,
|
|
39
38
|
isAdmin,
|
|
40
39
|
error_catcher(async (req, res) => {
|
|
41
40
|
res.redirect(`/menu`);
|
|
@@ -43,7 +42,7 @@ router.get(
|
|
|
43
42
|
);
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
|
-
* @param {object} req
|
|
45
|
+
* @param {object} req
|
|
47
46
|
* @returns {Form}
|
|
48
47
|
*/
|
|
49
48
|
const languageForm = (req) =>
|
|
@@ -83,7 +82,6 @@ const languageForm = (req) =>
|
|
|
83
82
|
*/
|
|
84
83
|
router.get(
|
|
85
84
|
"/localizer",
|
|
86
|
-
setTenant,
|
|
87
85
|
isAdmin,
|
|
88
86
|
error_catcher(async (req, res) => {
|
|
89
87
|
const cfgLangs = getState().getConfig("localizer_languages");
|
|
@@ -111,13 +109,13 @@ router.get(
|
|
|
111
109
|
},
|
|
112
110
|
{
|
|
113
111
|
label: req.__("Default"),
|
|
114
|
-
key: r
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
key: (r) =>
|
|
113
|
+
!!r.is_default
|
|
114
|
+
? i({
|
|
115
|
+
class: "fas fa-check-circle text-success",
|
|
116
|
+
})
|
|
117
|
+
: "",
|
|
119
118
|
},
|
|
120
|
-
|
|
121
119
|
],
|
|
122
120
|
Object.values(cfgLangs)
|
|
123
121
|
),
|
|
@@ -143,7 +141,6 @@ router.get(
|
|
|
143
141
|
*/
|
|
144
142
|
router.get(
|
|
145
143
|
"/localizer/add-lang",
|
|
146
|
-
setTenant,
|
|
147
144
|
isAdmin,
|
|
148
145
|
error_catcher(async (req, res) => {
|
|
149
146
|
send_infoarch_page({
|
|
@@ -167,7 +164,6 @@ router.get(
|
|
|
167
164
|
*/
|
|
168
165
|
router.get(
|
|
169
166
|
"/localizer/edit/:lang",
|
|
170
|
-
setTenant,
|
|
171
167
|
isAdmin,
|
|
172
168
|
error_catcher(async (req, res) => {
|
|
173
169
|
const { lang } = req.params;
|
|
@@ -175,8 +171,8 @@ router.get(
|
|
|
175
171
|
const form = languageForm(req);
|
|
176
172
|
form.values = cfgLangs[lang];
|
|
177
173
|
const { is_default } = form.values;
|
|
178
|
-
const cfgStrings = getState().getConfig("localizer_strings",{});
|
|
179
|
-
const translation = cfgStrings[lang] || {}
|
|
174
|
+
const cfgStrings = getState().getConfig("localizer_strings", {});
|
|
175
|
+
const translation = cfgStrings[lang] || {};
|
|
180
176
|
const strings = getState()
|
|
181
177
|
.getStringsForI18n()
|
|
182
178
|
.map((s) => ({ in_default: s, translated: translation[s] || s }));
|
|
@@ -232,16 +228,14 @@ router.get(
|
|
|
232
228
|
*/
|
|
233
229
|
router.post(
|
|
234
230
|
"/localizer/save-string/:lang/:defstring",
|
|
235
|
-
setTenant,
|
|
236
231
|
isAdmin,
|
|
237
232
|
error_catcher(async (req, res) => {
|
|
238
233
|
const { lang, defstring } = req.params;
|
|
239
234
|
|
|
240
235
|
const cfgStrings = getState().getConfigCopy("localizer_strings");
|
|
241
|
-
if(cfgStrings[lang])
|
|
242
|
-
cfgStrings[lang][defstring]
|
|
243
|
-
|
|
244
|
-
await getState().setConfig("localizer_strings", cfgStrings)
|
|
236
|
+
if (cfgStrings[lang]) cfgStrings[lang][defstring] = text(req.body.value);
|
|
237
|
+
else cfgStrings[lang] = { [defstring]: text(req.body.value) };
|
|
238
|
+
await getState().setConfig("localizer_strings", cfgStrings);
|
|
245
239
|
res.redirect(`/site-structure/localizer/edit/${lang}`);
|
|
246
240
|
})
|
|
247
241
|
);
|
|
@@ -254,7 +248,6 @@ router.post(
|
|
|
254
248
|
*/
|
|
255
249
|
router.post(
|
|
256
250
|
"/localizer/save-lang",
|
|
257
|
-
setTenant,
|
|
258
251
|
isAdmin,
|
|
259
252
|
error_catcher(async (req, res) => {
|
|
260
253
|
const form = languageForm(req);
|
package/routes/library.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
const Library = require("@saltcorn/data/models/library");
|
|
8
8
|
const Router = require("express-promise-router");
|
|
9
|
-
const {
|
|
9
|
+
const { isAdmin, error_catcher } = require("./utils.js");
|
|
10
10
|
const { send_infoarch_page } = require("../markup/admin.js");
|
|
11
11
|
const { mkTable, post_delete_btn } = require("@saltcorn/markup");
|
|
12
12
|
const { i } = require("@saltcorn/markup/tags");
|
|
@@ -29,7 +29,6 @@ module.exports = router;
|
|
|
29
29
|
*/
|
|
30
30
|
router.post(
|
|
31
31
|
"/savefrombuilder",
|
|
32
|
-
setTenant,
|
|
33
32
|
isAdmin,
|
|
34
33
|
error_catcher(async (req, res) => {
|
|
35
34
|
await Library.create(req.body);
|
|
@@ -45,7 +44,6 @@ router.post(
|
|
|
45
44
|
*/
|
|
46
45
|
router.get(
|
|
47
46
|
"/list",
|
|
48
|
-
setTenant,
|
|
49
47
|
isAdmin,
|
|
50
48
|
error_catcher(async (req, res) => {
|
|
51
49
|
const libs = await Library.find({});
|
|
@@ -89,7 +87,6 @@ router.get(
|
|
|
89
87
|
*/
|
|
90
88
|
router.post(
|
|
91
89
|
"/delete/:id",
|
|
92
|
-
setTenant,
|
|
93
90
|
isAdmin,
|
|
94
91
|
error_catcher(async (req, res) => {
|
|
95
92
|
const { id } = req.params;
|
package/routes/list.js
CHANGED
|
@@ -12,9 +12,19 @@ const Router = require("express-promise-router");
|
|
|
12
12
|
|
|
13
13
|
const db = require("@saltcorn/data/db");
|
|
14
14
|
const { mkTable, h, link, post_btn } = require("@saltcorn/markup");
|
|
15
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
a,
|
|
17
|
+
script,
|
|
18
|
+
domReady,
|
|
19
|
+
div,
|
|
20
|
+
text,
|
|
21
|
+
button,
|
|
22
|
+
input,
|
|
23
|
+
label,
|
|
24
|
+
form,
|
|
25
|
+
} = require("@saltcorn/markup/tags");
|
|
16
26
|
const Table = require("@saltcorn/data/models/table");
|
|
17
|
-
const {
|
|
27
|
+
const { isAdmin, error_catcher } = require("./utils");
|
|
18
28
|
const moment = require("moment");
|
|
19
29
|
const { readState } = require("@saltcorn/data/plugin-helper");
|
|
20
30
|
|
|
@@ -39,7 +49,6 @@ module.exports = router;
|
|
|
39
49
|
*/
|
|
40
50
|
router.get(
|
|
41
51
|
"/_versions/:name/:id",
|
|
42
|
-
setTenant,
|
|
43
52
|
isAdmin,
|
|
44
53
|
error_catcher(async (req, res) => {
|
|
45
54
|
const { name, id } = req.params;
|
|
@@ -88,7 +97,6 @@ router.get(
|
|
|
88
97
|
*/
|
|
89
98
|
router.post(
|
|
90
99
|
"/_restore/:name/:id/:_version",
|
|
91
|
-
setTenant,
|
|
92
100
|
isAdmin,
|
|
93
101
|
error_catcher(async (req, res) => {
|
|
94
102
|
const { name, id, _version } = req.params;
|
|
@@ -152,7 +160,7 @@ const typeToJsGridType = (t, field) => {
|
|
|
152
160
|
|
|
153
161
|
/**
|
|
154
162
|
* Version Field
|
|
155
|
-
* @param {string} tname
|
|
163
|
+
* @param {string} tname
|
|
156
164
|
* @returns {string}
|
|
157
165
|
*/
|
|
158
166
|
const versionsField = (tname) => `
|
|
@@ -183,7 +191,6 @@ jsGrid.fields.versions = VersionsField;
|
|
|
183
191
|
*/
|
|
184
192
|
router.get(
|
|
185
193
|
"/:tname",
|
|
186
|
-
setTenant,
|
|
187
194
|
isAdmin,
|
|
188
195
|
error_catcher(async (req, res) => {
|
|
189
196
|
const { tname } = req.params;
|
|
@@ -247,6 +254,42 @@ router.get(
|
|
|
247
254
|
{ href: `/table/${table.id || table.name}`, text: table.name },
|
|
248
255
|
{ text: req.__("Data") },
|
|
249
256
|
],
|
|
257
|
+
right: div(
|
|
258
|
+
{ class: "dropdown" },
|
|
259
|
+
button(
|
|
260
|
+
{
|
|
261
|
+
class: "btn btn-sm btn-outline-secondary dropdown-toggle",
|
|
262
|
+
"data-boundary": "viewport",
|
|
263
|
+
type: "button",
|
|
264
|
+
id: "btnHideCols",
|
|
265
|
+
"data-toggle": "dropdown",
|
|
266
|
+
"aria-haspopup": "true",
|
|
267
|
+
"aria-expanded": "false",
|
|
268
|
+
},
|
|
269
|
+
"Show/hide fields"
|
|
270
|
+
),
|
|
271
|
+
div(
|
|
272
|
+
{
|
|
273
|
+
class: "dropdown-menu",
|
|
274
|
+
"aria-labelledby": "btnHideCols",
|
|
275
|
+
},
|
|
276
|
+
form(
|
|
277
|
+
{ class: "px-2" },
|
|
278
|
+
fields.map((f) =>
|
|
279
|
+
div(
|
|
280
|
+
{ class: "form-check" },
|
|
281
|
+
input({
|
|
282
|
+
type: "checkbox",
|
|
283
|
+
onChange: `showHideCol('${f.name}', this)`,
|
|
284
|
+
class: "form-check-input",
|
|
285
|
+
checked: true,
|
|
286
|
+
}),
|
|
287
|
+
label(f.name)
|
|
288
|
+
)
|
|
289
|
+
)
|
|
290
|
+
)
|
|
291
|
+
)
|
|
292
|
+
),
|
|
250
293
|
},
|
|
251
294
|
{
|
|
252
295
|
type: "blank",
|
|
@@ -272,6 +315,7 @@ router.get(
|
|
|
272
315
|
`)
|
|
273
316
|
),
|
|
274
317
|
div({ id: "jsGridNotify" }),
|
|
318
|
+
|
|
275
319
|
div({ id: "jsGrid" })
|
|
276
320
|
),
|
|
277
321
|
},
|