diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000000000000000000000000000000000..5d0c0b511a2d9d83655c0ff977ef165cda5bc545 --- /dev/null +++ b/.mailmap @@ -0,0 +1,12 @@ +Jean-Sébastien Caux <git@jscaux.org> J.-S. Caux <J.S.Caux@uva.nl> +Jean-Sébastien Caux <git@jscaux.org> Jean-Sebastien Caux <J.S.Caux@uva.nl> +Jean-Sébastien Caux <git@jscaux.org> Jean-Sebastien Caux <jscaux@ABACUS.local> +Jean-Sébastien Caux <git@jscaux.org> Jean-Sebastien Caux <jscaux@vpn-staff-146-50-69-84.vpn.uva.nl> +SciPost techsupport <techsupport@scipost.org> +Jorran de Wit <jorrandewit@outlook.com> +Jorran de Wit <jorrandewit@outlook.com> Jorran at staging <jorrandewit@scipost.org> +Jorran de Wit <jorrandewit@outlook.com> <jorrandewit@wcw-stud-145-109-59-173.wireless.uva.nl> +Jorran de Wit <jorrandewit@outlook.com> productionserver <jorran@web507.webfaction.com> +Jorran de Wit <jorrandewit@outlook.com> <jorrandewit@scipost.org> +Jorran de Wit <jorrandewit@outlook.com> <jorrandewit@Jorrans-MacBook-Pro.local> +Jorran de Wit <jorrandewit@outlook.com> <jorran@web564.webfaction.com> diff --git a/package-lock.json b/package-lock.json index a3ec57edbb1daf3249dec7a38abeb9719fe9c4cd..bcb4632b3d79a74d1e49c784f5823327cf852641 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,24 +31,24 @@ } }, "@babel/runtime-corejs3": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.5.tgz", - "integrity": "sha512-cBbwXj3F2xjnQJ0ERaFRLjxhUSBYsQPXJ7CERz/ecx6q6hzQ99eTflAPFC3ks4q/IG4CWupNVdflc4jlFBJVsg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.15.4.tgz", + "integrity": "sha512-lWcAqKeB624/twtTc3w6w/2o9RqJPaNBhPGK6DKLSiwuVWC7WFkypWyNg+CpZoyJH0jVzv1uMtXZ/5/lQOLtCg==", "requires": { - "core-js-pure": "^3.14.0", + "core-js-pure": "^3.16.0", "regenerator-runtime": "^0.13.4" } }, "@discoveryjs/json-ext": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", - "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz", + "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==", "dev": true }, "@popperjs/core": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz", - "integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==" + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", + "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==" }, "@types/anymatch": { "version": "1.3.1", @@ -57,9 +57,9 @@ "dev": true }, "@types/eslint": { - "version": "7.2.13", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.13.tgz", - "integrity": "sha512-LKmQCWAlnVHvvXq4oasNUMTJJb2GwSyTY8+1C7OH5ILR8mPLaljv1jxL1bXW3xB3jFbQxTKxJAvI8PyjB09aBg==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==", "dev": true, "requires": { "@types/estree": "*", @@ -67,9 +67,9 @@ } }, "@types/eslint-scope": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", - "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", "dev": true, "requires": { "@types/eslint": "*", @@ -77,9 +77,9 @@ } }, "@types/estree": { - "version": "0.0.47", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.47.tgz", - "integrity": "sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==", + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", "dev": true }, "@types/glob": { @@ -97,30 +97,6 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" }, - "@types/lodash": { - "version": "4.14.170", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", - "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", - "dev": true - }, - "@types/lodash.foreach": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@types/lodash.foreach/-/lodash.foreach-4.5.6.tgz", - "integrity": "sha512-A8+157A+27zwJSstmW/eWPc9lHLJNEer4jiMlsyxWieBxEx0arwB9vgQm+iai6DEDYYQuufHrzVhQOiapCalQQ==", - "dev": true, - "requires": { - "@types/lodash": "*" - } - }, - "@types/lodash.get": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@types/lodash.get/-/lodash.get-4.4.6.tgz", - "integrity": "sha512-E6zzjR3GtNig8UJG/yodBeJeIOtgPkMgsLjDU3CbgCAPC++vJ0eCMnJhVpRZb/ENqEFlov1+3K9TKtY4UdWKtQ==", - "dev": true, - "requires": { - "@types/lodash": "*" - } - }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -194,172 +170,185 @@ } }, "@vue/component-compiler-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.2.1.tgz", - "integrity": "sha512-Mci9WJYLRjyJEBkGHMPxZ1ihJ9l6gOy2Gr6hpYZUNpQoe5+nbpeb3w00aP+PSHJygCF+fxJsqp7Af1zGDITzuw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.2.2.tgz", + "integrity": "sha512-rAYMLmgMuqJFWAOb3Awjqqv5X3Q3hVr4jH/kgrFJpiU0j3a90tnNBplqbj+snzrgZhC9W128z+dtgMifOiMfJg==", "dev": true, "requires": { "consolidate": "^0.15.1", "hash-sum": "^1.0.2", "lru-cache": "^4.1.2", "merge-source-map": "^1.1.0", + "postcss": "^7.0.36", "postcss-selector-parser": "^6.0.2", "prettier": "^1.18.2", "source-map": "~0.6.1", "vue-template-es2015-compiler": "^1.9.0" + }, + "dependencies": { + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + } } }, "@vue/composition-api": { - "version": "1.0.0-rc.11", - "resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.0.0-rc.11.tgz", - "integrity": "sha512-rB5cKeNZlHdjEYre2vBzdid+e09Mf2HmMrg31NCT6c1G6bgX1CJ6V8H7owo9+wK/O2YyN9AEkIVLOczP9s0VTQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.2.3.tgz", + "integrity": "sha512-aWST3aQVDceER1NTqYX3j7sTRFQVf86o/UXB0lFWn2vLJLbbS1E4uCx+TT3rqaXB0QjZFeCYTlrGRB0afdp/aA==", "requires": { - "tslib": "^2.2.0" + "tslib": "^2.3.0" } }, "@webassemblyjs/ast": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz", - "integrity": "sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, "requires": { - "@webassemblyjs/helper-numbers": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0" + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz", - "integrity": "sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", "dev": true }, "@webassemblyjs/helper-api-error": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz", - "integrity": "sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz", - "integrity": "sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", "dev": true }, "@webassemblyjs/helper-numbers": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz", - "integrity": "sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.0", - "@webassemblyjs/helper-api-error": "1.11.0", + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", "@xtuc/long": "4.2.2" } }, "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz", - "integrity": "sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz", - "integrity": "sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" } }, "@webassemblyjs/ieee754": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz", - "integrity": "sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, "requires": { "@xtuc/ieee754": "^1.2.0" } }, "@webassemblyjs/leb128": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz", - "integrity": "sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, "requires": { "@xtuc/long": "4.2.2" } }, "@webassemblyjs/utf8": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz", - "integrity": "sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz", - "integrity": "sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/helper-wasm-section": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0", - "@webassemblyjs/wasm-opt": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0", - "@webassemblyjs/wast-printer": "1.11.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" } }, "@webassemblyjs/wasm-gen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz", - "integrity": "sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/ieee754": "1.11.0", - "@webassemblyjs/leb128": "1.11.0", - "@webassemblyjs/utf8": "1.11.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, "@webassemblyjs/wasm-opt": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz", - "integrity": "sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-buffer": "1.11.0", - "@webassemblyjs/wasm-gen": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" } }, "@webassemblyjs/wasm-parser": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz", - "integrity": "sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/helper-api-error": "1.11.0", - "@webassemblyjs/helper-wasm-bytecode": "1.11.0", - "@webassemblyjs/ieee754": "1.11.0", - "@webassemblyjs/leb128": "1.11.0", - "@webassemblyjs/utf8": "1.11.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, "@webassemblyjs/wast-printer": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz", - "integrity": "sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/ast": "1.11.1", "@xtuc/long": "4.2.2" } }, @@ -379,9 +368,9 @@ } }, "@webpack-cli/serve": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", - "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.2.tgz", + "integrity": "sha512-vgJ5OLWadI8aKjDlOH3rb+dYyPd2GTZuQC/Tihjct6F9GpXGZINo3Y/IVuZVTM1eDQB+/AOsjPUWH/WySDaXvw==", "dev": true }, "@xtuc/ieee754": { @@ -403,9 +392,15 @@ "dev": true }, "acorn": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.3.0.tgz", - "integrity": "sha512-tqPKHZ5CaBJw0Xmy0ZZvLs1qTV+BNFSyvn77ASXkpBNfIRk8ev26fKrD9iLGwGA9zedPao52GSHzq8lyZG0NUw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "dev": true + }, + "acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true }, "adjust-sourcemap-loader": { @@ -497,9 +492,9 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "dev": true, "requires": { "delegates": "^1.0.0", @@ -558,9 +553,9 @@ "dev": true }, "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", + "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==", "dev": true }, "async-foreach": { @@ -582,15 +577,15 @@ "dev": true }, "autoprefixer": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.6.tgz", - "integrity": "sha512-8lChSmdU6dCNMCQopIf4Pe5kipkAGj/fvTMslCsih0uHpOrXOPUEVOmYMMqmw3cekQkSD7EhIeuYl5y0BLdKqg==", + "version": "10.3.7", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.3.7.tgz", + "integrity": "sha512-EmGpu0nnQVmMhX8ROoJ7Mx8mKYPlcUHuxkwrRYEYMz85lu7H09v8w6R1P0JPdn/hKU32GjpLBFEOuIlDWCRWvg==", "requires": { - "browserslist": "^4.16.6", - "caniuse-lite": "^1.0.30001230", - "colorette": "^1.2.2", + "browserslist": "^4.17.3", + "caniuse-lite": "^1.0.30001264", "fraction.js": "^4.1.1", "normalize-range": "^0.1.2", + "picocolors": "^0.2.1", "postcss-value-parser": "^4.1.0" } }, @@ -601,9 +596,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "balanced-match": { @@ -652,9 +647,9 @@ "dev": true }, "bootstrap": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.1.tgz", - "integrity": "sha512-Fl79+wsLOZKoiU345KeEaWD0ik8WKRI5zm0YSPj2oF1Qr+BO7z0fco6GbUtqjoG1h4VI89PeKJnMsMMVQdKKTw==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.2.tgz", + "integrity": "sha512-me838a7TSEkldKyplkx21dqFm16+9NbH/rCj3Myo+h2cByyjckqV4m0OnS8QBsSDEoBv8R2jHqfulGQXpvM8Bw==" }, "brace-expansion": { "version": "1.1.11", @@ -675,15 +670,15 @@ } }, "browserslist": { - "version": "4.16.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", - "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.3.tgz", + "integrity": "sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ==", "requires": { - "caniuse-lite": "^1.0.30001219", - "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.723", + "caniuse-lite": "^1.0.30001264", + "electron-to-chromium": "^1.3.857", "escalade": "^3.1.1", - "node-releases": "^1.1.71" + "node-releases": "^1.1.77", + "picocolors": "^0.2.1" } }, "buffer": { @@ -767,9 +762,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001230", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz", - "integrity": "sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==" + "version": "1.0.30001265", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz", + "integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==" }, "caseless": { "version": "0.12.0", @@ -800,18 +795,18 @@ } }, "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" } }, "chrome-trace-event": { @@ -885,9 +880,10 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -944,9 +940,9 @@ } }, "core-js-pure": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.14.0.tgz", - "integrity": "sha512-YVh+LN2FgNU0odThzm61BsdkwrbrchumFq3oztnE9vTKC4KS2fvnPmcx8t6jnqAyOTCTF4ZSiuK8Qhh7SNcL4g==" + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.18.2.tgz", + "integrity": "sha512-4hMMLUlZhKJKOWbbGD1/VDUxGPEhEoN/T01k7bx271WiBKCvCfkgPzy0IeRS4PB50p6/N1q/SZL4B/TRsTE5bA==" }, "core-util-is": { "version": "1.0.2", @@ -1001,9 +997,9 @@ } }, "css-loader": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.6.tgz", - "integrity": "sha512-0wyN5vXMQZu6BvjbrPdUJvkCzGEO24HC7IS7nW4llc6BBFC+zwR9CKtYGv63Puzsg10L/o12inMY5/2ByzfD6w==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.7.tgz", + "integrity": "sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg==", "dev": true, "requires": { "icss-utils": "^5.1.0", @@ -1018,6 +1014,12 @@ "semver": "^7.3.5" }, "dependencies": { + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -1054,12 +1056,12 @@ } }, "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "@types/json-schema": "^7.0.6", + "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" } @@ -1218,9 +1220,9 @@ } }, "electron-to-chromium": { - "version": "1.3.739", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz", - "integrity": "sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A==" + "version": "1.3.860", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.860.tgz", + "integrity": "sha512-gWwGZ+Wv4Mou2SJRH6JQzhTPjL5f95SX7n6VkLTQ/Q/INsZLZNQ1vH2GlZjozKyvT0kkFuCmWTwIoCj+/hUDPw==" }, "emoji-regex": { "version": "7.0.3", @@ -1274,9 +1276,9 @@ } }, "es-module-lexer": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.4.1.tgz", - "integrity": "sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.2.tgz", + "integrity": "sha512-YkAGWqxZq2B4FxQ5y687UwywDwvLQhIMCZ+SDU7ZW729SDHOEI6wVFXwTRecz+yiwJzCsVwC6V7bxyNbZSB1rg==", "dev": true }, "es5-ext": { @@ -1429,12 +1431,12 @@ "integrity": "sha512-WBpSGlNkn7YwbU2us7O+h0XsoFrB43Y/VCNSpRV4OZFXXKgw8W800BgNxLV0S97N3+KGnFYSCAJi1AV86NO22w==" }, "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "dev": true, "requires": { - "type": "^2.0.0" + "type": "^2.5.0" }, "dependencies": { "type": { @@ -1728,9 +1730,9 @@ } }, "globule": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", - "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.3.tgz", + "integrity": "sha512-mb1aYtDbIjTu4ShMB85m3UzjX9BVKe9WCzsnfMSZk+K5GpIbBOexgg4PPCt5eHDEG5/ZQAUX2Kct02zfiPLsKg==", "dev": true, "requires": { "glob": "~7.1.1", @@ -1814,6 +1816,11 @@ "entities": "^2.0.0" } }, + "htmx.org": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-1.6.0.tgz", + "integrity": "sha512-/XzLC1QgqdBDIzxGKYN1IbmPHz9QFyId/x+ujJYd4febA99lb1hozyCASNdMHUMTXIqtzBYs2hL2nJfVD/IELQ==" + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -1871,9 +1878,9 @@ } }, "import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", "dev": true, "requires": { "pkg-dir": "^4.2.0", @@ -1964,9 +1971,9 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "requires": { "is-extglob": "^2.1.1" } @@ -2009,9 +2016,9 @@ } }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, "is-typedarray": { @@ -2049,9 +2056,9 @@ "dev": true }, "jest-worker": { - "version": "27.0.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.2.tgz", - "integrity": "sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg==", + "version": "27.2.4", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.4.tgz", + "integrity": "sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g==", "dev": true, "requires": { "@types/node": "*", @@ -2390,15 +2397,20 @@ "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==" }, "mini-css-extract-plugin": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.0.tgz", - "integrity": "sha512-nPFKI7NSy6uONUo9yn2hIfb9vyYvkFu95qki0e21DQ9uaqNKDP15DGpK0KnV6wDroWxPHtExrdEwx/yDQ8nVRw==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", + "integrity": "sha512-WhDvO3SjGm40oV5y26GjMJYjd2UMqrLAGKy5YS2/3QKJy2F7jgynuHTir/tgUUOiNQu5saXHdc8reo7YuhhT4Q==", "requires": { "loader-utils": "^2.0.0", "schema-utils": "^3.0.0", "webpack-sources": "^1.1.0" }, "dependencies": { + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -2423,11 +2435,11 @@ } }, "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "requires": { - "@types/json-schema": "^7.0.6", + "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" } @@ -2458,14 +2470,9 @@ } }, "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" - }, - "nanoid": { - "version": "3.1.23", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", - "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==" + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" }, "neo-async": { "version": "2.6.2", @@ -2514,9 +2521,9 @@ "dev": true }, "node-releases": { - "version": "1.1.72", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz", - "integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==" + "version": "1.1.77", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz", + "integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==" }, "node-sass": { "version": "4.14.1", @@ -5945,6 +5952,11 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" + }, "picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", @@ -6022,13 +6034,20 @@ "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==" }, "postcss": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.2.tgz", - "integrity": "sha512-y1FK/AWdZlBF5lusS5j5l4/vF67+vQZt1SXPVJ32y1kRGDQyrs1zk32hG1cInRTu14P0V+orPz+ifwW/7rR4bg==", + "version": "8.3.9", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.9.tgz", + "integrity": "sha512-f/ZFyAKh9Dnqytx5X62jgjhhzttjZS7hMsohcI7HEI5tjELX/HxCy3EFhsRxyzGvrzFF+82XPvCS8T9TFleVJw==", "requires": { - "colorette": "^1.2.2", - "nanoid": "^3.1.23", + "nanoid": "^3.1.28", + "picocolors": "^0.2.1", "source-map-js": "^0.6.2" + }, + "dependencies": { + "nanoid": { + "version": "3.1.29", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.29.tgz", + "integrity": "sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg==" + } } }, "postcss-load-config": { @@ -6460,17 +6479,17 @@ } }, "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "requires": { "picomatch": "^2.2.1" } }, "rechoir": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", - "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, "requires": { "resolve": "^1.9.0" @@ -6487,9 +6506,9 @@ } }, "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" }, "regex-parser": { "version": "2.2.11", @@ -6583,9 +6602,9 @@ "dev": true }, "resolve-url-loader": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.3.tgz", - "integrity": "sha512-WbDSNFiKPPLem1ln+EVTE+bFUBdTTytfQZWbmghroaFNFaAVmGq0Saqw6F/306CwgPXsGwXVxbODE+3xAo/YbA==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.4.tgz", + "integrity": "sha512-D3sQ04o0eeQEySLrcz4DsX3saHfsr8/N6tfhblxgZKXxMT2Louargg12oGNfoTRLV09GXhVUe5/qgA5vdgNigg==", "dev": true, "requires": { "adjust-sourcemap-loader": "3.0.0", @@ -6594,16 +6613,16 @@ "convert-source-map": "1.7.0", "es6-iterator": "2.0.3", "loader-utils": "1.2.3", - "postcss": "7.0.21", + "postcss": "7.0.36", "rework": "1.0.1", "rework-visit": "1.0.0", "source-map": "0.6.1" }, "dependencies": { "postcss": { - "version": "7.0.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.21.tgz", - "integrity": "sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -6677,11 +6696,6 @@ "postcss": "^8.0.2" }, "dependencies": { - "colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" - }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -6691,23 +6705,13 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "postcss": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz", - "integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==", - "requires": { - "colorette": "^1.2.2", - "nanoid": "^3.1.23", - "source-map-js": "^0.6.2" - } } } }, "sass": { - "version": "1.34.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.34.1.tgz", - "integrity": "sha512-scLA7EIZM+MmYlej6sdVr0HRbZX5caX5ofDT9asWnUJj21oqgsC+1LuNfm0eg+vM0fCTZHhwImTiCU0sx9h9CQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.42.1.tgz", + "integrity": "sha512-/zvGoN8B7dspKc5mC6HlaygyCBRvnyzzgD5khiaCfglWztY99cYoiTUksVx11NlnemrcfH5CEaCpsUKoW0cQqg==", "requires": { "chokidar": ">=3.0.0 <4.0.0" } @@ -6746,9 +6750,9 @@ } }, "sass-resources-loader": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/sass-resources-loader/-/sass-resources-loader-2.2.1.tgz", - "integrity": "sha512-WlofxbWOVnxad874IHZdWbP9eW1pbyqsTJKBsMbeB+YELvLSrZQNDTpH70s6F19BwtanR3NEFnyGwJ9WyotJTQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/sass-resources-loader/-/sass-resources-loader-2.2.4.tgz", + "integrity": "sha512-hIQhBygYky+rLf+4cuoGYONZ623CEH4Swo1fs1WRJkukbqdvN1VIu2KCL59du6vX92bNELzNkGPLx+NorN73xA==", "dev": true, "requires": { "async": "^3.2.0", @@ -6767,9 +6771,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -6866,15 +6870,15 @@ } }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -6943,9 +6947,9 @@ } }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -6953,9 +6957,9 @@ } }, "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", "dev": true }, "spdx-correct": { @@ -6985,9 +6989,9 @@ } }, "spdx-license-ids": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", - "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", + "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", "dev": true }, "sprintf-js": { @@ -7161,14 +7165,14 @@ } }, "terser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", - "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", + "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", "dev": true, "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "dependencies": { "source-map": { @@ -7180,19 +7184,25 @@ } }, "terser-webpack-plugin": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz", - "integrity": "sha512-cxGbMqr6+A2hrIB5ehFIF+F/iST5ZOxvOmy9zih9ySbP1C2oEWQSOUS+2SNBTjzx5xLKO4xnod9eywdfq1Nb9A==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz", + "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==", "dev": true, "requires": { - "jest-worker": "^27.0.2", + "jest-worker": "^27.0.6", "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.0" + "terser": "^5.7.2" }, "dependencies": { + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -7203,12 +7213,12 @@ } }, "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "@types/json-schema": "^7.0.6", + "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" } @@ -7314,9 +7324,9 @@ } }, "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "tunnel-agent": { "version": "0.6.0", @@ -7454,9 +7464,9 @@ "dev": true }, "vue-loader": { - "version": "15.9.7", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.7.tgz", - "integrity": "sha512-qzlsbLV1HKEMf19IqCJqdNvFJRCI58WNbS6XbPqK13MrLz65es75w392MSQ5TsARAfIjUw+ATm3vlCXUJSOH9Q==", + "version": "15.9.8", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.8.tgz", + "integrity": "sha512-GwSkxPrihfLR69/dSV3+5CdMQ0D+jXg8Ma1S4nQXKJAznYFX14vHdc/NetQc34Dw+rBbIJyP7JOuVb9Fhprvog==", "dev": true, "requires": { "@vue/component-compiler-utils": "^3.1.0", @@ -7475,9 +7485,9 @@ } }, "vue-select": { - "version": "3.11.2", - "resolved": "https://registry.npmjs.org/vue-select/-/vue-select-3.11.2.tgz", - "integrity": "sha512-pIOcY8ajWNSwg8Ns4eHVr5ZWwqKCSZeQRymTnlUI8i+3QiQXF6JIM4lylK6mVfbccs4S6vOyxB7zmJBpp7tDUg==" + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/vue-select/-/vue-select-3.13.0.tgz", + "integrity": "sha512-+PcWtfA1i3WVtkVwBPQknnOZL6QWSD2XiAVbSn0xAQvjOrmGAg7z+o9HkezXhtGdEstloJOdM8SujrUVyphKqg==" }, "vue-style-loader": { "version": "4.1.3", @@ -7521,21 +7531,22 @@ } }, "webpack": { - "version": "5.38.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.38.1.tgz", - "integrity": "sha512-OqRmYD1OJbHZph6RUMD93GcCZy4Z4wC0ele4FXyYF0J6AxO1vOSuIlU1hkS/lDlR9CDYBz64MZRmdbdnFFoT2g==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.57.1.tgz", + "integrity": "sha512-kHszukYjTPVfCOEyrUthA3jqJwduY/P3eO8I0gMNOZGIQWKAwZftxmp5hq6paophvwo9NoUrcZOecs9ulOyyTg==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.47", - "@webassemblyjs/ast": "1.11.0", - "@webassemblyjs/wasm-edit": "1.11.0", - "@webassemblyjs/wasm-parser": "1.11.0", - "acorn": "^8.2.1", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.8.0", - "es-module-lexer": "^0.4.0", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", @@ -7544,17 +7555,23 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.0.0", + "schema-utils": "^3.1.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.1", + "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.2.0", - "webpack-sources": "^2.3.0" + "webpack-sources": "^3.2.0" }, "dependencies": { + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, "enhanced-resolve": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", - "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -7562,42 +7579,36 @@ } }, "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "@types/json-schema": "^7.0.6", + "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" } }, "tapable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", - "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true }, "webpack-sources": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.0.tgz", - "integrity": "sha512-WyOdtwSvOML1kbgtXbTDnEW0jkJ7hZr/bDByIwszhWd/4XX1A3XMkrbFMsuH4+/MfLlZCUzlAdg4r7jaGKEIgQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" - } + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz", + "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==", + "dev": true } } }, "webpack-bundle-tracker": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-tracker/-/webpack-bundle-tracker-1.0.0.tgz", - "integrity": "sha512-uO787xNxxq2+D+P4FPsnX7D+yDY4qmjopenkxxq2kT6e4QjMe2uPJ6R03mv9KT74YkWKKt/gBC+x+ZFGjb2URQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-tracker/-/webpack-bundle-tracker-1.4.0.tgz", + "integrity": "sha512-5dbAdtS+DbvJfXIXfCytRv5D4I2EWBdBBVOzDMpSa52goTroryWcH4lm3h2qwVqSQEgTTWCkgLGGlZYZmYRM9g==", "dev": true, "requires": { - "@types/lodash.foreach": "^4.5.6", - "@types/lodash.get": "^4.4.6", "lodash.assign": "^4.2.0", "lodash.defaults": "^4.2.0", "lodash.foreach": "^4.5.0", @@ -7606,32 +7617,32 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } } } }, "webpack-cli": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", - "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.8.0.tgz", + "integrity": "sha512-+iBSWsX16uVna5aAYN6/wjhJy1q/GKk4KjKvfg90/6hykCTSgozbfz5iRgDTSJt/LgSbYxdBX3KBHeobIs+ZEw==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^1.0.4", "@webpack-cli/info": "^1.3.0", - "@webpack-cli/serve": "^1.5.1", + "@webpack-cli/serve": "^1.5.2", "colorette": "^1.2.1", "commander": "^7.0.0", "execa": "^5.0.0", @@ -7765,11 +7776,11 @@ "dev": true }, "xregexp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-5.0.2.tgz", - "integrity": "sha512-JPNfN40YMNSDxZrahMrmtNH1QqPJp0/qNeEJM2nnOlhcBdfCCjekPYFV2OnwKxwvpEYglH1RBotbpRRaEuCG8Q==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-5.1.0.tgz", + "integrity": "sha512-PynwUWtXnSZr8tpQlDPMZfPTyv78EYuA4oI959ukxcQ0a9O/lvndLVKy5wpImzzA26eMxpZmnAXJYiQA13AtWA==", "requires": { - "@babel/runtime-corejs3": "^7.12.1" + "@babel/runtime-corejs3": "^7.14.9" } }, "y18n": { diff --git a/package.json b/package.json index d10c0bb9fa070a87573cff66fbf574b8a1280170..8c6c2afbbbed36933ae9e2674bd8be43e1d70d05 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "devDependencies": { "ajv": "^6.10.2", "clean-webpack-plugin": "^3.0.0", - "css-loader": "^5.2.6", + "css-loader": "^5.2.7", "enhanced-resolve": "^4.5.0", "exports-loader": "^0.7.0", "file-loader": "^6.2.0", @@ -30,51 +30,52 @@ "jquery": "^3.6.0", "jquery-ui": "^1.12.1", "node-loader": "^0.6.0", - "node-sass": "^4.13.0", + "node-sass": "^4.14.1", "postcss-load-config": "^2.1.0", "postcss-loader": "^5.3.0", "postcss-plugin": "^1.0.0", - "resolve-url-loader": "^3.1.3", + "resolve-url-loader": "^3.1.4", "sass-loader": "^8.0.0", - "sass-resources-loader": "^2.2.1", + "sass-resources-loader": "^2.2.4", "style-loader": "^1.0.0", "tapable": "^1.1.3", "tether": "^1.4.7", "url-loader": "^4.1.1", - "vue-loader": "^15.9.7", + "vue-loader": "^15.9.8", "vue-template-compiler": "^2.6.10", - "webpack": "^5.38.1", - "webpack-bundle-tracker": "^1.0.0", - "webpack-cli": "^4.7.2", + "webpack": "^5.57.1", + "webpack-bundle-tracker": "^1.4.0", + "webpack-cli": "^4.8.0", "webpack-glob-entry": "^2.1.1" }, "dependencies": { - "@popperjs/core": "^2.9.2", - "@vue/composition-api": "^1.0.0-rc.11", - "autoprefixer": "^10.2.6", - "bootstrap": "^5.0.1", + "@popperjs/core": "^2.10.2", + "@vue/composition-api": "^1.2.3", + "autoprefixer": "^10.3.7", + "bootstrap": "^5.1.2", "expose-loader": "^2.0.0", "fibers": "^4.0.2", + "htmx.org": "^1.6.0", "js-cookie": "^2.2.1", "lodash.debounce": "^4.0.8", "lodash.uniqueid": "^4.0.1", "mem": "^6.0.0", - "mini-css-extract-plugin": "^1.6.0", - "nan": "^2.14.0", + "mini-css-extract-plugin": "^1.6.2", + "nan": "^2.15.0", "npm": "^6.14.13", "npm-install-peers": "^1.2.2", - "postcss": "^8.3.2", + "postcss": "^8.3.9", "qrcode": "^1.4.4", - "sass": "^1.34.1", + "sass": "^1.42.1", "schema-utils": "^2.5.0", "sugarss": "^3.0.3", "tiptap": "^1.32.2", "tiptap-extensions": "^1.35.2", "vue": "^2.6.12", "vue-sanitize": "^0.2.1", - "vue-select": "^3.11.2", + "vue-select": "^3.13.0", "webpack-merge": "^5.8.0", - "xregexp": "^5.0.2" + "xregexp": "^5.1.0" }, "resolutions": { "prosemirror-model": "1.8.2" diff --git a/requirements.txt b/requirements.txt index 54429ec006f0fab5f9752382c22c3e59a9a550d0..f6e29d34b5aef42d1d71a229a80999fc1f881778 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,16 +13,17 @@ mock==2.0.0 # Django packages -django-autocomplete-light==3.8.1 # 2021-06-06 -django-cors-headers==3.5.0 # 2020-09-11, for enabling OAuth2 with django-oauth-toolkit -django-countries==7.2.1 # 2021-07-15 -django-debug-toolbar==3.2.1 # 2021-05-21 -django-extensions==2.2.8 # 2020-02-14 for e.g. runserver_plus (usage: python3 manage.py runserver_plus --cert [certificate .crt file]) -django-filter==2.4.0 # 2021-06-08 -django-guardian==2.4.0 # 2021-07-15 +django-autocomplete-light==3.8.1 # 2021-06-06 +django-cors-headers==3.5.0 # 2020-09-11, for enabling OAuth2 with django-oauth-toolkit +django-countries==7.2.1 # 2021-07-15 +django-crispy-forms==1.13.0 # 2021-10-16 +crispy-bootstrap5==0.6 # 2021-10-16, bootstrap5 plugin for crispy forms +django-debug-toolbar==3.2.1 # 2021-05-21 +django-extensions==2.2.8 # 2020-02-14 for e.g. runserver_plus (usage: python3 manage.py runserver_plus --cert [certificate .crt file]) +django-filter==2.4.0 # 2021-06-08 +django-guardian==2.4.0 # 2021-07-15 django-mathjax==0.0.8 django-oauth-toolkit==1.3.2 # 2020-09-03 -django-silk==2.0.0 django-webpack-loader==1.0.0 # 2021-05-22, implicitly loads vendor bundles django-maintenancemode-2 # 2021-07-15 djangorestframework-csv # 2020-10-13 @@ -40,6 +41,8 @@ sphinx-rtd-theme==0.4.3 # 2020-02-21 Sphinx theme urllib3==1.26.6 # 2021-07-15, for sentry-sdk sentry-sdk==1.3.0 # 2021-07-15, req: certifi, urllib3 +# Silk monitoring +django-silk==4.1.0 # 2021-10-16 # Testing factory-boy==3.0.1 # 2020-09-27 @@ -55,7 +58,7 @@ Whoosh==2.7.4 ithenticate-api-python==0.8 mailchimp3==2.0.15 python-dateutil==2.6.0 -Pillow==8.2.0 # 2021-05-21 +Pillow==8.3.2 # 2021-10-06 html2text diff --git a/scipost_django/SciPost_v1/settings/base.py b/scipost_django/SciPost_v1/settings/base.py index ffc8355213d57f16db63fda7f84053c137024258..1b01461462a292183b09e15088a95cf63cdae08c 100644 --- a/scipost_django/SciPost_v1/settings/base.py +++ b/scipost_django/SciPost_v1/settings/base.py @@ -83,6 +83,8 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', + 'crispy_forms', + 'crispy_bootstrap5', 'django_countries', 'django_extensions', 'django_filters', @@ -114,7 +116,6 @@ INSTALLED_APPS = ( 'oauth2_provider', 'ontology', 'organizations', - 'partners', 'petitions', 'preprints', 'proceedings', @@ -137,6 +138,9 @@ SITE_ID = 1 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' +CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" +CRISPY_TEMPLATE_PACK = "bootstrap5" + OAUTH2_PROVIDER = { 'SCOPES': { 'read': 'Read scope', @@ -233,14 +237,16 @@ CSP_IMG_SRC = ("'self'", 'scipost.org', "'report-sample'", 'data:', 'ajax.googleapis.com', 'assets.crossref.org', 'licensebuttons.net', 'crossmark-cdn.crossref.org', 'www.paypalobjects.com') -CSP_SCRIPT_SRC = ("'self'", 'scipost.org', "'report-sample'", +CSP_SCRIPT_SRC = ("'self'", 'scipost.org', "'report-sample'", "'unsafe-inline'", 'ajax.googleapis.com', 'cdn.mathjax.org', 'cdnjs.cloudflare.com', 'crossmark-cdn.crossref.org', 'www.recaptcha.net', 'www.gstatic.com', 'www.gstatic.cn', 'code.jquery.com', 'static.mendeley.com', - 'cdn.plot.ly') + 'cdn.plot.ly', + 'unpkg.com/htmx.org@1.6.0' + ) CSP_STYLE_SRC = ("'self'", 'scipost.org', "'report-sample'", 'crossmark-cdn.crossref.org', "'unsafe-inline'", 'ajax.googleapis.com', 'code.jquery.com', @@ -272,6 +278,7 @@ TEMPLATES = [ 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'journals.context_processors.journals_processor', + 'ontology.context_processors.ontology_processor', ], }, }, diff --git a/scipost_django/SciPost_v1/settings/local_JSC.py b/scipost_django/SciPost_v1/settings/local_JSC.py index d74b491429eb93cff5a8159f9ecf04029c404ada..caeca49dc9df7135e500cc7f0f4cfb48d577c4aa 100644 --- a/scipost_django/SciPost_v1/settings/local_JSC.py +++ b/scipost_django/SciPost_v1/settings/local_JSC.py @@ -36,5 +36,9 @@ CSP_REPORT_ONLY = True # Mailgun credentials MAILGUN_API_KEY = get_secret('MAILGUN_API_KEY') +# iThenticate +ITHENTICATE_USERNAME = get_secret('ITHENTICATE_USERNAME') +ITHENTICATE_PASSWORD = get_secret('ITHENTICATE_PASSWORD') + # CORS headers CORS_ALLOW_ALL_ORIGINS = True # Dev only! diff --git a/scipost_django/SciPost_v1/signalprocessors.py b/scipost_django/SciPost_v1/signalprocessors.py index c14da3b739f385947dfb1a457ea502239e3a23a4..085b68cc7d75899d70ef9d808befa9a9d0cccb3c 100644 --- a/scipost_django/SciPost_v1/signalprocessors.py +++ b/scipost_django/SciPost_v1/signalprocessors.py @@ -22,7 +22,7 @@ def remove_objects_indexes(sender_type_id, object_type_id, object_id): if isinstance(instance, Submission): # Submission have complex status handling, so a status change should lead to # more drastic reindexing. - ids_list = [k['id'] for k in list(instance.thread.public().values('id'))] + ids_list = [k['id'] for k in list(instance.thread.values('id'))] objects = Submission.objects.filter(pk__in=ids_list) else: # Objects such as Reports, Comments, Commentaries, etc. may get rejected. This diff --git a/scipost_django/SciPost_v1/urls.py b/scipost_django/SciPost_v1/urls.py index 06cbd1eeab12043dcc5749122ee6b36bce7d7895..4cd2072104d4c58d6627e793d29956e3ea0c5b06 100644 --- a/scipost_django/SciPost_v1/urls.py +++ b/scipost_django/SciPost_v1/urls.py @@ -13,10 +13,24 @@ from organizations.views import OrganizationListView from affiliates.converters import Crossref_DOI_converter from colleges.converters import CollegeSlugConverter -from journals.converters import JournalDOILabelConverter +from comments.converters import ( + CommentDOILabelConverter, AuthorReplyDOILabelConverter +) +from common.converters import ( + UnicodeSlugConverter, + FourDigitYearConverter, TwoDigitMonthConverter, TwoDigitDayConverter +) +from journals.converters import ( + JournalDOILabelConverter, + IssueDOILabelConverter, + PublicationDOILabelConverter +) from ontology.converters import ( - AcademicFieldSlugConverter, - SpecialtySlugConverter + AcademicFieldSlugConverter, SpecialtySlugConverter +) +from submissions.converters import ( + IdentifierWithoutVersionNumberConverter, IdentifierConverter, + ReportDOILabelConverter ) @@ -28,11 +42,25 @@ from ontology.converters import ( register_converter(Crossref_DOI_converter, 'doi') # colleges register_converter(CollegeSlugConverter, 'college') +# comments +register_converter(CommentDOILabelConverter, 'comment_doi_label') +register_converter(AuthorReplyDOILabelConverter, 'author_reply_doi_label') +# common +register_converter(UnicodeSlugConverter, 'slug') +register_converter(FourDigitYearConverter, 'YYYY') +register_converter(TwoDigitMonthConverter, 'MM') +register_converter(TwoDigitDayConverter, 'DD') # journals register_converter(JournalDOILabelConverter, 'journal_doi_label') +register_converter(IssueDOILabelConverter, 'issue_doi_label') +register_converter(PublicationDOILabelConverter, 'publication_doi_label') # ontology register_converter(AcademicFieldSlugConverter, 'acad_field') register_converter(SpecialtySlugConverter, 'specialty') +# submissions +register_converter(IdentifierWithoutVersionNumberConverter, 'identifier_wo_vn_nr') +register_converter(IdentifierConverter, 'identifier') +register_converter(ReportDOILabelConverter, 'report_doi_label') ###################################### # End of custom converter registration diff --git a/scipost_django/api/urls.py b/scipost_django/api/urls.py index b37662f77b8437f0736b6f4311100a36b6b05f8f..84b4e983479058f6be97563936860ef1fe0fc5c2 100644 --- a/scipost_django/api/urls.py +++ b/scipost_django/api/urls.py @@ -2,7 +2,6 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.urls import include, path from rest_framework import routers diff --git a/scipost_django/careers/templates/careers/jobapplication_detail.html b/scipost_django/careers/templates/careers/jobapplication_detail.html index 07a9009633c623233a6deae14cb0d1b5141ae992..34bb32324a35a1df700df90dbbe0187d069bf21d 100644 --- a/scipost_django/careers/templates/careers/jobapplication_detail.html +++ b/scipost_django/careers/templates/careers/jobapplication_detail.html @@ -27,7 +27,7 @@ </p> <p> If you have not received the email, please check your spam box; - if you still cannot find it, <a href="mailto:admin@scipost.org">contact SciPost admin</a>. + if you still cannot find it, <a href="mailto:admin@{{ request.get_host }}">contact SciPost admin</a>. </p> {% elif jobapplication.status == jobapplication.VERIFIED %} <p> @@ -45,7 +45,7 @@ carefully save its URL, which is the following: </p> <p> - https://scipost.org{{ jobapplication.get_absolute_url }} + https://{{ request.get_host }}{{ jobapplication.get_absolute_url }} </p> diff --git a/scipost_django/careers/templates/careers/jobopening_list.html b/scipost_django/careers/templates/careers/jobopening_list.html index ac0df9ab8d90035ea6cb90b94f5f04efa95acd6b..36afbf00885d352d39a84023e8325a5883c8d998 100644 --- a/scipost_django/careers/templates/careers/jobopening_list.html +++ b/scipost_django/careers/templates/careers/jobopening_list.html @@ -59,7 +59,7 @@ <div class="m-2"> <p> Do you have special skills which you are convinced could help SciPost in its mission? - Get in touch with us at <a href="mailto:admin@scipost.org">admin@scipost.org</a>. + Get in touch with us at <a href="mailto:admin@{{ request.get_host }}">admin@{{ request.get_host }}</a>. We are always on the lookout for highly competent people. </p> <p> diff --git a/scipost_django/careers/views.py b/scipost_django/careers/views.py index 66533192b2772f6a84b0027893b9ec1399cb13af..819631e94af1db1147139611983f6a90796bac8e 100644 --- a/scipost_django/careers/views.py +++ b/scipost_django/careers/views.py @@ -4,6 +4,7 @@ __license__ = "AGPL v3" from django.contrib import messages from django.contrib.auth.mixins import UserPassesTestMixin +from django.contrib.sites.models import Site from django.urls import reverse_lazy from django.shortcuts import get_object_or_404, redirect from django.views.generic.detail import DetailView @@ -77,7 +78,7 @@ class JobOpeningApplyView(CreateView): mail_sender = DirectMailUtil( 'careers/jobapplication_ack', delayed_processing=False, - bcc=['admin@scipost.org',], + bcc=['admin@{domain}'.format(domain=Site.objects.get_current().domain),], jobapplication=self.object) mail_sender.send_mail() return redirect(self.get_success_url()) diff --git a/scipost_django/colleges/forms.py b/scipost_django/colleges/forms.py index 7099a0c4707f9e58c2dba62ca943e569939ef03a..b5e69f10f1238f6e67b6c50206ae91feff16e4b0 100644 --- a/scipost_django/colleges/forms.py +++ b/scipost_django/colleges/forms.py @@ -83,30 +83,6 @@ class FellowshipRemoveSubmissionForm(forms.ModelForm): return fellowship -class FellowVotingRemoveSubmissionForm(forms.ModelForm): - """ - Use this form in admin-accessible views only! It could possibly reveal the - identity of the Editor-in-charge! - """ - class Meta: - model = Fellowship - fields = [] - - def __init__(self, *args, **kwargs): - self.submission = kwargs.pop('submission') - super().__init__(*args, **kwargs) - - def clean(self): - if self.submission.editor_in_charge == self.instance.contributor: - self.add_error(None, ('Submission cannot be removed as the Fellow is' - ' Editor-in-charge of this Submission.')) - - def save(self): - fellowship = self.instance - fellowship.voting_pool.remove(self.submission) - return fellowship - - class FellowshipAddSubmissionForm(forms.ModelForm): submission = forms.ModelChoiceField( queryset=Submission.objects.none(), @@ -131,7 +107,7 @@ class FellowshipAddSubmissionForm(forms.ModelForm): class SubmissionAddFellowshipForm(forms.ModelForm): fellowship = forms.ModelChoiceField( queryset=None, to_field_name='id', - empty_label="Please choose the Fellow to add to the Pool") + empty_label="Please choose the Fellow to add to this Submission's Fellowship") class Meta: model = Submission @@ -149,28 +125,6 @@ class SubmissionAddFellowshipForm(forms.ModelForm): return submission -class SubmissionAddVotingFellowForm(forms.ModelForm): - fellowship = forms.ModelChoiceField( - queryset=None, to_field_name='id', - empty_label="Please choose the Fellow to add to the Submission's Voting Fellows") - - class Meta: - model = Submission - fields = [] - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - pool = self.instance.voting_fellows.values_list('id', flat=True) - self.fields['fellowship'].queryset = Fellowship.objects.active().exclude(id__in=pool) - - def save(self): - fellowship = self.cleaned_data['fellowship'] - submission = self.instance - submission.fellows.add(fellowship) - submission.voting_fellows.add(fellowship) - return submission - - class FellowshipRemoveProceedingsForm(forms.ModelForm): """ Use this form in admin-accessible views only! It could possibly reveal the diff --git a/scipost_django/colleges/templates/colleges/college_list.html b/scipost_django/colleges/templates/colleges/college_list.html index b500f62db402382e4eef47dff552b85c604f6a69..53e293757b0ebc31bd2c7aa3e319e66f5ab34dce 100644 --- a/scipost_django/colleges/templates/colleges/college_list.html +++ b/scipost_django/colleges/templates/colleges/college_list.html @@ -84,7 +84,7 @@ <p> Does your field not have a College yet? Help us to form one by - <a href="mailto:admin@scipost.org">sending us your suggestions</a> for potential Fellows. + <a href="mailto:admin@{{ request.get_host }}">sending us your suggestions</a> for potential Fellows. </p> </div> </div> diff --git a/scipost_django/colleges/templates/colleges/fellowship_submission_remove.html b/scipost_django/colleges/templates/colleges/fellowship_submission_remove.html index 1da3b6041ae1ae839325815806a37b6b7a8f127e..e186587ed17d6040337cd7a78f75a69bf616c603 100644 --- a/scipost_django/colleges/templates/colleges/fellowship_submission_remove.html +++ b/scipost_django/colleges/templates/colleges/fellowship_submission_remove.html @@ -7,13 +7,13 @@ <a href="{% url 'colleges:colleges' %}" class="breadcrumb-item">Colleges</a> <a href="{% url 'colleges:fellowships' %}" class="breadcrumb-item">Fellowships</a> <a href="{{ fellowship.get_absolute_url }}" class="breadcrumb-item">Fellowship details</a> - <span class="breadcrumb-item">Remove Submission from Fellow's Pool</span> + <span class="breadcrumb-item">Remove Submission</span> {% endblock %} {% block pagetitle %}: Remove Submission from Fellowship{% endblock pagetitle %} {% block content %} - <h1>Remove Submission from Pool</h1> + <h1>Remove Submission from this Fellowship</h1> <h2 class="text-primary">Fellowship {{ fellowship }}</h2> <h3>Submission details</h3> @@ -23,7 +23,7 @@ <form method="post"> {% csrf_token %} {{ form|bootstrap }} - <input class="btn btn-danger px-3" type="submit" value="Remove from Pool"> + <input class="btn btn-danger px-3" type="submit" value="Remove"> </form> diff --git a/scipost_django/colleges/templates/colleges/fellowship_submission_remove_voting.html b/scipost_django/colleges/templates/colleges/fellowship_submission_remove_voting.html deleted file mode 100644 index 10567da66f4284c6bd483920bc59749d20eec81a..0000000000000000000000000000000000000000 --- a/scipost_django/colleges/templates/colleges/fellowship_submission_remove_voting.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends 'submissions/admin/base.html' %} - -{% load bootstrap %} - -{% block breadcrumb_items %} - {{ block.super }} - <a href="{% url 'colleges:submission_voting_fellows' submission.preprint.identifier_w_vn_nr %}" class="breadcrumb-item">Submission's Voting Fellows</a> - <span class="breadcrumb-item">Remove Fellow</span> -{% endblock %} - -{% block pagetitle %}: Remove Fellow from Submission's Voting Fellows{% endblock pagetitle %} - -{% block content %} - <h1>Remove Fellow from Submission's Voting Fellows</h1> - <h2 class="text-primary">Fellowship {{ fellowship }}</h2> - - <h3>Submission details</h3> - {% include 'submissions/_submission_summary.html' with submission=submission %} - <br> - - <form method="post"> - {% csrf_token %} - {{ form|bootstrap }} - <input class="btn btn-danger px-3" type="submit" value="Remove from Submission's Voting Fellows"> - </form> - - -{% endblock %} diff --git a/scipost_django/colleges/templates/colleges/submission_add_for_voting.html b/scipost_django/colleges/templates/colleges/submission_add_for_voting.html deleted file mode 100644 index dc316bb4a4c928dab705a084ec1a2a9642da6064..0000000000000000000000000000000000000000 --- a/scipost_django/colleges/templates/colleges/submission_add_for_voting.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends 'submissions/admin/base.html' %} - -{% load bootstrap %} - -{% block breadcrumb_items %} - {{ block.super }} - <a href="{% url 'colleges:submission_voting_fellows' submission.preprint.identifier_w_vn_nr %}" class="breadcrumb-item">Submission's Voting Fellows</a> - <span class="breadcrumb-item">Add Fellowship for voting</span> -{% endblock %} - -{% block pagetitle %}: Add Fellowship for voting{% endblock pagetitle %} - -{% block content %} - <h1>Add Fellowship to Submission's Voting Fellows</h1> - <h2 class="text-primary">{{submission.title}}</h2> - <h3 class="mb-3">by {{submission.author_list}}</h3> - {% include 'submissions/_submission_summary.html' with submission=submission hide_title=1 show_abstract=1 %} - <br> - - <h3>Choose one of the following (active) Fellowships to add to the Submission's Voting Fellows:</h3> - {% include 'colleges/_conflicts_of_interest.html' with submission=submission %} - <br> - <form method="post"> - {% csrf_token %} - {{ form|bootstrap }} - <input class="btn btn-primary" type="submit" value="Add Fellowship"> - </form> - - -{% endblock %} diff --git a/scipost_django/colleges/templates/colleges/submission_fellowships.html b/scipost_django/colleges/templates/colleges/submission_fellowships.html index 7f8c90b5be703b05b5258ba16035d8d985cb8afc..801553bb7b0db88884c82dd0956d06e4f72bff65 100644 --- a/scipost_django/colleges/templates/colleges/submission_fellowships.html +++ b/scipost_django/colleges/templates/colleges/submission_fellowships.html @@ -1,15 +1,19 @@ {% extends 'submissions/admin/base.html' %} {% load bootstrap %} +{% load user_groups %} {% block breadcrumb_items %} {{ block.super }} <span class="breadcrumb-item">Submission Fellowships</span> {% endblock %} -{% block pagetitle %}: Submission Felloswhips{% endblock pagetitle %} +{% block pagetitle %}: Submission Fellowships{% endblock pagetitle %} {% block content %} + + {% is_ed_admin request.user as is_ed_admin %} + <h1>Submission Fellowships</h1> <h2 class="text-primary">{{ submission.title }}</h2> <h3 class="mb-3">by {{ submission.author_list }}</h3> @@ -24,7 +28,7 @@ <th>Fellowship ID</th> <th>Fellow</th> <th>Type</th> - <th colspan="2">Date range</th> + <th colspan="2"></th> </tr> </thead> <tbody> @@ -34,7 +38,9 @@ <td>{{ fellowship.contributor }}</td> <td>{{ fellowship.guest|yesno:"Guest fellowship,Regular fellowship"|safe }}</td> <td> - <a class="text-danger" href="{% url 'colleges:fellowship_remove_submission' fellowship.id submission.preprint.identifier_w_vn_nr %}">Remove this Fellow from Submission's fellowhship</a> + {% if is_ed_admin %} + <a class="text-danger" href="{% url 'colleges:fellowship_remove_submission' fellowship.id submission.preprint.identifier_w_vn_nr %}">Remove this Fellow from Submission's fellowhship</a> + {% endif %} </td> </tr> {% endfor %} diff --git a/scipost_django/colleges/templates/colleges/submission_voting_fellows.html b/scipost_django/colleges/templates/colleges/submission_voting_fellows.html deleted file mode 100644 index 6d513c0bfad3ebba25eb9b17f991694d73c19736..0000000000000000000000000000000000000000 --- a/scipost_django/colleges/templates/colleges/submission_voting_fellows.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'submissions/admin/base.html' %} - -{% load bootstrap %} - -{% block breadcrumb_items %} - {{ block.super }} - <span class="breadcrumb-item">Submission's Voting Fellows</span> -{% endblock %} - -{% block pagetitle %}: Submission's Voting Fellows{% endblock pagetitle %} - -{% block content %} - <h1>Submission's Voting Fellows</h1> - <h2 class="text-primary">{{submission.title}}</h2> - <h3 class="mb-3">by {{submission.author_list}}</h3> - {% include 'submissions/_submission_summary.html' with submission=submission hide_title=1 show_abstract=1 %} - <br> - - <h3>Voting Fellows</h3> - {% include 'colleges/_conflicts_of_interest.html' with submission=submission %} - <table class="table table-hover"> - <thead> - <tr> - <th>Fellowship ID</th> - <th>Fellow</th> - <th>Type</th> - <th colspan="2">Date range</th> - </tr> - </thead> - <tbody> - {% for fellowship in submission.voting_fellows.all %} - <tr> - <td>{{ fellowship.id }}</td> - <td>{{ fellowship.contributor }}</td> - <td>{{ fellowship.guest|yesno:"Guest fellowship,Regular fellowship"|safe }}</td> - <td> - <a class="text-danger" href="{% url 'colleges:fellowship_remove_submission_voting' fellowship.id submission.preprint.identifier_w_vn_nr %}">Remove this Fellowship from Submission's Voting Fellows</a> - </td> - </tr> - {% endfor %} - <tr> - <td colspan="4" class="py-3 text-center"><a href="{% url 'colleges:submission_add_fellowship_voting' submission.preprint.identifier_w_vn_nr %}">Add Fellowship to this Submission's Voting Fellows</a></td> - </tr> - </tbody> - </table> - - -{% endblock %} diff --git a/scipost_django/colleges/urls.py b/scipost_django/colleges/urls.py index c89ecb16556b841b00d3a1703a9dc64b79c39b51..4567abb69c3393e2efde62bdcae3f81fedb6b407 100644 --- a/scipost_django/colleges/urls.py +++ b/scipost_django/colleges/urls.py @@ -2,11 +2,8 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.urls import path -from submissions.constants import SUBMISSIONS_COMPLETE_REGEX - from . import views @@ -31,16 +28,16 @@ urlpatterns = [ ), # Fellowships - url( - r'^fellowships/(?P<contributor_id>[0-9]+)/add/$', + path( + 'fellowships/<int:contributor_id>/add/', views.FellowshipCreateView.as_view(), name='fellowship_create'), - url( - r'^fellowships/(?P<pk>[0-9]+)/update/$', + path( + 'fellowships/<int:pk>/update/', views.FellowshipUpdateView.as_view(), name='fellowship_update'), - url( - r'^fellowships/(?P<pk>[0-9]+)/$', + path( + 'fellowships/<int:pk>/', views.FellowshipDetailView.as_view(), name='fellowship_detail' ), @@ -59,78 +56,80 @@ urlpatterns = [ views.FellowshipListView.as_view(), name='fellowships' ), - - url( - r'^fellowships/(?P<pk>[0-9]+)/email_start/$', + path( + 'fellowships/<int:pk>/email_start/', views.FellowshipStartEmailView.as_view(), name='fellowship_email_start' ), - - url(r'^fellowships/submissions/{regex}/$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_fellowships, - name='submission'), - url(r'^fellowships/submissions/{regex}/voting$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_voting_fellows, - name='submission_voting_fellows'), - url(r'^fellowships/submissions/{regex}/add$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_add_fellowship, - name='submission_add_fellowship'), - url(r'^fellowships/submissions/{regex}/voting/add$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.submission_add_fellowship_voting, - name='submission_add_fellowship_voting'), - url(r'^fellowships/(?P<id>[0-9]+)/submissions/{regex}/voting/remove$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.fellowship_remove_submission_voting, - name='fellowship_remove_submission_voting'), - - url(r'^fellowships/(?P<id>[0-9]+)/submissions/{regex}/remove$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.fellowship_remove_submission, - name='fellowship_remove_submission'), - url(r'^fellowships/(?P<id>[0-9]+)/submissions/add$', - views.fellowship_add_submission, name='fellowship_add_submission'), - - url(r'^fellowships/(?P<id>[0-9]+)/proceedings/add$', - views.fellowship_add_proceedings, name='fellowship_add_proceedings'), - url(r'^fellowships/(?P<id>[0-9]+)/proceedings/(?P<proceedings_id>[0-9]+)/remove$', - views.fellowship_remove_proceedings, name='fellowship_remove_proceedings'), + path( + 'fellowships/submissions/<identifier:identifier_w_vn_nr>/', + views.submission_fellowships, + name='submission' + ), + path( + 'fellowships/submissions/<identifier:identifier_w_vn_nr>/add', + views.submission_add_fellowship, + name='submission_add_fellowship' + ), + path( + 'fellowships/<int:id>/submissions/<identifier:identifier_w_vn_nr>/remove', + views.fellowship_remove_submission, + name='fellowship_remove_submission' + ), + path( + 'fellowships/<int:id>/submissions/add', + views.fellowship_add_submission, + name='fellowship_add_submission' + ), + path( + 'fellowships/<int:id>/proceedings/add', + views.fellowship_add_proceedings, + name='fellowship_add_proceedings' + ), + path( + 'fellowships/<int:id>/proceedings/<int:proceedings_id>/remove', + views.fellowship_remove_proceedings, + name='fellowship_remove_proceedings' + ), # Potential Fellowships - url( - r'^potentialfellowships/add/$', + path( + 'potentialfellowships/add/', views.PotentialFellowshipCreateView.as_view(), name='potential_fellowship_create' ), - url( - r'^potentialfellowships/(?P<pk>[0-9]+)/update/$', + path( + 'potentialfellowships/<int:pk>/update/', views.PotentialFellowshipUpdateView.as_view(), name='potential_fellowship_update' ), - url( - r'^potentialfellowsships/(?P<pk>[0-9]+)/update_status/$', + path( + 'potentialfellowsships/<int:pk>/update_status/', views.PotentialFellowshipUpdateStatusView.as_view(), name='potential_fellowship_update_status' ), - url( - r'^potentialfellowships/(?P<pk>[0-9]+)/delete/$', + path( + 'potentialfellowships/<int:pk>/delete/', views.PotentialFellowshipDeleteView.as_view(), name='potential_fellowship_delete' ), - url( - r'^potentialfellowships/(?P<pk>[0-9]+)/events/add/$', + path( + 'potentialfellowships/<int:pk>/events/add/', views.PotentialFellowshipEventCreateView.as_view(), name='potential_fellowship_event_create' ), - url( - r'^potentialfellowships/(?P<potfel_id>[0-9]+)/vote/(?P<vote>[AND])/$', + path( + 'potentialfellowships/<int:potfel_id>/vote/<str:vote>/', views.vote_on_potential_fellowship, name='vote_on_potential_fellowship' ), - url( - r'^potentialfellowships/(?P<pk>[0-9]+)/email_initial/$', + path( + 'potentialfellowships/<int:pk>/email_initial/', views.PotentialFellowshipInitialEmailView.as_view(), name='potential_fellowship_email_initial' ), - url( - r'^potentialfellowships/(?P<pk>[0-9]+)/$', + path( + 'potentialfellowships/<int:pk>/', views.PotentialFellowshipDetailView.as_view(), name='potential_fellowship_detail' ), diff --git a/scipost_django/colleges/views.py b/scipost_django/colleges/views.py index dbebf7537b2841be5bd048d2aea132ba7e762937..9bd33d25a0d16a083c0edbc4090120fad18e589f 100644 --- a/scipost_django/colleges/views.py +++ b/scipost_django/colleges/views.py @@ -6,7 +6,7 @@ import datetime from django.contrib import messages from django.contrib.auth.models import Group -from django.contrib.auth.decorators import login_required, permission_required +from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.urls import reverse, reverse_lazy from django.http import Http404 from django.shortcuts import get_object_or_404, render, redirect @@ -16,6 +16,7 @@ from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.views.generic.list import ListView from submissions.models import Submission +from submissions.permissions import is_edadmin_or_senior_fellow from .constants import ( POTENTIAL_FELLOWSHIP_STATUSES, POTENTIAL_FELLOWSHIP_EVENT_STATUSUPDATED, @@ -24,8 +25,7 @@ from .constants import ( POTENTIAL_FELLOWSHIP_EVENT_VOTED_ON, POTENTIAL_FELLOWSHIP_EVENT_EMAILED) from .forms import FellowshipForm, FellowshipRemoveSubmissionForm,\ FellowshipAddSubmissionForm, SubmissionAddFellowshipForm,\ - FellowshipRemoveProceedingsForm, FellowshipAddProceedingsForm, SubmissionAddVotingFellowForm,\ - FellowVotingRemoveSubmissionForm,\ + FellowshipRemoveProceedingsForm, FellowshipAddProceedingsForm, \ PotentialFellowshipForm, PotentialFellowshipStatusForm, PotentialFellowshipEventForm from .models import College, Fellowship, PotentialFellowship, PotentialFellowshipEvent @@ -185,7 +185,7 @@ def email_College_Fellows(request, college): @login_required -@permission_required('scipost.can_manage_college_composition', raise_exception=True) +@user_passes_test(is_edadmin_or_senior_fellow) def submission_fellowships(request, identifier_w_vn_nr): """ List all Fellowships related to Submission. @@ -199,70 +199,9 @@ def submission_fellowships(request, identifier_w_vn_nr): @login_required -@permission_required('scipost.can_manage_college_composition', raise_exception=True) -def submission_voting_fellows(request, identifier_w_vn_nr): - """ - List all Fellowships selected for voting on the EIC related to Submission. - """ - submission = get_object_or_404(Submission, preprint__identifier_w_vn_nr=identifier_w_vn_nr) - - context = { - 'submission': submission - } - return render(request, 'colleges/submission_voting_fellows.html', context) - - -@login_required -@permission_required('scipost.can_manage_college_composition', raise_exception=True) -def submission_add_fellowship_voting(request, identifier_w_vn_nr): - """Add Fellowship to the Fellows voting on the EICRecommendation of a Submission.""" - submission = get_object_or_404(Submission, preprint__identifier_w_vn_nr=identifier_w_vn_nr) - form = SubmissionAddVotingFellowForm(request.POST or None, instance=submission) - - if form.is_valid(): - form.save() - messages.success(request, 'Fellowship {fellowship} ({id}) added to voting Fellows.'.format( - fellowship=form.cleaned_data['fellowship'].contributor, - id=form.cleaned_data['fellowship'].id)) - return redirect(reverse('colleges:submission_voting_fellows', - args=(submission.preprint.identifier_w_vn_nr,))) - - context = { - 'submission': submission, - 'form': form, - } - return render(request, 'colleges/submission_add_for_voting.html', context) - - -@login_required -@permission_required('scipost.can_manage_college_composition', raise_exception=True) -def fellowship_remove_submission_voting(request, id, identifier_w_vn_nr): - """Remove Fellow from the EICRecommendation voting group for the Submission.""" - fellowship = get_object_or_404(Fellowship, id=id) - submission = get_object_or_404( - fellowship.voting_pool.all(), preprint__identifier_w_vn_nr=identifier_w_vn_nr) - form = FellowVotingRemoveSubmissionForm(request.POST or None, - submission=submission, instance=fellowship) - - if form.is_valid() and request.POST: - form.save() - messages.success(request, 'Submission {submission_id} removed from Fellowship.'.format( - submission_id=identifier_w_vn_nr)) - return redirect(reverse('colleges:submission_voting_fellows', - args=(submission.preprint.identifier_w_vn_nr,))) - - context = { - 'fellowship': fellowship, - 'form': form, - 'submission': submission - } - return render(request, 'colleges/fellowship_submission_remove_voting.html', context) - - -@login_required -@permission_required('scipost.can_manage_college_composition', raise_exception=True) +@user_passes_test(is_edadmin_or_senior_fellow) def submission_add_fellowship(request, identifier_w_vn_nr): - """Add Fellowship to the pool of a Submission.""" + """Add Fellowship to a Submission's Fellowship.""" submission = get_object_or_404(Submission, preprint__identifier_w_vn_nr=identifier_w_vn_nr) form = SubmissionAddFellowshipForm(request.POST or None, instance=submission) @@ -284,7 +223,7 @@ def submission_add_fellowship(request, identifier_w_vn_nr): @login_required @permission_required('scipost.can_manage_college_composition', raise_exception=True) def fellowship_remove_submission(request, id, identifier_w_vn_nr): - """Remove Submission from the pool of a Fellowship.""" + """Remove Submission from the Fellowship.""" fellowship = get_object_or_404(Fellowship, id=id) submission = get_object_or_404( fellowship.pool.all(), preprint__identifier_w_vn_nr=identifier_w_vn_nr) diff --git a/scipost_django/commentaries/templates/commentaries/commentary_list.html b/scipost_django/commentaries/templates/commentaries/commentary_list.html index 84d5838600fc5e63c7349120598e4d013a28488a..298412e6bc354ce5bbc1a3a7a0f08cfd0cae7232 100644 --- a/scipost_django/commentaries/templates/commentaries/commentary_list.html +++ b/scipost_django/commentaries/templates/commentaries/commentary_list.html @@ -8,7 +8,7 @@ {% block content %} <div class="row"> - <div class="col-md-4"> + <div class="col-md-6"> <div class="p-3 mb-3 bg-light scipost-bar border min-height-190"> <h1 class="mb-3">SciPost Commentaries</h1> <h4> @@ -19,7 +19,7 @@ </h3> </div> </div> - <div class="col-md-4"> + <div class="col-md-6"> <div class="p-3 mb-3 bg-light scipost-bar border min-height-190"> <h2>Search SciPost Commentaries:</h2> <form action="{% url 'commentaries:commentaries' %}" class="small" method="get"> @@ -28,44 +28,12 @@ </form> </div> </div> - <div class="col-md-4"> - <div class="p-3 mb-3 bg-light scipost-bar border min-height-190"> - <h2>View SciPost Commentaries</h2> - <ul> - <li>Last <a href="{% url 'commentaries:browse' nrweeksback=1 %}">week</a>, <a href="{% url 'commentaries:browse' nrweeksback=4 %}">month</a> or <a href="{% url 'commentaries:browse' nrweeksback=52 %}">year</a> </li> - </ul> - </div> - </div> </div> - {% if not browse and recent %} - <hr> - <div class="row"> - <div class="col-12"> - <h2>Recent Comments</h2> - </div> - <div class="col-12"> - <ul class="list-group list-group-flush"> - {% for comment in comment_list %} - <li class="list-group-item"> - {% include 'comments/_comment_card_content.html' with comment=comment %} - </li> - {% endfor %} - </ul> - </div> - </div> - {% endif %} - <hr> <div class="row"> <div class="col-12"> - {% if recent %} - <h2>Recently active Commentaries:</h2> - {% elif browse %} - <h2>Commentaries in the last {{ nrweeksback }} week{{ nrweeksback|pluralize }}:</h2> - {% else %} - <h2>Search results:</h2> - {% endif %} + <h2>Commentaries</h2> </div> {% if is_paginated %} <div class="col-12"> @@ -79,7 +47,7 @@ {% include 'commentaries/_commentary_card_content.html' with commentary=object %} </li> {% empty %} - <h3><em>No match found for your search query.</em></h3> + <h3><em>No match found.</em></h3> {% endfor %} </ul> </div> diff --git a/scipost_django/commentaries/templates/commentaries/howto.html b/scipost_django/commentaries/templates/commentaries/howto.html index 1c46b2044a18ad1aa043dbe4157d9d0787120a44..73ef85003eed0ab128fb1a9bc349268f97ef9195 100644 --- a/scipost_django/commentaries/templates/commentaries/howto.html +++ b/scipost_django/commentaries/templates/commentaries/howto.html @@ -17,7 +17,7 @@ <br/> <h3>Standardized URLs</h3> <p>In order to facilitate localization of commentaries on particular publications, within SciPost, all Commentary Pages have a standardized URL of the form</p> - <p class="text-blue">https://scipost.org/commentary/IDENTIFIER</p> + <p class="text-blue">https://{{ request.get_host }}/commentary/IDENTIFIER</p> <p>where IDENTIFIER is either the (by definition unique and stable) DOI of the published paper, or the arXiv identifier in new (arXiv:####.#####v#) or old (cond-mat/#######v#) style. NOTE: for arXiv, we systematically require the presence of the version number in order to avoid confusion (and yes, we do so even if there exists only one version).</p> </div> </div> diff --git a/scipost_django/commentaries/templates/commentaries/vet_commentary_email_accepted.html b/scipost_django/commentaries/templates/commentaries/vet_commentary_email_accepted.html index 8e5814eb3f2531e0a19039c27843eb77b9381fa0..56105bd04806a1db84d6376e31f4ff588ac487c6 100644 --- a/scipost_django/commentaries/templates/commentaries/vet_commentary_email_accepted.html +++ b/scipost_django/commentaries/templates/commentaries/vet_commentary_email_accepted.html @@ -1,6 +1,6 @@ Dear {{ commentary.requested_by.profile.get_title_display }} {{ commentary.requested_by.user.last_name }}, -The Commentary Page you have requested, concerning publication with title {{ commentary.title }} by {{ commentary.author_list }}, has been activated at https://scipost.org/commentary/{{ commentary.arxiv_or_DOI_string }}. +The Commentary Page you have requested, concerning publication with title {{ commentary.title }} by {{ commentary.author_list }}, has been activated at https://{{ domain }}/commentary/{{ commentary.arxiv_or_DOI_string }}. You are now welcome to submit your comments. Thank you for your contribution, diff --git a/scipost_django/commentaries/tests/test_views.py b/scipost_django/commentaries/tests/test_views.py index afce9b2844a60e711119ace19456b57516595494..2848b6c069b28be4f4e8941c080c634e28beff5e 100644 --- a/scipost_django/commentaries/tests/test_views.py +++ b/scipost_django/commentaries/tests/test_views.py @@ -138,27 +138,6 @@ class VetCommentaryRequestsTest(TestCase): self.assertTrue(type(response.context['commentary_to_vet']) is Commentary) -class BrowseCommentariesTest(TestCase): - """Test cases for `browse` view.""" - - def setUp(self): - add_groups_and_permissions() - CommentaryFactory(requested_by=ContributorFactory()) - self.view_url = reverse('commentaries:browse', kwargs={ - 'nrweeksback': '1' - }) - - def test_response_list(self): - '''Test if the browse view is passing commentaries to anonymous users.''' - response = self.client.get(self.view_url) - self.assertEqual(response.status_code, 200) - - # The created vetted Commentary is found! - self.assertTrue(response.context['commentary_list'].count() >= 1) - # The search form is passed trough the view... - self.assertTrue(type(response.context['form']) is CommentarySearchForm) - - class CommentaryDetailTest(TestCase): def setUp(self): add_groups_and_permissions() diff --git a/scipost_django/commentaries/urls.py b/scipost_django/commentaries/urls.py index 2264ad6a5b9dc48119eae33e0233e20e28a54305..5d16b525ab7a4b8c171184c3bf558a00cf44b800 100644 --- a/scipost_django/commentaries/urls.py +++ b/scipost_django/commentaries/urls.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path, re_path from django.views.generic import TemplateView from . import views @@ -11,38 +11,82 @@ app_name = 'commentaries' urlpatterns = [ # Commentaries - url(r'^$', views.CommentaryListView.as_view(), name='commentaries'), - url(r'^browse/(?P<nrweeksback>[0-9]{1,3})/$', - views.CommentaryListView.as_view(), name='browse'), - url(r'^howto$', TemplateView.as_view(template_name='commentaries/howto.html'), name='howto'), + path( + '', + views.CommentaryListView.as_view(), + name='commentaries' + ), + path( + 'howto', + TemplateView.as_view(template_name='commentaries/howto.html'), + name='howto' + ), # Match a DOI-based link: - url(r'^(?P<arxiv_or_DOI_string>10.[0-9]{4,9}/[-._;()/:a-zA-Z0-9]+)/$', - views.commentary_detail, name='commentary'), + re_path( + r'^(?P<arxiv_or_DOI_string>10.[0-9]{4,9}/[-._;()/:a-zA-Z0-9]+)/$', + views.commentary_detail, + name='commentary' + ), # Match an arxiv-based link: # new style identifiers: - url(r'^(?P<arxiv_or_DOI_string>arXiv:[0-9]{4,}.[0-9]{5,}(v[0-9]+)?)/$', - views.commentary_detail, name='commentary'), + re_path( + r'^(?P<arxiv_or_DOI_string>arXiv:[0-9]{4,}.[0-9]{5,}(v[0-9]+)?)/$', + views.commentary_detail, + name='commentary' + ), # old style identifiers: - url(r'^(?P<arxiv_or_DOI_string>arXiv:[a-z-]+/[0-9]{7,}(v[0-9]+)?)/$', - views.commentary_detail, name='commentary'), - - url(r'^request_commentary$', views.request_commentary, name='request_commentary'), - url(r'^request_commentary/published_article$', views.RequestPublishedArticle.as_view(), - name='request_published_article'), - url(r'^request_commentary/arxiv_preprint$', views.RequestArxivPreprint.as_view(), - name='request_arxiv_preprint'), - url(r'^prefill_using_DOI$', views.prefill_using_DOI, name='prefill_using_DOI'), - url(r'^prefill_using_arxiv_identifier$', views.prefill_using_arxiv_identifier, - name='prefill_using_arxiv_identifier'), - url(r'^vet_commentary_requests$', views.vet_commentary_requests, - name='vet_commentary_requests'), - url(r'^vet_commentary_requests/(?P<commentary_id>[0-9]+)$', views.vet_commentary_requests, - name='vet_commentary_requests_submit'), - url(r'^vet_commentary_requests/(?P<commentary_id>[0-9]+)/modify$', - views.modify_commentary_request, name='modify_commentary_request'), + re_path( + r'^(?P<arxiv_or_DOI_string>arXiv:[a-z-]+/[0-9]{7,}(v[0-9]+)?)/$', + views.commentary_detail, + name='commentary' + ), + + path( + 'request_commentary', + views.request_commentary, + name='request_commentary' + ), + path( + 'request_commentary/published_article', + views.RequestPublishedArticle.as_view(), + name='request_published_article' + ), + path( + 'request_commentary/arxiv_preprint', + views.RequestArxivPreprint.as_view(), + name='request_arxiv_preprint' + ), + path( + 'prefill_using_DOI', + views.prefill_using_DOI, + name='prefill_using_DOI' + ), + path( + 'prefill_using_arxiv_identifier', + views.prefill_using_arxiv_identifier, + name='prefill_using_arxiv_identifier' + ), + path( + 'vet_commentary_requests', + views.vet_commentary_requests, + name='vet_commentary_requests' + ), + path( + 'vet_commentary_requests/<int:commentary_id>', + views.vet_commentary_requests, + name='vet_commentary_requests_submit' + ), + path( + 'vet_commentary_requests/<int:commentary_id>/modify', + views.modify_commentary_request, + name='modify_commentary_request' + ), # Commentaries on SciPost Publications - url(r'^publications/(?P<doi_label>[a-zA-Z]+.[0-9]+.[0-9]+.[0-9]{3,})/comment$', - views.comment_on_publication, name='comment_on_publication') + re_path( + r'^publications/(?P<doi_label>[a-zA-Z]+.[0-9]+.[0-9]+.[0-9]{3,})/comment$', + views.comment_on_publication, + name='comment_on_publication' + ) ] diff --git a/scipost_django/commentaries/views.py b/scipost_django/commentaries/views.py index bb4e7f4af15ed294eb8c155feda750277b9022ec..296bf82483df8c1fa0a8d032ef19a12f475c69f8 100644 --- a/scipost_django/commentaries/views.py +++ b/scipost_django/commentaries/views.py @@ -5,6 +5,7 @@ __license__ = "AGPL v3" from django.shortcuts import get_object_or_404, render from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required +from django.contrib.sites.models import Site from django.core.mail import EmailMessage from django.urls import reverse, reverse_lazy from django.db import transaction @@ -123,10 +124,13 @@ def vet_commentary_requests(request, commentary_id=None): form = VetCommentaryForm(request.POST or None, user=request.user, commentary_id=commentary_id) if form.is_valid(): + domain = Site.objects.get_current().domain + # Get commentary commentary = form.get_commentary() email_context = { - 'commentary': commentary + 'commentary': commentary, + 'domain': domain } # Retrieve email_template for action @@ -147,9 +151,9 @@ def vet_commentary_requests(request, commentary_id=None): 'SciPost Commentary Page activated', email_text, commentary.requested_by.user.email, - ['commentaries@scipost.org'] + ['commentaries@%s' % domain] ) - emailmessage = EmailMessage(*email_args, reply_to=['commentaries@scipost.org']) + emailmessage = EmailMessage(*email_args, reply_to=['commentaries@%s' % domain]) emailmessage.send(fail_silently=False) commentary = form.process_commentary() @@ -171,6 +175,8 @@ def modify_commentary_request(request, commentary_id): id=commentary_id) form = RequestCommentaryForm(request.POST or None, instance=commentary) if form.is_valid(): + domain = Site.objects.get_current().domain + # Process commentary data commentary = form.save(commit=False) commentary.vetted = True @@ -178,14 +184,17 @@ def modify_commentary_request(request, commentary_id): # Send email and process form email_template = 'commentaries/vet_commentary_email_modified.html' - email_text = render_to_string(email_template, {'commentary': commentary}) + email_text = render_to_string( + email_template, + {'commentary': commentary, 'domain': domain} + ) email_args = ( 'SciPost Commentary Page activated', email_text, commentary.requested_by.user.email, - ['commentaries@scipost.org'] + ['commentaries@%s' % domain] ) - emailmessage = EmailMessage(*email_args, reply_to=['commentaries@scipost.org']) + emailmessage = EmailMessage(*email_args, reply_to=['commentaries@%s' % domain]) emailmessage.send(fail_silently=False) messages.success(request, 'SciPost Commentary request modified and vetted.') @@ -214,21 +223,10 @@ class CommentaryListView(PaginationMixin, ListView): def get_context_data(self, **kwargs): # Call the base implementation first to get a context context = super().get_context_data(**kwargs) - # Get newest comments context['comment_list'] = Comment.objects.vetted().order_by('-date_submitted')[:10] - # Form into the context! context['form'] = self.form - - # To customize display in the template - if 'acad_field' in self.kwargs: - context['acad_field'] = self.kwargs['acad_field'] - context['nrweeksback'] = self.kwargs['nrweeksback'] - context['browse'] = True - elif not any(self.request.GET[field] for field in self.request.GET): - context['recent'] = True - return context diff --git a/scipost_django/comments/converters.py b/scipost_django/comments/converters.py new file mode 100644 index 0000000000000000000000000000000000000000..4effaa8d5589a70b9b4c33567da3a8d43d72571e --- /dev/null +++ b/scipost_django/comments/converters.py @@ -0,0 +1,25 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + +class CommentDOILabelConverter: + regex = r'^(10.21468/)?SciPost.Comment.[0-9]+' + + def to_python(self, value): + """Strip the DOI prefix if present; check if Comment exists.""" + doi_label = value + if doi_label.startswith('10.21468/'): + doi_label = doi_label.partition('10.21468/')[2] + from comments.models import Comment + try: + return Comment.objects.get(doi_label=doi_label).doi_label + except Comment.DoesNotExist: + return ValueError + return doi_label + + def to_url(self, value): + return value + + +class AuthorReplyDOILabelConverter(CommentDOILabelConverter): + regex = r'^(10.21468/)?SciPost.AuthorReply.[0-9]+' diff --git a/scipost_django/comments/forms.py b/scipost_django/comments/forms.py index 6842ae1bca4c3f551d4d846fcba36f75f7d1fb3c..62545b84dbd70ca1a8d56734ac32b4d98328a703 100644 --- a/scipost_django/comments/forms.py +++ b/scipost_django/comments/forms.py @@ -3,6 +3,11 @@ __license__ = "AGPL v3" from django import forms +from django.db.models import Q + +from crispy_forms.helper import FormHelper +from crispy_forms.layout import Layout, Div +from crispy_bootstrap5.bootstrap5 import FloatingField from .constants import COMMENT_ACTION_CHOICES, COMMENT_ACTION_REFUSE, \ COMMENT_REFUSAL_CHOICES, COMMENT_REFUSAL_EMPTY @@ -46,3 +51,54 @@ class VetCommentForm(forms.Form): if data['refusal_reason'] == str(COMMENT_REFUSAL_EMPTY): self.add_error(None, 'Please choose a valid refusal reason') return data + + +class CommentTextSearchForm(forms.Form): + """Search for Comment""" + text = forms.CharField(max_length=1000, required=False, label="Text") + + def search_results(self): + """Return all Comment objects according to search""" + return Comment.objects.vetted().filter( + comment_text__icontains=self.cleaned_data['text'], + ).order_by('-date_submitted') + + +class CommentSearchForm(forms.Form): + object_title = forms.CharField( + max_length=100, + required=False + ) + + def __init__(self, *args, **kwargs): + self.acad_field_slug = kwargs.pop('acad_field_slug') + self.specialty_slug = kwargs.pop('specialty_slug') + super().__init__(*args, **kwargs) + self.helper = FormHelper() + self.helper.layout = Layout( + Div( + Div(FloatingField('object_title'), css_class='col-lg-6'), + ), + ) + + def search_results(self): + comments = Comment.objects.vetted() + if self.acad_field_slug != 'all': + comments = comments.filter( + Q(submissions__acad_field__slug=self.acad_field_slug) | + Q(reports__submission__acad_field__slug=self.acad_field_slug) | + Q(commentaries__acad_field__slug=self.acad_field_slug) + ) + if self.specialty_slug: + comments = comments.filter( + Q(submissions__specialties__slug=self.specialty_slug) | + Q(reports__submission__specialties__slug=self.specialty_slug) | + Q(commentaries__specialties__slug=self.specialty_slug) + ) + if self.cleaned_data.get('object_title'): + comments = comments.filter( + Q(submissions__title__icontains=self.cleaned_data.get('object_title')) | + Q(reports__submission__title__icontains=self.cleaned_data.get('object_title')) | + Q(commentaries__title__icontains=self.cleaned_data.get('object_title')) + ) + return comments.distinct() diff --git a/scipost_django/comments/migrations/0007_alter_comment_options.py b/scipost_django/comments/migrations/0007_alter_comment_options.py new file mode 100644 index 0000000000000000000000000000000000000000..fbf275a7eddb63f38986a2a7084081fb69a269c5 --- /dev/null +++ b/scipost_django/comments/migrations/0007_alter_comment_options.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.5 on 2021-10-30 15:58 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('comments', '0006_alter_comment_needs_doi'), + ] + + operations = [ + migrations.AlterModelOptions( + name='comment', + options={'ordering': ['-date_submitted'], 'permissions': (('can_vet_comments', 'Can vet submitted Comments'),)}, + ), + ] diff --git a/scipost_django/comments/models.py b/scipost_django/comments/models.py index 0da046a77785d581adcd1af502aec24de3b392fe..a3c0367d53a8fb28961c29bc4e035b60f2b870a3 100644 --- a/scipost_django/comments/models.py +++ b/scipost_django/comments/models.py @@ -78,6 +78,7 @@ class Comment(TimeStampedModel): objects = CommentQuerySet.as_manager() class Meta: + ordering = ['-date_submitted'] permissions = ( ('can_vet_comments', 'Can vet submitted Comments'), ) @@ -115,6 +116,16 @@ class Comment(TimeStampedModel): else: raise Exception + def all_nested_comments(self): + """ + Returns a queryset of all nested comments (recursive). + """ + qs = self.nested_comments.all() + for c in qs: + if c.nested_comments: + qs = qs | c.all_nested_comments().all() + return qs + @property def is_vetted(self): """Check if Comment is vetted.""" diff --git a/scipost_django/comments/templates/comments/_comment_identifier.html b/scipost_django/comments/templates/comments/_comment_identifier.html index 50e6fe3a28cf15e14871ddebd575a7bd63ba7a27..6acae04ccff35a9118c0c6efd40c382948a8ef3f 100644 --- a/scipost_django/comments/templates/comments/_comment_identifier.html +++ b/scipost_django/comments/templates/comments/_comment_identifier.html @@ -15,6 +15,7 @@ <a href="{{ comment.author.get_absolute_url }}">{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}</a> on {{ comment.date_submitted|date:'Y-m-d' }} {% endif %} + <small>[id {{ comment.id }}]</small> {% if user.is_authenticated %} {% with type_id=comment|content_type_id %} {% include 'helpdesk/_ticket_for_object_link.html' with type_id=type_id id=comment.id model="Comment" %} @@ -24,7 +25,7 @@ {% if comment.doi_string %} <small>{{ comment|citation }}</small>{% endif %} {% if comment|is_reply_to_comment %} - (in reply to <a href="{{ comment.content_object.get_absolute_url }}">{% if comment.content_object.anonymous %}Anonymous Comment{% else %}{{ comment.content_object.author.user.first_name }} {{ comment.content_object.author.user.last_name }}{% endif %}</a> on {{ comment.content_object.date_submitted|date:'Y-m-d' }}) + (in reply to <a href="{{ comment.content_object.get_absolute_url }}">{% if comment.content_object.anonymous %}Anonymous Comment{% else %}{{ comment.content_object.author.user.first_name }} {{ comment.content_object.author.user.last_name }}{% endif %}</a> on {{ comment.content_object.date_submitted|date:'Y-m-d' }} <small>[id {{ comment.content_object.id }}]) {% elif comment|is_reply_to_report %} (in reply to <a href="{{ comment.content_object.get_absolute_url }}">Report {{ comment.content_object.report_nr }}{% if not comment.content_object.anonymous %} by {{ comment.content_object.author.user.first_name }} {{ comment.content_object.author.user.last_name }}{% endif %}</a> diff --git a/scipost_django/comments/templates/comments/_single_comment.html b/scipost_django/comments/templates/comments/_single_comment.html index 829298b893b97464949e278d9ac7d7e02cdf0ee1..8921fb246a1771da705467dd9d07a471fca6ebbb 100644 --- a/scipost_django/comments/templates/comments/_single_comment.html +++ b/scipost_django/comments/templates/comments/_single_comment.html @@ -43,7 +43,7 @@ {% endif %} {% for reply in comment.nested_comments.vetted %} - {% include 'comments/_single_comment.html' with comment=reply perms=perms user=user %} + {% include 'comments/_single_comment_with_link.html' with comment=reply perms=perms user=user %} {% endfor %} {% block comment_footer %}{% endblock %} diff --git a/scipost_django/comments/templates/comments/_single_comment_with_link.html b/scipost_django/comments/templates/comments/_single_comment_with_link.html index 606a70e3c73bfab72a724b65cd28bbc0d251b4dd..3ddcedc66aaa5bd681aee4ebc19034d600752409 100644 --- a/scipost_django/comments/templates/comments/_single_comment_with_link.html +++ b/scipost_django/comments/templates/comments/_single_comment_with_link.html @@ -3,6 +3,6 @@ {% block comment_footer %} {% if user.is_authenticated and perms.scipost.can_submit_comments %} <hr class="small"> - <h3 class="mb-3"><a href="{% url 'comments:reply_to_comment' comment_id=comment.id %}">Reply to this comment</a></h3> + <h3 class="mb-3"><a href="{% url 'comments:reply_to_comment' comment_id=comment.id %}">Reply to comment <small>[id {{ comment.id }}]</small></a></h3> {% endif %} {% endblock %} diff --git a/scipost_django/comments/templates/comments/comment_list.html b/scipost_django/comments/templates/comments/comment_list.html new file mode 100644 index 0000000000000000000000000000000000000000..d3d7ffbc63e5eefba4dc2fb994560196f74e3771 --- /dev/null +++ b/scipost_django/comments/templates/comments/comment_list.html @@ -0,0 +1,55 @@ +{% extends 'scipost/base.html' %} + +{% load bootstrap %} +{% load request_filters %} + +{% block meta_description %}{{ block.super }} Comments list{% endblock meta_description %} +{% block pagetitle %}: Comments{% endblock pagetitle %} + +{% block content %} + <div class="row"> + <div class="col-md-6"> + <div class="p-3 mb-3 bg-light scipost-bar border min-height-190"> + <h1 class="mb-3">SciPost Comments</h1> + </div> + </div> + <div class="col-md-6"> + <div class="p-3 mb-3 bg-light scipost-bar border min-height-190"> + <h2>Search SciPost Comments:</h2> + <form action="{% url 'comments:comments' %}" class="small" method="get"> + {{ form|bootstrap:'4,8,sm' }} + <input class="btn btn-outline-secondary" type="submit" value="Search"/> + </form> + </div> + </div> + </div> + + <hr> + <div class="row"> + <div class="col-12"> + <h2>Comments</h2> + </div> + {% if is_paginated %} + <div class="col-12"> + {% include '_pagination.html' with page_obj=page_obj %} + </div> + {% endif %} + <div class="col-12"> + <ul class="list-group list-group-flush"> + {% for object in comment_list %} + <li class="list-group-item"> + {% include 'comments/_comment_card_content.html' with comment=object %} + </li> + {% empty %} + <h3><em>No match found.</em></h3> + {% endfor %} + </ul> + </div> + {% if is_paginated %} + <div class="col-12"> + {% include '_pagination.html' with page_obj=page_obj %} + </div> + {% endif %} + </div> + +{% endblock content %} diff --git a/scipost_django/comments/urls.py b/scipost_django/comments/urls.py index 43403fc1afd252db0105cbbc52ae78bffb62b023..3b8695a3aa3e47b3de82c23debb45b6915594a1d 100644 --- a/scipost_django/comments/urls.py +++ b/scipost_django/comments/urls.py @@ -3,6 +3,7 @@ __license__ = "AGPL v3" from django.conf.urls import url +from django.urls import path from . import views @@ -10,12 +11,39 @@ app_name = 'comments' urlpatterns = [ # Comments - url(r'^reports/(?P<report_id>[0-9]+)/reply$', views.reply_to_report, name='reply_to_report'), - url(r'^vet_submitted$', views.vet_submitted_comments_list, name='vet_submitted_comments_list'), - url(r'^new/(?P<type_of_object>[a-z]+)/(?P<object_id>[0-9]+)$', views.new_comment, - name='new_comment'), - url(r'^(?P<comment_id>[0-9]+)/attachment$', views.attachment, name='attachment'), - url(r'^(?P<comment_id>[0-9]+)/reply$', views.reply_to_comment, name='reply_to_comment'), - url(r'^(?P<comment_id>[0-9]+)/vet$', views.vet_submitted_comment, - name='vet_submitted_comment'), + path( + '', + views.CommentListView.as_view(), + name='comments' + ), + path( + 'reports/<int:report_id>/reply', + views.reply_to_report, + name='reply_to_report' + ), + path( + 'vet_submitted', + views.vet_submitted_comments_list, + name='vet_submitted_comments_list' + ), + path( + 'new/<str:type_of_object>/<int:object_id>', + views.new_comment, + name='new_comment' + ), + path( + '<int:comment_id>/attachment', + views.attachment, + name='attachment' + ), + path( + '<int:comment_id>/reply', + views.reply_to_comment, + name='reply_to_comment' + ), + path( + '<int:comment_id>/vet', + views.vet_submitted_comment, + name='vet_submitted_comment' + ), ] diff --git a/scipost_django/comments/views.py b/scipost_django/comments/views.py index 5d73af0afd4cb27d21178e30493158b9c6760610..5c451d589b620a2bf93cb37f13b05ea2ddec3704 100644 --- a/scipost_django/comments/views.py +++ b/scipost_django/comments/views.py @@ -4,26 +4,49 @@ __license__ = "AGPL v3" import time from django.contrib.auth.decorators import permission_required, login_required from django.contrib import messages -from django.urls import reverse from django.db import transaction from django.http import HttpResponse, Http404 -from django.utils import timezone from django.shortcuts import get_object_or_404, render, redirect +from django.urls import reverse +from django.utils import timezone +from django.views.generic.list import ListView from guardian.shortcuts import get_objects_for_user import strings from .constants import EXTENTIONS_IMAGES, EXTENTIONS_PDF from .models import Comment -from .forms import CommentForm, VetCommentForm +from .forms import CommentForm, VetCommentForm, CommentTextSearchForm from .utils import validate_file_extention from commentaries.models import Commentary from mails.utils import DirectMailUtil +from scipost.mixins import PaginationMixin from submissions.models import Submission, Report from theses.models import ThesisLink +class CommentListView(PaginationMixin, ListView): + model = Comment + form = CommentTextSearchForm + paginate_by = 10 + context_object_name = 'comment_list' + + def get_queryset(self): + '''Perform search form here already to get the right pagination numbers.''' + self.form = self.form(self.request.GET) + if self.form.is_valid() and self.form.has_changed(): + return self.form.search_results() + return self.model.objects.vetted().order_by('-date_submitted') + + def get_context_data(self, **kwargs): + # Call the base implementation first to get a context + context = super().get_context_data(**kwargs) + # Form into the context! + context['form'] = self.form + return context + + @login_required @permission_required('scipost.can_submit_comments', raise_exception=True) def new_comment(request, **kwargs): diff --git a/scipost_django/common/constants.py b/scipost_django/common/constants.py index b5ae5089eba850e5ec124f5601264ae90b7ce702..497cfd18ef5e29f1fa4dc023441f92c3d3fa792f 100644 --- a/scipost_django/common/constants.py +++ b/scipost_django/common/constants.py @@ -7,3 +7,33 @@ CHARACTER_ALTERNATIVES = { 'oe': 'ö', 'ö': 'oe', 'Oe': 'Ö', 'Ö': 'Oe', 'ue': 'ü', 'ü': 'ue', 'Ue': 'Ü', 'Ü': 'Ue', } + +CHARACTER_UNACCENTED = { + 'à ': 'a', 'À': 'A', + 'á': 'a', 'Ã': 'A', + 'â': 'a', 'Â': 'A', + 'ä': 'ae', 'Ä': 'Ae', + 'ã': 'a', 'Ã': 'A', + 'Ã¥': 'a', 'Ã…': 'A', + 'ç': 'c', 'Ç': 'C', + 'é': 'e', 'É': 'E', + 'è': 'e', 'È': 'E', + 'ê': 'e', 'Ê': 'E', + 'ë': 'e', 'Ë': 'E', + 'Ã': 'i', 'Ã': 'I', + 'ì': 'i', 'ÃŒ': 'I', + 'î': 'i', 'ÃŽ': 'I', + 'ï': 'i', 'Ã': 'I', + 'ñ': 'n', 'Ñ': 'N', + 'ó': 'o', 'Ó': 'O', + 'ò': 'o', 'Ã’': 'O', + 'ô': 'o', 'Ô': 'O', + 'ö': 'oe', 'Ö': 'Oe', + 'õ': 'o', 'Õ': 'O', + 'ø': 'o', 'Ø': 'O', + 'ß': 'ss', + 'ú': 'u', 'Ú': 'U', + 'ù': 'u', 'Ù': 'U', + 'û': 'u', 'Û': 'U', + 'ü': 'ue', 'Ü': 'Ue', +} diff --git a/scipost_django/common/converters.py b/scipost_django/common/converters.py new file mode 100644 index 0000000000000000000000000000000000000000..296286fc42967c8e8d2d8d31668fd48218fc9d68 --- /dev/null +++ b/scipost_django/common/converters.py @@ -0,0 +1,39 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + +from django.urls.converters import StringConverter + + +class UnicodeSlugConverter(StringConverter): + regex = '[-\w_]+' + + +class FourDigitYearConverter: + regex = '[0-9]{4}' + + def to_python(self, value): + return int(value) + + def to_url(self, value): + return '%04d' % int(value) + + +class TwoDigitMonthConverter: + regex = '0[1-9]|1[0-2]' + + def to_python(self, value): + return int(value) + + def to_url(self, value): + return str(value).zfill(2) + + +class TwoDigitDayConverter: + regex = '0[1-9]|[1-2][0-9]|3[0-1]' + + def to_python(self, value): + return int(value) + + def to_url(self, value): + return str(value).zfill(2) diff --git a/scipost_django/common/utils.py b/scipost_django/common/utils.py index 5bfe183ab9667e3d056372dc34dd18a3cd4fc6a7..4e2969e1dc4060c76700b144d14d27b3a5f31baa 100644 --- a/scipost_django/common/utils.py +++ b/scipost_django/common/utils.py @@ -4,11 +4,22 @@ __license__ = "AGPL v3" import datetime +from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.db.models import Q from django.template import loader -from .constants import CHARACTER_ALTERNATIVES +from .constants import CHARACTER_ALTERNATIVES, CHARACTER_UNACCENTED + + +def unaccent(text): + """ + Replace accented characters by unaccented ones. + """ + unaccented = text + for key, val in CHARACTER_UNACCENTED.items(): + unaccented = unaccented.replace(key, val) + return unaccented def alternative_spellings(text): @@ -101,14 +112,16 @@ def workdays_between(date_from, date_until): return workdays +# MARKED FOR DEPRECATION class BaseMailUtil(object): - mail_sender = 'no-reply@scipost.org' + mail_sender = 'no-reply@%s' % Site.objects.get_current().domain mail_sender_title = '' @classmethod def load(cls, _dict, request=None): cls._context = _dict cls._context['request'] = request + cls._context['domain'] = Site.objects.get_current().domain for var_name in _dict: setattr(cls, var_name, _dict[var_name]) @@ -134,7 +147,7 @@ class BaseMailUtil(object): if extra_bcc: bcc_list += extra_bcc email = EmailMultiAlternatives( - 'SciPost: ' + subject, # message, + subject, message, '%s <%s>' % (cls.mail_sender_title, cls.mail_sender), recipients, diff --git a/scipost_django/finances/templates/finances/business_model.html b/scipost_django/finances/templates/finances/business_model.html index 243e8e0e528473c6f31c199dfe6360c74f0542af..b05adbd674ae8f85714af8e9e09ae30afd46973d 100644 --- a/scipost_django/finances/templates/finances/business_model.html +++ b/scipost_django/finances/templates/finances/business_model.html @@ -328,7 +328,7 @@ </ul> </p> <p>Is your Organization interesting in helping us with such in-kind support? Please - <a href="mailto:admin@scipost.org">contact our administration</a> to discuss + <a href="mailto:admin@{{ request.get_host }}">contact our administration</a> to discuss concrete possibilities.</p> </div> diff --git a/scipost_django/finances/urls.py b/scipost_django/finances/urls.py index cba5798bd7e9b14b9390a5b0be0b340ced1b35a7..e8d2f3d94d9fdd41d0bbf3682325274073a7b556 100644 --- a/scipost_django/finances/urls.py +++ b/scipost_django/finances/urls.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from django.views.generic import TemplateView from . import views @@ -10,50 +10,92 @@ from . import views app_name = 'finances' urlpatterns = [ - url( - r'^$', + path( + '', views.finances, name='finances' ), - url( - r'^business_model/$', + path( + 'business_model/', TemplateView.as_view(template_name='finances/business_model.html'), name='business_model' ), - url( - r'^apex$', + path( + 'apex', views.apex, name='apex' ), # Subsidies - url(r'^subsidies/$', views.SubsidyListView.as_view(), name='subsidies'), - url(r'^subsidies/add/$', views.SubsidyCreateView.as_view(), name='subsidy_create'), - url(r'^subsidies/(?P<pk>[0-9]+)/update/$', views.SubsidyUpdateView.as_view(), - name='subsidy_update'), - url(r'^subsidies/(?P<pk>[0-9]+)/delete/$', views.SubsidyDeleteView.as_view(), - name='subsidy_delete'), - url(r'^subsidies/(?P<pk>[0-9]+)/$', views.SubsidyDetailView.as_view(), name='subsidy_details'), - url(r'^subsidies/(?P<subsidy_id>[0-9]+)/toggle_amount_visibility/$', + path( + 'subsidies/', + views.SubsidyListView.as_view(), + name='subsidies' + ), + path( + 'subsidies/add/', + views.SubsidyCreateView.as_view(), + name='subsidy_create' + ), + path( + 'subsidies/<int:pk>/update/', + views.SubsidyUpdateView.as_view(), + name='subsidy_update' + ), + path( + 'subsidies/<int:pk>/delete/', + views.SubsidyDeleteView.as_view(), + name='subsidy_delete' + ), + path( + 'subsidies/<int:pk>/', + views.SubsidyDetailView.as_view(), + name='subsidy_details' + ), + path( + 'subsidies/<int:subsidy_id>/toggle_amount_visibility/', views.subsidy_toggle_amount_public_visibility, - name='subsidy_toggle_amount_public_visibility'), - url(r'^subsidies/(?P<subsidy_id>[0-9]+)/attachments/add/$', + name='subsidy_toggle_amount_public_visibility' + ), + path( + 'subsidies/<int:subsidy_id>/attachments/add/', views.SubsidyAttachmentCreateView.as_view(), - name='subsidyattachment_create'), - url(r'^subsidies/attachments/(?P<pk>[0-9]+)/update/$', + name='subsidyattachment_create' + ), + path( + 'subsidies/attachments/<int:pk>/update/', views.SubsidyAttachmentUpdateView.as_view(), - name='subsidyattachment_update'), - url(r'^subsidies/attachments/(?P<pk>[0-9]+)/delete/$', + name='subsidyattachment_update' + ), + path( + 'subsidies/attachments/<int:pk>/delete/', views.SubsidyAttachmentDeleteView.as_view(), - name='subsidyattachment_delete'), - url(r'^subsidies/attachments/(?P<attachment_id>[0-9]+)/toggle_visibility/$', + name='subsidyattachment_delete' + ), + path( + 'subsidies/attachments/<int:attachment_id>/toggle_visibility/', views.subsidy_attachment_toggle_public_visibility, - name='subsidy_attachment_toggle_public_visibility'), - url(r'^subsidies/(?P<subsidy_id>[0-9]+)/attachments/(?P<attachment_id>[0-9]+)$', - views.subsidy_attachment, name='subsidy_attachment'), + name='subsidy_attachment_toggle_public_visibility' + ), + path( + 'subsidies/<int:subsidy_id>/attachments/<int:attachment_id>', + views.subsidy_attachment, name='subsidy_attachment' + ), # Timesheets - url(r'^timesheets$', views.timesheets, name='timesheets'), - url(r'^timesheets/detailed$', views.timesheets_detailed, name='timesheets_detailed'), - url(r'^logs/(?P<slug>\d+)/delete$', views.LogDeleteView.as_view(), name='log_delete'), + path( + 'timesheets', + views.timesheets, + name='timesheets' + ), + path( + 'timesheets/detailed', + views.timesheets_detailed, + name='timesheets_detailed' + ), + path( + 'logs/<slug:slug>/delete', + views.LogDeleteView.as_view(), + name='log_delete' + ), ] diff --git a/scipost_django/forums/templates/forums/forum_list.html b/scipost_django/forums/templates/forums/forum_list.html index 8c6e8af7327163ac8366021f4b1bdf5f567d755b..89fa4a63a091ae13763df3a9861917bf1709c877 100644 --- a/scipost_django/forums/templates/forums/forum_list.html +++ b/scipost_django/forums/templates/forums/forum_list.html @@ -14,6 +14,13 @@ {% block content %} + <div class="row"> + <div class="col-12"> + <h3 class="highlight">Public-facing discussions</h3> + <p>You will find our public-facing discussion server at <a href="https://disc.{{ request.get_host }}" target="_blank" rel="noopener">disc.{{ request.get_host }}</a>.</p> + </div> + </div> + <div class="row"> <div class="col-12"> diff --git a/scipost_django/forums/urls.py b/scipost_django/forums/urls.py index cbdfa58e1d643c1abb175572f82326dac35f6f3c..9af6c3a398739c68cdf0bfed4c1664b77938ae5b 100644 --- a/scipost_django/forums/urls.py +++ b/scipost_django/forums/urls.py @@ -2,85 +2,85 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views app_name = 'forums' urlpatterns = [ - url( - r'^forum/(?P<parent_model>[a-z]+)/(?P<parent_id>[0-9]+)/add/$', + path( + 'forum/<str:parent_model>/<int:parent_id>/add/', views.ForumCreateView.as_view(), name='forum_create' ), - url( - r'^add/$', + path( + 'add/', views.ForumCreateView.as_view(), name='forum_create' ), - url( - r'^meeting/(?P<parent_model>[a-z]+)/(?P<parent_id>[0-9]+)/add/$', + path( + 'meeting/<str:parent_model>/<int:parent_id>/add/', views.MeetingCreateView.as_view(), name='meeting_create' ), - url( - r'^meeting/add/$', + path( + 'meeting/add/', views.MeetingCreateView.as_view(), name='meeting_create' ), - url( - r'^(?P<slug>[\w-]+)/$', + path( + '<slug:slug>/', views.ForumDetailView.as_view(), name='forum_detail' ), - url( - r'^(?P<slug>[\w-]+)/update/$', + path( + '<slug:slug>/update/', views.ForumUpdateView.as_view(), name='forum_update' ), - url( - r'^(?P<slug>[\w-]+)/delete/$', + path( + '<slug:slug>/delete/', views.ForumDeleteView.as_view(), name='forum_delete' ), - url( - r'^(?P<slug>[\w-]+)/permissions/(?P<group_id>[0-9]+)/$', + path( + '<slug:slug>/permissions/<int:group_id>/', views.ForumPermissionsView.as_view(), name='forum_permissions' ), - url( - r'^(?P<slug>[\w-]+)/permissions/$', + path( + '<slug:slug>/permissions/', views.ForumPermissionsView.as_view(), name='forum_permissions' ), - url( - r'^$', + path( + '', views.ForumListView.as_view(), name='forums' ), - url( - r'^(?P<slug>[\w-]+)/post/(?P<parent_model>[a-z]+)/(?P<parent_id>[0-9]+)/add/$', + path( + '<slug:slug>/post/<str:parent_model>/<int:parent_id>/add/', views.PostCreateView.as_view(), name='post_create' ), - url( - r'^(?P<slug>[\w-]+)/motion/(?P<parent_model>[a-z]+)/(?P<parent_id>[0-9]+)/add/$', + path( + '<slug:slug>/motion/<str:parent_model>/<int:parent_id>/add/', views.MotionCreateView.as_view(), name='motion_create' ), - url( - r'^(?P<slug>[\w-]+)/post/(?P<parent_model>[a-z]+)/(?P<parent_id>[0-9]+)/add/confirm/$', + path( + '<slug:slug>/post/<str:parent_model>/<int:parent_id>/add/confirm/', views.PostConfirmCreateView.as_view(), name='post_confirm_create' ), - url( - r'^(?P<slug>[\w-]+)/motion/(?P<parent_model>[a-z]+)/(?P<parent_id>[0-9]+)/add/confirm/$', + path( + '<slug:slug>/motion/<str:parent_model>/<int:parent_id>/add/confirm/', views.MotionConfirmCreateView.as_view(), name='motion_confirm_create' ), - url( - r'^(?P<slug>[\w-]+)/motion/(?P<motion_id>[0-9]+)/(?P<vote>[YMNA])/$', + path( + '<slug:slug>/motion/<int:motion_id>/<str:vote>/', views.motion_vote, name='motion_vote' ), diff --git a/scipost_django/forums/views.py b/scipost_django/forums/views.py index ab73f77555c45e84ee399da28ffeec405248fcb4..0cee4d84fc3c21d99e56ae5a62cf6d0e2f1ad4c3 100644 --- a/scipost_django/forums/views.py +++ b/scipost_django/forums/views.py @@ -354,6 +354,8 @@ def motion_vote(request, slug, motion_id, vote): motion.in_disagreement.add(request.user) elif vote == 'A': motion.in_abstain.add(request.user) + else: + raise Http404 motion.save() else: messages.warning(request, 'You do not have voting rights on this Motion.') diff --git a/scipost_django/funders/urls.py b/scipost_django/funders/urls.py index 26d40ef762977e10725089c9e4dceabc583e46bb..08c0b1fab95f73692683829c9c9931ecea4e5efa 100644 --- a/scipost_django/funders/urls.py +++ b/scipost_django/funders/urls.py @@ -2,7 +2,6 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.urls import path from . import views @@ -20,14 +19,39 @@ urlpatterns = [ views.GrantAutocompleteView.as_view(), name='grant-autocomplete' ), - url(r'^$', views.funders, name='funders'), - url(r'^dashboard$', views.funders_dashboard, name='funders_dashboard'), - url(r'^query_crossref_for_funder$', views.query_crossref_for_funder, - name='query_crossref_for_funder'), - url(r'^add$', views.add_funder, name='add_funder'), - url(r'^(?P<funder_id>[0-9]+)/$', views.funder_publications, name='funder_publications'), - url(r'^grants/add$', views.CreateGrantView.as_view(), name='add_grant'), - url(r'^(?P<pk>[0-9]+)/link_to_organization/$', + path( + '', + views.funders, + name='funders' + ), + path( + 'dashboard', + views.funders_dashboard, + name='funders_dashboard' + ), + path( + 'query_crossref_for_funder', + views.query_crossref_for_funder, + name='query_crossref_for_funder' + ), + path( + 'add', + views.add_funder, + name='add_funder' + ), + path( + '<int:funder_id>/', + views.funder_publications, + name='funder_publications' + ), + path( + 'grants/add', + views.CreateGrantView.as_view(), + name='add_grant' + ), + path( + '<int:pk>/link_to_organization/', views.LinkFunderToOrganizationView.as_view(), - name='link_to_organization'), + name='link_to_organization' + ), ] diff --git a/scipost_django/guides/templates/guides/editorial/production/initial_production.html b/scipost_django/guides/templates/guides/editorial/production/initial_production.html index d99102d0b54d1b348533f0ad996f7be166d47d88..b21acf1b0beac939aa58d0e57e08ed7f5dba0d6f 100644 --- a/scipost_django/guides/templates/guides/editorial/production/initial_production.html +++ b/scipost_django/guides/templates/guides/editorial/production/initial_production.html @@ -129,7 +129,7 @@ <p> In this place, fill the missing numbers in the citation header: </p> - <pre><code>\rhead{\small \href{https://scipost.org/SciPostPhys.?.?.???}{SciPost Phys. ?, ??? (20??)}}</pre></code> + <pre><code>\rhead{\small \href{https://{{ request.get_host }}/SciPostPhys.?.?.???}{SciPost Phys. ?, ??? (20??)}}</pre></code> <p> The first argument of the <code>href</code> is the simple permanent URL for the publication. This includes 3 numbers: the volume number, issue, and three-digit paper number, for example <code>SciPostPhys.1.2.011</code>. Verify the appropriate issue number (this will be verified later by an EdAdmin). At this stage, leave the paper number to <code>???</code>: this number will be assigned and filled in in the last stage of production. </p> diff --git a/scipost_django/guides/templates/guides/editorial/production/online_publication.html b/scipost_django/guides/templates/guides/editorial/production/online_publication.html index 161e3d03415c5e00dca6540db071ef8f72069426..6b4e3788fdf9b50530ea9604b6863edb88c28e7d 100644 --- a/scipost_django/guides/templates/guides/editorial/production/online_publication.html +++ b/scipost_django/guides/templates/guides/editorial/production/online_publication.html @@ -30,7 +30,7 @@ <li>Ensure that the author names are in format <code>[First name] [Last name]</code> namely: not just initials, full first name, so for example <code>Abe Bee, Cee Dee and Elle Fine</code> (unless the authors specifically request initials-only, as can be preferred in some cultures).</li> <li>Insert the correct Received, Accepted and Published dates in copyright statement.</li> <li>Between the <code>\begin{minipage}{0.4\textwidth}</code> and <code>%%%%%%%%%% TODO: DATES</code> lines, paste:</li> -<pre><code>\noindent\begin{minipage}{0.68textwidth}</code></pre> +<pre><code>\noindent\begin{minipage}{0.68\textwidth}</code></pre> <li>Update the DOI block to:</li> <pre><code>%%%%%%%%%% TODO: DOI } @@ -54,7 +54,7 @@ <li>Recompile the LaTeX, and CAREFULLY CHECK EVERYTHING.</li> </ol> </blockquote> -<h3 id="uploading-to-scipost.org">Uploading to <code>scipost.org</code></h3> +<h3 id="uploading-to-{{ request.get_host }}">Uploading to <code>{{ request.get_host }}</code></h3> <blockquote> <ol> <li>From the Submissions Pool, click on the link to initiate the publication process.</li> @@ -104,8 +104,8 @@ <h3 id="metadata-testing-and-deposit">Metadata testing and deposit</h3> <blockquote> <p>At this stage, the metadata is ready for uploading to Crossref. This occurs via a POST query to either the test or live Crossref server.</p> -<p>Clicking on <code>Test metadata deposit</code> immediately posts the metadata to the test server, and takes you to a page where the server's response headers are displayed. The server also sends a more detailed response via email (to <code>admin@scipost.org</code>; if you do not have access to this mailbox, ask SciPost Administration) with the success status.</p> -<p>Similarly, the actual deposit is immediately performed upon clicking on the <code>Deposit the metadata to Crossref</code>. The response headers are displayed, and a detailed email response is sent by Crossref to <code>admin@scipost.org</code>.</p> +<p>Clicking on <code>Test metadata deposit</code> immediately posts the metadata to the test server, and takes you to a page where the server's response headers are displayed. The server also sends a more detailed response via email (to <code>admin@{{ request.get_host }}</code>; if you do not have access to this mailbox, ask SciPost Administration) with the success status.</p> +<p>Similarly, the actual deposit is immediately performed upon clicking on the <code>Deposit the metadata to Crossref</code>. The response headers are displayed, and a detailed email response is sent by Crossref to <code>admin@{{ request.get_host }}</code>.</p> <p><strong>This completes the publication process.</strong></p> </blockquote> diff --git a/scipost_django/guides/urls.py b/scipost_django/guides/urls.py index 4e32820d2d83f637e023e28b02f474269e2a824b..69e9d6be1ca5b835ec401f1bf3f4bf8ad6ce7b50 100644 --- a/scipost_django/guides/urls.py +++ b/scipost_django/guides/urls.py @@ -2,32 +2,46 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.contrib.auth.decorators import permission_required +from django.urls import path from django.views.generic import TemplateView app_name = 'guides' urlpatterns = [ - url(r'^$', + path( + '', permission_required('scipost.can_view_docs_scipost')( - TemplateView.as_view(template_name='guides/guides_index.html')), - name='guides_index'), - url(r'^editorial/submissions/submission_processing$', + TemplateView.as_view( + template_name='guides/guides_index.html')), + name='guides_index' + ), + path( + 'editorial/submissions/submission_processing', permission_required('scipost.can_view_docs_scipost')( - TemplateView.as_view( - template_name='guides/editorial/submissions/submission_prescreening.html')), - name='submission_prescreening'), - url(r'^editorial/production/initial_production$', + TemplateView.as_view( + template_name='guides/editorial/submissions/submission_prescreening.html')), + name='submission_prescreening' + ), + path( + 'editorial/production/initial_production', permission_required('scipost.can_view_docs_scipost')( - TemplateView.as_view(template_name='guides/editorial/production/initial_production.html')), - name='initial_production'), - url(r'^editorial/production/proofs$', + TemplateView.as_view( + template_name='guides/editorial/production/initial_production.html')), + name='initial_production' + ), + path( + 'editorial/production/proofs', permission_required('scipost.can_view_docs_scipost')( - TemplateView.as_view(template_name='guides/editorial/production/proofs.html')), - name='proofs'), - url(r'^editorial/production/online_publication$', + TemplateView.as_view( + template_name='guides/editorial/production/proofs.html')), + name='proofs' + ), + path( + 'editorial/production/online_publication', permission_required('scipost.can_view_docs_scipost')( - TemplateView.as_view(template_name='guides/editorial/production/online_publication.html')), - name='online_publication'), + TemplateView.as_view( + template_name='guides/editorial/production/online_publication.html')), + name='online_publication' + ), ] diff --git a/scipost_django/helpdesk/urls.py b/scipost_django/helpdesk/urls.py index 8d16b6b49a059fe00128358e3868fae3e012800e..68586944a5e79ca18fc233ad0313c392a9d0e088 100644 --- a/scipost_django/helpdesk/urls.py +++ b/scipost_django/helpdesk/urls.py @@ -2,85 +2,85 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views app_name = 'helpdesk' urlpatterns = [ - url( - r'^$', + path( + '', views.HelpdeskView.as_view(), name='helpdesk' ), - url( - r'^queue/(?P<parent_slug>[\w-]+)/add/$', + path( + 'queue/<slug:parent_slug>/add/', views.QueueCreateView.as_view(), name='queue_create' ), - url( - r'^queue/add/$', + path( + 'queue/add/', views.QueueCreateView.as_view(), name='queue_create' ), - url( - r'^queue/(?P<slug>[\w-]+)/update/$', + path( + 'queue/<slug:slug>/update/', views.QueueUpdateView.as_view(), name='queue_update' ), - url( - r'^queue/(?P<slug>[\w-]+)/delete/$', + path( + 'queue/<slug:slug>/delete/', views.QueueDeleteView.as_view(), name='queue_delete' ), - url( - r'^queue/(?P<slug>[\w-]+)/$', + path( + 'queue/<slug:slug>/', views.QueueDetailView.as_view(), name='queue_detail' ), - url( - r'^ticket/add/(?P<concerning_type_id>[0-9]+)/(?P<concerning_object_id>[0-9]+)/$', + path( + 'ticket/add/<int:concerning_type_id>/<int:concerning_object_id>/', views.TicketCreateView.as_view(), name='ticket_create' ), - url( - r'^ticket/add/$', + path( + 'ticket/add/', views.TicketCreateView.as_view(), name='ticket_create' ), - url( - r'^ticket/(?P<pk>[0-9]+)/update/$', + path( + 'ticket/<int:pk>/update/', views.TicketUpdateView.as_view(), name='ticket_update' ), - url( - r'^ticket/(?P<pk>[0-9]+)/delete/$', + path( + 'ticket/<int:pk>/delete/', views.TicketDeleteView.as_view(), name='ticket_delete' ), - url( - r'^ticket/(?P<pk>[0-9]+)/assign/$', + path( + 'ticket/<int:pk>/assign/', views.TicketAssignView.as_view(), name='ticket_assign' ), - url( - r'^ticket/(?P<pk>[0-9]+)/$', + path( + 'ticket/<int:pk>/', views.TicketDetailView.as_view(), name='ticket_detail' ), - url( - r'^ticket/(?P<pk>[0-9]+)/followup/$', + path( + 'ticket/<int:pk>/followup/', views.TicketFollowupView.as_view(), name='ticket_followup' ), - url( - r'^ticket/(?P<pk>[0-9]+)/resolved/$', + path( + 'ticket/<int:pk>/resolved/', views.TicketMarkResolved.as_view(), name='ticket_mark_resolved' ), - url( - r'^ticket/(?P<pk>[0-9]+)/closed/$', + path( + 'ticket/<int:pk>/closed/', views.TicketMarkClosed.as_view(), name='ticket_mark_closed' ), diff --git a/scipost_django/helpdesk/views.py b/scipost_django/helpdesk/views.py index 5fe8c5c7e487459d9965c41d70f9db74fca48a6d..8d400813d927e2743c5bfd9b70e65c979914f97f 100644 --- a/scipost_django/helpdesk/views.py +++ b/scipost_django/helpdesk/views.py @@ -275,7 +275,6 @@ class TicketFollowupView(UserPassesTestMixin, CreateView): bcc_emails = [k['email'] for k in list(queue_managers.all().values('email'))] if ticket.assigned_to and ticket.assigned_to.email not in bcc_emails: bcc_emails.append(ticket.assigned_to.email) - print(bcc_emails) mail_sender = DirectMailUtil( 'helpdesk/followup_on_ticket', delayed_processing=False, diff --git a/scipost_django/invitations/urls.py b/scipost_django/invitations/urls.py index c9ddf5aee4aa7f364271d8349f4d9d2a65fffc70..6b76801d3b1448809b417e30f6a44b1538881b7f 100644 --- a/scipost_django/invitations/urls.py +++ b/scipost_django/invitations/urls.py @@ -2,37 +2,86 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views app_name = 'invitations' urlpatterns = [ - url(r'^$', views.RegistrationInvitationsView.as_view(), name='list'), - url(r'^sent$', views.RegistrationInvitationsSentView.as_view(), name='list_sent'), - url(r'^contributors$', - views.RegistrationInvitationsDraftContributorView.as_view(), name='list_contributors'), - url(r'^fellows$', views.RegistrationInvitationsFellowView.as_view(), name='list_fellows'), - url(r'^new$', views.create_registration_invitation_or_citation, name='new'), - url(r'^(?P<pk>[0-9]+)/$', views.RegistrationInvitationsUpdateView.as_view(), name='update'), - url(r'^(?P<pk>[0-9]+)/add_citation$', views.RegistrationInvitationsAddCitationView.as_view(), - name='add_citation'), - url(r'^(?P<pk>[0-9]+)/delete$', views.RegistrationInvitationsDeleteView.as_view(), - name='delete'), - url(r'^(?P<pk>[0-9]+)/merge$', views.RegistrationInvitationsMergeView.as_view(), - name='merge'), - url(r'^(?P<pk>[0-9]+)/mark/(?P<label>sent)$', views.RegistrationInvitationsMarkView.as_view(), - name='mark'), - url(r'^(?P<pk>[0-9]+)/map_to_contributor/(?P<contributor_id>[0-9]+)/$', + path( + '', + views.RegistrationInvitationsView.as_view(), + name='list' + ), + path( + 'sent', + views.RegistrationInvitationsSentView.as_view(), + name='list_sent' + ), + path( + 'contributors', + views.RegistrationInvitationsDraftContributorView.as_view(), + name='list_contributors' + ), + path( + 'fellows', + views.RegistrationInvitationsFellowView.as_view(), + name='list_fellows' + ), + path( + 'new', + views.create_registration_invitation_or_citation, + name='new' + ), + path( + '<int:pk>/', + views.RegistrationInvitationsUpdateView.as_view(), + name='update' + ), + path( + '<int:pk>/add_citation', + views.RegistrationInvitationsAddCitationView.as_view(), + name='add_citation' + ), + path( + '<int:pk>/delete', + views.RegistrationInvitationsDeleteView.as_view(), + name='delete' + ), + path( + '<int:pk>/merge', + views.RegistrationInvitationsMergeView.as_view(), + name='merge' + ), + path( + '<int:pk>/mark/<str:label>', + views.RegistrationInvitationsMarkView.as_view(), + name='mark' + ), + path( + '<int:pk>/map_to_contributor/<int:contributor_id>/', views.RegistrationInvitationsMapToContributorView.as_view(), - name='map_to_contributor'), - url(r'^(?P<pk>[0-9]+)/send_reminder$', views.RegistrationInvitationsReminderView.as_view(), - name='send_reminder'), - url(r'^cleanup$', views.cleanup, name='cleanup'), - - url(r'^citations$', views.CitationNotificationsView.as_view(), - name='citation_notification_list'), - url(r'^citations/(?P<pk>[0-9]+)$', views.CitationNotificationsProcessView.as_view(), - name='citation_notification_process'), + name='map_to_contributor' + ), + path( + '<int:pk>/send_reminder', + views.RegistrationInvitationsReminderView.as_view(), + name='send_reminder' + ), + path( + 'cleanup', + views.cleanup, + name='cleanup' + ), + path( + 'citations', + views.CitationNotificationsView.as_view(), + name='citation_notification_list' + ), + path( + 'citations/<int:pk>', + views.CitationNotificationsProcessView.as_view(), + name='citation_notification_process' + ), ] diff --git a/scipost_django/invitations/utils.py b/scipost_django/invitations/utils.py index 6abd61a33e55d7535ceef19f8b8730ff08469abf..91d68d13bf825c854962ee3f7dce7bd19476ced2 100644 --- a/scipost_django/invitations/utils.py +++ b/scipost_django/invitations/utils.py @@ -2,11 +2,13 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +from django.contrib.sites.models import Site + from common.utils import BaseMailUtil class Utils(BaseMailUtil): - mail_sender = 'invitations@scipost.org' + mail_sender = 'invitations@%s' % Site.objects.get_current().domain mail_sender_title = 'SciPost Invitation' @classmethod diff --git a/scipost_django/invitations/views.py b/scipost_django/invitations/views.py index dff502d8b054dbe1d6057cc33484e903bd39f18f..32bb5df5f883e02f0c0821f9003703635a8de613 100644 --- a/scipost_django/invitations/views.py +++ b/scipost_django/invitations/views.py @@ -4,6 +4,7 @@ __license__ = "AGPL v3" from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required +from django.contrib.sites.models import Site from django.db import transaction from django.shortcuts import render, redirect from django.urls import reverse_lazy, reverse @@ -184,10 +185,9 @@ class RegistrationInvitationsUpdateView(RequestArgumentMixin, PermissionsMixin, def get_mail_config(self): config = super().get_mail_config() - print('Config', config) - print(self.object) if self.object.invitation_type == INVITATION_EDITORIAL_FELLOW: - config['from_email'] = 'jscaux@scipost.org' + domain = Site.objects.get_current().domain + config['from_email'] = f'jscaux@{domain}' config['from_name'] = 'J-S Caux' return config @@ -236,7 +236,8 @@ class RegistrationInvitationsReminderView(RequestArgumentMixin, PermissionsMixin def get_mail_config(self): config = super().get_mail_config() if self.object.invitation_type == INVITATION_EDITORIAL_FELLOW: - config['from_email'] = 'jscaux@scipost.org' + domain = Site.objects.get_current().domain + config['from_email'] = f'jscaux@{domain}' config['from_name'] = 'J-S Caux' return config diff --git a/scipost_django/journals/converters.py b/scipost_django/journals/converters.py index f65b6a302290748b178e28c59f961bb1b3072534..ae5e80cf5c65f7d48d615a46ff4d4eeb60c18661 100644 --- a/scipost_django/journals/converters.py +++ b/scipost_django/journals/converters.py @@ -24,3 +24,53 @@ class JournalDOILabelConverter: def to_url(self, value): return value + + +class IssueDOILabelConverter: + """ + Converter for journal issue DOI labels. + """ + + def __init__(self): + try: + from journals.models import Journal + self.regex = '|'.join([j.doi_label for j in Journal.objects.all()]) + except ProgrammingError: + self.regex = 'SciPost' + self.regex = '(' + self.regex + ')' + r'\.[0-9]+(\.[0-9]+)?' + + def to_python(self, value): + from journals.models import Publication + try: + return Publication.objects.get(doi_label=value).doi_label + except Publication.DoesNotExist: + return ValueError + return value + + def to_url(self, value): + return value + + +class PublicationDOILabelConverter: + """ + Converter for publication DOI labels. + """ + + def __init__(self): + try: + from journals.models import Journal + self.regex = '|'.join([j.doi_label for j in Journal.objects.all()]) + except ProgrammingError: + self.regex = 'SciPost' + self.regex = '(' + self.regex + ')' + r'\.[0-9]+(\.[0-9]+(\.[0-9]+)?)?' + + def to_python(self, value): + from journals.models import Publication + try: + return Publication.objects.get(doi_label=value).doi_label + except Publication.DoesNotExist: + return ValueError + return value + + def to_url(self, value): + return value diff --git a/scipost_django/journals/forms.py b/scipost_django/journals/forms.py index f0538d1b995c446f0d1f7dea95881ee24a32df07..2a5bba762ba3c3f36c19adf57ee81ffc9dcb4b7d 100644 --- a/scipost_django/journals/forms.py +++ b/scipost_django/journals/forms.py @@ -12,10 +12,14 @@ from datetime import datetime from django import forms from django.conf import settings +from django.contrib.sites.models import Site from django.forms import BaseModelFormSet, modelformset_factory from django.template import loader from django.utils import timezone +from crispy_forms.helper import FormHelper +from crispy_forms.layout import Layout, Div +from crispy_bootstrap5.bootstrap5 import FloatingField from dal import autocomplete from .constants import STATUS_DRAFT, STATUS_PUBLICLY_OPEN,\ @@ -31,6 +35,7 @@ from funders.models import Grant, Funder from journals.models import Journal from mails.utils import DirectMailUtil from organizations.models import Organization +from proceedings.models import Proceedings from production.constants import PROOFS_PUBLISHED from production.models import ProductionEvent from scipost.forms import RequestFormMixin @@ -39,6 +44,85 @@ from submissions.constants import STATUS_PUBLISHED from submissions.models import Submission +class PublicationSearchForm(forms.Form): + """Simple search form to filter a Publication queryset.""" + + author = forms.CharField( + max_length=100, + required=False, + label="Author(s)" + ) + title = forms.CharField( + max_length=100, + required=False + ) + doi_label = forms.CharField( + max_length=100, + required=False + ) + journal = forms.ModelChoiceField( + queryset=Journal.objects.all(), + required=False + ) + proceedings = forms.ModelChoiceField( + queryset=Proceedings.objects.all(), + required=False + ) + + def __init__(self, *args, **kwargs): + self.acad_field_slug = kwargs.pop('acad_field_slug') + self.specialty_slug = kwargs.pop('specialty_slug') + super().__init__(*args, **kwargs) + if self.acad_field_slug: + self.fields['journal'].queryset = Journal.objects.filter( + college__acad_field__slug=self.acad_field_slug + ) + self.helper = FormHelper() + self.helper.layout = Layout( + Div( + Div(FloatingField('author'), css_class="col-lg-6"), + Div(FloatingField('title'), css_class="col-lg-6"), + css_class='row mb-0' + ), + Div( + Div(FloatingField('journal'), css_class="col-lg-6"), + Div(FloatingField('doi_label'), css_class="col-lg-6"), + css_class='row mb-0' + ), + Div( + Div(FloatingField('proceedings'), css_class='col-lg-6'), + css_class='row mb-0', + css_id='row_proceedings', + style='display: none' + ), + ) + + def search_results(self): + """ + Return all public Publication objects fitting search criteria. + """ + publications = Publication.objects.published() + if self.acad_field_slug != 'all': + publications = publications.filter(acad_field__slug=self.acad_field_slug) + if self.specialty_slug: + publications = publications.filter(specialties__slug=self.specialty_slug) + if self.cleaned_data.get('author'): + publications = publications.filter(author_list__icontains=self.cleaned_data.get('author')) + if self.cleaned_data.get('title'): + publications = publications.filter(title__icontains=self.cleaned_data.get('title')) + if self.cleaned_data.get('doi_label'): + publications = publications.filter( + doi_label__icontains=self.cleaned_data.get('doi_label') + ) + if self.cleaned_data.get('journal'): + publications = publications.for_journal(self.cleaned_data.get('journal').name) + if self.cleaned_data.get('proceedings'): + publications = publications.filter( + in_issue__proceedings=self.cleaned_data.get('proceedings') + ) + return publications + + class CitationListBibitemsForm(forms.ModelForm): latex_bibitems = forms.CharField(widget=forms.Textarea()) @@ -166,6 +250,7 @@ class CreateMetadataXMLForm(forms.ModelForm): # Render from template template = loader.get_template('xml/publication_crossref.html') context = { + 'domain': Site.objects.get_current().domain, 'publication': publication, 'doi_batch_id': doi_batch_id, 'deposit_email': settings.CROSSREF_DEPOSIT_EMAIL, @@ -514,13 +599,14 @@ class DraftPublicationForm(forms.ModelForm): '\tyear={%s},\n' '\tpublisher={SciPost},\n' '\tdoi={%s},\n' - '\turl={https://scipost.org/%s},\n' + '\turl={https://%s/%s},\n' '}' ) % ( issue.number, paper_nr, issue.until_date.strftime('%Y'), doi_string, + Site.objects.get_current().domain, doi_string) self.fields['BiBTeX_entry'].initial = bibtex_entry @@ -546,7 +632,7 @@ class DraftPublicationForm(forms.ModelForm): '\tyear={%s},\n' '\tpublisher={SciPost},\n' '\tdoi={%s},\n' - '\turl={https://scipost.org/%s},\n' + '\turl={https://%s/%s},\n' '}' ) % ( doi_string, @@ -556,6 +642,7 @@ class DraftPublicationForm(forms.ModelForm): paper_nr, timezone.now().year, doi_string, + Site.objects.get_current().domain, doi_string) self.fields['BiBTeX_entry'].initial = bibtex_entry if not self.instance.BiBTeX_entry: diff --git a/scipost_django/journals/models/update.py b/scipost_django/journals/models/update.py index 6b1d142a1f62d53305bbde9f16aadc44004b4104..376e2c9a8511ba99273dc2932170dc6bfa4d198d 100644 --- a/scipost_django/journals/models/update.py +++ b/scipost_django/journals/models/update.py @@ -7,6 +7,7 @@ import random import string from django.conf import settings +from django.contrib.sites.models import Site from django.contrib.contenttypes.fields import GenericRelation from django.contrib.postgres.fields import JSONField from django.db import models @@ -106,6 +107,7 @@ class PublicationUpdate(models.Model): # Render from template template = loader.get_template('xml/publication_update_crossref.html') context = { + 'domain': Site.objects.get_current().domain, 'update': self, 'doi_batch_id': doi_batch_id, 'deposit_email': settings.CROSSREF_DEPOSIT_EMAIL, diff --git a/scipost_django/journals/templates/journals/_publication_ris.html b/scipost_django/journals/templates/journals/_publication_ris.html index ffd6a27cbaa54a3abe9b28ad806adf2114f97bc8..f35081172640d437c269dc25249715825df20de9 100644 --- a/scipost_django/journals/templates/journals/_publication_ris.html +++ b/scipost_django/journals/templates/journals/_publication_ris.html @@ -6,7 +6,7 @@ <span>DO - {{ publication.doi_string }}</span><br> <span>TI - {{ publication.title }}</span><br> <span>PY - {{ publication.publication_date|date:'Y/m/d' }}</span><br> - <span>UR - https://scipost.org{{ publication.get_absolute_url }}</span><br> + <span>UR - https://{{ request.get_host }}{{ publication.get_absolute_url }}</span><br> <span>JF - {{ publication.get_journal.name }}</span><br> <span>JA - {{ publication.get_journal.name_abbrev }}</span><br> {% if publication.in_issue %} diff --git a/scipost_django/journals/templates/journals/allocate_orgpubfractions.html b/scipost_django/journals/templates/journals/allocate_orgpubfractions.html index e8da81940c1121be0c28eb8ec2e30ceaf1b131da..68ebc82f2a5744cf4b9ef94309323e116406ee00 100644 --- a/scipost_django/journals/templates/journals/allocate_orgpubfractions.html +++ b/scipost_django/journals/templates/journals/allocate_orgpubfractions.html @@ -26,7 +26,7 @@ <hr class="divider"> <h3 class="highlight">Which Organizations supported the research in this publication?</h3> - <p>Please indicate <strong>which Organizations should be credited with supporting the research published in this publication</strong>.<br/>Data provided here is indicative and does not need to be extremely accurate.<br/>Note however that this data <strong>is used</strong> to set the suggested level of support from external Organizations which SciPost needs to remain sustainable.<br/><br/>The Organizations listed here appear as either host institutions for the authors, or as acknowledged funders.<br/>Is the list of Organizations incomplete? <a href="mailto:edadmin@scipost.org?subject=Missing Organizations for {{ publication.doi_label }}&body=[Please provide the missing data here]">Please email EdAdmin with details</a>.</p> + <p>Please indicate <strong>which Organizations should be credited with supporting the research published in this publication</strong>.<br/>Data provided here is indicative and does not need to be extremely accurate.<br/>Note however that this data <strong>is used</strong> to set the suggested level of support from external Organizations which SciPost needs to remain sustainable.<br/><br/>The Organizations listed here appear as either host institutions for the authors, or as acknowledged funders.<br/>Is the list of Organizations incomplete? <a href="mailto:edadmin@{{ request.get_host }}?subject=Missing Organizations for {{ publication.doi_label }}&body=[Please provide the missing data here]">Please email EdAdmin with details</a>.</p> <form method="post" action="{% url 'journals:allocate_orgpubfractions' doi_label=publication.doi_label %}"> {% csrf_token %} diff --git a/scipost_django/journals/templates/journals/journal_list.html b/scipost_django/journals/templates/journals/journal_list.html index 25fd4ae339d85f7252013c11865987f53ddc91e2..3b1ab5291373cb2a4ef52f6b62733c0e08dfa7de 100644 --- a/scipost_django/journals/templates/journals/journal_list.html +++ b/scipost_django/journals/templates/journals/journal_list.html @@ -5,9 +5,6 @@ {% load journals_extras %} {% load scipost_extras %} -{% block headsup %} - <style>{% for journal in object_list %}{% if journal.style %}{{ journal.style }}{% endif %}{% endfor %}</style> -{% endblock headsup %} {% block meta_description %}{{ block.super }} {% if acad_field %} in {{ acad_field.name }}{% endif %}{% endblock meta_description %} {% block pagetitle %}: Journals{% if acad_field %} in {{ acad_field.name }}{% endif %}{% endblock pagetitle %} @@ -84,7 +81,7 @@ {% empty %} <p> There are no Journals yet in this branch of academia. - <strong>Help us to get started: nominate potential Fellows by <a href="mailto:admin@scipost.org">emailing us</a> with your suggestions!</strong> + <strong>Help us to get started: nominate potential Fellows by <a href="mailto:admin@{{ request.get_host }}">emailing us</a> with your suggestions!</strong> </p> {% endfor %} </div> diff --git a/scipost_django/journals/templates/journals/publication_detail.html b/scipost_django/journals/templates/journals/publication_detail.html index b8cf8eb11f515afa7cec04c9af690a8c95f4c38c..71f9cffb8e6753cf7e61b8effe390c0ee933154c 100644 --- a/scipost_django/journals/templates/journals/publication_detail.html +++ b/scipost_django/journals/templates/journals/publication_detail.html @@ -35,7 +35,7 @@ <meta name="citation_issue" content="{{ publication.in_issue.number }}"/> {% endif %} <meta name="citation_firstpage" content="{{ publication.paper_nr|paper_nr_string_filter }}"/> - <meta name="citation_pdf_url" content="https://scipost.org/{{ publication.doi_string }}/pdf"/> + <meta name="citation_pdf_url" content="https://{{ request.get_host }}/{{ publication.doi_string }}/pdf"/> <meta name="dc.identifier" content="doi:{{ publication.doi_string }}"/> {% endblock headsup %} diff --git a/scipost_django/journals/templates/xml/publication_crossref.html b/scipost_django/journals/templates/xml/publication_crossref.html index fb0b310c64a802480e917d30cef0529482a507d8..be62bd3726c9101d25df8cfafd2d9e3ec9887ea7 100644 --- a/scipost_django/journals/templates/xml/publication_crossref.html +++ b/scipost_django/journals/templates/xml/publication_crossref.html @@ -19,7 +19,7 @@ {% if publication.in_issue.in_volume.in_journal.issn %}<issn media_type='electronic'>{{ publication.in_issue.in_volume.in_journal.issn }}</issn>{% endif %} <doi_data> <doi>{{ publication.in_issue.in_volume.in_journal.doi_string }}</doi> - <resource>https://scipost.org/{{ publication.in_issue.in_volume.in_journal.doi_string }}</resource> + <resource>https://{{ domain }}/{{ publication.in_issue.in_volume.in_journal.doi_string }}</resource> </doi_data> </journal_metadata> <journal_issue> @@ -38,7 +38,7 @@ {% if publication.in_issue.in_journal.issn %}<issn media_type='electronic'>{{ publication.in_issue.in_journal.issn }}</issn>{% endif %} <doi_data> <doi>{{ publication.in_issue.in_journal.doi_string }}</doi> - <resource>https://scipost.org/{{ publication.in_issue.in_journal.doi_string }}</resource> + <resource>https://{{ domain }}/{{ publication.in_issue.in_journal.doi_string }}</resource> </doi_data> </journal_metadata> <journal_issue> @@ -54,7 +54,7 @@ {% if publication.in_journal.issn %}<issn media_type='electronic'>{{ publication.in_journal.issn }}</issn>{% endif %} <doi_data> <doi>{{ publication.in_journal.doi_string }}</doi> - <resource>https://scipost.org/{{ publication.in_journal.doi_string }}</resource> + <resource>https://{{ domain }}/{{ publication.in_journal.doi_string }}</resource> </doi_data> </journal_metadata> {% endif %} @@ -94,7 +94,7 @@ <crossmark> <crossmark_policy>10.21468/SciPost.CrossmarkPolicy</crossmark_policy> <crossmark_domains> - <crossmark_domain><domain>scipost.org</domain></crossmark_domain> + <crossmark_domain><domain>{{ domain }}</domain></crossmark_domain> </crossmark_domains> <crossmark_domain_exclusive>false</crossmark_domain_exclusive> <custom_metadata> @@ -127,15 +127,15 @@ </archive_locations> <doi_data> <doi>{{ publication.doi_string }}</doi> - <resource>https://scipost.org/{{ publication.doi_string }}</resource> + <resource>https://{{ domain }}/{{ publication.doi_string }}</resource> <collection property='crawler-based'> <item crawler='iParadigms'> - <resource>https://scipost.org/{{ publication.doi_string }}/pdf</resource> + <resource>https://{{ domain }}/{{ publication.doi_string }}/pdf</resource> </item> </collection> <collection property='text-mining'> <item> - <resource mime_type='application/pdf'>https://scipost.org/{{ publication.doi_string }}/pdf</resource> + <resource mime_type='application/pdf'>https://{{ domain }}/{{ publication.doi_string }}/pdf</resource> </item> </collection> </doi_data> diff --git a/scipost_django/journals/templates/xml/publication_update_crossref.html b/scipost_django/journals/templates/xml/publication_update_crossref.html index edd3e4c587ed38fa4a44e21193b6eccb7c3d8dc8..79ee75204082a1200bb925a0e0701d16ec7408aa 100644 --- a/scipost_django/journals/templates/xml/publication_update_crossref.html +++ b/scipost_django/journals/templates/xml/publication_update_crossref.html @@ -19,7 +19,7 @@ {% if update.publication.in_issue.in_volume.in_journal.issn %}<issn media_type='electronic'>{{ update.publication.in_issue.in_volume.in_journal.issn }}</issn>{% endif %} <doi_data> <doi>{{ update.publication.in_issue.in_volume.in_journal.doi_string }}</doi> - <resource>https://scipost.org/{{ update.publication.in_issue.in_volume.in_journal.doi_string }}</resource> + <resource>https://{{ domain }}/{{ update.publication.in_issue.in_volume.in_journal.doi_string }}</resource> </doi_data> </journal_metadata> {% elif update.publication.in_issue.in_journal %} @@ -29,7 +29,7 @@ {% if update.publication.in_issue.in_journal.issn %}<issn media_type='electronic'>{{ update.publication.in_issue.in_journal.issn }}</issn>{% endif %} <doi_data> <doi>{{ update.publication.in_issue.in_journal.doi_string }}</doi> - <resource>https://scipost.org/{{ update.publication.in_issue.in_journal.doi_string }}</resource> + <resource>https://{{ domain }}/{{ update.publication.in_issue.in_journal.doi_string }}</resource> </doi_data> </journal_metadata> {% else %} @@ -39,7 +39,7 @@ {% if update.publication.in_journal.issn %}<issn media_type='electronic'>{{ update.publication.in_journal.issn }}</issn>{% endif %} <doi_data> <doi>{{ update.publication.in_journal.doi_string }}</doi> - <resource>https://scipost.org/{{ update.publication.in_journal.doi_string }}</resource> + <resource>https://{{ domain }}/{{ update.publication.in_journal.doi_string }}</resource> </doi_data> </journal_metadata> {% endif %} @@ -75,7 +75,7 @@ <crossmark> <crossmark_policy>10.21468/SciPost.CrossmarkPolicy</crossmark_policy> <crossmark_domains> - <crossmark_domain><domain>scipost.org</domain></crossmark_domain> + <crossmark_domain><domain>{{ domain }}</domain></crossmark_domain> </crossmark_domains> <crossmark_domain_exclusive>false</crossmark_domain_exclusive> <updates> @@ -84,7 +84,7 @@ </crossmark> <doi_data> <doi>{{ update.doi_string }}</doi> - <resource>https://scipost.org/{{ update.doi_string }}</resource> + <resource>https://{{ domain }}/{{ update.doi_string }}</resource> </doi_data> </journal_article> </journal> diff --git a/scipost_django/journals/urls/general.py b/scipost_django/journals/urls/general.py index 5ae2a35b4bf357fbfeec4e1301126b373846336a..ac79842869a580628808aa3011f3aa6b8c85926b 100644 --- a/scipost_django/journals/urls/general.py +++ b/scipost_django/journals/urls/general.py @@ -6,9 +6,6 @@ from django.conf.urls import url from django.urls import path, re_path, reverse_lazy from django.views.generic import TemplateView, RedirectView -from submissions.constants import SUBMISSIONS_COMPLETE_REGEX - -from journals.regexes import PUBLICATION_DOI_LABEL_REGEX from journals import views as journals_views @@ -23,8 +20,8 @@ urlpatterns = [ name='publication-autocomplete', ), # Journals - url( - r'^$', + path( + '', journals_views.JournalListView.as_view(), name='journals' ), @@ -33,197 +30,273 @@ urlpatterns = [ journals_views.JournalListView.as_view(), name='journals_in_acad_spec' ), - url(r'^publications$', journals_views.PublicationListView.as_view(), name='publications'), - url(r'scipost_physics', RedirectView.as_view(url=reverse_lazy('scipost:landing_page', - args=['SciPostPhys']))), - url(r'^journals_terms_and_conditions$', - TemplateView.as_view(template_name='journals/journals_terms_and_conditions.html'), - name='journals_terms_and_conditions'), - url(r'^crossmark_policy$', - TemplateView.as_view(template_name='journals/crossmark_policy.html'), - name='crossmark_policy'), + path( + 'publications', + journals_views.PublicationListView.as_view(), + name='publications' + ), + path( + 'scipost_physics', + RedirectView.as_view( + url=reverse_lazy('scipost:landing_page', args=['SciPostPhys'])) + ), + path( + 'journals_terms_and_conditions', + TemplateView.as_view( + template_name='journals/journals_terms_and_conditions.html'), + name='journals_terms_and_conditions' + ), + path( + 'crossmark_policy', + TemplateView.as_view( + template_name='journals/crossmark_policy.html'), + name='crossmark_policy' + ), # Publication creation - url(r'^admin/publications/{regex}/$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'admin/publications/<identifier:identifier_w_vn_nr>/', journals_views.DraftPublicationUpdateView.as_view(), - name='update_publication'), - url(r'^admin/publications/(?P<doi_label>{regex})/publish$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='update_publication' + ), + path( + 'admin/publications/<publication_doi_label:doi_label>/publish', journals_views.PublicationPublishView.as_view(), - name='publish_publication'), - url(r'^admin/publications/(?P<doi_label>{regex})/approval$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='publish_publication' + ), + path( + 'admin/publications/<publication_doi_label:doi_label>/approval', journals_views.DraftPublicationApprovalView.as_view(), - name='send_publication_for_approval'), - url(r'^admin/publications/(?P<doi_label>{regex})/authors$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), - # journals_views.PublicationAuthorOrderingView.as_view(), + name='send_publication_for_approval' + ), + path( + 'admin/publications/<publication_doi_label:doi_label>/authors', journals_views.publication_authors_ordering, - name='update_author_ordering'), - url(r'^admin/publications/(?P<doi_label>{regex})/grants$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='update_author_ordering' + ), + path( + 'admin/publications/<publication_doi_label:doi_label>/grants', journals_views.PublicationGrantsView.as_view(), - name='update_grants'), - url(r'^admin/publications/(?P<doi_label>{regex})/grants/(?P<grant_id>[0-9]+)/remove$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='update_grants' + ), + path( + 'admin/publications/<publication_doi_label:doi_label>/grants/<int:grant_id>/remove', journals_views.PublicationGrantsRemovalView.as_view(), - name='remove_grant'), + name='remove_grant' + ), # Editorial and Administrative Workflow - url(r'^admin/(?P<doi_label>{regex})/authors/add$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + path( + 'admin/<publication_doi_label:doi_label>/authors/add', journals_views.add_author, - name='add_author'), - url(r'^admin/(?P<doi_label>{regex})/manage_metadata/$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='add_author' + ), + path( + 'admin/<publication_doi_label:doi_label>/manage_metadata/', journals_views.manage_metadata, - name='manage_metadata'), - url(r'^admin/manage_metadata/$', + name='manage_metadata' + ), + path( + 'admin/manage_metadata/', journals_views.manage_metadata, - name='manage_metadata'), - url(r'^admin/(?P<doi_label>{regex})/authoraffiliations/$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='manage_metadata' + ), + path( + 'admin/<publication_doi_label:doi_label>/authoraffiliations/', journals_views.AuthorAffiliationView.as_view(), - name='author_affiliations'), - url(r'^admin/(?P<doi_label>{regex})/authoraffiliations/(?P<pk>[0-9]+)/add/$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), - #journals_views.AddAffiliationView.as_view(), + name='author_affiliations' + ), + path( + 'admin/<publication_doi_label:doi_label>/authoraffiliations/<int:pk>/add/', journals_views.add_affiliation, - name='author_affiliation_update'), - url(r'^admin/(?P<doi_label>{regex})/authoraffiliations/(?P<pk>[0-9]+)/remove/(?P<organization_id>[0-9]+)/$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), - #journals_views.AddAffiliationView.as_view(), + name='author_affiliation_update' + ), + path( + 'admin/<publication_doi_label:doi_label>/authoraffiliations/<int:pk>/remove/<int:organization_id>/', journals_views.remove_affiliation, - name='author_affiliation_remove'), - url(r'^admin/(?P<doi_label>{regex})/citation_list_metadata$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='author_affiliation_remove' + ), + path( + 'admin/<publication_doi_label:doi_label>/citation_list_metadata', journals_views.CitationUpdateView.as_view(), - name='create_citation_list_metadata'), - url(r'^admin/(?P<doi_label>{regex})/abstract_jats$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='create_citation_list_metadata' + ), + path( + 'admin/<publication_doi_label:doi_label>/abstract_jats', journals_views.AbstractJATSUpdateView.as_view(), - name='abstract_jats'), - url(r'^admin/(?P<doi_label>{regex})/update_references$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), - journals_views.update_references, name='update_references'), - url(r'^admin/(?P<doi_label>{regex})/funders/create_metadata$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='abstract_jats' + ), + path( + 'admin/<publication_doi_label:doi_label>/update_references', + journals_views.update_references, + name='update_references' + ), + path( + 'admin/<publication_doi_label:doi_label>/funders/create_metadata', journals_views.FundingInfoView.as_view(), - name='create_funding_info_metadata'), - url(r'^admin/(?P<doi_label>{regex})/funders/add_generic$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='create_funding_info_metadata' + ), + path( + 'admin/<publication_doi_label:doi_label>/funders/add_generic', journals_views.add_generic_funder, - name='add_generic_funder'), - url(r'^admin/(?P<doi_label>{regex})/grants/add$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='add_generic_funder' + ), + path( + 'admin/<publication_doi_label:doi_label>/grants/add', journals_views.add_associated_grant, - name='add_associated_grant'), + name='add_associated_grant' + ), # Admin: Volumes and Issues - url(r'^admin/volumes/$', + path( + 'admin/volumes/', journals_views.VolumesAdminListView.as_view(), - name='admin_volumes_list'), - url(r'^admin/volumes/add$', + name='admin_volumes_list' + ), + path( + 'admin/volumes/add', journals_views.VolumesAdminAddView.as_view(), - name='add_volume'), - url(r'^admin/volumes/(?P<pk>[0-9]+)/$', + name='add_volume' + ), + path( + 'admin/volumes/<int:pk>/', journals_views.VolumesAdminUpdateView.as_view(), - name='update_volume'), - url(r'^admin/issues/$', + name='update_volume' + ), + path( + 'admin/issues/', journals_views.IssuesAdminListView.as_view(), - name='admin_issue_list'), - url(r'^admin/issues/add$', + name='admin_issue_list' + ), + path( + 'admin/issues/add', journals_views.IssuesAdminAddView.as_view(), - name='add_issue'), - url(r'^admin/issues/(?P<pk>[0-9]+)/$', + name='add_issue' + ), + path( + 'admin/issues/<int:pk>/', journals_views.IssuesAdminUpdateView.as_view(), - name='update_issue'), + name='update_issue' + ), # Metadata handling - url(r'^admin/(?P<doi_label>{regex})/metadata/crossref/create$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + path( + 'admin/<publication_doi_label:doi_label>/metadata/crossref/create', journals_views.CreateMetadataXMLView.as_view(), - name='create_metadata_xml'), - url(r'^admin/(?P<doi_label>{regex})/metadata/crossref/deposit/(?P<option>[a-z]+)$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='create_metadata_xml' + ), + path( + 'admin/<publication_doi_label:doi_label>/metadata/crossref/deposit/<str:option>', journals_views.metadata_xml_deposit, - name='metadata_xml_deposit'), - url(r'^admin/(?P<doi_label>{regex})/metadata/DOAJ$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='metadata_xml_deposit' + ), + path( + 'admin/<publication_doi_label:doi_label>/metadata/DOAJ', journals_views.produce_metadata_DOAJ, - name='produce_metadata_DOAJ'), - url(r'^admin/(?P<doi_label>{regex})/metadata/DOAJ/deposit$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='produce_metadata_DOAJ' + ), + path( + 'admin/<publication_doi_label:doi_label>/metadata/DOAJ/deposit', journals_views.metadata_DOAJ_deposit, - name='metadata_DOAJ_deposit'), - url(r'^admin/metadata/crossref/(?P<deposit_id>[0-9]+)/mark/(?P<success>[0-1])$', + name='metadata_DOAJ_deposit' + ), + path( + 'admin/metadata/crossref/<int:deposit_id>/mark/<int:success>', journals_views.mark_deposit_success, - name='mark_deposit_success'), - url(r'^admin/metadata/DOAJ/(?P<deposit_id>[0-9]+)/mark/(?P<success>[0-1])$', + name='mark_deposit_success' + ), + path( + 'admin/metadata/DOAJ/<int:deposit_id>/mark/<int:success>', journals_views.mark_doaj_deposit_success, - name='mark_doaj_deposit_success'), - url(r'^admin/metadata/generic/(?P<type_of_object>[a-z]+)/(?P<object_id>[0-9]+)/metadata$', + name='mark_doaj_deposit_success' + ), + path( + 'admin/metadata/generic/<str:type_of_object>/<int:object_id>/metadata', journals_views.generic_metadata_xml_deposit, - name='generic_metadata_xml_deposit'), - url(r'^admin/metadata/generic/(?P<deposit_id>[0-9]+)/mark/(?P<success>[0-1])$', + name='generic_metadata_xml_deposit' + ), + path( + 'admin/metadata/generic/<int:deposit_id>/mark/<int:success>', journals_views.mark_generic_deposit_success, - name='mark_generic_deposit_success'), - url(r'^admin/generic/(?P<type_of_object>[a-z]+)/(?P<object_id>[0-9]+)/email_made_citable$', + name='mark_generic_deposit_success' + ), + path( + 'admin/generic/<str:type_of_object>/<int:object_id>/email_made_citable', journals_views.email_object_made_citable, - name='email_object_made_citable'), + name='email_object_made_citable' + ), # Topics: - url(r'^publication_add_topic/(?P<doi_label>{regex})$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + path( + 'publication_add_topic/<publication_doi_label:doi_label>', journals_views.publication_add_topic, - name='publication_add_topic'), - url(r'^publication_remove_topic/(?P<doi_label>{regex})/(?P<slug>[-\w]+)/$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='publication_add_topic' + ), + path( + 'publication_remove_topic/<publication_doi_label:doi_label>/<slug:slug>/', journals_views.publication_remove_topic, - name='publication_remove_topic'), + name='publication_remove_topic' + ), # PubFraction allocation: - url(r'^allocate_orgpubfractions/(?P<doi_label>{regex})$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + path( + 'allocate_orgpubfractions/<publication_doi_label:doi_label>', journals_views.allocate_orgpubfractions, - name='allocate_orgpubfractions'), - url(r'^request_pubfrac_check/(?P<doi_label>{regex})$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='allocate_orgpubfractions' + ), + path( + 'request_pubfrac_check/<publication_doi_label:doi_label>', journals_views.request_pubfrac_check, - name='request_pubfrac_check'), + name='request_pubfrac_check' + ), # Citedby - url(r'^admin/citedby/$', + path( + 'admin/citedby/', journals_views.harvest_citedby_list, - name='harvest_citedby_list'), - url(r'^admin/citedby/(?P<doi_label>{regex})/harvest$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='harvest_citedby_list' + ), + path( + 'admin/citedby/<publication_doi_label:doi_label>/harvest', journals_views.harvest_citedby_links, - name='harvest_citedby_links'), + name='harvest_citedby_links' + ), # Reports - url(r'^reports/$', + path( + 'reports/', journals_views.manage_report_metadata, - name='manage_report_metadata'), - url(r'^reports/(?P<report_id>[0-9]+)/sign$', + name='manage_report_metadata' + ), + path( + 'reports/<int:report_id>/sign', journals_views.sign_existing_report, - name='sign_existing_report'), - url(r'^reports/(?P<report_id>[0-9]+)/mark_doi_needed/(?P<needed>[0-1])$', + name='sign_existing_report' + ), + path( + 'reports/<int:report_id>/mark_doi_needed/<int:needed>', journals_views.mark_report_doi_needed, - name='mark_report_doi_needed'), + name='mark_report_doi_needed' + ), # Comments - url(r'^comments/$', + path( + 'comments/', journals_views.manage_comment_metadata, - name='manage_comment_metadata'), - url(r'^comments/(?P<comment_id>[0-9]+)/mark_doi_needed/(?P<needed>[0-1])$', + name='manage_comment_metadata' + ), + path( + 'comments/<int:comment_id>/mark_doi_needed/<int:needed>', journals_views.mark_comment_doi_needed, - name='mark_comment_doi_needed'), + name='mark_comment_doi_needed' + ), # PublicationUpdates - url(r'^updates/$', + path( + 'updates/', journals_views.manage_update_metadata, - name='manage_update_metadata'), + name='manage_update_metadata' + ), ] diff --git a/scipost_django/journals/urls/journal.py b/scipost_django/journals/urls/journal.py index 9c7fa9d8fb9d14ad9f51de45a8854be1ae29c86b..9c2299ea55749b9c0098adcc78696bc5f02f9fc5 100644 --- a/scipost_django/journals/urls/journal.py +++ b/scipost_django/journals/urls/journal.py @@ -2,7 +2,6 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.urls import path from journals import views as journals_views @@ -12,12 +11,36 @@ app_name = 'urls.journals' urlpatterns = [ # Journal routes - url(r'^issues$', journals_views.IssuesView.as_view(), name='issues'), - url(r'^recent$', journals_views.redirect_to_about, name='recent'), - url(r'^accepted$', journals_views.redirect_to_about, name='accepted'), - url(r'^authoring$', journals_views.authoring, name='authoring'), - url(r'^refereeing$', journals_views.refereeing, name='refereeing'), - url(r'^about$', journals_views.about, name='about'), + path( + 'issues', + journals_views.IssuesView.as_view(), + name='issues' + ), + path( + 'recent', + journals_views.redirect_to_about, + name='recent' + ), + path( + 'accepted', + journals_views.redirect_to_about, + name='accepted' + ), + path( + 'authoring', + journals_views.authoring, + name='authoring' + ), + path( + 'refereeing', + journals_views.refereeing, + name='refereeing' + ), + path( + 'about', + journals_views.about, + name='about' + ), path( 'metrics/<specialty:specialty>', journals_views.metrics, diff --git a/scipost_django/journals/utils.py b/scipost_django/journals/utils.py index 73d4865890217893e204d53f882ff7c5e7629c86..9487e1362919b286a0d7ecb2d54c4bdb4e236bef 100644 --- a/scipost_django/journals/utils.py +++ b/scipost_django/journals/utils.py @@ -2,18 +2,20 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +from django.contrib.sites.models import Site from django.core.mail import EmailMessage from common.utils import BaseMailUtil class JournalUtils(BaseMailUtil): - mail_sender = 'edadmin@scipost.org' + mail_sender = 'edadmin@%s' % Site.objects.get_current().domain mail_sender_title = 'SciPost Editorial Admin' @classmethod def send_authors_paper_published_email(cls): """ Requires loading 'publication' attribute. """ + domain = Site.objects.get_current().domain email_text = ('Dear ' + cls.publication.accepted_submission.submitted_by.profile.get_title_display() + ' ' + @@ -24,7 +26,7 @@ class JournalUtils(BaseMailUtil): '\n\nhas been published online with reference ' + cls.publication.citation + '.' '\n\nThe publication page is located at the permanent link ' - 'https://scipost.org/' + cls.publication.doi_label + '.' + 'https://' + domain + '/' + cls.publication.doi_label + '.' '\n\nThe permanent DOI for your publication is 10.21468/' + cls.publication.doi_label + '.' '\n\nTo facilitate dissemination of your paper, we will also automatically ' @@ -36,10 +38,10 @@ class JournalUtils(BaseMailUtil): '\n\nThe SciPost Team.') emailmessage = EmailMessage( 'SciPost: paper published', email_text, - 'SciPost Editorial Admin <edadmin@scipost.org>', + 'SciPost Editorial Admin <edadmin@%s>' % domain, [cls.publication.accepted_submission.submitted_by.user.email, - 'edadmin@scipost.org'], - reply_to=['edadmin@scipost.org']) + 'edadmin@%s' % domain], + reply_to=['edadmin@%s' % domain]) emailmessage.send(fail_silently=False) @classmethod diff --git a/scipost_django/journals/views.py b/scipost_django/journals/views.py index 07b89632922be8a93c9ffaaa422c36697518e03d..5d600fa70da3740da1de1ba76273b070066d396d 100644 --- a/scipost_django/journals/views.py +++ b/scipost_django/journals/views.py @@ -16,6 +16,7 @@ from plotly.graph_objs import Bar from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType +from django.contrib.sites.models import Site from django.core.exceptions import PermissionDenied from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.urls import reverse, reverse_lazy @@ -906,10 +907,12 @@ def metadata_xml_deposit(request, doi_label, option='test'): @permission_required('scipost.can_publish_accepted_submission', return_403=True) def mark_deposit_success(request, deposit_id, success): deposit = get_object_or_404(Deposit, pk=deposit_id) - if success == '1': + if success == 1: deposit.deposit_successful = True - elif success == '0': + elif success == 0: deposit.deposit_successful = False + else: + return Http404 deposit.save() return redirect('journals:manage_metadata') @@ -1096,10 +1099,12 @@ def request_pubfrac_check(request, doi_label): @permission_required('scipost.can_publish_accepted_submission', return_403=True) def mark_doaj_deposit_success(request, deposit_id, success): deposit = get_object_or_404(DOAJDeposit, pk=deposit_id) - if success == '1': + if success == 1: deposit.deposit_successful = True - elif success == '0': + elif success == 0: deposit.deposit_successful = False + else: + raise Http404 deposit.save() return redirect('journals:manage_metadata') @@ -1233,10 +1238,12 @@ def manage_update_metadata(request): @permission_required('scipost.can_publish_accepted_submission', return_403=True) def mark_report_doi_needed(request, report_id, needed): report = get_object_or_404(Report, pk=report_id) - if needed == '1': + if needed == 1: report.needs_doi = True - elif needed == '0': + elif needed == 0: report.needs_doi = False + else: + raise Http404 report.save() return redirect(reverse('journals:manage_report_metadata')) @@ -1244,10 +1251,12 @@ def mark_report_doi_needed(request, report_id, needed): @permission_required('scipost.can_publish_accepted_submission', return_403=True) def mark_comment_doi_needed(request, comment_id, needed): comment = get_object_or_404(Comment, pk=comment_id) - if needed == '1': + if needed == 1: comment.needs_doi = True - elif needed == '0': + elif needed == 0: comment.needs_doi = False + else: + raise Http404 comment.save() return redirect(reverse('journals:manage_comment_metadata')) @@ -1273,6 +1282,8 @@ def generic_metadata_xml_deposit(request, **kwargs): For PublicationUpdates, the deposit type is `journal_article` and the journal is used as container. """ + domain = Site.objects.get_current().domain + type_of_object = kwargs['type_of_object'] object_id = int(kwargs['object_id']) @@ -1342,9 +1353,9 @@ def generic_metadata_xml_deposit(request, **kwargs): ) if isinstance(_object, Publication): - url_to_declare = 'https://scipost.org{}'.format(_object.get_absolute_url()) + url_to_declare = 'https://{domain}{doi}'.format(domain=domain, doi=_object.get_absolute_url()) else: - url_to_declare = 'https://scipost.org/{}'.format(_object.doi_label) + url_to_declare = 'https://{domain}/{doi}'.format(domain=domain, doi=_object.doi_label) metadata_xml += ( '</contributors>\n' @@ -1377,7 +1388,7 @@ def generic_metadata_xml_deposit(request, **kwargs): '</database_metadata>\n' '<dataset dataset_type="collection">\n' '<doi_data><doi>' + _object.doi_string + '</doi>\n' - '<resource>https://scipost.org' + _object.get_absolute_url() + + '<resource>https://' + domain + _object.get_absolute_url() + '</resource></doi_data>\n' '</dataset></database>\n' '</body></doi_batch>' @@ -1415,12 +1426,14 @@ def generic_metadata_xml_deposit(request, **kwargs): @permission_required('scipost.can_publish_accepted_submission', return_403=True) def mark_generic_deposit_success(request, deposit_id, success): deposit = get_object_or_404(GenericDOIDeposit, pk=deposit_id) - if success == '1': + if success == 1: deposit.deposit_successful = True deposit.content_object.doideposit_needs_updating = False deposit.content_object.save() - elif success == '0': + elif success == 0: deposit.deposit_successful = False + else: + raise Http404 deposit.save() if deposit.content_type.name == 'report': return redirect(reverse('journals:manage_report_metadata')) diff --git a/scipost_django/mailing_lists/urls.py b/scipost_django/mailing_lists/urls.py index c3abb11cf84a1d963b086b940c1a4b9258da0295..cb5463424b2ba2dafa656fb15b4cc4fadf4ff52d 100644 --- a/scipost_django/mailing_lists/urls.py +++ b/scipost_django/mailing_lists/urls.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views @@ -10,10 +10,29 @@ app_name = 'mailing_lists' urlpatterns = [ # Mailchimp - url(r'^$', views.MailchimpListView.as_view(), name='overview'), - url(r'^sync$', views.syncronize_lists, name='sync_lists'), - url(r'^sync/(?P<list_id>[0-9a-zA-Z]+)/members$', views.syncronize_members, name='sync_members'), - url(r'^(?P<list_id>[0-9a-zA-Z]+)/$', views.ListDetailView.as_view(), name='list_detail'), - url(r'^non_registered/export$', views.export_non_registered_invitations, - name='export_non_registered_invitations'), + path( + '', + views.MailchimpListView.as_view(), + name='overview' + ), + path( + 'sync', + views.syncronize_lists, + name='sync_lists' + ), + path( + 'sync/<str:list_id>/members', + views.syncronize_members, + name='sync_members' + ), + path( + '<str:list_id>/', + views.ListDetailView.as_view(), + name='list_detail' + ), + path( + 'non_registered/export', + views.export_non_registered_invitations, + name='export_non_registered_invitations' + ), ] diff --git a/scipost_django/mails/core.py b/scipost_django/mails/core.py index 0a2bd0c15a2fff7804dba5466ff08247f4eeefc0..214596421e84227ef8faf40f393598f8b6143f37 100644 --- a/scipost_django/mails/core.py +++ b/scipost_django/mails/core.py @@ -7,6 +7,7 @@ import re import inspect from django.conf import settings +from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.db import models from django.template.loader import get_template @@ -52,6 +53,8 @@ class MailEngine: 'recipient_list': recipient_list, } self.template_variables = kwargs + # Add the 'domain' template variable to all templates using the Sites framework: + self.template_variables['domain'] = Site.objects.get_current().domain def __repr__(self): return '<%(cls)s code="%(code)s", validated=%(validated)s sent=%(sent)s>' % { @@ -107,11 +110,11 @@ class MailEngine: self.mail_data.get('message', ''), '%s <%s>' % ( self.mail_data.get('from_name', 'SciPost'), - self.mail_data.get('from_email', 'noreply@scipost.org')), + self.mail_data.get('from_email', 'noreply@%s' % Site.objects.get_current().domain)), self.mail_data['recipient_list'], bcc=self.mail_data['bcc'], reply_to=[ - self.mail_data.get('from_email', 'noreply@scipost.org') + self.mail_data.get('from_email', 'noreply@%s' % Site.objects.get_current().domain) ], headers={ 'delayed_processing': not self._processed_template, @@ -222,10 +225,15 @@ class MailEngine: self.mail_data[email_key] = self._validate_email_addresses(self.mail_data[email_key]) def _validate_email_addresses(self, entry): - """Return email address given raw email or database relation given in `entry`.""" + """ + Return email address given raw email, email prefix or database relation given in `entry`. + """ if re.match("[^@]+@[^@]+\.[^@]+", entry): # Email string return entry + # if the email address is given as a prefix of the form `[recipient]@`, add domain name: + elif re.match("[^@]+@$", entry): + return '%s%s' % (entry, Site.objects.get_current().domain) elif self.template_variables['object']: mail_to = self.template_variables['object'] for attr in entry.split('.'): diff --git a/scipost_django/mails/management/commands/send_mails.py b/scipost_django/mails/management/commands/send_mails.py index 572dc3d44e9ccbbe2d6182419b2ef8b5c0dcc7dc..4390f271716f22e85d5cf8c5deeb94f1b2254b3e 100644 --- a/scipost_django/mails/management/commands/send_mails.py +++ b/scipost_django/mails/management/commands/send_mails.py @@ -65,6 +65,6 @@ class Command(BaseCommand): if options.get('id'): mails = MailLog.objects.filter(id=options['id']) else: - mails = MailLog.objects.not_sent().order_by('created')[:2] + mails = MailLog.objects.not_sent().order_by('created')[:10] nr_mails = self.send_mails(mails) self.stdout.write('Sent {} mails.'.format(nr_mails)) diff --git a/scipost_django/mails/mixins.py b/scipost_django/mails/mixins.py index 268f3756fe97294cdf9398ad2eb414cd4bfbfff7..4d9444905d078c327739973bd030b0e1a1099d42 100644 --- a/scipost_django/mails/mixins.py +++ b/scipost_django/mails/mixins.py @@ -10,6 +10,7 @@ from html2text import HTML2Text from django.core.mail import EmailMultiAlternatives from django.contrib.auth import get_user_model +from django.contrib.sites.models import Site from django.conf import settings from django.template import loader @@ -57,7 +58,7 @@ class MailUtilsMixin: 'to_address': kwargs.pop('to', ''), 'bcc_to': kwargs.pop('bcc', ''), 'from_address_name': kwargs.pop('from_name', 'SciPost'), - 'from_address': kwargs.pop('from', 'no-reply@scipost.org'), + 'from_address': kwargs.pop('from', 'no-reply@%s' % Site.objects.get_current().domain), } # Gather meta data diff --git a/scipost_django/markup/urls.py b/scipost_django/markup/urls.py index dd40e75981328843a434980e57144cd64c8c689e..be914d898485676be8e6dbe73ab8e81d8fb216fa 100644 --- a/scipost_django/markup/urls.py +++ b/scipost_django/markup/urls.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views @@ -10,28 +10,28 @@ app_name = 'markup' urlpatterns = [ - url( - r'^process/$', + path( + 'process/', views.process, name='process' ), - url( - r'^help/$', + path( + 'help/', views.markup_help, name='help' ), - url( - r'^help/plaintext$', + path( + 'help/plaintext', views.plaintext_help, name='plaintext_help' ), - url( - r'^help/Markdown$', + path( + 'help/Markdown', views.markdown_help, name='markdown_help' ), - url( - r'^help/reStructuredText$', + path( + 'help/reStructuredText', views.restructuredtext_help, name='restructuredtext_help' ), diff --git a/scipost_django/markup/utils.py b/scipost_django/markup/utils.py index 0d3d9a816159908f4d9723581e425499a7991839..5b105aef3530392860e2b34c27cf8fbae0ce4ef1 100644 --- a/scipost_django/markup/utils.py +++ b/scipost_django/markup/utils.py @@ -375,9 +375,6 @@ def process_markup(text, language_forced=None): markup['language'] = language markup['errors'] = markup_detector['errors'] - print("Language: ", markup['language']) - print("Errors: ", markup['errors']) - if markup['errors']: markup['processed'] = ( mark_safe( diff --git a/scipost_django/news/urls.py b/scipost_django/news/urls.py index e6209bd7ed0993bd242bf420ca5658039de88941..116efb248331d1af99f8659d0dccb1cd2aad6c74 100644 --- a/scipost_django/news/urls.py +++ b/scipost_django/news/urls.py @@ -2,43 +2,64 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views app_name = 'news' urlpatterns = [ - url(r'^manage/$', + path( + 'manage/', views.NewsManageView.as_view(), - name='manage'), - url(r'^newsletter/(?P<year>[0-9]{4,})-(?P<month>[0-9]{2,})-(?P<day>[0-9]{2,})/$', + name='manage' + ), + path( + 'newsletter/<YYYY:year>-<MM:month>-<DD:day>/', views.NewsLetterView.as_view(), - name='newsletter_detail'), - url(r'^newsletter/add/$', + name='newsletter_detail' + ), + path( + 'newsletter/add/', views.NewsLetterCreateView.as_view(), - name='newsletter_create'), - url(r'^newsletter/(?P<pk>[0-9]+)/update/$', + name='newsletter_create' + ), + path( + 'newsletter/<int:pk>/update/', views.NewsLetterUpdateView.as_view(), - name='newsletter_update'), - url(r'^newsletter/(?P<pk>[0-9]+)/update_ordering/$', - #views.NewsLetterNewsItemsOrderingUpdateView.as_view(), + name='newsletter_update' + ), + path( + 'newsletter/<int:pk>/update_ordering/', views.newsletter_update_ordering, - name='newsletter_update_ordering'), - url(r'^newsletter/(?P<pk>[0-9]+)/delete/$', + name='newsletter_update_ordering' + ), + path( + 'newsletter/<int:pk>/delete/', views.NewsLetterDeleteView.as_view(), - name='newsletter_delete'), - url(r'^newsitem/add/$', + name='newsletter_delete' + ), + path( + 'newsitem/add/', views.NewsItemCreateView.as_view(), - name='newsitem_create'), - url(r'^newsitem/(?P<pk>[0-9]+)/update/$', + name='newsitem_create' + ), + path( + 'newsitem/<int:pk>/update/', views.NewsItemUpdateView.as_view(), - name='newsitem_update'), - url(r'^newsitem/(?P<pk>[0-9]+)/delete/$', + name='newsitem_update' + ), + path( + 'newsitem/<int:pk>/delete/', views.NewsItemDeleteView.as_view(), - name='newsitem_delete'), - url(r'^add_newsitem_to_newsletter/(?P<nlpk>[0-9]+)/$', + name='newsitem_delete' + ), + path( + 'add_newsitem_to_newsletter/<int:nlpk>/', views.NewsLetterNewsItemsTableCreateView.as_view(), - name='add_newsitem_to_newsletter'), - url(r'^$', views.NewsListView.as_view(), name='news'), + name='add_newsitem_to_newsletter' + ), + path( + '', views.NewsListView.as_view(), name='news' + ), ] diff --git a/scipost_django/news/views.py b/scipost_django/news/views.py index 80f1864ccf8252349efe293e400446bf7027d80e..71cb4b805e6073a6721a6df607d5ed50d0ff72be 100644 --- a/scipost_django/news/views.py +++ b/scipost_django/news/views.py @@ -84,36 +84,6 @@ def newsletter_update_ordering(request, pk): return render(request, 'news/newsletter_update_ordering.html', context) -class NewsLetterNewsItemsOrderingUpdateView(PermissionsMixin, UpdateView): - """ - Update the ordering of News Items within a Newsletter. - """ - permission_required = 'scipost.can_manage_news' - model = NewsLetterNewsItemsTable - fields = ['order'] - template_name = 'news/newsletter_update_ordering.html' - success_url = reverse_lazy('news:news') - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - newsletter = get_object_or_404(NewsLetter, id=self.kwargs['pk']) - context['ni_formset'] = NewsLetterNewsItemsOrderingFormSet( - self.request.POST or None, - queryset=newsletter.newsletternewsitemstable_set.order_by('order')) - return context - - # def form_valid(self, form): - # context = self.get_context_data() - # ni_formset = context['ni_formset'] - # if ni_formset.is_valid(): - # # self.object = form.save() - # # ni_formset.instance = self.object - # ni_formset.save() - # return redirect(self.success_url) - # else: - # return self.render_to_response(self.get_context_data(form=form)) - - class NewsLetterDeleteView(PermissionsMixin, DeleteView): """ Delete a NewsLetter. diff --git a/scipost_django/ontology/context_processors.py b/scipost_django/ontology/context_processors.py index 99a1a6dfbf2367bb7655f63355d0c828cbe0bdeb..4bf67e3c83eb51b9dbaa2b1266513a59610bb051 100644 --- a/scipost_django/ontology/context_processors.py +++ b/scipost_django/ontology/context_processors.py @@ -1,7 +1,9 @@ __copyright__ = "Copyright 2016-2018, Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" + from .models import Branch, AcademicField, Specialty +from .forms import SessionAcademicFieldForm, SessionSpecialtyForm def ontology_processor(request): @@ -13,10 +15,27 @@ def ontology_processor(request): 'branches': Branch.objects.all(), 'acad_fields': AcademicField.objects.all(), } - if request.session.get('acad_field_slug', None): - context['session_acad_field'] = AcademicField.objects.get( - slug=request.session.get('acad_field_slug')) - if request.session.get('specialty_slug', None): - context['session_specialty'] = Specialty.objects.get( - slug=request.session.get('specialty_slug')) + initial_acad_field = {} + if request.session.get('session_acad_field_slug', None): + try: + context['session_acad_field'] = AcademicField.objects.get( + slug=request.session.get('session_acad_field_slug')) + initial_acad_field['acad_field_slug'] = request.session.get('session_acad_field_slug') + except AcademicField.DoesNotExist: + context['session_acad_field'] = None + context['session_acad_field_form'] = SessionAcademicFieldForm(initial=initial_acad_field) + initial_specialty = {} + # If AcademicField is set, deal with Specialty + if 'session_acad_field' in context: + if request.session.get('session_specialty_slug', None): + try: + context['session_specialty'] = Specialty.objects.get( + slug=request.session.get('session_specialty_slug')) + initial_specialty['specialty_slug'] = request.session.get('session_specialty_slug') + except Specialty.DoesNotExist: + context['session_specialty'] = None + context['session_specialty_form'] = SessionSpecialtyForm( + acad_field_slug=request.session['session_acad_field_slug'], + initial=initial_specialty + ) return context diff --git a/scipost_django/ontology/forms.py b/scipost_django/ontology/forms.py index 55d690ff574558be10f8aa0556bfafb29457cf7b..b27e04efc1ea04ef2adeb3029c830b5edfb82d4e 100644 --- a/scipost_django/ontology/forms.py +++ b/scipost_django/ontology/forms.py @@ -4,10 +4,80 @@ __license__ = "AGPL v3" from django import forms +from crispy_forms.helper import FormHelper +from crispy_forms.layout import Layout, Div +from crispy_bootstrap5.bootstrap5 import FloatingField from dal import autocomplete from .constants import TOPIC_RELATIONS_ASYM -from .models import Tag, Topic +from .models import Branch, AcademicField, Specialty, Tag, Topic + + +def academic_field_slug_choices(): + choices = ( + ('All', ( + ('all', 'All'), + )), + ) + for branch in Branch.objects.all(): + if branch.name != 'Multidisciplinary' and branch.journals.active().exists(): + subchoices = () + for acad_field in branch.academic_fields.all(): + if acad_field.journals.active().exists(): + subchoices += ( + (acad_field.slug, acad_field.name), + ) + choices += ( + (branch.name, subchoices), + ) + return choices + + +class SessionAcademicFieldForm(forms.Form): + acad_field_slug = forms.ChoiceField( + label='Academic Field', + choices=academic_field_slug_choices() + ) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.helper = FormHelper(self) + self.helper.disable_csrf = True + self.helper.show_errors = True + self.helper.layout = Layout( + Div(FloatingField('acad_field_slug')) + ) + + +def specialty_slug_choices(acad_field_slug): + specialties = Specialty.objects.filter( + acad_field__slug=acad_field_slug) if acad_field_slug else Specialty.objects.none() + choices = ( + ('', '--------'), + ) + for specialty in specialties.all(): + choices += ((specialty.slug, str(specialty)),) + return choices + + +class SessionSpecialtyForm(forms.Form): + specialty_slug = forms.ChoiceField( + label='Specialty', + ) + + def __init__(self, *args, **kwargs): + try: + acad_field_slug = kwargs.pop('acad_field_slug') + except KeyError: + acad_field_slug = '' + super().__init__(*args, **kwargs) + self.fields['specialty_slug'].choices = specialty_slug_choices(acad_field_slug) + self.helper = FormHelper(self) + self.helper.disable_csrf = True + self.helper.show_errors = True + self.helper.layout = Layout( + Div(FloatingField('specialty_slug')) + ) class SelectTagsForm(forms.Form): diff --git a/scipost_django/ontology/templates/ontology/session_acad_field_form.html b/scipost_django/ontology/templates/ontology/session_acad_field_form.html new file mode 100644 index 0000000000000000000000000000000000000000..edd146ff69eff113a5a34820b64dc57fdaeceb28 --- /dev/null +++ b/scipost_django/ontology/templates/ontology/session_acad_field_form.html @@ -0,0 +1,8 @@ +{% load crispy_forms_tags %} +<form id="session_acad_field_form" + hx-get="{% url 'ontology:set_session_acad_field' %}" + hx-trigger="change" + hx-swap="outerHTML" +> + {% crispy session_acad_field_form %} +</form> diff --git a/scipost_django/ontology/templates/ontology/session_specialty_form.html b/scipost_django/ontology/templates/ontology/session_specialty_form.html new file mode 100644 index 0000000000000000000000000000000000000000..aeb52e69f101e288df739a20dd6cdb11969e8885 --- /dev/null +++ b/scipost_django/ontology/templates/ontology/session_specialty_form.html @@ -0,0 +1,8 @@ +{% load crispy_forms_tags %} +<form id="session_specialty_form" + hx-get="{% url 'ontology:set_session_specialty' %}" + hx-trigger="change" + hx-swap="outerHTML" +> + {% crispy session_specialty_form %} +</form> diff --git a/scipost_django/ontology/urls.py b/scipost_django/ontology/urls.py index dba3e54cb66b9d39f1a53c317023135bc695b9dc..f5f38e6dbf0df4ec7dbe574ba48fd9c5cce39069 100644 --- a/scipost_django/ontology/urls.py +++ b/scipost_django/ontology/urls.py @@ -2,7 +2,6 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.urls import path from . import views @@ -35,48 +34,63 @@ urlpatterns = [ views.TopicLinkedAutocompleteView.as_view(), name='topic-linked-autocomplete', ), - url( - r'^$', + path( + 'set_session_acad_field', + views.set_session_acad_field, + name='set_session_acad_field' + ), + path( + '_hx_session_specialty_form', + views._hx_session_specialty_form, + name='_hx_session_specialty_form' + ), + path( + 'set_session_specialty', + views.set_session_specialty, + name='set_session_specialty' + ), + path( + '', views.ontology, name='ontology' ), - url( - r'^topic/add/$', + path( + 'topic/add/', views.TopicCreateView.as_view(), name='topic_create' ), - url( - r'^topic/(?P<slug>[-\w]+)/add_tags/$', + path( + 'topic/<slug:slug>/add_tags/', views.topic_add_tags, name='topic_add_tags' ), - url( - r'^topic/(?P<slug>[-\w]+)/remove_tag/(?P<tag_id>[0-9]+)/$', + path( + 'topic/<slug:slug>/remove_tag/<int:tag_id>/', views.topic_remove_tag, name='topic_remove_tag' ), - url( - r'^topic/(?P<slug>[-\w]+)/update/$', + path( + 'topic/<slug:slug>/update/', views.TopicUpdateView.as_view(), name='topic_update' ), - url( - r'^topic/(?P<slug>[-\w]+)/$', + path( + 'topic/<slug:slug>/', views.TopicDetailView.as_view(), name='topic_details' ), - url( - r'^topics/$', + path( + 'topics/', views.TopicListView.as_view(), name='topics' ), - url( - r'^add_relation_asym/(?P<slug>[-\w]+)/$', + path( + 'add_relation_asym/<slug:slug>/', views.add_relation_asym, name='add_relation_asym' ), - url( - r'^delete_relation_asym/(?P<relation_id>[0-9]+)/(?P<slug>[-\w]+)/$', + path( + 'delete_relation_asym/<int:relation_id>/<slug:slug>/', views.delete_relation_asym, name='delete_relation_asym' ), diff --git a/scipost_django/ontology/views.py b/scipost_django/ontology/views.py index 24924b82d1fa10437cdede3b1fe71580b0bc2b83..2d981cd3ab8fdc0ffe5d66026f04cdc66abc37bf 100644 --- a/scipost_django/ontology/views.py +++ b/scipost_django/ontology/views.py @@ -3,6 +3,7 @@ __license__ = "AGPL v3" from django.contrib import messages +from django.http import HttpResponse from django.urls import reverse, reverse_lazy from django.db.models import Q from django.shortcuts import get_object_or_404, redirect, render @@ -15,12 +16,78 @@ from dal import autocomplete from guardian.decorators import permission_required from .models import AcademicField, Specialty, Tag, Topic, RelationAsym -from .forms import SelectTagsForm, SelectLinkedTopicForm, AddRelationAsymForm +from .forms import ( + SessionAcademicFieldForm, SessionSpecialtyForm, + SelectTagsForm, SelectLinkedTopicForm, + AddRelationAsymForm +) from scipost.forms import SearchTextForm from scipost.mixins import PaginationMixin, PermissionsMixin +def set_session_acad_field(request): + """Set the Academic Field to be viewed in the current user session.""" + form = SessionAcademicFieldForm(request.GET or None) + if form.is_valid(): + request.session['session_acad_field_slug'] = form.cleaned_data['acad_field_slug'] + request.session['session_specialty_slug'] = '' + try: + initial = { + 'acad_field_slug': AcademicField.objects.get( + slug=request.session['session_acad_field_slug']).slug + } + except AcademicField.DoesNotExist: + initial = {} + form = SessionAcademicFieldForm(initial=initial) + response = render( + request, + 'ontology/session_acad_field_form.html', + context={ 'session_acad_field_form': form} + ) + response['HX-Trigger'] = 'session-acad-field-set' + return response + + +def _hx_session_specialty_form(request): + """Serve the session Specialty choice form.""" + context = { + 'session_specialty_form': SessionSpecialtyForm( + acad_field_slug=request.session.get('session_acad_field_slug', None), + initial={ 'specialty_slug': request.session.get('session_specialty_slug', None)} + ) + } + return render(request, 'ontology/session_specialty_form.html', context) + + +def set_session_specialty(request): + """Set the Specialty to be viewed in the current user session.""" + form = SessionSpecialtyForm( + request.GET or None, + acad_field_slug=request.session.get('session_acad_field_slug', ''), + ) + if form.is_valid(): + request.session['session_specialty_slug'] = form.cleaned_data['specialty_slug'] + try: + initial = { + 'specialty_slug': Specialty.objects.get( + slug=request.session['session_specialty_slug']).slug + } + except (KeyError, Specialty.DoesNotExist): + initial = {} + form = SessionSpecialtyForm( + acad_field_slug=request.session['session_acad_field_slug'], + initial=initial + ) + response = render( + request, + 'ontology/session_specialty_form.html', + context={ 'session_specialty_form': form} + ) + response['HX-Trigger'] = 'session-specialty-set' + return response + + def ontology(request): context = { 'select_linked_topic_form': SelectLinkedTopicForm(), diff --git a/scipost_django/organizations/templates/organizations/_organization_card.html b/scipost_django/organizations/templates/organizations/_organization_card.html index eef0d1b8b66cc5c884bc3a34bbc48353ddc1b3ed..84a806718a9b04abe6abb9bca8ea9b8f41ec5447 100644 --- a/scipost_django/organizations/templates/organizations/_organization_card.html +++ b/scipost_django/organizations/templates/organizations/_organization_card.html @@ -65,7 +65,7 @@ <p>Are you a representative of this Organization? We advise you to:</p> <ul> <li>Make sure your Organization gets included in <a href="https://www.crossref.org/services/funder-registry/" target="_blank" rel="noopener">Crossref's Funder Registry</a>;</li> - <li>After inclusion, <a href="mailto:admin@scipost.org?subject=Inclusion of {{ organization|urlencode }} {% if organization.acronym %}({{ organization.acronym|urlencode }}){% endif %} in the Funder Registry">contact our administration</a> with this information so that we can update our records.</li> + <li>After inclusion, <a href="mailto:admin@{{ request.get_host }}?subject=Inclusion of {{ organization|urlencode }} {% if organization.acronym %}({{ organization.acronym|urlencode }}){% endif %} in the Funder Registry">contact our administration</a> with this information so that we can update our records.</li> </ul> </li> {% endfor %} diff --git a/scipost_django/organizations/urls.py b/scipost_django/organizations/urls.py index 4284fec2a6787fe425dccd668a6441d1f120dcbc..9cc17ef6188bcfec63934093701b4a89cab69a46 100644 --- a/scipost_django/organizations/urls.py +++ b/scipost_django/organizations/urls.py @@ -2,7 +2,6 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url from django.urls import path from . import views @@ -15,123 +14,124 @@ urlpatterns = [ views.OrganizationAutocompleteView.as_view(), name='organization-autocomplete', ), - url( - r'^$', + path( + '', views.OrganizationListView.as_view(), name='organizations' ), - url( - r'^add/$', + path( + 'add/', views.OrganizationCreateView.as_view(), name='organization_create' ), - url( - r'^(?P<pk>[0-9]+)/update/$', + path( + '<int:pk>/update/', views.OrganizationUpdateView.as_view(), name='organization_update' ), - url( - r'^(?P<pk>[0-9]+)/delete/$', + path( + '<int:pk>/delete/', views.OrganizationDeleteView.as_view(), name='organization_delete' ), - url( - r'^(?P<pk>[0-9]+)/$', + path( + '<int:pk>/', views.OrganizationDetailView.as_view(), name='organization_detail' ), - url( - r'^get_organization_detail$', + path( + 'get_organization_detail', views.get_organization_detail, name='get_organization_detail' ), - url( - r'^(?P<pk>[0-9]+)/orgevent/add/$', + path( + '<int:pk>/orgevent/add/', views.OrganizationEventCreateView.as_view(), name='organizationevent_create' ), - url( - r'^organizationevents/$', + path( + 'organizationevents/', views.OrganizationEventListView.as_view(), name='organizationevent_list' ), - url( - r'^add_contactperson/(?P<organization_id>[0-9]+)/$', + path( + 'add_contactperson/<organization_id>/', views.ContactPersonCreateView.as_view(), name='contactperson_create' ), - url( - r'^contactperson/add/$', + path( + 'contactperson/add/', views.ContactPersonCreateView.as_view(), name='contactperson_create' ), - url( - r'^contactperson/(?P<pk>[0-9]+)/update/$', + path( + 'contactperson/<int:pk>/update/', views.ContactPersonUpdateView.as_view(), name='contactperson_update' ), - url( - r'^contactperson/(?P<pk>[0-9]+)/delete/$', + path( + 'contactperson/<int:pk>/delete/', views.ContactPersonDeleteView.as_view(), name='contactperson_delete' ), - url( - r'^contactpersons/$', + path( + 'contactpersons/', views.ContactPersonListView.as_view(), name='contactperson_list' ), - url( - r'^contactperson/(?P<contactperson_id>[0-9]+)/email/(?P<mail>followup)$', + path( + 'contactperson/<int:contactperson_id>/email/<str:mail>', views.email_contactperson, name='email_contactperson' ), - url( - r'^contactperson/(?P<contactperson_id>[0-9]+)/email/$', + path( + 'contactperson/<int:contactperson_id>/email/', views.email_contactperson, name='email_contactperson' ), - url( + path( # For upgrading a ContactPerson to a Contact - r'^add_contact/(?P<organization_id>[0-9]+)/(?P<contactperson_id>[0-9]+)/$', + 'add_contact/<int:organization_id>/<int:contactperson_id>/', views.organization_add_contact, name='add_contact' ), - url( - r'^add_contact/(?P<organization_id>[0-9]+)/$', + path( + 'add_contact/<int:organization_id>/', views.organization_add_contact, name='add_contact' ), - url( - r'^activate/(?P<activation_key>.+)$', + path( + 'activate/<str:activation_key>', views.activate_account, name='activate_account' ), - url( - r'^dashboard/$', + path( + 'dashboard/', views.dashboard, name='dashboard' ), - url(r'^contact/(?P<pk>[0-9]+)/$', + path( + 'contact/<int:pk>/', views.ContactDetailView.as_view(), name='contact_details' ), - url( - r'^contactrole/(?P<pk>[0-9]+)/update/$', + path( + 'contactrole/<int:pk>/update/', views.ContactRoleUpdateView.as_view(), name='contactrole_update' ), - url( - r'^contactrole/(?P<pk>[0-9]+)/delete/$', + path( + 'contactrole/<int:pk>/delete/', views.ContactRoleDeleteView.as_view(), name='contactrole_delete' ), - url( - r'^contactrole/(?P<contactrole_id>[0-9]+)/email/(?P<mail>renewal)$', + path( + 'contactrole/<contactrole_id>/email/<str:mail>', views.email_contactrole, name='email_contactrole' ), - url( - r'^contactrole/(?P<contactrole_id>[0-9]+)/email/$', + path( + 'contactrole/<contactrole_id>/email/', views.email_contactrole, name='email_contactrole' ), diff --git a/scipost_django/partners/views.py b/scipost_django/partners/views.py deleted file mode 100644 index e04ff31cf1a7994cf682557bbf540a5af8ba639e..0000000000000000000000000000000000000000 --- a/scipost_django/partners/views.py +++ /dev/null @@ -1,423 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -import mimetypes - -from django.contrib import messages -from django.contrib.auth.decorators import login_required -from django.db import transaction -from django.forms import modelformset_factory -from django.http import HttpResponse -from django.shortcuts import get_object_or_404, render, reverse, redirect -from django.utils import timezone - -from guardian.decorators import permission_required - -from mails.views import MailEditorSubview - -from .constants import PROSPECTIVE_PARTNER_REQUESTED,\ - PROSPECTIVE_PARTNER_APPROACHED, PROSPECTIVE_PARTNER_ADDED,\ - PROSPECTIVE_PARTNER_EVENT_REQUESTED, PROSPECTIVE_PARTNER_EVENT_EMAIL_SENT,\ - PROSPECTIVE_PARTNER_FOLLOWED_UP -from .models import Partner, ProspectivePartner, ProspectiveContact, ContactRequest,\ - ProspectivePartnerEvent, MembershipAgreement, Contact, PartnersAttachment -from .forms import ProspectivePartnerForm, ProspectiveContactForm,\ - PromoteToPartnerForm,\ - ProspectivePartnerEventForm, MembershipQueryForm,\ - PartnerForm, ContactForm, ContactFormset, ContactModelFormset,\ - NewContactForm, ActivationForm, PartnerEventForm,\ - MembershipAgreementForm, RequestContactForm, RequestContactFormSet,\ - ProcessRequestContactForm, PartnersAttachmentFormSet, PartnersAttachmentForm - - -def supporting_partners(request): - current_agreements = MembershipAgreement.objects.now_active() - context = { - 'current_agreements': current_agreements - } - if request.user.groups.filter(name='Editorial Administrators').exists(): - # Show Agreements to Administrators only! - prospective_agreements = MembershipAgreement.objects.submitted().order_by('date_requested') - context['prospective_partners'] = prospective_agreements - return render(request, 'partners/supporting_partners.html', context) - - -@login_required -@permission_required('scipost.can_read_partner_page', return_403=True) -def dashboard(request): - """Administration page for Partners and Prospective Partners. - - This page is meant as a personal page for Partners, where they will for example be able - to read their personal data and agreements. - """ - context = {} - try: - context['personal_agreements'] = (MembershipAgreement.objects.open_to_partner() - .filter(partner__contact=request.user.partner_contact)) - except Contact.DoesNotExist: - pass - - if request.user.has_perm('scipost.can_manage_SPB'): - context['contact_requests_count'] = ContactRequest.objects.awaiting_processing().count() - context['inactivate_contacts_count'] = Contact.objects.filter(user__is_active=False).count() - context['partners'] = Partner.objects.all() - context['prospective_partners'] = ProspectivePartner.objects.order_by( - 'country', 'institution_name') - context['ppevent_form'] = ProspectivePartnerEventForm() - context['agreements'] = MembershipAgreement.objects.order_by('date_requested') - return render(request, 'partners/dashboard.html', context) - - -@transaction.atomic -def membership_request(request): - query_form = MembershipQueryForm(request.POST or None) - if query_form.is_valid(): - prospartner = ProspectivePartner( - kind=query_form.cleaned_data['partner_kind'], - institution_name=query_form.cleaned_data['institution_name'], - country=query_form.cleaned_data['country'], - date_received=timezone.now(), - status=PROSPECTIVE_PARTNER_REQUESTED, - ) - prospartner.save() - contact = ProspectiveContact( - prospartner=prospartner, - title=query_form.cleaned_data['title'], - first_name=query_form.cleaned_data['first_name'], - last_name=query_form.cleaned_data['last_name'], - email=query_form.cleaned_data['email'], - ) - contact.save() - prospartnerevent = ProspectivePartnerEvent( - prospartner=prospartner, - event=PROSPECTIVE_PARTNER_EVENT_REQUESTED) - prospartnerevent.save() - ack_message = ('Thank you for your SPB Membership query. ' - 'We will get back to you in the very near future ' - 'with further details.') - context = {'ack_message': ack_message} - return render(request, 'scipost/acknowledgement.html', context) - context = {'query_form': query_form} - return render(request, 'partners/membership_request.html', context) - - -@permission_required('scipost.can_manage_organizations', return_403=True) -@transaction.atomic -def promote_prospartner(request, prospartner_id): - prospartner = get_object_or_404(ProspectivePartner.objects.not_yet_partner(), - pk=prospartner_id) - form = PromoteToPartnerForm(request.POST or None, instance=prospartner) - contact_formset = ContactModelFormset(request.POST or None, - queryset=prospartner.prospective_contacts.all()) - if form.is_valid() and contact_formset.is_valid(): - partner = form.promote_to_partner(request.user) - contacts = contact_formset.promote_contacts(partner, request.user) - messages.success(request, ('<h3>Upgraded Partner %s</h3>' - '%i contacts have received a validation mail.') % - (str(partner), len(contacts))) - return redirect(reverse('partners:dashboard')) - context = {'form': form, 'contact_formset': contact_formset} - return render(request, 'partners/promote_prospartner.html', context) - - -############### -# Partner views -############### -@permission_required('scipost.can_view_own_partner_details', return_403=True) -def partner_view(request, partner_id): - partner = get_object_or_404(Partner.objects.my_partners(request.user), id=partner_id) - form = PartnerEventForm(request.POST or None) - if form.is_valid(): - event = form.save(commit=False) - event.partner = partner - event.noted_by = request.user - event.save() - messages.success(request, 'Added a new event to Partner.') - return redirect(partner.get_absolute_url()) - context = { - 'partner': partner, - 'form': form - } - return render(request, 'partners/partners_detail.html', context) - - -@permission_required('scipost.can_manage_SPB', return_403=True) -@transaction.atomic -def partner_edit(request, partner_id): - partner = get_object_or_404(Partner, id=partner_id) - - # Start/fill forms - form = PartnerForm(request.POST or None, instance=partner) - ContactModelFormset = modelformset_factory(Contact, ContactForm, can_delete=True, extra=0, - formset=ContactFormset) - contact_formset = ContactModelFormset(request.POST or None, partner=partner, - queryset=partner.contact_set.all()) - - # Validate forms for POST request - if form.is_valid() and contact_formset.is_valid(): - form.save() - contact_formset.save() - messages.success(request, 'Partner saved') - return redirect(reverse('partners:partner_view', args=(partner.id,))) - context = { - 'form': form, - 'contact_formset': contact_formset - } - return render(request, 'partners/partner_edit.html', context) - - -@permission_required('scipost.can_manage_SPB', return_403=True) -def partner_add_contact(request, partner_id): - partner = get_object_or_404(Partner, id=partner_id) - form = NewContactForm(request.POST or None, partner=partner) - if form.is_valid(): - contact = form.save(current_user=request.user) - messages.success(request, '<h3>Created contact: %s</h3>Email has been sent.' - % str(contact)) - return redirect(reverse('partners:dashboard')) - context = { - 'partner': partner, - 'form': form - } - return render(request, 'partners/partner_add_contact.html', context) - - -@permission_required('scipost.can_view_own_partner_details', return_403=True) -def partner_request_contact(request, partner_id): - partner = get_object_or_404(Partner.objects.my_partners(request.user), id=partner_id) - form = RequestContactForm(request.POST or None) - if form.is_valid(): - contact_request = form.save(commit=False) - contact_request.partner = partner - contact_request.save() - messages.success(request, ('<h3>Request sent</h3>' - 'We will process your request as soon as possible.')) - return redirect(partner.get_absolute_url()) - context = { - 'partner': partner, - 'form': form - } - return render(request, 'partners/partner_request_contact.html', context) - - -@permission_required('scipost.can_manage_SPB', return_403=True) -def process_contact_requests(request): - form = RequestContactForm(request.POST or None) - - RequestContactModelFormSet = modelformset_factory(ContactRequest, ProcessRequestContactForm, - formset=RequestContactFormSet, extra=0) - formset = RequestContactModelFormSet(request.POST or None, - queryset=ContactRequest.objects.awaiting_processing()) - if formset.is_valid(): - formset.process_requests(current_user=request.user) - messages.success(request, 'Processing completed') - return redirect(reverse('partners:process_contact_requests')) - context = { - 'form': form, - 'formset': formset - } - return render(request, 'partners/process_contact_requests.html', context) - - - -########################### -# Prospective Partner Views -########################### - -@permission_required('scipost.can_manage_SPB', return_403=True) -def add_prospective_partner(request): - form = ProspectivePartnerForm(request.POST or None) - if form.is_valid(): - pp = form.save() - messages.success(request, 'Prospective Partner successfully added') - return redirect(reverse('partners:add_prospartner_contact', - kwargs={'prospartner_id': pp.id})) - context = {'form': form} - return render(request, 'partners/add_prospective_partner.html', context) - - -@permission_required('scipost.can_manage_SPB', return_403=True) -def add_prospartner_contact(request, prospartner_id): - prospartner = get_object_or_404(ProspectivePartner, pk=prospartner_id) - form = ProspectiveContactForm(request.POST or None, initial={'prospartner': prospartner}) - if form.is_valid(): - form.save() - messages.success(request, 'Contact successfully added to Prospective Partner') - return redirect(reverse('partners:dashboard')) - context = {'form': form, 'prospartner': prospartner} - return render(request, 'partners/add_prospartner_contact.html', context) - - -@permission_required('scipost.can_email_prospartner_contact', return_403=True) -@transaction.atomic -def email_prospartner_contact(request, contact_id, mail=None): - contact = get_object_or_404(ProspectiveContact, pk=contact_id) - - suffix = '' - if mail == 'followup': - code = 'partners_followup_mail' - suffix = ' (followup)' - new_status = PROSPECTIVE_PARTNER_FOLLOWED_UP - else: - code = 'partners_initial_mail' - new_status = PROSPECTIVE_PARTNER_APPROACHED - - mail_request = MailEditorSubview(request, code, contact=contact) - if mail_request.is_valid(): - comments = 'Email{suffix} sent to {name}.'.format(suffix=suffix, name=contact) - prospartnerevent = ProspectivePartnerEvent( - prospartner=contact.prospartner, - event=PROSPECTIVE_PARTNER_EVENT_EMAIL_SENT, - comments=comments, - noted_on=timezone.now(), - noted_by=request.user.contributor) - prospartnerevent.save() - if contact.prospartner.status in [PROSPECTIVE_PARTNER_REQUESTED, - PROSPECTIVE_PARTNER_ADDED, - PROSPECTIVE_PARTNER_APPROACHED]: - contact.prospartner.status = new_status - contact.prospartner.save() - - messages.success(request, 'Email successfully sent.') - mail_request.send_mail() - return redirect(reverse('partners:dashboard')) - else: - return mail_request.interrupt() - - -@permission_required('scipost.can_email_prospartner_contact', return_403=True) -@transaction.atomic -def email_prospartner_generic(request, prospartner_id, mail=None): - prospartner = get_object_or_404(ProspectivePartner, pk=prospartner_id) - - suffix = '' - - if mail == 'followup': - code = 'partners_followup_mail' - suffix = ' (followup)' - new_status = PROSPECTIVE_PARTNER_FOLLOWED_UP - else: - code = 'partners_initial_mail' - new_status = PROSPECTIVE_PARTNER_APPROACHED - - mail_request = MailEditorSubview(request, mail_code=code, recipient_list=[]) - if mail_request.is_valid(): - comments = 'Email{suffix} sent to {name}.'.format( - suffix=suffix, name=mail_request.recipients_string) - prospartnerevent = ProspectivePartnerEvent( - prospartner=prospartner, - event=PROSPECTIVE_PARTNER_EVENT_EMAIL_SENT, - comments=comments, - noted_on=timezone.now(), - noted_by=request.user.contributor) - prospartnerevent.save() - if prospartner.status in [PROSPECTIVE_PARTNER_REQUESTED, - PROSPECTIVE_PARTNER_ADDED, - PROSPECTIVE_PARTNER_APPROACHED]: - prospartner.status = new_status - prospartner.save() - - messages.success(request, 'Email successfully sent.') - mail_request.send_mail() - return redirect(reverse('partners:dashboard')) - else: - return mail_request.interrupt() - - -@permission_required('scipost.can_manage_SPB', return_403=True) -@transaction.atomic -def add_prospartner_event(request, prospartner_id): - prospartner = get_object_or_404(ProspectivePartner, pk=prospartner_id) - if request.method == 'POST': - ppevent_form = ProspectivePartnerEventForm(request.POST) - if ppevent_form.is_valid(): - ppevent = ppevent_form.save(commit=False) - ppevent.prospartner = prospartner - ppevent.noted_by = request.user.contributor - ppevent.save() - prospartner.update_status_from_event(ppevent.event) - prospartner.save() - return redirect(reverse('partners:dashboard')) - else: - errormessage = 'The form was invalidly filled.' - return render(request, 'scipost/error.html', {'errormessage': errormessage}) - errormessage = 'This view can only be posted to.' - return render(request, 'scipost/error.html', {'errormessage': errormessage}) - - -############ -# Agreements -############ -@permission_required('scipost.can_manage_SPB', return_403=True) -def add_agreement(request): - form = MembershipAgreementForm(request.POST or None, initial=request.GET) - if request.POST and form.is_valid(): - agreement = form.save(request.user) - messages.success(request, 'Membership Agreement created.') - return redirect(agreement.get_absolute_url()) - context = { - 'form': form - } - return render(request, 'partners/agreements_add.html', context) - - -@permission_required('scipost.can_view_own_partner_details', return_403=True) -def agreement_details(request, agreement_id): - agreement = get_object_or_404(MembershipAgreement, id=agreement_id) - context = {} - - if request.user.has_perm('scipost.can_manage_SPB'): - form = MembershipAgreementForm(request.POST or None, instance=agreement) - PartnersAttachmentFormSet - - PartnersAttachmentFormset = modelformset_factory(PartnersAttachment, - PartnersAttachmentForm, - formset=PartnersAttachmentFormSet) - attachment_formset = PartnersAttachmentFormset(request.POST or None, request.FILES or None, - queryset=agreement.attachments.all()) - - context['form'] = form - context['attachment_formset'] = attachment_formset - if form.is_valid() and attachment_formset.is_valid(): - agreement = form.save(request.user) - attachment_formset.save(agreement) - messages.success(request, 'Membership Agreement updated.') - return redirect(agreement.get_absolute_url()) - - context['agreement'] = agreement - return render(request, 'partners/agreements_details.html', context) - - -@permission_required('scipost.can_view_own_partner_details', return_403=True) -def agreement_attachments(request, agreement_id, attachment_id): - attachment = get_object_or_404(PartnersAttachment.objects.my_attachments(request.user), - agreement__id=agreement_id, id=attachment_id) - - content_type, encoding = mimetypes.guess_type(attachment.attachment.path) - content_type = content_type or 'application/octet-stream' - response = HttpResponse(attachment.attachment.read(), content_type=content_type) - response["Content-Encoding"] = encoding - response['Content-Disposition'] = ('filename=%s' % attachment.name) - return response - - -######### -# Account -######### -def activate_account(request, activation_key): - contact = get_object_or_404(Contact, user__is_active=False, - activation_key=activation_key, - user__email__icontains=request.GET.get('email', None)) - - # TODO: Key Expires fallback - form = ActivationForm(request.POST or None, instance=contact.user) - if form.is_valid(): - form.activate_user() - messages.success(request, '<h3>Thank you for registration</h3>') - return redirect(reverse('partners:dashboard')) - context = { - 'contact': contact, - 'form': form - } - return render(request, 'partners/activate_account.html', context) diff --git a/scipost_django/petitions/templates/petitions/petition_email.html b/scipost_django/petitions/templates/petitions/petition_email.html index 355560c70969968c9a2843acad2635685c890875..aaf0f865af3ddeaee245c15b5d133754e5ae8a03 100644 --- a/scipost_django/petitions/templates/petitions/petition_email.html +++ b/scipost_django/petitions/templates/petitions/petition_email.html @@ -1,4 +1,4 @@ -[PLEASE FILL IN THE TO FIELD ABOVE (keeping sponsors@scipost.org in cc)]%0D%0A +[PLEASE FILL IN THE TO FIELD ABOVE (keeping sponsors@{{ request.get_host }} in cc)]%0D%0A %0D%0A Dear ...%0D%0A %0D%0A @@ -11,8 +11,8 @@ Sincerely,%0D%0A %0D%0A %0D%0A %0D%0A -SciPost (https://scipost.org) is a top-quality next-generation Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://scipost.org/about and https://scipost.org/FAQ.%0D%0A +SciPost (https://{{ request.get_host }}) is a top-quality next-generation Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://{{ request.get_host }}/about and https://{{ request.get_host }}/FAQ.%0D%0A %0D%0A SciPost follows a different funding model than most traditional publishers. It operates on an entirely not-for-profit basis, and charges neither subscription fees nor article processing charges; instead, its activities are financed through a cost-slashing consortial model.%0D%0A %0D%0A -By making a small financial commitment, the institutions and organizations that benefit from SciPost’s activities can become Sponsors. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the consortial funding scheme and how to join can be found at https://scipost.org/sponsors or by emailing sponsors@scipost.org.%0D%0A +By making a small financial commitment, the institutions and organizations that benefit from SciPost’s activities can become Sponsors. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the consortial funding scheme and how to join can be found at https://{{ request.get_host }}/sponsors or by emailing sponsors@{{ request.get_host }}.%0D%0A diff --git a/scipost_django/petitions/urls.py b/scipost_django/petitions/urls.py index e7e42d64db2fb27115b8b55c70b272953c728fbf..19c98d7f1e246aaae450928a36bb4b0ef4427485 100644 --- a/scipost_django/petitions/urls.py +++ b/scipost_django/petitions/urls.py @@ -2,14 +2,21 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views app_name = 'petitions' urlpatterns = [ - url(r'^(?P<slug>[-\w]+)/verify_signature/(?P<key>.+)$', - views.verify_signature, name='verify_signature'), - url(r'^(?P<slug>[-\w]+)$', views.petition, name='petition'), + path( + '<slug:slug>/verify_signature/<str:key>', + views.verify_signature, + name='verify_signature' + ), + path( + '<slug:slug>', + views.petition, + name='petition' + ), ] diff --git a/scipost_django/petitions/views.py b/scipost_django/petitions/views.py index 27ed6917333636e60b69ecbf37256e0ddd178b23..4739a3a4782e4fd901ff3fea8667d944c1b5f62e 100644 --- a/scipost_django/petitions/views.py +++ b/scipost_django/petitions/views.py @@ -7,6 +7,7 @@ import random import string from django.contrib import messages +from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.shortcuts import get_object_or_404, render, redirect from django.template import Context, Template @@ -41,6 +42,7 @@ def petition(request, slug): form = SignPetitionForm(request.POST or None, initial=initial, petition=petition, current_user=request.user) if form.is_valid(): + domain = Site.objects.get_current().domain signature = form.save(commit=False) signature.petition = petition message = ('<h3>Many thanks for signing!</h3>' @@ -65,12 +67,12 @@ def petition(request, slug): message += '\n<p>You will receive an email with a verification link.</p>' email_text = ('Please click on the link below to confirm ' 'your signature of the petition: \n' - 'https://scipost.org/petitions/' + 'https://' + domain + '/petitions/' + petition.slug + '/verify_signature/' + verification_key + '.\n') email_text_html = ( '<p>Please click on the link below to confirm ' 'your signature of the petition:</p>' - '<p><a href="https://scipost.org/petitions/{{ slug }}/verify_signature' + '<p><a href="https://' + domain + '/petitions/{{ slug }}/verify_signature' '/{{ key }}">confirm your signature</a></p>') html_template = Template(email_text_html) html_version = html_template.render(Context({'slug': petition.slug, @@ -78,9 +80,9 @@ def petition(request, slug): emailmessage = EmailMultiAlternatives( 'Petition signature verification', email_text, - 'SciPost petitions<petitions@scipost.org>', + 'SciPost petitions<petitions@%s>' % domain, [form.cleaned_data['email']], - bcc=['petitions@scipost.org']) + bcc=['petitions@%s' % domain]) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send() messages.success(request, message) diff --git a/scipost_django/preprints/migrations/0013_alter_preprint_identifier_w_vn_nr.py b/scipost_django/preprints/migrations/0013_alter_preprint_identifier_w_vn_nr.py new file mode 100644 index 0000000000000000000000000000000000000000..41cff6aec3f3b29ba22a9592d56cbca4f56cf177 --- /dev/null +++ b/scipost_django/preprints/migrations/0013_alter_preprint_identifier_w_vn_nr.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-09-17 07:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preprints', '0012_auto_20200721_0933'), + ] + + operations = [ + migrations.AlterField( + model_name='preprint', + name='identifier_w_vn_nr', + field=models.CharField(db_index=True, max_length=128, unique=True), + ), + ] diff --git a/scipost_django/preprints/models.py b/scipost_django/preprints/models.py index 75ef5a5243a3e43f1e575735bcb84b18e248de69..6aaf45daf7fd983c767bcb5dcb39ec7720a45655 100644 --- a/scipost_django/preprints/models.py +++ b/scipost_django/preprints/models.py @@ -2,10 +2,15 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +import requests + +from django.contrib.sites.models import Site from django.urls import reverse from django.db import models from django.http import Http404 +from submissions.exceptions import PreprintDocumentNotFoundError + class Preprint(models.Model): """ @@ -15,7 +20,7 @@ class Preprint(models.Model): """ # (arXiv) identifiers with/without version number - identifier_w_vn_nr = models.CharField(max_length=25, unique=True, db_index=True) + identifier_w_vn_nr = models.CharField(max_length=128, unique=True, db_index=True) url = models.URLField(blank=True) # SciPost preprints only @@ -42,13 +47,26 @@ class Preprint(models.Model): return reverse('preprints:pdf', args=(self.identifier_w_vn_nr,)) raise Http404 + def get_document(self): + """ + Retrieve the preprint document itself, calling preprint server if necessary. + """ + if self._file: # SciPost-hosted, + # return file directly since the url isn't yet publicly accessible + return self._file.read() + url = self.citation_pdf_url + response = requests.get(url) + if response.status_code != 200: + raise PreprintDocumentNotFoundError(url) + return response.content + @property def citation_pdf_url(self): """Return the absolute URL of the pdf for the meta tag for Google Scholar.""" if self._file: # means this is a SciPost-hosted preprint - return "https://scipost.org%s" % self.get_absolute_url() + return "https://%s%s" % (Site.objects.get_current().domain, self.get_absolute_url()) elif self.is_arXiv: - return self.get_absolute_url().replace("/abs/", "/pdf/") + return '%s.pdf' % self.get_absolute_url().replace("/abs/", "/pdf/") else: return self.get_absolute_url() diff --git a/scipost_django/preprints/urls.py b/scipost_django/preprints/urls.py index d683be114944e74633fb0313d210404cd1c99a44..71cc84bde5ba703098b6f07ede5ef73ed2d6ceea 100644 --- a/scipost_django/preprints/urls.py +++ b/scipost_django/preprints/urls.py @@ -2,19 +2,22 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url +from django.urls import path from . import views -from submissions.constants import SUBMISSIONS_WO_VN_REGEX, SUBMISSIONS_COMPLETE_REGEX app_name = 'preprints' urlpatterns = [ - url(r'^{regex}/$'.format(regex=SUBMISSIONS_WO_VN_REGEX), + path( + '<identifier_wo_vn_nr:identifier_wo_vn_nr>/', views.preprint_pdf_wo_vn_nr, - name='preprint_wo_vn_nr'), - url(r'^{regex}/$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), + name='preprint_wo_vn_nr' + ), + path( + '<identifier:identifier_w_vn_nr>/', views.preprint_pdf, - name='pdf'), + name='pdf' + ), ] diff --git a/scipost_django/production/utils.py b/scipost_django/production/utils.py index ec9b8d988ac723b8f96d9f9be304aeebeb1961d0..d9e34c6d57125e446bc95bd44efe57f7d69396ff 100644 --- a/scipost_django/production/utils.py +++ b/scipost_django/production/utils.py @@ -2,6 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" from django.contrib.auth.models import Group +from django.contrib.sites.models import Site from guardian.shortcuts import assign_perm from common.utils import BaseMailUtil @@ -28,7 +29,7 @@ def get_or_create_production_stream(submission): class ProductionUtils(BaseMailUtil): - mail_sender = 'no-reply@scipost.org' + mail_sender = 'proofs@%s' % Site.objects.get_current().domain mail_sender_title = 'SciPost Production' @classmethod diff --git a/scipost_django/production/views.py b/scipost_django/production/views.py index 6812efa9611fc19abf3de2271913f2893b896e7c..a73677d09f6b3461f1e4465f80147706aadebc99 100644 --- a/scipost_django/production/views.py +++ b/scipost_django/production/views.py @@ -253,7 +253,7 @@ def add_officer(request, stream_id): # Temp fix. # TODO: Implement proper email - ProductionUtils.load({'stream': stream}) + ProductionUtils.load({'request': request, 'stream': stream}) ProductionUtils.email_assigned_production_officer() return redirect(stream.get_absolute_url()) else: @@ -288,7 +288,7 @@ def add_invitations_officer(request, stream_id): # Temp fix. # TODO: Implement proper email - ProductionUtils.load({'stream': stream}) + ProductionUtils.load({'request': request, 'stream': stream}) ProductionUtils.email_assigned_invitation_officer() else: for key, error in form.errors.items(): @@ -363,7 +363,7 @@ def add_supervisor(request, stream_id): # Temp fix. # TODO: Implement proper email - ProductionUtils.load({'stream': stream}) + ProductionUtils.load({'request': request, 'stream': stream}) ProductionUtils.email_assigned_supervisor() return redirect(stream.get_absolute_url()) else: diff --git a/scipost_django/profiles/forms.py b/scipost_django/profiles/forms.py index 84363c7354f0703e2cd7a2471d038d6c4176b896..033e1c3ec0c52bfdda16c2b55a1231df26e03afd 100644 --- a/scipost_django/profiles/forms.py +++ b/scipost_django/profiles/forms.py @@ -172,6 +172,8 @@ class ProfileEmailForm(forms.ModelForm): def save(self): """Save to a profile.""" + if self.cleaned_data['primary']: + self.profile.emails.update(primary=False) self.instance.profile = self.profile return super().save() diff --git a/scipost_django/profiles/migrations/0035_alter_profile_title.py b/scipost_django/profiles/migrations/0035_alter_profile_title.py new file mode 100644 index 0000000000000000000000000000000000000000..cce6ead555b241d9ac7387d7f80a42c954875462 --- /dev/null +++ b/scipost_django/profiles/migrations/0035_alter_profile_title.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-10-06 10:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('profiles', '0034_auto_20210310_2026'), + ] + + operations = [ + migrations.AlterField( + model_name='profile', + name='title', + field=models.CharField(choices=[('PR', 'Prof.'), ('DR', 'Dr'), ('MR', 'Mr'), ('MRS', 'Mrs'), ('MS', 'Ms'), ('MX', 'Mx')], default='DR', max_length=4), + ), + ] diff --git a/scipost_django/profiles/models.py b/scipost_django/profiles/models.py index e4ced5ad0a3d463e0ba9ac1aa5f4dfc58a483816..aae61ebf89cf450874f486e926d8ba9241956608 100644 --- a/scipost_django/profiles/models.py +++ b/scipost_django/profiles/models.py @@ -8,7 +8,7 @@ from django.db.models.functions import Concat from django.shortcuts import get_object_or_404 from scipost.behaviors import orcid_validator -from scipost.constants import TITLE_CHOICES +from scipost.constants import TITLE_CHOICES, TITLE_DR from scipost.fields import ChoiceArrayField from scipost.models import Contributor @@ -47,7 +47,11 @@ class Profile(models.Model): * mark somebody as a non-referee (if that person does not want to referee for SciPost) """ - title = models.CharField(max_length=4, choices=TITLE_CHOICES, blank=True, null=True) + title = models.CharField( + max_length=4, + choices=TITLE_CHOICES, + default=TITLE_DR + ) first_name = models.CharField(max_length=64) last_name = models.CharField(max_length=64) diff --git a/scipost_django/profiles/templates/profiles/_profile_card.html b/scipost_django/profiles/templates/profiles/_profile_card.html index 76e7e11c6539d1f36b31f82e5a318fcfe18f5dfe..bae9323ad9cc70b22f18fc3af0b380831e4be6d3 100644 --- a/scipost_django/profiles/templates/profiles/_profile_card.html +++ b/scipost_django/profiles/templates/profiles/_profile_card.html @@ -46,8 +46,8 @@ <td class="d-flex"> <form method="post" action="{% url 'profiles:toggle_email_status' profile_mail.id %}">{% csrf_token %}<button type="submit" class="btn btn-link py-0">{{ profile_mail.still_valid|yesno:'Deprecate,Mark valid' }}</button></form> <form method="post" action="{% url 'profiles:email_make_primary' profile_mail.id %}">{% csrf_token %}<button type="submit" class="btn btn-link py-0">Make primary</button></form> - <a type="button" class="btn py-0" data-bs-toggle="modal" data-bs-target="#confirmDeleteEmailModal"><span class="text-danger">{% include 'bi/trash-fill.html' %}</span></a> - <div class="modal" id="confirmDeleteEmailModal" tabindex="-1" role="dialog"> + <a type="button" class="btn py-0" data-bs-toggle="modal" data-bs-target="#confirmDeleteEmailModal-{{ profile_mail.id }}"><span class="text-danger">{% include 'bi/trash-fill.html' %}</span></a> + <div class="modal" id="confirmDeleteEmailModal-{{ profile_mail.id }}" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> diff --git a/scipost_django/profiles/views.py b/scipost_django/profiles/views.py index ab6f06dabf761b2cf4d030610de2da908239c37b..5e3597a2a55aa717a2778eaf1b270df8e94455c5 100644 --- a/scipost_django/profiles/views.py +++ b/scipost_django/profiles/views.py @@ -283,8 +283,8 @@ class ProfileDuplicateListView(PermissionsMixin, PaginationMixin, ListView): if len(context['object_list']) > 1: initial = { - 'to_merge': context['object_list'][0].id, - 'to_merge_into': context['object_list'][1].id + 'to_merge': context['object_list'][1].id, + 'to_merge_into': context['object_list'][0].id } context['merge_form'] = ProfileMergeForm(initial=initial) return context diff --git a/scipost_django/scipost/forms.py b/scipost_django/scipost/forms.py index b8f85c1e10887722cc471386049bc2ce9e108ab3..ec395891daa4eb2747d78d1fe62c8c197486efd7 100644 --- a/scipost_django/scipost/forms.py +++ b/scipost_django/scipost/forms.py @@ -12,6 +12,7 @@ from django.contrib.auth.models import User, Group from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.password_validation import validate_password from django.contrib.auth.validators import UnicodeUsernameValidator +from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.http import Http404 from django.utils import timezone @@ -45,6 +46,7 @@ from submissions.models import Submission, EditorialAssignment, RefereeInvitatio EditorialCommunication, EICRecommendation from theses.models import ThesisLink +domain = Site.objects.get_current().domain REGISTRATION_REFUSAL_CHOICES = ( (None, '-'), @@ -162,7 +164,7 @@ class RegistrationForm(forms.Form): if profile and profile.contributor: raise forms.ValidationError( 'There is already a registered Contributor with your email address. ' - 'Please contact techsupport@scipost.org to clarify this issue.' + f'Please contact techsupport@{domain} to clarify this issue.' ) except Contributor.DoesNotExist: pass @@ -805,7 +807,7 @@ class EmailUsersForm(forms.Form): html_version = html_template.render(Context(email_context)) message = mail.EmailMultiAlternatives( self.cleaned_data['email_subject'], - email_text, 'SciPost Admin <admin@scipost.org>', + email_text, f'SciPost Admin <admin@{domain}>', [user.email], connection=connection) message.attach_alternative(html_version, 'text/html') message.send() diff --git a/scipost_django/scipost/management/commands/add_groups_and_permissions.py b/scipost_django/scipost/management/commands/add_groups_and_permissions.py index 4311644b536c0f06e6d129d409416833e21e6851..5259a7690c0e836d97dfeb39d97e134c1d03d331 100644 --- a/scipost_django/scipost/management/commands/add_groups_and_permissions.py +++ b/scipost_django/scipost/management/commands/add_groups_and_permissions.py @@ -26,6 +26,7 @@ class Command(BaseCommand): name='Registered Contributors') Developers, created = Group.objects.get_or_create(name='Developers') Testers, created = Group.objects.get_or_create(name='Testers') + Previewers, created = Group.objects.get_or_create(name='Previewers') NewsAdmin, created = Group.objects.get_or_create(name='News Administrators') Ambassadors, created = Group.objects.get_or_create(name='Ambassadors') JuniorAmbassadors, created = Group.objects.get_or_create(name='Junior Ambassadors') @@ -311,6 +312,11 @@ class Command(BaseCommand): name='Can manage ontology', content_type=content_type) + # Previewing new features + can_preview_new_features, created = Permission.objects.get_or_create( + codename='can_preview_new_features', + name='Can preview new features', + content_type=content_type) # Assign permissions to groups SciPostAdmin.permissions.set([ @@ -428,6 +434,10 @@ class Command(BaseCommand): can_view_docs_scipost, ]) + Previewers.permissions.set([ + can_preview_new_features, + ]) + Ambassadors.permissions.set([ can_create_registration_invitations, can_manage_registration_invitations, diff --git a/scipost_django/scipost/managers.py b/scipost_django/scipost/managers.py index 3b1aa40b73e6453f386ceb6210487d000c685773..fb97e3b294bce2feb93604cbf2dbd55c220746d4 100644 --- a/scipost_django/scipost/managers.py +++ b/scipost_django/scipost/managers.py @@ -10,20 +10,6 @@ from django.utils import timezone from .constants import NORMAL_CONTRIBUTOR, NEWLY_REGISTERED, DOUBLE_ACCOUNT, AUTHORSHIP_CLAIM_PENDING -class FellowManager(models.Manager): - """Custom defined filters for the Fellow model.""" - - def active(self): - """Filter Fellows active within its set date ranges.""" - today = timezone.now().date() - return self.filter( - Q(start_date__lte=today, until_date__isnull=True) | - Q(start_date__isnull=True, until_date__gte=today) | - Q(start_date__lte=today, until_date__gte=today) | - Q(start_date__isnull=True, until_date__isnull=True) - ).order_by('contributor__user__last_name') - - class ContributorQuerySet(models.QuerySet): """Custom defined filters for the Contributor model.""" diff --git a/scipost_django/scipost/models.py b/scipost_django/scipost/models.py index 5f27541dfddbb1cd192efa2b42e860b0499cf3c6..2f566451c99fca69a85d5eab8b7bed8a6b28a4ae 100644 --- a/scipost_django/scipost/models.py +++ b/scipost_django/scipost/models.py @@ -21,7 +21,7 @@ from .constants import ( AUTHORSHIP_CLAIM_PENDING, AUTHORSHIP_CLAIM_STATUS, CONTRIBUTOR_STATUSES, NEWLY_REGISTERED) from .fields import ChoiceArrayField from .managers import ( - FellowManager, ContributorQuerySet, UnavailabilityPeriodManager, AuthorshipClaimQuerySet) + ContributorQuerySet, UnavailabilityPeriodManager, AuthorshipClaimQuerySet) from conflicts.models import ConflictOfInterest @@ -143,6 +143,10 @@ class Contributor(models.Model): """Check if Contributor is a member of the Editorial College.""" return self.fellowships.active().exists() or self.user.is_superuser + @property + def is_active_senior_fellow(self): + return self.fellowships.active().senior().exists() + @property def is_vetting_editor(self): """Check if Contributor is a Vetting Editor.""" diff --git a/scipost_django/scipost/services.py b/scipost_django/scipost/services.py index 79889b5baf981c1ae99dbcb9a196f403ee1b16bf..798a8e0b50ef5ad8ac65fda199406064ecd23e8a 100644 --- a/scipost_django/scipost/services.py +++ b/scipost_django/scipost/services.py @@ -73,8 +73,8 @@ class DOICaller: except KeyError: author_list.append(author['name']) author_list = ', '.join(author_list) - - journal = data.get('container-title', [])[0] + abstract = data.get('abstract', '') + journal = data.get('container-title', [])[0] if len(data.get('container-title', [])) > 0 else '' volume = data.get('volume', '') pages = self._get_pages(data) pub_date = extract_publication_date_from_Crossref_data(data) @@ -82,6 +82,7 @@ class DOICaller: self.data = { 'title': title, 'author_list': author_list, + 'abstract': abstract, 'journal': journal, 'volume': volume, 'pages': pages, diff --git a/scipost_django/scipost/static/scipost/assets/config/preconfig.scss b/scipost_django/scipost/static/scipost/assets/config/preconfig.scss index 60d1c94fb8744947bbd90a73b6bb752d89859ffd..be0be842b16a0dd10e2a6cb6a4ac9a16e6731419 100644 --- a/scipost_django/scipost/static/scipost/assets/config/preconfig.scss +++ b/scipost_django/scipost/static/scipost/assets/config/preconfig.scss @@ -198,3 +198,5 @@ $theme-colors: ( "light": $gray-100, "dark": $gray-800 ); + +$theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value"); diff --git a/scipost_django/scipost/static/scipost/assets/css/_navbar.scss b/scipost_django/scipost/static/scipost/assets/css/_navbar.scss index d1973870c101f64aa8d2e9d88cc1689e7ed38fe3..df0aef1f8f6cabc5d72e24dc53fb8a47f2a97e01 100644 --- a/scipost_django/scipost/static/scipost/assets/css/_navbar.scss +++ b/scipost_django/scipost/static/scipost/assets/css/_navbar.scss @@ -232,55 +232,41 @@ header .nav-item { position: relative; } -#header-search-form { - right: 0; - width: 600px; - height: 100%; - position: absolute; - - form { - display: block; - top: 15px; - position: absolute; - width: 100%; - height: 50px; - background-color: $white; - padding: 0.25rem 1.0rem; - margin: 0; - border: 1px solid $scipost-lightblue; - outline: none; - - input[type='text'] { - width: 100%; - height: 100%; - border: 0; - outline: none; - padding-right: 100px; - background: none; - } +#headerSearchInput { + background-color: $scipost-darkblue; + // border: 1px solid $scipost-orange; + border: 0px; + color: $white; +} - .btn-group { - position: absolute; - right: 0; - top: 0; - height: 100%; - padding: 0.25rem 0.25rem 0.25rem 1.25rem; - width: 90px; - } +#session_acad_field_form { - .btn { - color: $scipost-darkblue; - font-size: 110%; - padding: 0.375rem 0; - margin: 0 0.5rem; + div #div_id_acad_field_slug { + margin: 0rem !important; - &:hover { - color: $scipost-lightblue; - } + #id_acad_field_slug { + background-color: $scipost-darkblue; + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); + border: 2px solid $scipost-lightblue; + border-radius: 2px; + color: $white; + min-width: 16em; + } + } +} - &.close-form { - font-size: 16px; - } - } +#session_specialty_form { + + div #div_id_specialty_slug { + margin: 0rem !important; + + #id_specialty_slug { + background-color: $scipost-darkblue; + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); + border: 2px solid $scipost-lightblue; + border-radius: 2px; + color: $white; + min-width: 24rem; + } } } diff --git a/scipost_django/scipost/static/scipost/assets/css/style.scss b/scipost_django/scipost/static/scipost/assets/css/style.scss index 28f3cd5091e9f62a21a35e011b48aaa136608067..0f6dcd2e6d0e3511447365b53a9f3de757750dd7 100644 --- a/scipost_django/scipost/static/scipost/assets/css/style.scss +++ b/scipost_django/scipost/static/scipost/assets/css/style.scss @@ -2,7 +2,7 @@ @import "node_modules/bootstrap/scss/bootstrap"; /** * Make variables defined in preconfig.scss accessible in this file, - * plus default variables and mixins of Bootstrap@4 + * plus default variables and mixins of Bootstrap * * Do not write styles in this file. Get or create a file in this folder * and make sure its imported underneath! diff --git a/scipost_django/scipost/static/scipost/assets/js/base.js b/scipost_django/scipost/static/scipost/assets/js/base.js index a094f92d43ace447bc50ae5e57c6df3226a34600..ecd8da51f3fd9e915d60219b89d5d2247a1cb0ed 100644 --- a/scipost_django/scipost/static/scipost/assets/js/base.js +++ b/scipost_django/scipost/static/scipost/assets/js/base.js @@ -3,3 +3,14 @@ import './../css/style.scss' //import { Button, Navbar, Table } from 'bootstrap'; import 'bootstrap' + +// import 'htmx.org' +var htmx = require('htmx.org'); + +// To prevent all tabs from being updated if acad_field or specialty are changed, +// tweak the HTMX request by letting through only the one(s) of the active portal tab: +htmx.on('htmx:configRequest', evt => { + if (evt.target.closest('div.portal-tab') && !evt.target.closest('div.portal-tab').classList.contains('active')) { + evt.preventDefault(); + } +}); diff --git a/scipost_django/scipost/static/scipost/search-header.js b/scipost_django/scipost/static/scipost/search-header.js deleted file mode 100644 index 9d953326c5109815c824672e5f5423cfaa785140..0000000000000000000000000000000000000000 --- a/scipost_django/scipost/static/scipost/search-header.js +++ /dev/null @@ -1,25 +0,0 @@ -function searchHeader() { - document.getElementById("header-search-button").addEventListener("click", function(event){ - if (document.documentElement.clientWidth > 768) { - event.preventDefault(); - var x = document.getElementById("header-search-form"); - if (x.style.display === "none") { - x.style.display = "block"; - } else { - x.style.display = "none"; - } - } - }); - - document.getElementById("header-search-close-btn").addEventListener("click", function(event){ - var x = document.getElementById("header-search-form"); - x.style.display = "none"; - }); - - if (document.documentElement.clientWidth <= 768) { - // Force-close if form is prefilled. - var x = document.getElementById("header-search-form"); - x.style.display = "none"; - } -} -searchHeader(); diff --git a/scipost_django/scipost/static/scipost/toggle-header-forms.js b/scipost_django/scipost/static/scipost/toggle-header-forms.js new file mode 100644 index 0000000000000000000000000000000000000000..bbd68f66fbb08e5d84b4a513d0f6c3348acbeb92 --- /dev/null +++ b/scipost_django/scipost/static/scipost/toggle-header-forms.js @@ -0,0 +1,9 @@ +/* If home tab is chosen, don't show header forms to set acad_field and specialty. */ +document.getElementById('home-tab').addEventListener('show.bs.tab', () => { + document.getElementById('session_acad_field_form').style.display = 'none' + document.getElementById('session_specialty_form').style.display = 'none' +}) +document.getElementById('home-tab').addEventListener('hide.bs.tab', () => { + document.getElementById('session_acad_field_form').style.display = 'block' + document.getElementById('session_specialty_form').style.display = 'block' +}) diff --git a/scipost_django/scipost/static/scipost/toggle-proceedings.js b/scipost_django/scipost/static/scipost/toggle-proceedings.js new file mode 100644 index 0000000000000000000000000000000000000000..05b53397dfbd927b932ceb0e30094dda14533937 --- /dev/null +++ b/scipost_django/scipost/static/scipost/toggle-proceedings.js @@ -0,0 +1,41 @@ +/* If Proceedings is chosen as Journal, display Proceedings selector */ + +/* for portal publications tab */ +if (document.getElementById("id_journal")) { + document.getElementById("id_journal").addEventListener("change", () => { + var e = document.getElementById("id_journal") + if (e.options[e.selectedIndex].text.includes('Proceedings')) { + document.getElementById("row_proceedings").style.display = 'block' + } else { + document.getElementById("row_proceedings").style.display = 'none' + document.getElementById("id_proceedings").value = null + } + }) +} + +/* for portal/pool submissions tab */ +if (document.getElementById("id_submitted_to")) { + document.getElementById("id_submitted_to").addEventListener("change", () => { + var e = document.getElementById("id_submitted_to") + if (e.options[e.selectedIndex].text.includes('Proceedings')) { + document.getElementById("row_proceedings").style.display = 'block' + } else { + document.getElementById("row_proceedings").style.display = 'none' + document.getElementById("id_proceedings").value = null + } + }) +} + +/* For pool. If user opts for viewing submissions for which they are EIC, toggle + editor_in_charge selector and set status to 'all' */ +document.getElementsByName("search_set").forEach(e => { + e.addEventListener("change", () => { + if (e.checked && e.value == 'eic') { + document.getElementById("id_editor_in_charge").value = null + document.getElementById("col_eic").style.display = 'none' + document.getElementById("id_status").value = 'all' + } else { + document.getElementById("col_eic").style.display = 'block' + } + }) +}) diff --git a/scipost_django/scipost/tasks.py b/scipost_django/scipost/tasks.py index 07104ede2b2ce76496fbf413322712a3cadbb098..9dcec183b6945b87a873431412a82eccf399e98d 100644 --- a/scipost_django/scipost/tasks.py +++ b/scipost_django/scipost/tasks.py @@ -2,11 +2,13 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +from django.contrib.sites.models import Site from django.core.mail import send_mail - from SciPost_v1.celery import app +domain = Site.objects.get_current().domain + @app.task(bind=True) def test_celery_using_mail(self): @@ -14,7 +16,7 @@ def test_celery_using_mail(self): send_mail( 'Test subject', 'Received this mail?', - 'noreply@scipost.org', - ['jorrandewit@scipost.org'], + f'noreply@{domain}', + [f'techsupport@{domain}'], fail_silently=False, ) diff --git a/scipost_django/scipost/templates/scipost/EdCol_by-laws.html b/scipost_django/scipost/templates/scipost/EdCol_by-laws.html index 662cf5344fe6ae6145fecd1537a2b48525d3b641..75e52a33ab9f91c558777e7a2abcf3a6af0823a4 100644 --- a/scipost_django/scipost/templates/scipost/EdCol_by-laws.html +++ b/scipost_django/scipost/templates/scipost/EdCol_by-laws.html @@ -194,9 +194,9 @@ using our online forums/meetings facilities. </p> <ol> - <li><strong>Virtual General Meetings</strong> + <li><strong>Annual Meetings</strong> <p>Once per year, Fellows of the Editorial Colleges are asked to participate in a - virtual general meeting. The meeting is organized by the Foundation and takes + Virtual General Meeting. The meeting is organized by the Foundation and takes place over the course of one week during the month of January.</p> <p>For the VGM, a special web page is activated, which is accessible only to Fellows, members of the Advisory Board, Foundation Board members and SciPost @@ -216,11 +216,11 @@ implementing the decisions taken and releases the minutes of the VGM to the Advisory Board and Editorial College.</p> </li> - <li><strong>Extraordinary Virtual Meetings</strong> - <p>At any time, the Foundation can call an Extraordinary Virtual Meeting, to - discuss pressing issues. This meeting must be - announced at least one week before its scheduled start. - An EVM otherwise follows the same procedures as a VGM. + <li><strong>Special Meetings</strong> + <p>At any time, the Foundation or groups of at least five current + Fellows can call a Special Meeting, to put forward motions for SciPost policy + changes. This meeting must be announced at least one week before its scheduled + start. The voting on motions follows the same procedure as in the Annual Meeting. </p> </li> </ol> diff --git a/scipost_django/scipost/templates/scipost/ExpSustDrive2018.html b/scipost_django/scipost/templates/scipost/ExpSustDrive2018.html index 72755ac1494f27e4492d98a27b5de33bb15ebe9a..73d574199c6d86af51123b580542d6a89d411d38 100644 --- a/scipost_django/scipost/templates/scipost/ExpSustDrive2018.html +++ b/scipost_django/scipost/templates/scipost/ExpSustDrive2018.html @@ -15,7 +15,7 @@ <div class="row justify-content-center"> <div class="col-md-7 col-lg-5"> <p> - Since our original <a href="{% url 'scipost:call' %}" target="_blank">call for openness</a> in scientific publishing, things have been developing extremely well with SciPost. One quick glance at our <a href="{% url 'journals:publications' %}" target="_blank">publishing activities</a> (our list of publications now numbers more than 100, including some <a href="https://scipost.org/SciPostPhys?tab=most-cited" target="_blank">highly-cited ones</a>) is hopefully enough to convince you that we are well on our way to implementing a healthier infrastructure for scientific publishing. + Since our original <a href="{% url 'scipost:call' %}" target="_blank">call for openness</a> in scientific publishing, things have been developing extremely well with SciPost. One quick glance at our <a href="{% url 'journals:publications' %}" target="_blank">publishing activities</a> (our list of publications now numbers more than 100, including some <a href="https://{{ request.get_host }}/SciPostPhys?tab=most-cited" target="_blank">highly-cited ones</a>) is hopefully enough to convince you that we are well on our way to implementing a healthier infrastructure for scientific publishing. </p> <p> Separately, in a sure sign that <i>The Times They Are A Changin'</i>, big players are moving towards implementing Open Access very similarly to our vision (including the European Commission with its recent <a href="https://ted.europa.eu/udl?uri=TED:NOTICE:141558-2018:TEXT:EN:HTML&tabId=1" target="_blank" rel="noopener">Call for Tenders</a>, though you should read recent blog posts <a href="https://jscaux.org/blog/post/2018/04/02/ectender/" target="_blank" rel="noopener">here</a> and <a href="https://jscaux.org/blog/post/2018/04/27/ECTenderInterview/" target="_blank" rel="noopener">here</a> for how this relates to SciPost). @@ -66,11 +66,11 @@ Are you sympathetic towards what we are aiming to achieve? You can help us accelerate our growth with these easy steps: </p> <ul> - <li><i>Is your field insufficiently represented in our current <a href="{% url 'scipost:about' %}#editorial_college_physics">Editorial College</a>?</i><br/>We are looking for world-class researchers to become Fellows. Send us your nominations at <a href="mailto:admin@scipost.org">admin@scipost.org</a>.<br/>Are you a professorial-level researcher working as editor for non-<a href="https://jscaux.org/blog/post/2018/05/05/genuine-open-access/" target="_blank" rel="noopener">Genuine OA</a>-compliant publishers? Looking to invest your expertise in a more community-friendly alternative? Get in touch.<br/>Please note that in view of our development plans, we also welcome nominations in fields beyond Physics.</li> + <li><i>Is your field insufficiently represented in our current <a href="{% url 'scipost:about' %}#editorial_college_physics">Editorial College</a>?</i><br/>We are looking for world-class researchers to become Fellows. Send us your nominations at <a href="mailto:admin@{{ request.get_host }}">admin@{{ request.get_host }}</a>.<br/>Are you a professorial-level researcher working as editor for non-<a href="https://jscaux.org/blog/post/2018/05/05/genuine-open-access/" target="_blank" rel="noopener">Genuine OA</a>-compliant publishers? Looking to invest your expertise in a more community-friendly alternative? Get in touch.<br/>Please note that in view of our development plans, we also welcome nominations in fields beyond Physics.</li> <br/> <li</li> - <li><i>Is your institution or funding agency not listed on our <a href="{% url 'sponsors:sponsors' %}" target="_blank">Sponsors page</a>?</i><br/>Encourage them (through a librarian, Open Access officer, director, ...) to join by personally emailing them directly using this <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'petitions/petition_email.html' %}{% endautoescape %}&cc=sponsors@scipost.org">email template</a>. Experience shows that such personal testimonies and statements of support from active scientists constitute the most persuasive means to convince institutions to support us. - <br/>Funders which have been acknowledged in SciPost publications are listed at <a href="https://scipost.org/organizations/" target="_blank">this link</a>; clicking on a funder will show how many publications they are related to, which have been produced at no direct cost to them by our cost-slashing operations. Seeing this might also help convincing them to become Sponsors.</li> + <li><i>Is your institution or funding agency not listed on our <a href="{% url 'sponsors:sponsors' %}" target="_blank">Sponsors page</a>?</i><br/>Encourage them (through a librarian, Open Access officer, director, ...) to join by personally emailing them directly using this <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'petitions/petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">email template</a>. Experience shows that such personal testimonies and statements of support from active scientists constitute the most persuasive means to convince institutions to support us. + <br/>Funders which have been acknowledged in SciPost publications are listed at <a href="https://{{ request.get_host }}{% url 'organizations:organizations' %}" target="_blank">this link</a>; clicking on a funder will show how many publications they are related to, which have been produced at no direct cost to them by our cost-slashing operations. Seeing this might also help convincing them to become Sponsors.</li> <br/> <li><i>Are people in your surroundings and social network not yet sufficiently aware of SciPost?</i><br/>You can point them to our <a href="https://youtu.be/Pgvd7EvehCI" target="_blank" rel="noopener">intro video</a> and mention this drive on social media using the <a href="https://twitter.com/hashtag/SciPostDrive2018">#SciPostDrive2018</a> and <a href="https://twitter.com/hashtag/SciPost">#SciPost</a> hashtags. </li> diff --git a/scipost_django/scipost/templates/scipost/FAQ.html b/scipost_django/scipost/templates/scipost/FAQ.html index d9c0586734b535d5431778588cfc92a8075464eb..efad23ea1501a02d0a495c9848be2e96def76004 100644 --- a/scipost_django/scipost/templates/scipost/FAQ.html +++ b/scipost_django/scipost/templates/scipost/FAQ.html @@ -25,7 +25,7 @@ all the way to post-publication commenting, is offered by SciPost. </p> <p> - Thus, simply stated: share your preprint on <a target="_blank" rel="noopener" href="https://www.arxiv.org">arXiv</a>, publish it in <a href="https://scipost.org">SciPost</a>. + Thus, simply stated: share your preprint on <a target="_blank" rel="noopener" href="https://www.arxiv.org">arXiv</a>, publish it in <a href="https://{{ request.get_host }}{% url 'scipost:index' %}">SciPost</a>. </p><!-- End SciPost --> <!-- SciPost Journals --> @@ -288,7 +288,7 @@ </a> <div id="scipost_funded" class="collapse" role="tabpanel"> <p>SciPost operates non-commercially and purely not-for-profit, incurring minimal costs. Contributors, who are by definition all academically employed, provide all the content and perform all editorial tasks as part of their normal institutional academic duties. Operations are kept running by a team of volunteer officers, themselves academically employed.</p> - <p>The startup phase was supported by a grant from the <a target="_blank" rel="noopener" href="https://www.nwo.nl/en">NWO</a> in the Netherlands. Long-term operations will be financed by donations from national funding agencies, universities, societies, foundations and individuals. More information on our cost-slashing consortial scheme can be found on our <a href="{% url 'sponsors:sponsors' %}">sponsors page</a>. You can also take a look at our <a href="{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement template</a> for more information. You might even consider petitioning your local librarian/director/... to consider sponsoring us, which you can easily do using this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@scipost.org">template</a>. + <p>The startup phase was supported by a grant from the <a target="_blank" rel="noopener" href="https://www.nwo.nl/en">NWO</a> in the Netherlands. Long-term operations will be financed by donations from national funding agencies, universities, societies, foundations and individuals. More information on our cost-slashing consortial scheme can be found on our <a href="{% url 'sponsors:sponsors' %}">sponsors page</a>. You can also take a look at our <a href="{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement template</a> for more information. You might even consider petitioning your local librarian/director/... to consider sponsoring us, which you can easily do using this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">template</a>. </p> </div> </div> diff --git a/scipost_django/scipost/templates/scipost/PlanSciPost.html b/scipost_django/scipost/templates/scipost/PlanSciPost.html index b779c03b37bff6ef5290989d7bd67f3a66fb5825..3abe1923ef9d825f919cb28a12ad5c8f6dda0fd3 100644 --- a/scipost_django/scipost/templates/scipost/PlanSciPost.html +++ b/scipost_django/scipost/templates/scipost/PlanSciPost.html @@ -48,7 +48,7 @@ <li>At least 3 field-specific Advisory Board members</li> <li>A field-specific Editorial College with at least 25 committed Fellows</li> </ul> - Do you know somebody appropriate? Send us your suggestions at <a href="mailto:admin@scipost.org?subject=Fellow suggestion">admin@scipost.org</a>. + Do you know somebody appropriate? Send us your suggestions at <a href="mailto:admin@{{ request.get_host }}?subject=Fellow suggestion">admin@{{ request.get_host }}</a>. </div> </div> </div> @@ -75,7 +75,7 @@ {% if perms.scipost.can_attend_VGMs %} <div class="container border border-danger"> - <span class="text-danger">DRAFT (POOLVIEW ONLY) - <a href="mailto:admin@scipost.org">COMMENTS WELCOME</a></span> + <span class="text-danger">DRAFT (POOLVIEW ONLY) - <a href="mailto:admin@{{ request.get_host }}">COMMENTS WELCOME</a></span> <h2 class="highlight">Launch schedule <span class="small text-muted"></span></h2> diff --git a/scipost_django/scipost/templates/scipost/_hx_news.html b/scipost_django/scipost/templates/scipost/_hx_news.html new file mode 100644 index 0000000000000000000000000000000000000000..5d1b24ce4bb450afc18df12961038f03a2f09587 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/_hx_news.html @@ -0,0 +1,16 @@ +{% load scipost_extras %} + +<div id="further-news" class="sp-swap" + hx-get="{% url 'scipost:_hx_news' %}?dt={{ request.GET.dt|increment_dt }}" + hx-trigger="every {{ request.GET.dt|increment_dt }}s" + hx-swap="outerHTML swap:1s" +> + <h3><a href="{% url 'news:news' %}#news_{{ news.id }}">{{ news.headline }}</a></h3> + <div class="text-muted">{{ news.date|date:'j F Y' }}</div> + <p> + {{ news.blurb_short }} + <br> + <br> + <a href="{% url 'news:news' %}#news_{{ news.id }}" class="my-1">Read more →</a> + </p> +</div> diff --git a/scipost_django/scipost/templates/scipost/_hx_participates_in.html b/scipost_django/scipost/templates/scipost/_hx_participates_in.html new file mode 100644 index 0000000000000000000000000000000000000000..4fafaec4e476537a1c68ec47eacbbc8b9b057b8c --- /dev/null +++ b/scipost_django/scipost/templates/scipost/_hx_participates_in.html @@ -0,0 +1,14 @@ +{% load static %} + +<div class="card"> + <div class="card-header"> + <h1>SciPost participates in</h1> + </div> + <div class="card-body logos"> + <a href="https://www.crossref.org" target="_blank" rel="noopener"><img src="https://assets.crossref.org/logo/crossref-logo-200.svg" width="100" alt="Crossref logo"></a> + <a href="https://www.doaj.org" target="_blank" rel="noopener"><img src="{% static 'scipost/images/doaj_logo_200.jpg' %}" width="90" alt="DOAJ logo"></a> + <a href="https://www.clockss.org" target="_blank" rel="noopener"><img src="{% static 'scipost/images/clockss_original_logo_boxed_ai-cropped-90.png' %}" width="80" alt="Clockss logo"></a> + <a href="https://i4oc.org/" target="_blank" rel="noopener"><img width="100" src="{% static 'scipost/images/I4OC.png' %}" alt="I4OC logo"></a> + <a href="https://freejournals.org" target="_blank" rel="noopener"><img width="100" src="{% static 'scipost/images/FJN-logo-long.png' %}" alt="FJN logo"></a> + </div> +</div> diff --git a/scipost_django/scipost/templates/scipost/_hx_sponsors.html b/scipost_django/scipost/templates/scipost/_hx_sponsors.html new file mode 100644 index 0000000000000000000000000000000000000000..acb4851ccca25db47c606aac54c5277ad2ef5e14 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/_hx_sponsors.html @@ -0,0 +1,19 @@ +{% load static %} +{% load scipost_extras %} + +<div id="sponsor-logos" class="sp-swap" + hx-get="{% url 'scipost:_hx_sponsors' %}?dt={{ request.GET.dt|increment_dt }}" + hx-trigger="every {{ request.GET.dt|increment_dt }}s" + hx-swap="outerHTML swap:1s" +> + <ul class="list list-unstyled"> + {% for sponsor in current_sponsors %} + {% if sponsor.logo %} + <li class="p-2"> + <img class="rounded" style="max-height: 10em;" + src="{{ sponsor.logo.url }}" alt="{{ sponsor.name }} logo"> + </li> + {% endif %} + {% endfor %} + </ul> +</div> diff --git a/scipost_django/scipost/templates/scipost/_personal_page_account.html b/scipost_django/scipost/templates/scipost/_personal_page_account.html index 2305b8bc355e9ae306b7583b009b98ba11c35748..c7ca7fcf1dc330f44dd355f75e072ce7a37ddd2b 100644 --- a/scipost_django/scipost/templates/scipost/_personal_page_account.html +++ b/scipost_django/scipost/templates/scipost/_personal_page_account.html @@ -76,7 +76,7 @@ <p class="mb-1">If it is not listed on our <a href="{% url 'sponsors:sponsors' %}" target="_blank">Sponsors page</a>, please encourage your institution (through a librarian, director, ...) to join. - You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@scipost.org">template</a>.</p> + You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">template</a>.</p> </div> <hr> diff --git a/scipost_django/scipost/templates/scipost/acad_field_portal.html b/scipost_django/scipost/templates/scipost/acad_field_portal.html deleted file mode 100644 index d793672a7135e044bd1dc71e0b9ddf1169a4467f..0000000000000000000000000000000000000000 --- a/scipost_django/scipost/templates/scipost/acad_field_portal.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends 'scipost/base.html' %} - -{% load render_bundle from webpack_loader %} - - -{% block content %} - - <h1>{{ acad_field.name }} portal</h1> - -{% endblock content %} - - -{% block footer_script %} -{% endblock footer_script %} diff --git a/scipost_django/scipost/templates/scipost/bare_base.html b/scipost_django/scipost/templates/scipost/bare_base.html index 4f8b97c8c1a110a6044e817d5b3e470eaade16cd..e1258f6d33fb72f6f94bc6f24a7ae8885c1c912d 100644 --- a/scipost_django/scipost/templates/scipost/bare_base.html +++ b/scipost_django/scipost/templates/scipost/bare_base.html @@ -18,13 +18,19 @@ <title>SciPost{% block pagetitle %}{% endblock pagetitle %}</title> + <style>{% for journal in journals %}{% if journal.style %}{{ journal.style }}{% endif %}{% endfor %}</style> + {% block headsup %} {% endblock headsup %} </head> <body class="{% block body_class %}{% endblock %}"> - {% include 'scipost/header.html' %} - {% include 'scipost/navbar.html' %} + {% block header %} + {% include 'scipost/header.html' %} + {% endblock header %} + {% block navbar %} + {% include 'scipost/navbar.html' %} + {% endblock navbar %} {% block breadcrumb %}{% endblock breadcrumb %} {% block secondary_navbar %}{% endblock secondary_navbar %} @@ -35,10 +41,15 @@ <div class="backdrop" id="backdrop"></div> - <script src="{% static 'scipost/mathjax-config.js' %}"></script> + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/mathjax-config.js' %}"></script> <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML,Safe"></script> {% block footer_script %} + <script nonce="{{ request.csp_nonce }}"> + document.body.addEventListener('htmx:afterSettle', function () { + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + }) + </script> {% endblock footer_script %} </body> diff --git a/scipost_django/scipost/templates/scipost/contact.html b/scipost_django/scipost/templates/scipost/contact.html index 97413bf5d46eed630429fc24b58ddce27b7ec306..fcfad3cf577c257f65df283d05350797a009e8da 100644 --- a/scipost_django/scipost/templates/scipost/contact.html +++ b/scipost_django/scipost/templates/scipost/contact.html @@ -17,7 +17,7 @@ <div class="card-body"> <p> For anything relating to the initiative, its setup, running and plans, email us at - <a href="mailto:admin@scipost.org">admin[at]scipost.org</a>. + <a href="mailto:admin@{{ request.get_host }}">admin[at]{{ request.get_host }}</a>. </p> </div> </div> @@ -32,7 +32,7 @@ Know an ideal Fellow candidate for one of our <a href="{% url 'colleges:colleges' %}">Editorial Colleges</a>? </p> <p> - Email your suggestion to <a href="mailto:edadmin@scipost.org">edadmin[at]scipost.org</a>. + Email your suggestion to <a href="mailto:edadmin@{{ request.get_host }}">edadmin[at]{{ request.get_host }}</a>. </p> </div> </div> @@ -45,7 +45,7 @@ <div class="card-body"> <p> For all editorial matters, please contact us at - <a href="mailto:edadmin@scipost.org">edadmin[at]scipost.org</a>. + <a href="mailto:edadmin@{{ request.get_host }}">edadmin[at]{{ request.get_host }}</a>. </p> </div> </div> @@ -61,7 +61,7 @@ </p> <p> Interested in helping? Get in touch with us at - <a href="mailto:sponsors@scipost.org">sponsors[at]scipost.org</a>. + <a href="mailto:sponsors@{{ request.get_host }}">sponsors[at]{{ request.get_host }}</a>. </p> </div> </div> @@ -74,7 +74,7 @@ <div class="card-body"> <p> For all technical matters, contact us at - <a href="mailto:techsupport@scipost.org">techsupport[at]scipost.org</a>. + <a href="mailto:techsupport@{{ request.get_host }}">techsupport[at]{{ request.get_host }}</a>. </p> </div> </div> @@ -93,7 +93,7 @@ P.O Box 94485<br> 1090 GL Amsterdam<br> The Netherlands<br> - <a href="mailto:jscaux@scipost.org">jscaux[at]scipost.org</a>. + <a href="mailto:jscaux@{{ request.get_host }}">jscaux[at]{{ request.get_host }}</a>. </p> </div> </div> diff --git a/scipost_django/scipost/templates/scipost/feeds.html b/scipost_django/scipost/templates/scipost/feeds.html index 684d1b16e70a6ea0699b72df3d14804a39851b46..30e4c54397645b1608b673eedb45aab894553447 100644 --- a/scipost_django/scipost/templates/scipost/feeds.html +++ b/scipost_django/scipost/templates/scipost/feeds.html @@ -14,23 +14,23 @@ <h2>News feeds</h2> <p> We provide both RSS (2.0) and Atom feeds for latest news and announcements. - The URL of the RSS feed is <a href="{% url 'scipost:feeds_rss_news' %}">https://scipost.org/rss/news/</a>. - The URL of the Atom feed is <a href="{% url 'scipost:feeds_atom_news' %}">https://scipost.org/atom/news/</a>. + The URL of the RSS feed is <a href="{% url 'scipost:feeds_rss_news' %}">https://{{ request.get_host }}{% url 'scipost:feeds_rss_news' %}</a>. + The URL of the Atom feed is <a href="{% url 'scipost:feeds_atom_news' %}">https://{{ request.get_host }}{% url 'scipost:feeds_atom_news' %}</a>. </p> <h2>Publications feeds</h2> <p> Similarly, we provide feeds for the latest publications. - The URL of the general RSS feed is <a href="{% url 'scipost:feeds_rss_publications' %}">https://scipost.org/rss/publications</a>. - The URL of the general Atom feed is <a href="{% url 'scipost:feeds_atom_publications' %}">https://scipost.org/atom/publications/</a>. + The URL of the general RSS feed is <a href="{% url 'scipost:feeds_rss_publications' %}">https://{{ request.get_host }}{% url 'scipost:feeds_rss_publications' %}</a>. + The URL of the general Atom feed is <a href="{% url 'scipost:feeds_atom_publications' %}">https://{{ request.get_host }}{% url 'scipost:feeds_atom_publications' %}</a>. </p> <p>You can also obtain feeds only for any specific specialization by using the links in the table below.</p> <h2>Submissions feeds</h2> <p> We also provide feeds for the latest submissions. - The URL of the general RSS feed is <a href="{% url 'scipost:feeds_rss_submissions' %}">https://scipost.org/rss/submissions</a>. - The URL of the general Atom feed is <a href="{% url 'scipost:feeds_atom_submissions' %}">https://scipost.org/atom/submissions/</a>. + The URL of the general RSS feed is <a href="{% url 'scipost:feeds_rss_submissions' %}">https://{{ request.get_host }}{% url 'scipost:feeds_rss_submissions' %}</a>. + The URL of the general Atom feed is <a href="{% url 'scipost:feeds_atom_submissions' %}">https://{{ request.get_host }}{% url 'scipost:feeds_atom_submissions' %}</a>. </p> <p>You can also obtain feeds only for any specific specialty by using the links in the table below.</p> diff --git a/scipost_django/scipost/templates/scipost/footer.html b/scipost_django/scipost/templates/scipost/footer.html index c9d2f2397759d5c0c14f03ceb35099e224352b68..d7ff1c7b9d41301020b49d7bd789f2fe8efe82ad 100644 --- a/scipost_django/scipost/templates/scipost/footer.html +++ b/scipost_django/scipost/templates/scipost/footer.html @@ -16,12 +16,12 @@ <div class="col-md-3 mb-3 mb-md-0"> <ul class="list-unstyled"> - <li><a href="mailto:admin@scipost.org">Contact the administrators</a></li> + <li><a href="mailto:admin@{{ request.get_host }}">Contact the administrators</a></li> {% if request.user.is_authenticated %} <li><a href="{% url 'helpdesk:helpdesk' %}">Helpdesk</a></li> {% endif %} - <li><a href="mailto:techsupport@scipost.org">Write to tech support</a></li> - <li><a href="https://git.scipost.org" target="_blank" rel="noopener">{% include 'bi/code-square.html' %} git.scipost.org</a></li> + <li><a href="mailto:techsupport@{{ request.get_host }}">Write to tech support</a></li> + <li><a href="https://git.{{ request.get_host }}" target="_blank" rel="noopener">{% include 'bi/code-square.html' %} git.{{ request.get_host }}</a></li> </ul> </div> @@ -41,7 +41,7 @@ Twitter </a> </li> - <li><a href="https://disc.scipost.org" target="_blank" rel="noopener">Community</a></li> + <li><a href="https://disc.{{ request.get_host }}" target="_blank" rel="noopener">Community</a></li> </ul> </div> @@ -49,10 +49,10 @@ <div class="row"> <div class="col-12"> <br> - <a rel="license noopener" href="//creativecommons.org/licenses/by/4.0/" target="_blank" class="m-2"> - <img alt="Creative Commons License" style="border-width:0" src="//licensebuttons.net/l/by/4.0/80x15.png" /> + <a rel="license noopener" href="https://creativecommons.org/licenses/by/4.0/" target="_blank" class="m-2"> + <img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by/4.0/80x15.png" /> </a> - Except where otherwise noted, all content on SciPost.org is licensed under a <a rel="license noopener" href="//creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International License</a>. + Except where otherwise noted, all content on {{ request.get_host }} is licensed under a <a rel="license noopener" href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International License</a>. </div> </div> </div> diff --git a/scipost_django/scipost/templates/scipost/foundation.html b/scipost_django/scipost/templates/scipost/foundation.html index 59294872765833d3778fc600b52daf1d3fa6bfb9..19d94ecf05af500c3f8125069133ffc00519c645 100644 --- a/scipost_django/scipost/templates/scipost/foundation.html +++ b/scipost_django/scipost/templates/scipost/foundation.html @@ -53,7 +53,7 @@ <div class="card-body"> <h2 class="highlight">Contact details</h2> <address class="px-2"> - c/o Prof. <a href="mailto:jscaux@scipost.org">J.-S. Caux</a></br> + c/o Prof. <a href="mailto:jscaux@{{ request.get_host }}">J.-S. Caux</a></br> Institute of Physics</br> University of Amsterdam</br> Postbus 94485</br> diff --git a/scipost_django/scipost/templates/scipost/header.html b/scipost_django/scipost/templates/scipost/header.html index 9f27397d006ff6436050b011b73a757e190e2e92..ce6481d0f38b44b5c0118643be6045d2530c182e 100644 --- a/scipost_django/scipost/templates/scipost/header.html +++ b/scipost_django/scipost/templates/scipost/header.html @@ -1,37 +1,27 @@ {% load static %} +{% load crispy_forms_tags %} -<header> +<header class="py-2"> <div class="container"> <div class="d-md-flex justify-content-between"> <div class="logobox"> <a href="{% url 'scipost:index' %}"><img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" alt="SciPost logo" width="180" /></a> </div> - <ul class="navbar-nav"> - <li class="nav-item"> - <a class="nav-link" id="header-search-button" href="{% url 'scipost:search' %}"> - {% include 'bi/search.html' %} - Search - </a> - - <div id="header-search-form"{% if not request.GET.q %} style="display: none;"{% endif %}> - <form method="get" action="{% url 'scipost:search' %}"> - <input type="text" name="q" placeholder="Search term" value="{{ request.GET.q }}"> - <div class="btn-group"> - <button type="submit" class="btn btn-link"> - {% include 'bi/search.html' %} - </button> - <a class="btn btn-link close-form" id="header-search-close-btn"> - {% include 'bi/x-circle-fill.html' %} - </a> - </div> - </form> - </div> - </li> - </ul> + <div class="ms-auto me-0 my-4 my-md-auto"> + <form id="header-search-form" method="get" action="{% url 'scipost:search' %}"> + <div class="form-floating"> + <input type="text" id="headerSearchInput" class="form-control" name="q" placeholder="Search" value="{{ request.GET.q }}"> + <label for="headerSearchInput" class="text-white"> + Quick search {% include 'bi/search.html' %} + </label> + </div> + </form> + </div> </div> - <script src="{% static 'scipost/search-header.js' %}"></script> + {% block header_sup %} + {% endblock header_sup %} </div> </header> diff --git a/scipost_django/scipost/templates/scipost/header_with_acad_field_and_spec.html b/scipost_django/scipost/templates/scipost/header_with_acad_field_and_spec.html new file mode 100644 index 0000000000000000000000000000000000000000..5fb64bac062ec16810712613fff4240c67da48e3 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/header_with_acad_field_and_spec.html @@ -0,0 +1,23 @@ +{% extends 'scipost/header.html' %} +{% load crispy_forms_tags %} + +{% block header_sup %} + <div class="d-md-flex justify-content-center mb-2"> + <div class="my-4 my-md-auto"> + <form id="session_acad_field_form" + hx-get="{% url 'ontology:set_session_acad_field' %}" + hx-trigger="change" + hx-swap="outerHTML" + > + {% crispy session_acad_field_form %} + </form> + </div> + <div class="ms-md-2 my-4 my-md-auto" + hx-get="{% url 'ontology:_hx_session_specialty_form' %}" + hx-trigger="load, session-acad-field-set from:body" + > + </div> + + </div> + +{% endblock header_sup %} diff --git a/scipost_django/scipost/templates/scipost/header_with_acad_field_and_spec2p2.html b/scipost_django/scipost/templates/scipost/header_with_acad_field_and_spec2p2.html new file mode 100644 index 0000000000000000000000000000000000000000..eecdf7c7cf9799472d7640f110d2963ed9c8910d --- /dev/null +++ b/scipost_django/scipost/templates/scipost/header_with_acad_field_and_spec2p2.html @@ -0,0 +1,41 @@ +{% load static %} +{% load crispy_forms_tags %} + +<header> + + <div class="d-lg-flex justify-content-between p-4 w-100"> + + <div class="me-2 my-4 my-md-auto" style="flex: 200px"> + <a href="{% url 'scipost:index' %}"><img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" class="m-0 p-0" alt="SciPost logo" style="max-width: unset;" width="180" /></a> + </div> + + <div class="mx-2 my-4 my-lg-auto"> + <form id="session_acad_field_form" + hx-get="{% url 'ontology:set_session_acad_field' %}" + hx-trigger="change" + hx-swap="outerHTML" + > + {% crispy session_acad_field_form %} + </form> + </div> + <div class="mx-2 my-4 my-lg-auto" + hx-get="{% url 'ontology:_hx_session_specialty_form' %}" + hx-trigger="load, session-acad-field-set from:body" + > + </div> + + <div class="ms-2 my-4 my-lg-auto"> + <form id="header-search-form" method="get" action="{% url 'scipost:search' %}"> + <div class="form-floating"> + <input type="text" id="headerSearchInput" class="form-control" name="q" placeholder="Search" value="{{ request.GET.q }}"> + <label for="headerSearchInput" class="text-white"> + Quick search {% include 'bi/search.html' %} + </label> + </div> + </form> + </div> + </div> + + + +</header> diff --git a/scipost_django/scipost/templates/scipost/howto_production.html b/scipost_django/scipost/templates/scipost/howto_production.html index 20418321187e5c7fc1ac27db2b5bd44e27d7191c..9a3902fa29e0a14264e0c6a84e0a1b68461555ac 100644 --- a/scipost_django/scipost/templates/scipost/howto_production.html +++ b/scipost_django/scipost/templates/scipost/howto_production.html @@ -89,16 +89,16 @@ urlcolor={blue!80!black} \fancypagestyle{SPtitlepage}{% \fancyhf{} \fancyfoot[C]{\textbf{\thepage}} - \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} + \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://{{ request.get_host }}}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} \chead{} - \rhead{\small \href{https://scipost.org/SciPostPhys.1.1.???}{SciPost Phys. 1, ??? (2016)}} + \rhead{\small \href{https://{{ request.get_host }}/SciPostPhys.1.1.???}{SciPost Phys. 1, ??? (2016)}} \renewcommand{\headrulewidth}{1pt} } \fancypagestyle{SPbulk}{ \fancyhf{} - \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} - \rhead{\small \href{https://scipost.org/SciPostPhys.1.1.???}{SciPost Phys. 1, ??? (2016)}} + \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://{{ request.get_host }}}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} + \rhead{\small \href{https://{{ request.get_host }}/SciPostPhys.1.1.???}{SciPost Phys. 1, ??? (2016)}} \fancyfoot[C]{\textbf{\thepage}} \renewcommand{\headrulewidth}{1pt} } diff --git a/scipost_django/scipost/templates/scipost/index.html b/scipost_django/scipost/templates/scipost/index.html index 663ab8184abdcfdeb107baca25f4c6e575a52bd4..c660c10fb46d806c98aed1baf86cd286bff1858c 100644 --- a/scipost_django/scipost/templates/scipost/index.html +++ b/scipost_django/scipost/templates/scipost/index.html @@ -98,7 +98,7 @@ We invite <a href="{% url 'organizations:organizations' %}">organizations benefitting from SciPost's activities</a> to join our growing <a href="{% url 'sponsors:sponsors' %}">list of Sponsors</a>. Look at our <a href="{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement template</a>. </p> <p> - <strong>Scientists, please help us out:</strong> Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@scipost.org">template</a>. + <strong>Scientists, please help us out:</strong> Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">template</a>. </p> </div> <div class="col-md-4"> diff --git a/scipost_django/scipost/templates/scipost/index2.html b/scipost_django/scipost/templates/scipost/index2.html new file mode 100644 index 0000000000000000000000000000000000000000..bf2ae4076e7343f1b48af9bfd7a30c065b915a7b --- /dev/null +++ b/scipost_django/scipost/templates/scipost/index2.html @@ -0,0 +1,211 @@ +{% extends 'scipost/base.html' %} + +{% load render_bundle from webpack_loader %} +{% load static %} + +{% block navbar %} + {% include 'scipost/navbar2.html' %} +{% endblock %} + +{% block headsup %} + {{ block.super }} + <style> + .sp-swap.htmx-added { + opacity: 0; + } + .sp-swap.htmx-swapping { + opacity: 0; + } + .sp-swap { + opacity: 1; + transition: opacity 1s; + } + </style> +{% endblock %} + +{% block body_class %}{{ block.super }} homepage{% endblock %} + +{% block meta_description %}{{ block.super }} homepage{% endblock meta_description %} +{% block pagetitle %}Homepage{% endblock pagetitle %} + +{% block content %} + + <div class="row gx-4"> + <div class="col-md-8"> + <div class="card"> + <div class="card-header"> + <h1>The Home of Genuine Open Publishing</h1> + </div> + <div class="card-body"> + <p>SciPost is a complete publishing infrastructure serving professional scientists worldwide.</p> + <div class="row g-2"> + <div class="col-lg-6"> + <div class="card"> + <div class="card-header"> + <h3>We implement<br><a href="{% url 'scipost:about' %}#GOA">Genuine Open Access</a></h3> + </div> + <div class="card-body"> + <ul class="list list-unstyled"> + <li>{% include 'bi/check-square.html' %} Community Ownership</li> + <li>{% include 'bi/check-square.html' %} Open Infrastructure</li> + <li>{% include 'bi/check-square.html' %} Copyright to Authors</li> + <li>{% include 'bi/check-square.html' %} Open Access</li> + <li>{% include 'bi/check-square.html' %} Open Citations</li> + <li>{% include 'bi/check-square.html' %} Fee Free</li> + <li>{% include 'bi/check-square.html' %} Non Profit</li> + <li>{% include 'bi/check-square.html' %} Open Finances</li> + <li>{% include 'bi/check-square.html' %} Academic Editing</li> + </ul> + </div> + </div> + </div> + <div class="col-lg-6"> + <div class="card mb-2"> + <div class="card-header"> + <h3>Info</h3> + </div> + <div class="card-body"> + <ul class="list list-unstyled"> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:about' %}">About SciPost</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:foundation' %}">The Foundation</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:FAQ' %}">FAQ</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:contact' %}">Contact us</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'careers:jobopenings' %}">Careers@SciPost</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="https://disc.{{ request.get_host }}" target="_blank" rel="noopener">{% include 'bi/chat-right-text.html' %} Community</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="https://git.{{ request.get_host }}" target="_blank" rel="noopener">{% include 'bi/code-square.html' %} git.{{ request.get_host }}</a></li> + </ul> + </div> + </div> + + {% if not user.is_authenticated %} + <!-- Register --> + <div class="card border border-danger"> + <div class="card-header"> + <h3>Register</h3> + </div> + <div class="card-body"> + <p class="mb-1">Professional scientists (PhD students and above) can become Contributors to SciPost by filling the <a href="{% url 'scipost:register' %}">registration form</a>.</p> + </div><!-- End Register --> + </div> + {% endif %} + </div> + </div> + </div> + </div> + </div> + <div class="col-md-4"> + <h2 class="highlight text-center mt-0">Portals</h2> + <div class="d-flex justify-content-center"> + <div class="btn-group-vertical w-100" role="group"> + {% for branch in branches %} + {% if branch.name != 'Multidisciplinary' and branch.journals.all|length > 0 %} + {% for acad_field in branch.academic_fields.all %} + {% if acad_field.journals.active.all|length > 0 %} + <a type="button" class="btn-primary w-100 m-1 p-2 text-center" href={% url 'scipost:portal' %}?field={{ acad_field.slug }}><strong>{{ acad_field.name }}</strong></a> + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + </div> + </div> + </div> + + </div> + +{% endblock %} + + +{% block content_footer %} + + <div class="container-fluid text-start secondary pt-4 mt-5 border-top border-primary"> + <div class="row"> + <div class="col"> + <h1 class="title"> + News + <button class="btn btn-link btn-sm m-0 mb-1" href="{% url 'scipost:feeds' %}" aria-label="RSS feeds">{% include 'bi/rss-fill.html' %}</button> + </h1> + </div> + <div class="col"> + <a href="{% url 'news:news' %}" class="my-1 float-right">See complete News list</a> + </div> + </div> + + <div class="row g-2"> + <div class="col-md-6"> + <div class="card"> + <div class="card-header"> + <h3>Latest</h3> + </div> + <div class="card-body"> + <h3><a href="{% url 'news:news' %}#news_{{ latest_newsitem.id }}">{{ latest_newsitem.headline }}</a></h3> + <div class="text-muted">{{ latest_newsitem.date|date:'j F Y' }}</div> + <p> + {{ latest_newsitem.blurb_short }} + <br> + <br> + <a href="{% url 'news:news' %}#news_{{ latest_newsitem.id }}" class="my-1">Read more →</a> + </p> + </div> + </div> + </div> + + <div class="col-md-6"> + <div class="card"> + <div class="card-header"> + <h3>Further news</h3> + </div> + <div class="card-body"> + <div id="further-news" class="sp-swap" + hx-get="{% url 'scipost:_hx_news' %}" + hx-trigger="load" + hx-swap="outerHTML swap:1s" + > + </div> + </div> + </div> + </div> + </div> + </div> + + <div class="container-fluid text-start secondary pt-4 mt-5 border-top border-primary"> + <div class="row"> + <div class="col-md-8"> + <h1>Sponsors</h1> + <p> + SciPost guarantees free online access to all publications in all its Journals and does not charge any article processing fees for publishing. Sponsors provide operating funds to SciPost through a cost-slashing consortial model. + </p> + <p> + We invite <a href="{% url 'organizations:organizations' %}">organizations benefitting from SciPost's activities</a> to join our growing <a href="{% url 'sponsors:sponsors' %}">list of Sponsors</a>. Look at our <a href="{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement template</a>. + </p> + <p> + <strong>Scientists, please help us out:</strong> Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">template</a>. + </p> + </div> + <div class="col-md-4"> + <a href="{% url 'sponsors:sponsors' %}">See all sponsors</a> + <br> + <div id="sponsor-logos" class="sp-swap" + hx-get="{% url 'scipost:_hx_sponsors' %}" + hx-trigger="load" + hx-swap="outerHTML swap:1s" + > + </div> + </div> + </div> + + <hr> + + <div hx-get="{% url 'scipost:_hx_participates_in' %}" + hx-trigger="load" + > + </div> + + </div> +{% endblock %} diff --git a/scipost_django/scipost/templates/scipost/index_alt.html b/scipost_django/scipost/templates/scipost/index3.html similarity index 94% rename from scipost_django/scipost/templates/scipost/index_alt.html rename to scipost_django/scipost/templates/scipost/index3.html index 505e36f74f5f58f3ae25e848d0eb277422d462f4..cdb9331079f65ae65a93d650d26c32f8e9daab42 100644 --- a/scipost_django/scipost/templates/scipost/index_alt.html +++ b/scipost_django/scipost/templates/scipost/index3.html @@ -1,9 +1,9 @@ {% extends 'scipost/base.html' %} {% block headsup %} -<link rel="preconnect" href="https://fonts.googleapis.com"> -<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> -<link href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;500;600&display=swap" rel="stylesheet"> + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;500;600&display=swap" rel="stylesheet"> {% endblock headsup %} {% load render_bundle from webpack_loader %} @@ -14,6 +14,10 @@ {% block meta_description %}{{ block.super }} homepage{% endblock meta_description %} {% block pagetitle %}Homepage{% endblock pagetitle %} +{% block navbar %} + {% include 'scipost/navbar2.html' %} +{% endblock %} + {% block content %} <div class="row"> <div class="col-12"> diff --git a/scipost_django/scipost/templates/scipost/navbar.html b/scipost_django/scipost/templates/scipost/navbar.html index 545cd96ff30dbe4a269e05419db3c8ce9ba456d8..a825a9c7bbcddd69da544fb39301b7db648504b4 100644 --- a/scipost_django/scipost/templates/scipost/navbar.html +++ b/scipost_django/scipost/templates/scipost/navbar.html @@ -118,6 +118,9 @@ <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="MoreDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover">More</a> <div class="dropdown-menu" aria-labelledby="MoreDropdown"> + <div class="dropdown-item"> + <a href="{% url 'comments:comments' %}">Comments</a> + </div> <div class="dropdown-item"> <a href="{% url 'commentaries:commentaries' %}">Commentaries</a> </div> diff --git a/scipost_django/scipost/templates/scipost/navbar2.html b/scipost_django/scipost/templates/scipost/navbar2.html new file mode 100644 index 0000000000000000000000000000000000000000..532f259cba19c31430bdf2baa34a37a256101433 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/navbar2.html @@ -0,0 +1,178 @@ +{% load request_filters %} +{% load static %} +{% load scipost_extras %} +{% load journals_extras %} +{% load user_groups %} + +{% is_active_fellow request.user as is_active_fellow %} + + +<nav class="navbar navbar-expand-lg main-nav"> + <div class="container"> + <button class="navbar-toggler p-0 border-0" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar" aria-label="Navbar toggler"> + <span class="navbar-toggler-icon">{% include 'bi/list.html' %}</span> + </button> + <div class="collapse navbar-collapse mt-lg-0 mt-3" id="main-navbar"> + <ul class="navbar-nav me-auto"> + + {% if perms.scipost.can_preview_new_features %} + <li class="nav-item dropdown border border-warning"> + <a class="nav-link dropdown-toggle" href="#" id="HomepagesDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> + <span class="d-none d-lg-inline-block text-warning" aria-hidden="true" style="min-width: 16px;">{% include 'bi/house-fill.html' %}</span> + <span class="d-lg-none d-inline-block text-warning">Homepages</span> + </a> + <div class="dropdown-menu" aria-labelledby="HomepagesDropdown"> + <div class="dropdown-item"> + <a href="{% url 'scipost:index' %}">Current homepage</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:index2' %}">2: home + portal</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:portal2p2' %}">2.2: ----> portal2p2</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:index3' %}">3: homepage, restyled</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:index4' %}">4: home + portal, into one</a> + </div> + </div> + </li> + {% endif %} + + <li class="nav-item{% if request.path == '/home2' %} active{% endif %}"> + <a href="{% url 'scipost:index2' %}" class="nav-link" aria-label="SciPost Home"> + <span class="d-none d-lg-inline-block" aria-hidden="true" style="min-width: 16px;">{% include 'bi/house-fill.html' %}</span> + <span class="d-lg-none d-inline-block">Home</span> + </a> + </li> + + <li class="nav-item{% if 'portal' in request.path %} active{% endif %}"> + <a href="{% url 'scipost:portal' %}" class="nav-link" aria-label="Portal" + data-bs-toggle="tooltip" title="Academic Portal"> + <span class="d-none d-lg-inline-block" aria-hidden="true" style="min-width: 16px;">{% include 'bi/person-workspace.html' %}</span> + <span class="d-lg-none d-inline-block">Academic Portal</span> + </a> + </li> + + + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="AboutDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> + <span class="d-none d-lg-inline-block" aria-hidden="true" style="min-width: 16px;">{% include 'bi/question-square.html' %}</span> + <span class="d-lg-none d-inline-block">About Scipost</span> + </a> + <div class="dropdown-menu" aria-labelledby="AboutDropdown"> + <div class="dropdown-item"> + <a href="{% url 'scipost:contact' %}">Contact us</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:about' %}">About SciPost</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'scipost:foundation' %}">The Foundation</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'careers:jobopenings' %}">Careers@SciPost</a> + </div> + + <div class="dropdown-divider"></div> + + <div class="dropdown-item"> + <a href="{% url 'scipost:FAQ' %}">FAQ</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'news:news' %}">News</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'scipost:feeds' %}">Feeds</a> + </div> + + <div class="dropdown-divider"></div> + + <div class="dropdown-item"> + <a href="{% url 'finances:business_model' %}">Our Business Model</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'organizations:organizations' %}">Organizations<br/><span class="small">benefitting from our activities</span></a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'sponsors:sponsors' %}">Sponsors</a> + </div> + + <div class="dropdown-item"> + <a href="{% url 'finances:finances' %}">Finances</a> + </div> + + </div> + </li> + + </ul> + + <hr class="lg d-lg-none"> + + <ul class="navbar-nav me-0"> + {% if user.is_authenticated %} + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="PersonalDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> + Logged in as {% if user.last_name %}{% if user.contributor %}{{ user.contributor.profile.get_title_display }} {% endif %}{{ user.first_name }} {{ user.last_name }}{% else %}{{ user.username }}{% endif %}</a> + + {% if request.user.contributor and not request.user.contributor.is_currently_available %} + <button type="button" class="btn btn-link p-0 text-warning" data-bs-toggle="tooltip" data-bs-title="You are currently unavailable.<br>Check your availability on your Personal Page if this should not be the case." data-bs-html="true">{% include 'bi/exclamation-triangle-fill.html' %}</button> + + {% endif %} + <div class="dropdown-menu dropdown-menu-right" aria-labelledby="PersonalDropdown"> + {% if user.contributor %} + <div class="dropdown-item"> + <a href="{% url 'scipost:personal_page' %}">Personal Page</a> + </div> + {% if is_active_fellow %} + <div class="dropdown-item"> + <a href="{% url 'submissions:pool' %}">Submissions Pool</a> + </div> + {% endif %} + {% endif %} + {% if perms.scipost.can_view_production %} + <div class="dropdown-item"> + <a href="{% url 'production:production' %}">Production</a> + </div> + {% endif %} + {% if perms.scipost.can_manage_organizations or user.org_contact %} + <div class="dropdown-item"> + <a href="{% url 'organizations:dashboard' %}">Orgs dashboard</a> + </div> + {% endif %} + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'forums:forums' %}">Forums and Meetings</a> + </div> + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'helpdesk:helpdesk' %}">Helpdesk</a> + </div> + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'scipost:logout' %}?next={{ request.path }}">Logout</a> + </div> + </div> + </li> + + <li class="nav-item"> +  <a href="{% url 'helpdesk:ticket_create' %}" target="_blank" class="nav-link"><span style="font-size: 80%;" data-bs-toggle="tooltip" data-bs-html="true" title="Notice something wrong?<br/>Open a support ticket">{% include 'bi/sticky-fill.html' %}</span></a> + </li> + + {% else %} + <li class="nav-item{% if request.path == '/login/' %} active{% endif %}"> + <a class="nav-link" href="{% url 'scipost:login' %}?next={{request.path}}">Login or register</a> + </li> + {% endif %} + </ul> + </div> + </div> +</nav> diff --git a/scipost_django/scipost/templates/scipost/navbar4.html b/scipost_django/scipost/templates/scipost/navbar4.html new file mode 100644 index 0000000000000000000000000000000000000000..7182080cc67925d02095566563a1c67e9c91628b --- /dev/null +++ b/scipost_django/scipost/templates/scipost/navbar4.html @@ -0,0 +1,113 @@ +{% load request_filters %} +{% load static %} +{% load scipost_extras %} +{% load journals_extras %} +{% load user_groups %} + +{% is_active_fellow request.user as is_active_fellow %} + + +<nav class="navbar navbar-expand-lg main-nav"> + <div class="container"> + <button class="navbar-toggler p-0 border-0" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar" aria-label="Navbar toggler"> + <span class="navbar-toggler-icon">{% include 'bi/list.html' %}</span> + </button> + <div class="collapse navbar-collapse mt-lg-0 mt-3" id="main-navbar"> + <ul class="navbar-nav me-auto"> + + {% if perms.scipost.can_preview_new_features %} + <li class="nav-item dropdown border border-warning"> + <a class="nav-link dropdown-toggle" href="#" id="HomepagesDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> + <span class="d-none d-lg-inline-block text-warning" aria-hidden="true" style="min-width: 16px;">{% include 'bi/house-fill.html' %}</span> + <span class="d-lg-none d-inline-block text-warning">Homepages</span> + </a> + <div class="dropdown-menu" aria-labelledby="HomepagesDropdown"> + <div class="dropdown-item"> + <a href="{% url 'scipost:index' %}">Current homepage</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:index2' %}">2: home + portal</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:portal2p2' %}">2.2: ----> portal2p2</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:index3' %}">3: homepage, restyled</a> + </div> + <div class="dropdown-item"> + <a href="{% url 'scipost:index4' %}">4: home + portal, into one</a> + </div> + </div> + </li> + {% endif %} + + <li class="nav-item{% if request.path == '/home4' %} active{% endif %}"> + <a href="{% url 'scipost:index2' %}" class="nav-link" aria-label="SciPost Home"> + <span class="d-none d-lg-inline-block" aria-hidden="true" style="min-width: 16px;">{% include 'bi/house-fill.html' %}</span> + <span class="d-lg-none d-inline-block">Home</span> + </a> + </li> + + </ul> + + <hr class="lg d-lg-none"> + + <ul class="navbar-nav me-0"> + {% if user.is_authenticated %} + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="PersonalDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-trigger="hover"> + Logged in as {% if user.last_name %}{% if user.contributor %}{{ user.contributor.profile.get_title_display }} {% endif %}{{ user.first_name }} {{ user.last_name }}{% else %}{{ user.username }}{% endif %}</a> + + {% if request.user.contributor and not request.user.contributor.is_currently_available %} + <button type="button" class="btn btn-link p-0 text-warning" data-bs-toggle="tooltip" data-bs-title="You are currently unavailable.<br>Check your availability on your Personal Page if this should not be the case." data-bs-html="true">{% include 'bi/exclamation-triangle-fill.html' %}</button> + + {% endif %} + <div class="dropdown-menu dropdown-menu-right" aria-labelledby="PersonalDropdown"> + {% if user.contributor %} + <div class="dropdown-item"> + <a href="{% url 'scipost:personal_page' %}">Personal Page</a> + </div> + {% if is_active_fellow %} + <div class="dropdown-item"> + <a href="{% url 'submissions:pool' %}">Submissions Pool</a> + </div> + {% endif %} + {% endif %} + {% if perms.scipost.can_view_production %} + <div class="dropdown-item"> + <a href="{% url 'production:production' %}">Production</a> + </div> + {% endif %} + {% if perms.scipost.can_manage_organizations or user.org_contact %} + <div class="dropdown-item"> + <a href="{% url 'organizations:dashboard' %}">Orgs dashboard</a> + </div> + {% endif %} + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'forums:forums' %}">Forums and Meetings</a> + </div> + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'helpdesk:helpdesk' %}">Helpdesk</a> + </div> + <div class="dropdown-divider"></div> + <div class="dropdown-item"> + <a href="{% url 'scipost:logout' %}?next={{ request.path }}">Logout</a> + </div> + </div> + </li> + + <li class="nav-item"> +  <a href="{% url 'helpdesk:ticket_create' %}" target="_blank" class="nav-link"><span style="font-size: 80%;" data-bs-toggle="tooltip" data-bs-html="true" title="Notice something wrong?<br/>Open a support ticket">{% include 'bi/sticky-fill.html' %}</span></a> + </li> + + {% else %} + <li class="nav-item{% if request.path == '/login/' %} active{% endif %}"> + <a class="nav-link" href="{% url 'scipost:login' %}?next={{request.path}}">Login or register</a> + </li> + {% endif %} + </ul> + </div> + </div> +</nav> diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_comments.html b/scipost_django/scipost/templates/scipost/portal/_hx_comments.html new file mode 100644 index 0000000000000000000000000000000000000000..1875b2b368c20fc8677262fa1fe72cf5c389aad7 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_comments.html @@ -0,0 +1,32 @@ +{% load crispy_forms_tags %} + +<div class="d-flex justify-content-between"> + <button class="btn btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#commentsSearch" aria-expanded="false" aria-controls="commentsSearch"> + {% include 'bi/search.html' %} Simple search / filter + </button> + <a class="btn btn-outline-primary ms-2" href="{% url 'scipost:search' %}"> + {% include 'bi/binoculars-fill.html' %}... or use our advanced search API {% include 'bi/arrow-right.html' %} + </a> +</div> +<div class="collapse" id="commentsSearch"> + <div class="card card-body"> + <form + hx-post="{% url 'scipost:portal_hx_comments_page' %}?page=1" + hx-trigger="load, keyup delay:500ms, change" + hx-target="#comments-search-results" + hx-indicator="#indicator-comments-search" + > + <div id="comments-search-form">{% crispy comments_search_form %}</div> + </form> + </div> + <div id="indicator-comments-search" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading...</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </div> +</div> + +<h2 class="highlight mb-0">Comments on objects in {{ session_acad_field }}: {% if session_specialty %}{{ session_specialty }}{% else %}(all specialties){% endif %}</h2> + +<ul id="comments-search-results" class="list-unstyled pool-list mt-2"></ul> diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_comments_page.html b/scipost_django/scipost/templates/scipost/portal/_hx_comments_page.html new file mode 100644 index 0000000000000000000000000000000000000000..e6e45ee8ae53e49eb42fa6a4f032760ec03e5d38 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_comments_page.html @@ -0,0 +1,28 @@ +{% for comment in page_obj %} + <li class="list-group-item py-2"> + {% include 'comments/_comment_card_content.html' with comment=comment %} + </li> +{% empty %} + <li class="list-group-item py-2"> + No comments yet + </li> +{% endfor %} +{% if page_obj.has_next %} + <li id="next-comments-{{ page_obj.number }}"> + <button class="btn btn-primary m-2" type="button" + hx-post="{% url 'scipost:portal_hx_comments_page' %}?page={{ page_obj.next_page_number }}" + hx-include="#comments-search-form" + hx-target="#next-comments-{{ page_obj.number }}" + hx-swap="outerHTML" + hx-indicator="#indicator-comments-page-{{ page_obj.number }}" + > + Load page {{ page_obj.next_page_number }} (out of {{ page_obj.paginator.num_pages }}) + </button> + <span id="indicator-comments-page-{{ page_obj.number }}" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading page {{ page_obj.next_page_number }} out of {{ page_obj.paginator.num_pages }}</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </span> + </li> +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_home.html b/scipost_django/scipost/templates/scipost/portal/_hx_home.html new file mode 100644 index 0000000000000000000000000000000000000000..828746c9ca398047748a3b6058b88ee235a471ec --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_home.html @@ -0,0 +1,178 @@ +{% load static %} + +{% block headsup %} + <style> + .sp-swap.htmx-added { + opacity: 0; + } + .sp-swap.htmx-swapping { + opacity: 0; + } + .sp-swap { + opacity: 1; + transition: opacity 1s; + } + </style> +{% endblock %} + +{% block content %} + + <div class="row gx-4"> + <div class="col-md-8"> + <div class="card"> + <div class="card-header"> + <h1>The Home of Genuine Open Publishing</h1> + </div> + <div class="card-body"> + <p>SciPost is a complete publishing infrastructure serving professional scientists worldwide.</p> + <div class="row g-2"> + <div class="col-lg-6"> + <div class="card"> + <div class="card-header"> + <h3>We implement<br><a href="{% url 'scipost:about' %}#GOA">Genuine Open Access</a></h3> + </div> + <div class="card-body"> + <ul class="list list-unstyled"> + <li>{% include 'bi/check-square.html' %} Community Ownership</li> + <li>{% include 'bi/check-square.html' %} Open Infrastructure</li> + <li>{% include 'bi/check-square.html' %} Copyright to Authors</li> + <li>{% include 'bi/check-square.html' %} Open Access</li> + <li>{% include 'bi/check-square.html' %} Open Citations</li> + <li>{% include 'bi/check-square.html' %} Fee Free</li> + <li>{% include 'bi/check-square.html' %} Non Profit</li> + <li>{% include 'bi/check-square.html' %} Open Finances</li> + <li>{% include 'bi/check-square.html' %} Academic Editing</li> + </ul> + </div> + </div> + </div> + <div class="col-lg-6"> + <div class="card mb-2"> + <div class="card-header"> + <h3>Info</h3> + </div> + <div class="card-body"> + <ul class="list list-unstyled"> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:about' %}">About SciPost</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:foundation' %}">The Foundation</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:FAQ' %}">FAQ</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'scipost:contact' %}">Contact us</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="{% url 'careers:jobopenings' %}">Careers@SciPost</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="https://disc.{{ request.get_host }}" target="_blank" rel="noopener">{% include 'bi/chat-right-text.html' %} Community</a></li> + <li>{% include 'bi/arrow-right.html' %} + <a href="https://git.{{ request.get_host }}" target="_blank" rel="noopener">{% include 'bi/code-square.html' %} git.{{ request.get_host }}</a></li> + <li class="mt-4">{% include 'bi/arrow-right.html' %} + <a href="{% url 'finances:business_model' %}">Our Business Model</a></li> + <li class="mt-2">{% include 'bi/arrow-right.html' %} + <a href="{% url 'organizations:organizations' %}">Organizations<br/><span class="small">  benefitting from our activities</span></a></li> + </ul> + + </div> + </div> + + {% if not user.is_authenticated %} + <!-- Register --> + <div class="card border border-danger"> + <div class="card-header"> + <h3>Register</h3> + </div> + <div class="card-body"> + <p class="mb-1">Professional scientists (PhD students and above) can become Contributors to SciPost by filling the <a href="{% url 'scipost:register' %}">registration form</a>.</p> + </div><!-- End Register --> + </div> + {% endif %} + </div> + + <div class="col-lg-12"> + <div class="card"> + <div class="card-header"> + <h1>Sponsors</h1> + </div> + <div class="card-body"> + <div class="row"> + <div class="col"> + <p> + We invite <a href="{% url 'organizations:organizations' %}">organizations benefitting from SciPost's activities</a> to join our growing <a href="{% url 'sponsors:sponsors' %}">list of Sponsors</a>. Look at our <a href="{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement template</a>. + </p> + <p> + <strong>Scientists, please help us out:</strong> Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">template</a>. + </p> + </div> + <div class="col-md-4"> + <a href="{% url 'sponsors:sponsors' %}">See all sponsors</a> + <br> + <div id="sponsor-logos" class="sp-swap" + hx-get="{% url 'scipost:_hx_sponsors' %}" + hx-trigger="load" + hx-swap="outerHTML swap:1s" + > + </div> + </div> + </div> + </div> + </div> + </div> + + <div class="col-lg-12" + hx-get="{% url 'scipost:_hx_participates_in' %}" + hx-trigger="load" + > + </div> + + + + </div> + </div> + </div> + </div> + + + + + <div class="col-md-4"> + <h1 class="title"> + News + <button class="btn btn-link btn-sm m-0 mb-1" href="{% url 'scipost:feeds' %}" aria-label="RSS feeds">{% include 'bi/rss-fill.html' %}</button> + </h1> + <a href="{% url 'news:news' %}" class="my-1 float-right">See complete News list</a> + + <div class="card"> + <div class="card-header"> + <h3>Latest</h3> + </div> + <div class="card-body"> + <h3><a href="{% url 'news:news' %}#news_{{ latest_newsitem.id }}">{{ latest_newsitem.headline }}</a></h3> + <div class="text-muted">{{ latest_newsitem.date|date:'j F Y' }}</div> + <p> + {{ latest_newsitem.blurb_short }} + <br> + <br> + <a href="{% url 'news:news' %}#news_{{ latest_newsitem.id }}" class="my-1">Read more →</a> + </p> + </div> + </div> + + <div class="card"> + <div class="card-header"> + <h3>Further news</h3> + </div> + <div class="card-body"> + <div id="further-news" class="sp-swap" + hx-get="{% url 'scipost:_hx_news' %}" + hx-trigger="load" + hx-swap="outerHTML swap:1s" + > + </div> + </div> + </div> + </div> + + </div> + +{% endblock %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_journals.html b/scipost_django/scipost/templates/scipost/portal/_hx_journals.html new file mode 100644 index 0000000000000000000000000000000000000000..d964fa75a2bea880e7c70c433096651317e506b1 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_journals.html @@ -0,0 +1,70 @@ +{% load static %} +{% load automarkup %} +{% load journals_extras %} +{% load scipost_extras %} + + +{% if session_acad_field %} + + <div class="row"> + {% for journal in session_acad_field.journals %} + {% if journal.active or perms.scipost.can_view_pool %} + <div class="col-md-6 col-lg-4 mb-2" style="{{ journal.style }}"> + <div class="card"> + <div class="card-header {{ journal.doi_label }}"> + <a href="{{ journal.get_absolute_url }}">{{ journal.name }}</a> + {% if journal.has_DOAJ_Seal %} + <a href="https://doaj.org" class="float-end"><img src="{% static 'scipost/images/DOAJ_Seal_logo_big.png' %}" alt="DOAJ Seal" width="20em"></a> + {% endif %} + </div> + <div class="card-body"> + {{ journal.blurb|automarkup }} + </div> + {% if journal.series_set.all|length > 0 %} + <div class="card-footer"> + Series hosted in this Journal: + <ul> + {% for series in journal.series_set.all %} + <li> + <a href="{{ series.get_absolute_url }}" target="_blank">{{ series }}</a> + </li> + {% endfor %} + </ul> + </div> + {% endif %} + </div> + </div> + {% endif %} + {% empty %} + <p> + There are no Journals yet in this branch of academia. + <strong>Help us to get started: nominate potential Fellows by <a href="mailto:admin@{{ request.get_host }}">emailing us</a> with your suggestions!</strong> + </p> + {% endfor %} + +{% else %} + + <h2 class="highlight">Full list of our Journals</h2> + <table class="table table-borderless"> + {% for branch in branches %} + {% for acad_field in branch.academic_fields.all %} + {% if acad_field.journals.active.all|length > 0 %} + <tr> + <td class="align-middle"><strong>{{ acad_field.name }}</strong></td> + <td> + <ul class="list-group m-2"> + {% for journal in acad_field.journals.active.all %} + <li class="list-group-item m-1 px-3 py-2 {{ journal.doi_label }}"> + <a href="{{ journal.get_absolute_url }}">{{ journal.name }}</a> + </li> + {% endfor %} + </ul> + </td> + </tr> + {% endif %} + {% endfor %} + {% endfor %} + </table> + + +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_publications.html b/scipost_django/scipost/templates/scipost/portal/_hx_publications.html new file mode 100644 index 0000000000000000000000000000000000000000..2c115451ab0119f2e19642096c24516e89d332b9 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_publications.html @@ -0,0 +1,60 @@ +{% load static %} +{% load journals_extras %} + +{% load crispy_forms_tags %} + +{% if session_acad_field and not session_acad_field.journals.active|length > 0 %} + <div class="card m-2 border-2"> + <div class="card-header m-0 p-0"> + <h2 class="m-0 p-4 text-white text-center bg-danger">We are not yet active in<br>{{ session_acad_field }}</h2> + </div> + <div class="card-body"> + <h3>Interested in helping us set things up?</h3> + <p> + <a href="mailto:admin@{{ request.get_host }}">Email us</a> + your suggestions for Editorial Fellows. + </p> + </div> + </div> + + <hr> + +{% endif %} + +<div class="d-flex justify-content-between"> + <button class="btn btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#publicationsSearch" aria-expanded="false" aria-controls="publicationsSearch"> + {% include 'bi/search.html' %} Simple search / filter + </button> + <a class="btn btn-outline-primary ms-2" href="{% url 'scipost:search' %}"> + {% include 'bi/binoculars-fill.html' %}... or use our advanced search API {% include 'bi/arrow-right.html' %} + </a> +</div> +<div class="collapse" id="publicationsSearch"> + <div class="card card-body"> + <form + hx-post="{% url 'scipost:portal_hx_publications_page' %}?page=1" + hx-trigger="load, keyup delay:500ms, change" + hx-target="#publications-search-results" + hx-indicator="#indicator-publications-search" + > + <div id="publications-search-form">{% crispy publications_search_form %}</div> + </form> + </div> + <div id="indicator-publications-search" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading...</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </div> +</div> + +<h2 class="highlight mb-0">Publications in {{ session_acad_field }}: {% if session_specialty %}{{ session_specialty }}{% else %}(all specialties){% endif %}</h2> + +<ul id="publications-search-results" class="list-unstyled pool-list mt-2"></ul> + + + +{% block footer_script %} + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/toggle-proceedings.js' %}"> + </script> +{% endblock footer_script %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_publications_page.html b/scipost_django/scipost/templates/scipost/portal/_hx_publications_page.html new file mode 100644 index 0000000000000000000000000000000000000000..b8c14803af161ce74027cb3608ddd286697ccb32 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_publications_page.html @@ -0,0 +1,28 @@ +{% for publication in page_obj %} + <li class="list-group-item py-2"> + {% include 'journals/_publication_li_content.html' with publication=publication %} + </li> +{% empty %} + <li class="list-group-item py-2"> + No publications yet + </li> +{% endfor %} +{% if page_obj.has_next %} + <li id="next-publications-{{ page_obj.number }}"> + <button class="btn btn-primary m-2" type="button" + hx-post="{% url 'scipost:portal_hx_publications_page' %}?page={{ page_obj.next_page_number }}" + hx-include="#publications-search-form" + hx-target="#next-publications-{{ page_obj.number }}" + hx-swap="outerHTML" + hx-indicator="#indicator-publications-page-{{ page_obj.number }}" + > + Load page {{ page_obj.next_page_number }} (out of {{ page_obj.paginator.num_pages }}) + </button> + <span id="indicator-publications-page-{{ page_obj.number }}" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading page {{ page_obj.next_page_number }} out of {{ page_obj.paginator.num_pages }}</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </span> + </li> +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_reports.html b/scipost_django/scipost/templates/scipost/portal/_hx_reports.html new file mode 100644 index 0000000000000000000000000000000000000000..d4eba9664e9818e8f02dd3b553e3fcbc69fbac81 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_reports.html @@ -0,0 +1,32 @@ +{% load crispy_forms_tags %} + +<div class="d-flex justify-content-between"> + <button class="btn btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#reportsSearch" aria-expanded="false" aria-controls="reportsSearch"> + {% include 'bi/search.html' %} Simple search / filter + </button> + <a class="btn btn-outline-primary ms-2" href="{% url 'scipost:search' %}"> + {% include 'bi/binoculars-fill.html' %}... or use our advanced search API {% include 'bi/arrow-right.html' %} + </a> +</div> +<div class="collapse" id="reportsSearch"> + <div class="card card-body"> + <form + hx-post="{% url 'scipost:portal_hx_reports_page' %}?page=1" + hx-trigger="load, keyup delay:500ms, change" + hx-target="#reports-search-results" + hx-indicator="#indicator-reports-search" + > + <div id="reports-search-form">{% crispy reports_search_form %}</div> + </form> + </div> + <div id="indicator-reports-search" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading...</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </div> +</div> + +<h2 class="highlight mb-0">Reports on Submissions in {{ session_acad_field }}: {% if session_specialty %}{{ session_specialty }}{% else %}(all specialties){% endif %}</h2> + +<ul id="reports-search-results" class="list-unstyled pool-list mt-2"></ul> diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_reports_page.html b/scipost_django/scipost/templates/scipost/portal/_hx_reports_page.html new file mode 100644 index 0000000000000000000000000000000000000000..e2ce46301b54f2a034c5234d86b259cd36e2e70e --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_reports_page.html @@ -0,0 +1,28 @@ +{% for report in page_obj %} + <li class="list-group-item py-2"> + {% include 'submissions/_report_li_content.html' with report=report %} + </li> +{% empty %} + <li class="list-group-item py-2"> + No reports yet + </li> +{% endfor %} +{% if page_obj.has_next %} + <li id="next-reports-{{ page_obj.number }}"> + <button class="btn btn-primary m-2" type="button" + hx-post="{% url 'scipost:portal_hx_reports_page' %}?page={{ page_obj.next_page_number }}" + hx-include="#reports-search-form" + hx-target="#next-reports-{{ page_obj.number }}" + hx-swap="outerHTML" + hx-indicator="#indicator-reports-page-{{ page_obj.number }}" + > + Load page {{ page_obj.next_page_number }} (out of {{ page_obj.paginator.num_pages }}) + </button> + <span id="indicator-reports-page-{{ page_obj.number }}" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading page {{ page_obj.next_page_number }} out of {{ page_obj.paginator.num_pages }}</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </span> + </li> +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_submissions.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions.html new file mode 100644 index 0000000000000000000000000000000000000000..84783caef54a60b505b88c88ad8318407fc86495 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_submissions.html @@ -0,0 +1,7 @@ +{% load crispy_forms_tags %} + +{% if reports_needed %} + {% include 'scipost/portal/_hx_submissions_base.html' with form=submissions_search_form name='reports_needed' reports_needed=reports_needed %} +{% else %} + {% include 'scipost/portal/_hx_submissions_base.html' with form=submissions_search_form name='submissions' reports_needed=reports_needed %} +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html new file mode 100644 index 0000000000000000000000000000000000000000..16d0d7e728a17772f5b6b275da68d01f01671286 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html @@ -0,0 +1,50 @@ +{% load journals_extras %} + +{% load crispy_forms_tags %} + +<div class="d-flex justify-content-between"> + <button class="btn btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#{{ name }}Search" aria-expanded="false" aria-controls="{{ name }}Search"> + {% include 'bi/search.html' %} Simple search / filter + </button> + <a class="btn btn-outline-primary ms-2" href="{% url 'scipost:search' %}"> + {% include 'bi/binoculars-fill.html' %}... or use our advanced search API {% include 'bi/arrow-right.html' %} + </a> +</div> +<div class="collapse" id="{{ name }}Search"> + <div class="card card-body"> + <form + hx-post="{% url 'scipost:portal_hx_submissions_page' %}?page=1{% if reports_needed %}&reports_needed=1{% endif %}" + hx-trigger="load, keyup delay:500ms, change" + hx-target="#{{ name }}-search-results" + hx-indicator="#indicator-{{ name }}-search" + > + <div id="{{ name }}-search-form">{% crispy form %}</div> + </form> + </div> + <div id="indicator-{{ name }}-search" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading...</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </div> +</div> + +<h2 class="highlight mb-0">Submissions in {{ session_acad_field }}: {% if session_specialty %}{{ session_specialty }}{% else %}(all specialties){% endif %}</h2> + +{% if reports_needed %} + <div class="card m-2 border-2 text-center"> + <div class="card-header m-0 p-0"> + <h2 class="m-0 p-2 text-white bg-danger"> + {% include 'bi/alarm-fill.html' %} Reports are needed on these Submissions + </h2> + </div> + <div class="card-body"> + <h3>Please consider contributing a Report so we can minimize delays in editorial processing.</h3> + <p>To do so, please navigate to the Submission's page and click on the <strong>Contribute a Report</strong> link {% if not user.is_authenticated %}(login required){% endif %} + </div> + </div> + + <hr> +{% endif %} + +<ul id="{{ name }}-search-results" class="list-unstyled pool-list mt-2"></ul> diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page.html new file mode 100644 index 0000000000000000000000000000000000000000..1c51e184b7f5b857a640286a6bf1d3f05741cffc --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page.html @@ -0,0 +1,5 @@ +{% if reports_needed %} + {% include 'scipost/portal/_hx_submissions_page_base.html' with page_obj=page_obj name='reports_needed' reports_needed=reports_needed %} +{% else %} + {% include 'scipost/portal/_hx_submissions_page_base.html' with page_obj=page_obj name='submissions' reports_needed=reports_needed %} +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page_base.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page_base.html new file mode 100644 index 0000000000000000000000000000000000000000..ad067ee40231f4c6c81991a70706c2b09cb1e59b --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page_base.html @@ -0,0 +1,28 @@ +{% for submission in page_obj %} + <li class="list-group-item py-2"> + {% include 'submissions/_submission_card_content_homepage.html' with submission=submission %} + </li> +{% empty %} + <li class="list-group-item py-2"> + No submissions yet + </li> +{% endfor %} +{% if page_obj.has_next %} + <li id="next-{{ name }}-{{ page_obj.number }}"> + <button class="btn btn-primary m-2" type="button" + hx-post="{% url 'scipost:portal_hx_submissions_page' %}?page={{ page_obj.next_page_number }}{% if reports_needed %}&reports_needed=1{% endif %}" + hx-include="#{{ name }}-search-form" + hx-target="#next-{{ name }}-{{ page_obj.number }}" + hx-swap="outerHTML" + hx-indicator="#indicator-{{ name }}-page-{{ page_obj.number }}" + > + Load page {{ page_obj.next_page_number }} (out of {{ page_obj.paginator.num_pages }}) + </button> + <span id="indicator-{{ name }}-page-{{ page_obj.number }}" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading page {{ page_obj.next_page_number }} out of {{ page_obj.paginator.num_pages }}</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </span> + </li> +{% endif %} diff --git a/scipost_django/scipost/templates/scipost/portal/portal.html b/scipost_django/scipost/templates/scipost/portal/portal.html new file mode 100644 index 0000000000000000000000000000000000000000..99d6d3e53ae8c59e7fa17907b6b409e793e594e3 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/portal.html @@ -0,0 +1,142 @@ +{% extends 'scipost/base.html' %} +{% load static %} + +{% load render_bundle from webpack_loader %} +{% load static %} + +{% block navbar %} + {% include 'scipost/navbar2.html' %} +{% endblock %} + +{% block body_class %}{{ block.super }} homepage{% endblock %} + +{% block meta_description %}{{ block.super }} homepage{% endblock meta_description %} +{% block pagetitle %}Homepage{% endblock pagetitle %} + +{% block header %} + {% include 'scipost/header_with_acad_field_and_spec.html' %} +{% endblock %} + + +{% block content %} + + <ul class="nav nav-pills flex-wrap flex-sm-row mb-3 justify-content-center" + role="tablist"> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="journals-tab" + data-bs-toggle="tab" data-bs-target="#journals" + type="button" role="tab" + aria-controls="journals" aria-selected="true"> + Journals + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link active" id="publications-tab" + data-bs-toggle="tab" data-bs-target="#publications" + type="button" role="tab" + aria-controls="publications" aria-selected="true"> + Publications + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="submissions-tab" + data-bs-toggle="tab" data-bs-target="#submissions" + type="button" role="tab" + aria-controls="submissions" aria-selected="true"> + Submissions + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link border border-warning" id="reports-needed-tab" + data-bs-toggle="tab" data-bs-target="#reports-needed" + type="button" role="tab" + aria-controls="reports-needed" aria-selected="true"> + Reports needed <span class="text-warning">{% include 'bi/exclamation-square-fill.html' %}</span> + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="reports-tab" + data-bs-toggle="tab" data-bs-target="#reports" + type="button" role="tab" + aria-controls="reports" aria-selected="true"> + Reports + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="comments-tab" + data-bs-toggle="tab" data-bs-target="#comments" + type="button" role="tab" + aria-controls="comments" aria-selected="true"> + Comments + </button> + </li> + + </ul> + + <hr> + + <div class="tab-content mt-4" id="portalTabContent"> + + <div class="tab-pane portal-tab fade" id="journals" + role="tabpanel" aria-labelledby="journals-tab"> + <div hx-get="{% url 'scipost:portal_hx_journals' %}" + hx-trigger="click delay:200ms from:#journals-tab, session-acad-field-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade show active" id="publications" + role="tabpanel" aria-labelledby="publications-tab"> + <div hx-get="{% url 'scipost:portal_hx_publications' %}" + hx-trigger="load, click delay:200ms from:#publications-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="submissions" + role="tabpanel" aria-labelledby="submissions-tab"> + <div hx-get="{% url 'scipost:portal_hx_submissions' %}" + hx-trigger="click delay:200ms from:#submissions-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="reports-needed" + role="tabpanel" aria-labelledby="reports-needed-tab"> + <div hx-get="{% url 'scipost:portal_hx_submissions' %}?reports_needed=1" + hx-trigger="click delay:200ms from:#reports-needed-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="reports" + role="tabpanel" aria-labelledby="reports-tab"> + <div hx-get="{% url 'scipost:portal_hx_reports' %}" + hx-trigger="click delay:200ms from:#reports-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="comments" + role="tabpanel" aria-labelledby="comments-tab"> + <div hx-get="{% url 'scipost:portal_hx_comments' %}" + hx-trigger="click delay:200ms from:#comments-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + </div> + +{% endblock %} + +{% block footer_script %} + {{ block.super }} + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/toggle-proceedings.js' %}"> + </script> +{% endblock footer_script %} diff --git a/scipost_django/scipost/templates/scipost/portal/portal2p2.html b/scipost_django/scipost/templates/scipost/portal/portal2p2.html new file mode 100644 index 0000000000000000000000000000000000000000..ec538dadf688b12f6528205c19887b6494bddcb0 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/portal2p2.html @@ -0,0 +1,158 @@ +{% extends 'scipost/base.html' %} +{% load static %} + +{% load render_bundle from webpack_loader %} +{% load static %} + +{% block navbar %} + {% include 'scipost/navbar2.html' %} +{% endblock %} + +{% block body_class %}{{ block.super }} homepage{% endblock %} + +{% block meta_description %}{{ block.super }} homepage{% endblock meta_description %} +{% block pagetitle %}Homepage{% endblock pagetitle %} + +{% block header %} + {% include 'scipost/header_with_acad_field_and_spec2p2.html' %} +{% endblock %} + + +{% block content %} + + + <div class="row"> + <div class="col-lg-3"> + <ul class="list list-unstyled list-horizontal text-center"> + <li class="list-item"> + <a class="btn text-white" style="background-color: #338844;" + href="{% url 'submissions:submit_manuscript' %}"> + Submit a paper + </a> + </li> + </ul> + </div> + + <div class="col-lg-9"> + <ul class="nav nav-pills flex-wrap flex-sm-row mb-3 justify-content-center" + role="tablist"> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="journals-tab" + data-bs-toggle="tab" data-bs-target="#journals" + type="button" role="tab" + aria-controls="journals" aria-selected="true"> + Journals + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link active" id="publications-tab" + data-bs-toggle="tab" data-bs-target="#publications" + type="button" role="tab" + aria-controls="publications" aria-selected="true"> + Publications + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="submissions-tab" + data-bs-toggle="tab" data-bs-target="#submissions" + type="button" role="tab" + aria-controls="submissions" aria-selected="true"> + Submissions + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link border border-warning" id="reports-needed-tab" + data-bs-toggle="tab" data-bs-target="#reports-needed" + type="button" role="tab" + aria-controls="reports-needed" aria-selected="true"> + Reports needed <span class="text-warning">{% include 'bi/exclamation-square-fill.html' %}</span> + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="reports-tab" + data-bs-toggle="tab" data-bs-target="#reports" + type="button" role="tab" + aria-controls="reports" aria-selected="true"> + Reports + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="comments-tab" + data-bs-toggle="tab" data-bs-target="#comments" + type="button" role="tab" + aria-controls="comments" aria-selected="true"> + Comments + </button> + </li> + + </ul> + </div> + </div> + + <hr> + + <div class="tab-content mt-4" id="portalTabContent"> + + <div class="tab-pane portal-tab fade" id="journals" + role="tabpanel" aria-labelledby="journals-tab"> + <div hx-get="{% url 'scipost:portal_hx_journals' %}" + hx-trigger="click delay:200ms from:#journals-tab, session-acad-field-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade show active" id="publications" + role="tabpanel" aria-labelledby="publications-tab"> + <div hx-get="{% url 'scipost:portal_hx_publications' %}" + hx-trigger="load, click delay:200ms from:#publications-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="submissions" + role="tabpanel" aria-labelledby="submissions-tab"> + <div hx-get="{% url 'scipost:portal_hx_submissions' %}" + hx-trigger="click delay:200ms from:#submissions-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="reports-needed" + role="tabpanel" aria-labelledby="reports-needed-tab"> + <div hx-get="{% url 'scipost:portal_hx_submissions' %}?reports_needed=1" + hx-trigger="click delay:200ms from:#reports-needed-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="reports" + role="tabpanel" aria-labelledby="reports-tab"> + <div hx-get="{% url 'scipost:portal_hx_reports' %}" + hx-trigger="click delay:200ms from:#reports-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="comments" + role="tabpanel" aria-labelledby="comments-tab"> + <div hx-get="{% url 'scipost:portal_hx_comments' %}" + hx-trigger="click delay:200ms from:#comments-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + </div> + +{% endblock %} + +{% block footer_script %} + {{ block.super }} + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/toggle-proceedings.js' %}"> + </script> +{% endblock footer_script %} diff --git a/scipost_django/scipost/templates/scipost/portal/portal4.html b/scipost_django/scipost/templates/scipost/portal/portal4.html new file mode 100644 index 0000000000000000000000000000000000000000..82b354c1b0c1beec90c67b219a1e0b3342d742a5 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/portal/portal4.html @@ -0,0 +1,170 @@ +{% extends 'scipost/base.html' %} +{% load static %} + +{% load render_bundle from webpack_loader %} +{% load static %} + +{% block navbar %} + {% include 'scipost/navbar4.html' %} +{% endblock %} + +{% block body_class %}{{ block.super }} homepage{% endblock %} + +{% block meta_description %}{{ block.super }} homepage{% endblock meta_description %} +{% block pagetitle %}Homepage{% endblock pagetitle %} + +{% block header %} + {% include 'scipost/header_with_acad_field_and_spec2p2.html' %} +{% endblock %} + + +{% block content %} + + + <ul class="nav nav-pills flex-wrap flex-sm-row mb-3 justify-content-center" + id="portal-tablist" + role="tablist"> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="home-tab" + data-bs-toggle="tab" data-bs-target="#home" + type="button" role="tab" + aria-controls="home" aria-selected="true"> + Home + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="journals-tab" + data-bs-toggle="tab" data-bs-target="#journals" + type="button" role="tab" + aria-controls="journals" aria-selected="true"> + Journals + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link active" id="publications-tab" + data-bs-toggle="tab" data-bs-target="#publications" + type="button" role="tab" + aria-controls="publications" aria-selected="true"> + Publications + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="submissions-tab" + data-bs-toggle="tab" data-bs-target="#submissions" + type="button" role="tab" + aria-controls="submissions" aria-selected="true"> + Submissions + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link border border-warning" id="reports-needed-tab" + data-bs-toggle="tab" data-bs-target="#reports-needed" + type="button" role="tab" + aria-controls="reports-needed" aria-selected="true"> + Reports needed <span class="text-warning">{% include 'bi/exclamation-square-fill.html' %}</span> + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="reports-tab" + data-bs-toggle="tab" data-bs-target="#reports" + type="button" role="tab" + aria-controls="reports" aria-selected="true"> + Reports + </button> + </li> + + <li class="nav-item" role="presentation"> + <button class="nav-link" id="comments-tab" + data-bs-toggle="tab" data-bs-target="#comments" + type="button" role="tab" + aria-controls="comments" aria-selected="true"> + Comments + </button> + </li> + + <li class="nav-item" role="presentation"> + <a class="btn btn-outline-success border-2 ms-4" + href="{% url 'submissions:submit_manuscript' %}"> + {% include 'bi/arrow-right.html' %}<strong>Submit</strong> + </a> + </li> + + </ul> + + <hr> + + <div class="tab-content mt-4" id="portalTabContent"> + + <div class="tab-pane portal-tab fade" id="home" + role="tabpanel" aria-labelledby="home-tab"> + <div hx-get="{% url 'scipost:portal_hx_home' %}" + hx-trigger="click delay:200ms from:#home-tab" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="journals" + role="tabpanel" aria-labelledby="journals-tab"> + <div hx-get="{% url 'scipost:portal_hx_journals' %}" + hx-trigger="click delay:200ms from:#journals-tab, session-acad-field-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade show active" id="publications" + role="tabpanel" aria-labelledby="publications-tab"> + <div hx-get="{% url 'scipost:portal_hx_publications' %}" + hx-trigger="load, click delay:200ms from:#publications-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="submissions" + role="tabpanel" aria-labelledby="submissions-tab"> + <div hx-get="{% url 'scipost:portal_hx_submissions' %}" + hx-trigger="click delay:200ms from:#submissions-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="reports-needed" + role="tabpanel" aria-labelledby="reports-needed-tab"> + <div hx-get="{% url 'scipost:portal_hx_submissions' %}?reports_needed=1" + hx-trigger="click delay:200ms from:#reports-needed-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="reports" + role="tabpanel" aria-labelledby="reports-tab"> + <div hx-get="{% url 'scipost:portal_hx_reports' %}" + hx-trigger="click delay:200ms from:#reports-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + <div class="tab-pane portal-tab fade" id="comments" + role="tabpanel" aria-labelledby="comments-tab"> + <div hx-get="{% url 'scipost:portal_hx_comments' %}" + hx-trigger="click delay:200ms from:#comments-tab, session-acad-field-set from:body, session-specialty-set from:body" + > + </div> + </div> + + </div> + +{% endblock %} + +{% block footer_script %} + {{ block.super }} + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/toggle-proceedings.js' %}"> + </script> + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/toggle-header-forms.js' %}"> + </script> +{% endblock footer_script %} diff --git a/scipost_django/scipost/templates/scipost/quick_tour.html b/scipost_django/scipost/templates/scipost/quick_tour.html index 219238038923d2de6af387c696b47c7afcee0db2..efa73e9142c254faeeba6120ca7fbd177f54cce4 100644 --- a/scipost_django/scipost/templates/scipost/quick_tour.html +++ b/scipost_django/scipost/templates/scipost/quick_tour.html @@ -19,7 +19,7 @@ <h2 class="highlight">SciPost in bullet points</h2> <ul> <li>Share on <a href="http://www.arxiv.org">arXiv</a>, - publish in <a href="https://scipost.org">SciPost</a></li> + publish in <a href="https://{{ request.get_host }}{% url 'scipost:index' %}">SciPost</a></li> <li>high-quality two-way open access peer-reviewed journals</li> <li>commentaries on existing literature</li> <li>links to theses, with searchable abstracts database</li> diff --git a/scipost_django/scipost/templates/scipost/terms_and_conditions.html b/scipost_django/scipost/templates/scipost/terms_and_conditions.html index 51da0868fd4837e423bc95efc28398e4001ee95c..19cc0ca9549112be20a854f1f8ddc30320c5a357 100644 --- a/scipost_django/scipost/templates/scipost/terms_and_conditions.html +++ b/scipost_django/scipost/templates/scipost/terms_and_conditions.html @@ -25,39 +25,39 @@ <div class="row"> <div class="col-12"> <h2>General</h2> - <p>The SciPost Foundation, Inc. (Stichting SciPost, hereafter "SciPost") is a nonprofit charitable organization dedicated to developing, implementing and maintaining innovative forms of electronic scientific communication and publishing. The SciPost Foundation operates the SciPost.org interactive online portal for the benefit of the international scientific community and further interested parties. SciPost offers the use of the scipost.org portal free of charge to the general public. Access to and use of the sites is provided by SciPost subject to the following Terms and Conditions, which are a contract between SciPost and you. Use of the scipost.org portal constitutes your acceptance of these Terms and Conditions. If you do not accept these Terms and Conditions in full, you do not have permission to access and use the scipost.org sites and should cease doing so immediately.</p> + <p>The SciPost Foundation, Inc. (Stichting SciPost, hereafter "SciPost") is a nonprofit charitable organization dedicated to developing, implementing and maintaining innovative forms of electronic scientific communication and publishing. The SciPost Foundation operates the {{ request.get_host }} interactive online portal for the benefit of the international scientific community and further interested parties. SciPost offers the use of the {{ request.get_host }} portal free of charge to the general public. Access to and use of the sites is provided by SciPost subject to the following Terms and Conditions, which are a contract between SciPost and you. Use of the {{ request.get_host }} portal constitutes your acceptance of these Terms and Conditions. If you do not accept these Terms and Conditions in full, you do not have permission to access and use the {{ request.get_host }} sites and should cease doing so immediately.</p> <h2>Ownership</h2> - <p>The scipost.org portal, the underlying software, content and trademarks used on or in connection with the scipost.org portal are owned by Stichting SciPost or its licensors, and are subject to international intellectual property rights and laws. Nothing contained herein shall be construed as conferring by implication, or otherwise any license or right under any trademark, copyright or patent of SciPost or any other third party and all rights are reserved, except as explicitly stated in these Terms and Conditions.</p> + <p>The {{ request.get_host }} portal, the underlying software, content and trademarks used on or in connection with the {{ request.get_host }} portal are owned by Stichting SciPost or its licensors, and are subject to international intellectual property rights and laws. Nothing contained herein shall be construed as conferring by implication, or otherwise any license or right under any trademark, copyright or patent of SciPost or any other third party and all rights are reserved, except as explicitly stated in these Terms and Conditions.</p> <h2>License to use Journal Articles, Submissions, Commentaries, Thesis Links and Related Content</h2> - <p>Unless otherwise indicated, the journal articles and all other online content published by SciPost on the scipost.org portal are licensed under the <a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International (CC BY 4.0) License</a>. This means that you are free to use, reproduce and distribute the articles and related content (unless otherwise noted), for commercial and noncommercial purposes, subject to the citation of the original source in accordance with the CC-BY license, section 3a.</p> + <p>Unless otherwise indicated, the journal articles and all other online content published by SciPost on the {{ request.get_host }} portal are licensed under the <a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International (CC BY 4.0) License</a>. This means that you are free to use, reproduce and distribute the articles and related content (unless otherwise noted), for commercial and noncommercial purposes, subject to the citation of the original source in accordance with the CC-BY license, section 3a.</p> <h2>Contributions</h2> <p>All contributions to SciPost will be scanned for plagiarism. In their own interests, contributors should avoid any dubious cases. All forms of contributions (submissions, reports, comments, etc) must give proper citations to any works referred to. It is the responsibility of the Contributor to ensure compliance with any relevant licenses applicable to the cited works.</p> <h2>Impermissible Uses</h2> - <p>You agree to use the scipost.org portal only for lawful purposes, and in a manner that does not infringe the rights of, or restrict or inhibit the use of the scipost.org portal by any third party. Such restriction or inhibition includes, without limitation, conduct which is unlawful, or which may harass or cause distress or inconvenience to any person and the transmission of obscene or offensive content or disruption of normal flow of dialogue within the portal. As a condition to your use of the scipost.org portal, you agree not to:</p> + <p>You agree to use the {{ request.get_host }} portal only for lawful purposes, and in a manner that does not infringe the rights of, or restrict or inhibit the use of the {{ request.get_host }} portal by any third party. Such restriction or inhibition includes, without limitation, conduct which is unlawful, or which may harass or cause distress or inconvenience to any person and the transmission of obscene or offensive content or disruption of normal flow of dialogue within the portal. As a condition to your use of the {{ request.get_host }} portal, you agree not to:</p> <ul> <li>upload, post, email, transmit or otherwise make available any information, materials, or other content that is illegal, harmful, threatening, abusive, harassing, defamatory, obscene, pornographic, or offensive; or that infringes another's rights, including any intellectual property rights;</li> <li>impersonate any person or entity or falsely state or otherwise misrepresent your affiliation with a person or entity; or obtain, collect, store, or modify personal information about other users;</li> - <li>upload, post, email, transmit, or otherwise make available to any user on the scipost.org portal any unsolicited or unauthorized advertising, promotional materials, 'junk mail', 'spam', 'chain letters', 'pyramid schemes', or any other form of solicitation;</li> - <li>modify, adapt, or hack the scipost.org portal or falsely imply that some other site is associated with SciPost; or</li> - <li>use the scipost.org portal for any illegal or unauthorized purpose. You must not, in the use of the scipost.org portal, violate any Dutch laws or laws in your jurisdicition (including but not limited to copyright laws);</li> - <li>use the scipost.org portal in violation with the nationally and internationally accepted standards for scientific conduct as stated in the Netherlands Code of Conduct for Scientific Practice (Association of Universities in the Netherlands).</li> + <li>upload, post, email, transmit, or otherwise make available to any user on the {{ request.get_host }} portal any unsolicited or unauthorized advertising, promotional materials, 'junk mail', 'spam', 'chain letters', 'pyramid schemes', or any other form of solicitation;</li> + <li>modify, adapt, or hack the {{ request.get_host }} portal or falsely imply that some other site is associated with SciPost; or</li> + <li>use the {{ request.get_host }} portal for any illegal or unauthorized purpose. You must not, in the use of the {{ request.get_host }} portal, violate any Dutch laws or laws in your jurisdicition (including but not limited to copyright laws);</li> + <li>use the {{ request.get_host }} portal in violation with the nationally and internationally accepted standards for scientific conduct as stated in the Netherlands Code of Conduct for Scientific Practice (Association of Universities in the Netherlands).</li> </ul> <h2>Suspension of Use/Violation of these Terms and Conditions</h2> - <p>SciPost reserves the right to limit, suspend, or terminate your access and use of the scipost.org portal at any time without notice. SciPost reserves the right to investigate and prosecute violations of any of these Terms and Conditions to the fullest extend of the law. SciPost may involve and cooperate with law enforcement authorities in prosecuting users who violate these Terms and Conditions. You acknowledge that SciPost has no obligation to pre-screen or monitor your access to or use of the scipost.org portal, but has a right to do so. You hereby agree that SciPost may, in the exercise of SciPost's sole discretion, remove or delete any entries, information, materials or other content that violates these Terms and Conditions or that is otherwise objectionable.</p> + <p>SciPost reserves the right to limit, suspend, or terminate your access and use of the {{ request.get_host }} portal at any time without notice. SciPost reserves the right to investigate and prosecute violations of any of these Terms and Conditions to the fullest extend of the law. SciPost may involve and cooperate with law enforcement authorities in prosecuting users who violate these Terms and Conditions. You acknowledge that SciPost has no obligation to pre-screen or monitor your access to or use of the {{ request.get_host }} portal, but has a right to do so. You hereby agree that SciPost may, in the exercise of SciPost's sole discretion, remove or delete any entries, information, materials or other content that violates these Terms and Conditions or that is otherwise objectionable.</p> <h2>Disclaimer of Warranty</h2> - <p>The scipost.org portal, including, without limitation, the SciPost software, the SciPost APIs and the content on the scipost.org portal (e.g. the articles, submissions, commentaries, comments, information, data, names, images, pictures, logos and icons), whether belonging to SciPost or a third party, are provided 'AS IS' and on an 'AS AVAILABLE' basis without any representation or endorsement made and without warranty of any kind whether express or implied, including but not limited to ANY implied warranties of satisfactory quality, merchantability, fitness for a particular purpose, non-infringement, compatibility, security, completeness and accuracy. SciPost, its directors, officers, employees, agents and funders (collectively the 'SciPost Parties'), its software vendors, developers or other consultants working on the scipost.org portal do not warrant that the scipost.org portal will be uninterrupted or error free, that defects will be corrected, or that the scipost.org portal or the server that makes it available are free of viruses or bugs or represents the full functionality, accuracy and reliability of the materials.</p> + <p>The {{ request.get_host }} portal, including, without limitation, the SciPost software, the SciPost APIs and the content on the {{ request.get_host }} portal (e.g. the articles, submissions, commentaries, comments, information, data, names, images, pictures, logos and icons), whether belonging to SciPost or a third party, are provided 'AS IS' and on an 'AS AVAILABLE' basis without any representation or endorsement made and without warranty of any kind whether express or implied, including but not limited to ANY implied warranties of satisfactory quality, merchantability, fitness for a particular purpose, non-infringement, compatibility, security, completeness and accuracy. SciPost, its directors, officers, employees, agents and funders (collectively the 'SciPost Parties'), its software vendors, developers or other consultants working on the {{ request.get_host }} portal do not warrant that the {{ request.get_host }} portal will be uninterrupted or error free, that defects will be corrected, or that the {{ request.get_host }} portal or the server that makes it available are free of viruses or bugs or represents the full functionality, accuracy and reliability of the materials.</p> <h2>Limitation of Liability</h2> - <p>To the fullest extent permitted by law, in no event will the SciPost Parties, the software vendors, developers or other consultants working on the scipost.org portal be liable for any losses, damages, liabilities, costs or claims including, without limitation, direct, indirect, punative or consequential damages, and loss of use, data or profits, arising out of or in connection with the use of the scipost.org portal, the underlying software, or any content on the scipost.org portal or linked sources, whether in action of contract, negligence or otherwise. </p> + <p>To the fullest extent permitted by law, in no event will the SciPost Parties, the software vendors, developers or other consultants working on the {{ request.get_host }} portal be liable for any losses, damages, liabilities, costs or claims including, without limitation, direct, indirect, punative or consequential damages, and loss of use, data or profits, arising out of or in connection with the use of the {{ request.get_host }} portal, the underlying software, or any content on the {{ request.get_host }} portal or linked sources, whether in action of contract, negligence or otherwise. </p> <h2>Indemnity</h2> - <p>You are solely responsible for your actions in connection with the scipost.org portal and any internet costs incurred in accessing the sites. You agree to indemnify and hold harmless, and at SciPost's option defend, the SciPost Parties, the software vendors, developers, consultants or other persons working on the scipost.org portal from and against any liability, damage, loss, cost or expenses (including reasonable attorney's fees) in connection with your use of the scipost.org portal, including, without limitation, the underlying software and content on the scipost.org portal, and the results of any action you may take based on the material contained herein, and from any consequences of the following:</p> + <p>You are solely responsible for your actions in connection with the {{ request.get_host }} portal and any internet costs incurred in accessing the sites. You agree to indemnify and hold harmless, and at SciPost's option defend, the SciPost Parties, the software vendors, developers, consultants or other persons working on the {{ request.get_host }} portal from and against any liability, damage, loss, cost or expenses (including reasonable attorney's fees) in connection with your use of the {{ request.get_host }} portal, including, without limitation, the underlying software and content on the {{ request.get_host }} portal, and the results of any action you may take based on the material contained herein, and from any consequences of the following:</p> <ul> <li>your failure to comply with any of these Terms and Conditions;</li> <li>unlawful disclosure of alteration of or interference of whatsoever nature by any person with the content of any transmission by you or on your behalf by means of a public telecommunication system or of information concerning such transmission or the use made of such system by any person; and</li> @@ -68,25 +68,25 @@ <p>SciPost respects the privacy of its users and is committed to the protection of personal information as described in our Privacy Policy. You confirm that you have read and accept our <a href="{% url 'scipost:privacy_policy' %}">Privacy Policy</a>.</p> <h2>Interactive Features</h2> - <p>In the course of using the scipost.org portal, you may provide us with feedback, including but not limited to suggestions, observations, errors, problems, and defects regarding the scipost.org portal (collectively 'Feedback') as well as comments on site contents ('Comments'). You hereby grand SciPost a worldwide, irrevocable, perpetual, royalty-free, transferable, and sub-licensable, non-exclusive right to use, copy, modify, distribute, display, perform, create derivative works from and otherwise exploit all such Feedback and Comments. All such Feedback and Comments shall comply with these Terms and Conditions generally and in particular the restrictions in Impermissible Uses above. In addition, content provided by authors for submission shall be subject to the Author Guide and Policies.</p> + <p>In the course of using the {{ request.get_host }} portal, you may provide us with feedback, including but not limited to suggestions, observations, errors, problems, and defects regarding the {{ request.get_host }} portal (collectively 'Feedback') as well as comments on site contents ('Comments'). You hereby grand SciPost a worldwide, irrevocable, perpetual, royalty-free, transferable, and sub-licensable, non-exclusive right to use, copy, modify, distribute, display, perform, create derivative works from and otherwise exploit all such Feedback and Comments. All such Feedback and Comments shall comply with these Terms and Conditions generally and in particular the restrictions in Impermissible Uses above. In addition, content provided by authors for submission shall be subject to the Author Guide and Policies.</p> <h2>Infringement</h2> - <p>If you believe that your work has been copied in a way that constitutes copyright infringement or your intellectual property rights have otherwise been violated, please notify <a href="mailto:admin@scipost.org">admin@scipost.org.</a></p> + <p>If you believe that your work has been copied in a way that constitutes copyright infringement or your intellectual property rights have otherwise been violated, please notify <a href="mailto:admin@{{ request.get_host }}">admin@{{ request.get_host }}.</a></p> <h2>Links to Other Websites and Resources</h2> - <p>The scipost.org portal provides links to other websites and resources. Because SciPost has no control over such sites and resources, you acknowledge and agree that SciPost is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any materials on or available from such sites or resources. Your business dealings with any such external sites or resources including payment and delivery of related goods or services, and any warranties, conditions or other terms associated with such dealings, are solely between you and such third party. You further acknowledge and agree that the SciPost Parties shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any contents, goods, or services available on or through any such site or resource.</p> + <p>The {{ request.get_host }} portal provides links to other websites and resources. Because SciPost has no control over such sites and resources, you acknowledge and agree that SciPost is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any materials on or available from such sites or resources. Your business dealings with any such external sites or resources including payment and delivery of related goods or services, and any warranties, conditions or other terms associated with such dealings, are solely between you and such third party. You further acknowledge and agree that the SciPost Parties shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any contents, goods, or services available on or through any such site or resource.</p> - <h2>Modification to scipost.org Portal and Terms and Conditions</h2> - <p>SciPost reserves the right to modify or discontinue, temporarily or permanently, any part of the scipost.org portal with or without notice at any time. SciPost reserves the right to change these Terms and Conditions at any time by posting changes online. You are responsible for reviewing regularly information posted online to obtain timely notice of such changes. Your continued use of the scipost.org portal after changes are posted constitutes your acceptance of this agreement as modified by the posted changes.</p> + <h2>Modification to {{ request.get_host }} Portal and Terms and Conditions</h2> + <p>SciPost reserves the right to modify or discontinue, temporarily or permanently, any part of the {{ request.get_host }} portal with or without notice at any time. SciPost reserves the right to change these Terms and Conditions at any time by posting changes online. You are responsible for reviewing regularly information posted online to obtain timely notice of such changes. Your continued use of the {{ request.get_host }} portal after changes are posted constitutes your acceptance of this agreement as modified by the posted changes.</p> <h2>Additional Terms for Certain Features</h2> - <p>Certain parts of the scipost.org portal are subject to registration and additional conditions which will be made available to you to read at the time of registration. Those terms and conditions are incorporated herein. If there is any conflict between these Terms and Conditions and/or specific terms and conditions appearing elsewhere on the scipost.org portal relating to specific material then the latter shall prevail. When registering, you are required to select a password. You are solely responsible for maintaining the confidentiality of your password, and any activity taken under your password. You are required to notify SciPost immediately of any known or suspected unauthorized use of your account or password and take reasonable steps to stop such use.</p> + <p>Certain parts of the {{ request.get_host }} portal are subject to registration and additional conditions which will be made available to you to read at the time of registration. Those terms and conditions are incorporated herein. If there is any conflict between these Terms and Conditions and/or specific terms and conditions appearing elsewhere on the {{ request.get_host }} portal relating to specific material then the latter shall prevail. When registering, you are required to select a password. You are solely responsible for maintaining the confidentiality of your password, and any activity taken under your password. You are required to notify SciPost immediately of any known or suspected unauthorized use of your account or password and take reasonable steps to stop such use.</p> <h2>General</h2> - <p>Any forbearance or indulgence by SciPost in enforcing any provision in these Terms and Conditions shall not affect SciPost's right of enforcement and any waiver of any breach shall not operate as a waiver of any subsequent or continuing breach. If any of these Terms and Conditions should be determined to be illegal, invalid or otherwise unenforceable by reason of the laws of any state or country in which these Terms and Conditions are intended to be effective, then to the extent and within the jurisdiction which that Term and Condition is illegal, invalid or unenforceable, it shall be severed and deleted from the clause and the remaining terms and conditions shall survive, remain in full force and effect and continue to be binding an enforceable. These Terms and Conditions shall be governed by and construed in accordance with laws of the Netherlands, without regard to its conflict of law principles. Disputes arising here from shall be exclusively subject to the jurisdiction of the courts of the Netherlands. If there is any conflict between these Terms and Conditions and/or specific terms appearing elsewhere on the scipost.org portal relating to specific material then the latter shall prevail.</p> + <p>Any forbearance or indulgence by SciPost in enforcing any provision in these Terms and Conditions shall not affect SciPost's right of enforcement and any waiver of any breach shall not operate as a waiver of any subsequent or continuing breach. If any of these Terms and Conditions should be determined to be illegal, invalid or otherwise unenforceable by reason of the laws of any state or country in which these Terms and Conditions are intended to be effective, then to the extent and within the jurisdiction which that Term and Condition is illegal, invalid or unenforceable, it shall be severed and deleted from the clause and the remaining terms and conditions shall survive, remain in full force and effect and continue to be binding an enforceable. These Terms and Conditions shall be governed by and construed in accordance with laws of the Netherlands, without regard to its conflict of law principles. Disputes arising here from shall be exclusively subject to the jurisdiction of the courts of the Netherlands. If there is any conflict between these Terms and Conditions and/or specific terms appearing elsewhere on the {{ request.get_host }} portal relating to specific material then the latter shall prevail.</p> <h2>Questions and Comments</h2> - <p>If you have any questions or comments about these Terms and Conditions, please contact <a href="mailto:admin@scipost.org">admin@scipost.org</a>.</p> + <p>If you have any questions or comments about these Terms and Conditions, please contact <a href="mailto:admin@{{ request.get_host }}">admin@{{ request.get_host }}</a>.</p> </div> </div> diff --git a/scipost_django/scipost/templatetags/scipost_extras.py b/scipost_django/scipost/templatetags/scipost_extras.py index f5ab4569ad37d662c82f2104a747a8dcdd64000e..2a220a0e602c348f732e8979355fa3ae3c5f7a56 100644 --- a/scipost_django/scipost/templatetags/scipost_extras.py +++ b/scipost_django/scipost/templatetags/scipost_extras.py @@ -2,6 +2,8 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +import random + from django import template from django.contrib.contenttypes.models import ContentType @@ -54,6 +56,17 @@ def content_type_id(obj): return ContentType.objects.get_for_model(obj).id +@register.filter(name='increment_dt') +def increment_dt(dt): + try: + delta = abs(int(dt)) + if delta >= 4: + return random.randint(delta, int(1.25*delta)) + except: + pass + return random.randint(4, 8) + + ####################### # For scipost objects # ####################### diff --git a/scipost_django/scipost/tests/test_views.py b/scipost_django/scipost/tests/test_views.py index 43bc25ceec14b94450ceab3dd82e2f0b3df8b769..b1606372230a13fa0bc1ad062f582c6eeb23a3ba 100644 --- a/scipost_django/scipost/tests/test_views.py +++ b/scipost_django/scipost/tests/test_views.py @@ -97,27 +97,6 @@ class VetCommentaryRequestsTest(TestCase): self.assertTrue(type(response.context['commentary_to_vet']) is Commentary) -class BrowseCommentariesTest(TestCase): - """Test cases for `browse` view.""" - - def setUp(self): - add_groups_and_permissions() - CommentaryFactory() - self.view_url = reverse('commentaries:browse', kwargs={ - 'nrweeksback': '1' - }) - - def test_response_list(self): - '''Test if the browse view is passing commentaries to anoymous users.''' - response = self.client.get(self.view_url) - self.assertEqual(response.status_code, 200) - - # The created vetted Commentary is found! - self.assertTrue(response.context['commentary_list'].count() >= 1) - # The search form is passed trough the view... - self.assertTrue(type(response.context['form']) is CommentarySearchForm) - - class CommentaryDetailTest(TestCase): def setUp(self): diff --git a/scipost_django/scipost/urls.py b/scipost_django/scipost/urls.py index b04286927580cbf80b1b2829044afbf99e67f93f..d84ad60bc50f36fabb3396f14622c3cf5a149201 100644 --- a/scipost_django/scipost/urls.py +++ b/scipost_django/scipost/urls.py @@ -29,12 +29,19 @@ app_name = 'scipost' urlpatterns = [ # redirect for favicon - re_path(r'^favicon\.ico$', favicon_view), + path( + 'favicon\.ico', + favicon_view + ), # Utilities: # Test Sentry installation - url(r'sentry-debug/$', views.trigger_error, name='trigger_error'), + path( + 'sentry-debug/', + views.trigger_error, + name='trigger_error' + ), # Autocomplete path( @@ -49,76 +56,258 @@ urlpatterns = [ ), # Search - url(r'^search_old$', views.SearchView.as_view(), name='search_old'), - url( - r'^search$', + path( + 'search_old', + views.SearchView.as_view(), + name='search_old' + ), + path( + 'search', TemplateView.as_view(template_name='search/search.html'), name='search' ), - url(r'^$', views.index, name='index'), - url(r'^home_alt/$', views.index_alt, name='index-alt'), - url(r'^files/secure/(?P<path>.*)$', views.protected_serve, name='secure_file'), + + # Homepage + path( + '', + views.index, + name='index' + ), + + path( + 'home2', + views.index2, + name='index2' + ), + path( + 'home3', + views.index3, name='index3' + ), + path( + 'home4', + views.index4, name='index4' + ), + + # Portal + path( + 'portal', + views.portal, + name='portal' + ), + path( + 'portal2p2', + views.portal2p2, + name='portal2p2' + ), + + # HTMX-delivered fragments + path( + 'portal/_hx_home', + views.portal_hx_home, + name='portal_hx_home' + ), + path( + 'portal/_hx_journals', + TemplateView.as_view(template_name='scipost/portal/_hx_journals.html'), + name='portal_hx_journals' + ), + path( + 'portal/_hx_publications', + views.portal_hx_publications, + name='portal_hx_publications' + ), + path( + 'portal/_hx_publications_page', + views.portal_hx_publications_page, + name='portal_hx_publications_page' + ), + path( + 'portal/_hx_submissions', + views.portal_hx_submissions, + name='portal_hx_submissions' + ), + path( + 'portal/_hx_submissions_page', + views.portal_hx_submissions_page, + name='portal_hx_submissions_page' + ), + path( + 'portal/_hx_reports', + views.portal_hx_reports, + name='portal_hx_reports' + ), + path( + 'portal/_hx_reports_page', + views.portal_hx_reports_page, + name='portal_hx_reports_page' + ), + path( + 'portal/_hx_comments', + views.portal_hx_comments, + name='portal_hx_comments' + ), + path( + 'portal/_hx_comments_page', + views.portal_hx_comments_page, + name='portal_hx_comments_page' + ), + path( + '_hx_news', + views._hx_news, + name='_hx_news' + ), + path( + '_hx_participates_in', + TemplateView.as_view(template_name='scipost/_hx_participates_in.html'), + name='_hx_participates_in' + ), + path( + '_hx_sponsors', + views._hx_sponsors, + name='_hx_sponsors' + ), + + path( + 'files/secure/<path:path>', + views.protected_serve, + name='secure_file' + ), # General use pages - url(r'^error$', TemplateView.as_view(template_name='scipost/error.html'), name='error'), - url(r'^acknowledgement$', TemplateView.as_view(template_name='scipost/acknowledgement.html'), - name='acknowledgement'), + path( + 'error', + TemplateView.as_view( + template_name='scipost/error.html'), + name='error' + ), + path( + 'acknowledgement', + TemplateView.as_view( + template_name='scipost/acknowledgement.html'), + name='acknowledgement' + ), # Info - url(r'^about$', TemplateView.as_view(template_name='scipost/about.html'), name='about'), + path( + 'about', + TemplateView.as_view( + template_name='scipost/about.html'), + name='about' + ), path( 'contact', TemplateView.as_view(template_name='scipost/contact.html'), name='contact' ), - url(r'^call$', TemplateView.as_view(template_name='scipost/call.html'), name='call'), - url(r'^donations/thank-you/$', TemplateView.as_view(template_name='scipost/donation_thank_you.html'), name='donation_thank_you'), - url( - r'^ExpSustDrive2018$', + path( + 'call', + TemplateView.as_view( + template_name='scipost/call.html'), + name='call' + ), + path( + 'donations/thank-you/', + TemplateView.as_view( + template_name='scipost/donation_thank_you.html'), + name='donation_thank_you' + ), + path( + 'ExpSustDrive2018', TemplateView.as_view(template_name='scipost/ExpSustDrive2018.html'), name='ExpSustDrive2018' ), - url( - r'^PlanSciPost$', + path( + 'PlanSciPost', TemplateView.as_view(template_name='scipost/PlanSciPost.html'), name='PlanSciPost' ), - url(r'^foundation$', TemplateView.as_view(template_name='scipost/foundation.html'), - name='foundation'), - url(r'^tour$', TemplateView.as_view(template_name='scipost/quick_tour.html'), - name='quick_tour'), - url(r'^FAQ$', TemplateView.as_view(template_name='scipost/FAQ.html'), name='FAQ'), - url(r'^terms_and_conditions$', + path( + 'foundation', + TemplateView.as_view(template_name='scipost/foundation.html'), + name='foundation' + ), + path( + 'tour', + TemplateView.as_view(template_name='scipost/quick_tour.html'), + name='quick_tour' + ), + path( + 'FAQ', + TemplateView.as_view(template_name='scipost/FAQ.html'), + name='FAQ' + ), + path( + 'terms_and_conditions', TemplateView.as_view(template_name='scipost/terms_and_conditions.html'), - name='terms_and_conditions'), - url(r'^privacy_policy$', TemplateView.as_view(template_name='scipost/privacy_policy.html'), - name='privacy_policy'), + name='terms_and_conditions' + ), + path( + 'privacy_policy', + TemplateView.as_view(template_name='scipost/privacy_policy.html'), + name='privacy_policy' + ), # Feeds - url(r'^feeds$', views.feeds, name='feeds'), - url(r'^rss/news/$', LatestNewsFeedRSS(), name='feeds_rss_news'), - url(r'^atom/news/$', LatestNewsFeedAtom(), name='feeds_atom_news'), - url(r'^rss/comments/$', LatestCommentsFeedRSS(), name='feeds_rss_comments'), - url(r'^atom/comments/$', LatestCommentsFeedAtom(), name='feeds_atom_comments'), - url(r'^rss/submissions/$', LatestSubmissionsFeedRSS(), name='feeds_rss_submissions'), + path( + 'feeds', + views.feeds, + name='feeds' + ), + path( + 'rss/news/', + LatestNewsFeedRSS(), + name='feeds_rss_news' + ), + path( + 'atom/news/', + LatestNewsFeedAtom(), + name='feeds_atom_news' + ), + path( + 'rss/comments/', + LatestCommentsFeedRSS(), + name='feeds_rss_comments' + ), + path( + 'atom/comments/', + LatestCommentsFeedAtom(), + name='feeds_atom_comments' + ), + path( + 'rss/submissions/', + LatestSubmissionsFeedRSS(), + name='feeds_rss_submissions' + ), path( 'rss/submissions/<specialty:specialty>', LatestSubmissionsFeedRSS(), name='sub_feed_spec_rss' ), - url(r'^atom/submissions/$', LatestSubmissionsFeedAtom(), name='feeds_atom_submissions'), + path( + 'atom/submissions/', + LatestSubmissionsFeedAtom(), + name='feeds_atom_submissions' + ), path( 'atom/submissions/<specialty:specialty>', LatestSubmissionsFeedAtom(), name='sub_feed_spec_atom' ), - url(r'^rss/publications/$', LatestPublicationsFeedRSS(), name='feeds_rss_publications'), + path( + 'rss/publications/', + LatestPublicationsFeedRSS(), + name='feeds_rss_publications' + ), path( 'rss/publications/<specialty:specialty>', LatestPublicationsFeedRSS(), name='pub_feed_spec_rss' ), - url(r'^atom/publications/$', LatestPublicationsFeedAtom(), name='feeds_atom_publications'), + path( + 'atom/publications/', + LatestPublicationsFeedAtom(), + name='feeds_atom_publications' + ), path( 'atom/publications/<specialty:specialty>', LatestPublicationsFeedAtom(), @@ -131,54 +320,90 @@ urlpatterns = [ ################ # Contributor info (public view) - url(r'^contributor/(?P<contributor_id>[0-9]+)$', views.contributor_info, - name="contributor_info"), + path( + 'contributor/<int:contributor_id>', + views.contributor_info, + name='contributor_info' + ), # Registration - url(r'^register$', views.register, name='register'), - url(r'^thanks_for_registering$', - TemplateView.as_view(template_name='scipost/thanks_for_registering.html'), - name='thanks_for_registering'), - url(r'^activation/(?P<contributor_id>[0-9]+)/(?P<key>.+)/$', - views.activation, name='activation'), - url(r'^activation/(?P<contributor_id>[0-9]+)/(?P<key>.+)/renew$', - views.request_new_activation_link, name='request_new_activation_link'), - url(r'^unsubscribe/(?P<contributor_id>[0-9]+)/(?P<key>.+)$', views.unsubscribe, - name='unsubscribe'), - url(r'^vet_registration_requests$', - views.vet_registration_requests, name='vet_registration_requests'), - url(r'^vet_registration_request_ack/(?P<contributor_id>[0-9]+)$', - views.vet_registration_request_ack, name='vet_registration_request_ack'), - url(r'^registration_requests$', views.registration_requests, name="registration_requests"), - url(r'^registration_requests/(?P<contributor_id>[0-9]+)/reset$', - views.registration_requests_reset, name="registration_requests_reset"), + path( + 'register', + views.register, + name='register' + ), + path( + 'thanks_for_registering', + TemplateView.as_view( + template_name='scipost/thanks_for_registering.html'), + name='thanks_for_registering' + ), + path( + 'activation/<int:contributor_id>/<str:key>/', + views.activation, + name='activation' + ), + path( + 'activation/<int:contributor_id>/<str:key>/renew', + views.request_new_activation_link, + name='request_new_activation_link' + ), + path( + 'unsubscribe/<int:contributor_id>/<str:key>', + views.unsubscribe, + name='unsubscribe' + ), + path( + 'vet_registration_requests', + views.vet_registration_requests, + name='vet_registration_requests' + ), + path( + 'vet_registration_request_ack/<int:contributor_id>', + views.vet_registration_request_ack, + name='vet_registration_request_ack' + ), + path( + 'registration_requests', + views.registration_requests, + name='registration_requests' + ), + path( + 'registration_requests/<int:contributor_id>/reset', + views.registration_requests_reset, + name='registration_requests_reset' + ), # Registration invitations (Never change this route! Thank you.) - url(r'^invitation/(?P<key>.+)$', views.invitation, name='invitation'), + path( + 'invitation/<str:key>', + views.invitation, + name='invitation' + ), # Authentication - url( - r'^login/$', + path( + 'login/', views.SciPostLoginView.as_view(), name='login' ), - url( - r'^login/info/$', + path( + 'login/info/', views.raw_user_auth_info, name='login_info' ), - url( - r'^logout/$', + path( + 'logout/', views.SciPostLogoutView.as_view(), name='logout' ), - url( - r'^password_change$', + path( + 'password_change', views.SciPostPasswordChangeView.as_view(), name='password_change' ), - url( - r'^password_reset/$', + path( + 'password_reset/', views.SciPostPasswordResetView.as_view(), name='password_reset' ), @@ -187,10 +412,26 @@ urlpatterns = [ views.SciPostPasswordResetConfirmView.as_view(), name='password_reset_confirm' ), - url(r'^update_personal_data$', views.update_personal_data, name='update_personal_data'), - url(r'^totp/$', views.TOTPListView.as_view(), name='totp'), - url(r'^totp/create$', views.TOTPDeviceCreateView.as_view(), name='totp_create'), - url(r'^totp/(?P<device_id>[0-9]+)/delete$', views.TOTPDeviceDeleteView.as_view(), name='totp_delete'), + path( + 'update_personal_data', + views.update_personal_data, + name='update_personal_data' + ), + path( + 'totp/', + views.TOTPListView.as_view(), + name='totp' + ), + path( + 'totp/create', + views.TOTPDeviceCreateView.as_view(), + name='totp_create' + ), + path( + 'totp/<int:device_id>/delete', + views.TOTPDeviceDeleteView.as_view(), + name='totp_delete' + ), # Single sign-on [for GitLab: see api/urls] path( @@ -200,128 +441,232 @@ urlpatterns = [ ), # Personal Page - url(r'^personal_page/$', views.personal_page, name='personal_page'), - url(r'^personal_page/account$', views.personal_page, - name='personal_page_account', kwargs={'tab': 'account'}), - url(r'^personal_page/admin_actions$', views.personal_page, - name='personal_page_admin_actions', kwargs={'tab': 'admin_actions'}), - url(r'^personal_page/editorial_actions$', views.personal_page, - name='personal_page_editorial_actions', kwargs={'tab': 'editorial_actions'}), - url(r'^personal_page/refereeing$', views.personal_page, - name='personal_page_refereeing', kwargs={'tab': 'refereeing'}), - url(r'^personal_page/publications$', views.personal_page, - name='personal_page_publications', kwargs={'tab': 'publications'}), - url(r'^personal_page/submissions$', views.personal_page, - name='personal_page_submissions', kwargs={'tab': 'submissions'}), - url(r'^personal_page/commentaries$', views.personal_page, - name='personal_page_commentaries', kwargs={'tab': 'commentaries'}), - url(r'^personal_page/theses$', views.personal_page, - name='personal_page_theses', kwargs={'tab': 'theses'}), - url(r'^personal_page/comments$', views.personal_page, - name='personal_page_comments', kwargs={'tab': 'comments'}), - url(r'^personal_page/author_replies$', views.personal_page, - name='personal_page_author_replies', kwargs={'tab': 'author_replies'}), + path( + 'personal_page/', + views.personal_page, + name='personal_page' + ), + path( + 'personal_page/account', + views.personal_page, + name='personal_page_account', kwargs={'tab': 'account'} + ), + path( + 'personal_page/admin_actions', + views.personal_page, + name='personal_page_admin_actions', kwargs={'tab': 'admin_actions'} + ), + path( + 'personal_page/editorial_actions', + views.personal_page, + name='personal_page_editorial_actions', kwargs={'tab': 'editorial_actions'} + ), + path( + 'personal_page/refereeing', + views.personal_page, + name='personal_page_refereeing', kwargs={'tab': 'refereeing'} + ), + path( + 'personal_page/publications', + views.personal_page, + name='personal_page_publications', kwargs={'tab': 'publications'} + ), + path( + 'personal_page/submissions', + views.personal_page, + name='personal_page_submissions', kwargs={'tab': 'submissions'} + ), + path( + 'personal_page/commentaries', + views.personal_page, + name='personal_page_commentaries', kwargs={'tab': 'commentaries'} + ), + path( + 'personal_page/theses', + views.personal_page, + name='personal_page_theses', kwargs={'tab': 'theses'} + ), + path( + 'personal_page/comments', + views.personal_page, + name='personal_page_comments', kwargs={'tab': 'comments'} + ), + path( + 'personal_page/author_replies', + views.personal_page, + name='personal_page_author_replies', kwargs={'tab': 'author_replies'} + ), # Unavailabilities - url(r'^unavailable_period$', views.mark_unavailable_period, name='mark_unavailable_period'), - url(r'^unavailable_period/(?P<period_id>[0-9]+)/delete$', views.delete_unavailable_period, - name='delete_unavailable_period'), + path( + 'unavailable_period', + views.mark_unavailable_period, + name='mark_unavailable_period' + ), + path( + 'unavailable_period/<int:period_id>/delete', + views.delete_unavailable_period, + name='delete_unavailable_period' + ), # Authorship claims - url(r'^claim_authorships$', views.claim_authorships, name="claim_authorships"), - url(r'^claim_sub_authorship/(?P<submission_id>[0-9]+)/(?P<claim>[0-1])$', - views.claim_sub_authorship, name='claim_sub_authorship'), - url(r'^claim_com_authorship/(?P<commentary_id>[0-9]+)/(?P<claim>[0-1])$', - views.claim_com_authorship, name='claim_com_authorship'), - url(r'^claim_thesis_authorship/(?P<thesis_id>[0-9]+)/(?P<claim>[0-1])$', - views.claim_thesis_authorship, name='claim_thesis_authorship'), - url(r'^vet_authorship_claims$', views.vet_authorship_claims, name="vet_authorship_claims"), - url(r'^vet_authorship_claim/(?P<claim_id>[0-9]+)/(?P<claim>[0-1])$', - views.vet_authorship_claim, name='vet_authorship_claim'), + path( + 'claim_authorships', + views.claim_authorships, + name='claim_authorships' + ), + path( + 'claim_sub_authorship/<int:submission_id>/<int:claim>', + views.claim_sub_authorship, + name='claim_sub_authorship' + ), + path( + 'claim_com_authorship/<int:commentary_id>/<int:claim>', + views.claim_com_authorship, + name='claim_com_authorship' + ), + path( + 'claim_thesis_authorship/<int:thesis_id>/<int:claim>', + views.claim_thesis_authorship, + name='claim_thesis_authorship' + ), + path( + 'vet_authorship_claims', + views.vet_authorship_claims, + name='vet_authorship_claims' + ), + path( + 'vet_authorship_claim/<int:claim_id>/<int:claim>', + views.vet_authorship_claim, + name='vet_authorship_claim' + ), # Potential duplicates - url(r'contributor_duplicates/$', + path( + 'contributor_duplicates/', views.ContributorDuplicateListView.as_view(), - name='contributor_duplicates'), - url(r'contributor_merge/$', + name='contributor_duplicates' + ), + path( + 'contributor_merge/', views.contributor_merge, - name='contributor_merge'), + name='contributor_merge' + ), #################### # Email facilities # #################### - url('^email_group_members$', views.email_group_members, name='email_group_members'), - url('^email_particular$', views.email_particular, name='email_particular'), - url('^send_precooked_email$', views.send_precooked_email, name='send_precooked_email'), + path( + 'email_group_members', + views.email_group_members, + name='email_group_members' + ), + path( + 'email_particular', + views.email_particular, + name='email_particular' + ), + path( + 'send_precooked_email', + views.send_precooked_email, + name='send_precooked_email' + ), ##################### # Editorial College # ##################### - url(r'^EdCol_by-laws$', views.EdCol_bylaws, name='EdCol_by-laws'), - url(r'^EdCol_by-laws_Changes_2021_04$', views.EdCol_bylaws_Changes_2021_04, name='EdCol_by-laws_Changes_2021_04'), + path( + 'EdCol_by-laws', + views.EdCol_bylaws, + name='EdCol_by-laws' + ), + path( + 'EdCol_by-laws_Changes_2021_04', + views.EdCol_bylaws_Changes_2021_04, + name='EdCol_by-laws_Changes_2021_04' + ), ################ # Publications # ################ # Reports - url(r'^(?P<doi_label>SciPost.Report.[0-9]+)$', - journals_views.report_detail, - name='report_detail'), - url(r'^10.21468/(?P<doi_label>SciPost.Report.[0-9]+)$', + path( + '<report_doi_label:doi_label>', journals_views.report_detail, - name='report_detail'), + name='report_detail' + ), # Comments - url(r'^(?P<doi_label>SciPost.Comment.[0-9]+)$', - journals_views.comment_detail, - name='comment_detail'), - url(r'^10.21468/(?P<doi_label>SciPost.Comment.[0-9]+)$', + path( + '<comment_doi_label:doi_label>', journals_views.comment_detail, - name='comment_detail'), + name='comment_detail' + ), # Author Replies - url(r'^(?P<doi_label>SciPost.AuthorReply.[0-9]+)$', - journals_views.author_reply_detail, - name='author_reply_detail'), - url(r'^10.21468/(?P<doi_label>SciPost.AuthorReply.[0-9]+)$', + path( + '<author_reply_doi_label:doi_label>', journals_views.author_reply_detail, - name='author_reply_detail'), + name='author_reply_detail' + ), # Publication detail (+pdf) - url(r'^10.21468/{pattern}$'.format(pattern=DOI_DISPATCH_PATTERN), - journals_views.doi_dispatch, name='doi_dispatch'), - url(r'^{pattern}$'.format(pattern=DOI_DISPATCH_PATTERN), - journals_views.doi_dispatch, name='doi_dispatch'), - url(r'^10.21468/(?P<doi_label>{regex})$'.format(regex=PUBLICATION_DOI_LABEL_REGEX), + re_path( + '^10.21468/{pattern}$'.format(pattern=DOI_DISPATCH_PATTERN), + journals_views.doi_dispatch, + name='doi_dispatch' + ), + re_path( + '^{pattern}$'.format(pattern=DOI_DISPATCH_PATTERN), + journals_views.doi_dispatch, + name='doi_dispatch' + ), + path( + '10.21468/<publication_doi_label:doi_label>', journals_views.publication_detail, - name='publication_detail'), - url(r'^(?P<doi_label>{regex})$'.format(regex=PUBLICATION_DOI_LABEL_REGEX), + name='publication_detail' + ), + path( + '<publication_doi_label:doi_label>', journals_views.publication_detail, - name='publication_detail'), - url(r'^10.21468/(?P<doi_label>{regex})/pdf$'.format(regex=PUBLICATION_DOI_LABEL_REGEX), + name='publication_detail' + ), + path( + '10.21468/<publication_doi_label:doi_label>/pdf', journals_views.publication_detail_pdf, - name='publication_pdf'), - url(r'^(?P<doi_label>{regex})/pdf$'.format(regex=PUBLICATION_DOI_LABEL_REGEX), + name='publication_pdf' + ), + path( + '<publication_doi_label:doi_label>/pdf', journals_views.publication_detail_pdf, - name='publication_pdf'), + name='publication_pdf' + ), # Publication updates - url(r'^(?P<doi_label>{regex})-update-(?P<update_nr>[0-9]+)$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + path( + '<publication_doi_label:doi_label>-update-<int:update_nr>', journals_views.publication_update_detail, - name='publication_update_detail'), - url(r'^10.21468/(?P<doi_label>{regex})-update-(?P<update_nr>[0-9]+)$'.format( - regex=PUBLICATION_DOI_LABEL_REGEX), + name='publication_update_detail' + ), + path( + '10.21468/<publication_doi_label:doi_label>-update-<int:update_nr>', journals_views.publication_update_detail, - name='publication_update_detail'), + name='publication_update_detail' + ), # Journal issue - url(r'^10.21468/(?P<doi_label>{regex})$'.format(regex=ISSUE_DOI_LABEL_REGEX), - journals_views.issue_detail, name='issue_detail'), - url(r'^(?P<doi_label>{regex})$'.format(regex=ISSUE_DOI_LABEL_REGEX), - journals_views.issue_detail, name='issue_detail'), + path( + '10.21468/<issue_doi_label:doi_label>', + journals_views.issue_detail, + name='issue_detail' + ), + path( + '<issue_doi_label:doi_label>', + journals_views.issue_detail, + name='issue_detail' + ), # Journal landing page path( @@ -345,23 +690,25 @@ urlpatterns = [ # Howto guides # ################ - url(r'^howto$', + path( + 'howto', TemplateView.as_view(template_name='scipost/howto.html'), - name='howto'), - url(r'^howto/production$', + name='howto' + ), + path( + 'howto/production', TemplateView.as_view(template_name='scipost/howto_production.html'), - name='howto_production'), - - # Temporary fix, due to mails sent with wrong urls - url(r'^decline_ref_invitation/(?P<invitation_key>.+)$', - submission_views.decline_ref_invitation), + name='howto_production' + ), ######################## - # Pawning verification # + # Pwning verification # ######################## - url(r'^have-i-been-pwned-verification.txt$', + path( + 'have-i-been-pwned-verification.txt', views.have_i_been_pwned, - name='have_i_been_pwned'), + name='have_i_been_pwned' + ), ] diff --git a/scipost_django/scipost/utils.py b/scipost_django/scipost/utils.py index bf1363f3f80be061100bd36eb6db80db2159feac..af1d77832a39732fbabe3ab7a2f0fc570823eb46 100644 --- a/scipost_django/scipost/utils.py +++ b/scipost_django/scipost/utils.py @@ -2,6 +2,9 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +from django.contrib.sites.models import Site +domain = Site.objects.get_current().domain + from common.utils import BaseMailUtil @@ -9,9 +12,7 @@ def build_absolute_uri_using_site(path): """ In cases where request is not available, build absolute uri from Sites framework. """ - from django.contrib.sites.models import Site - site = Site.objects.get_current() - return 'https://{domain}{path}'.format(domain=site.domain, path=path) + return 'https://{domain}{path}'.format(domain=domain, path=path) SCIPOST_SUMMARY_FOOTER = ( @@ -25,10 +26,10 @@ SCIPOST_SUMMARY_FOOTER = ( 'means of commenting on all existing literature. SciPost is established as ' 'a not-for-profit foundation devoted to serving the interests of the ' 'international scientific community.' - '\n\nThe site is anchored at https://scipost.org. Many further details ' + f'\n\nThe site is anchored at https://{domain}. Many further details ' 'about SciPost, its principles, ideals and implementation can be found at ' - 'https://scipost.org/about and https://scipost.org/FAQ.\n' - 'Professional scientists can register at https://scipost.org/register.' + f'https://{domain}/about and https://{domain}/FAQ.\n' + f'Professional scientists can register at https://{domain}/register.' ) SCIPOST_SUMMARY_FOOTER_HTML = ( @@ -42,42 +43,42 @@ SCIPOST_SUMMARY_FOOTER_HTML = ( 'means of commenting on all existing literature. SciPost is established as ' 'a not-for-profit foundation devoted to serving the interests of the ' 'international scientific community.</p>' - '<p>The site is anchored at https://scipost.org. Many further details ' + f'<p>The site is anchored at https://{domain}. Many further details ' 'about SciPost, its principles, ideals and implementation can be found at ' - 'https://scipost.org/about and https://scipost.org/FAQ.\n' - 'Professional scientists can register at https://scipost.org/register.</p>' + f'https://{domain}/about and https://{domain}/FAQ.\n' + f'Professional scientists can register at https://{domain}/register.</p>' ) EMAIL_FOOTER = ( '\n{% load static %}' - '<a href="https://scipost.org"><img src="{% static ' - '\'scipost/images/logo_scipost_with_bgd_small.png\' %}" width="64px"></a><br/>' + f'<a href="https://{domain}">' + '<img src="{% static \'scipost/images/logo_scipost_with_bgd_small.png\' %}" width="64px"></a><br/>' '<div style="background-color: #f0f0f0; color: #002B49; align-items: center;">' '<div style="display: inline-block; padding: 8px;">' - '<a href="https://scipost.org/journals/">Journals</a></div>' + f'<a href="https://{domain}/journals/">Journals</a></div>' '<div style="display: inline-block; padding: 8px;">' - '<a href="https://scipost.org/submissions/">Submissions</a></div>' + f'<a href="https://{domain}/submissions/">Submissions</a></div>' '<div style="display: inline-block; padding: 8px;">' - '<a href="https://scipost.org/commentaries/">Commentaries</a></div>' + f'<a href="https://{domain}/commentaries/">Commentaries</a></div>' '<div style="display: inline-block; padding: 8px;">' - '<a href="https://scipost.org/theses/">Theses</a></div>' + f'<a href="https://{domain}/theses/">Theses</a></div>' '<div style="display: inline-block; padding: 8px;">' - '<a href="https://scipost.org/login/">Login</a></div>' + f'<a href="https://{domain}/login/">Login</a></div>' '</div>' ) EMAIL_UNSUBSCRIBE_LINK_PLAIN = ( '\n\nDon\'t want to receive such emails? Unsubscribe by ' - 'updating your personal data at https://scipost.org/update_personal_data.' + f'updating your personal data at https://{domain}/update_personal_data.' ) EMAIL_UNSUBSCRIBE_LINK_HTML = ( '\n\n<p style="font-size: 10px;">Don\'t want to receive such emails? Unsubscribe by ' - '<a href="https://scipost.org/update_personal_data">updating your personal data</a>.</p>' + f'<a href="https://{domain}/update_personal_data">updating your personal data</a>.</p>' ) class Utils(BaseMailUtil): - mail_sender = 'registration@scipost.org' + mail_sender = f'registration@{domain}' mail_sender_title = 'SciPost registration' diff --git a/scipost_django/scipost/views.py b/scipost_django/scipost/views.py index 6e98414435c1a82a00d1f066b872a0d694334044..29ad453cfee659f5b6bcb707811e744543f89d3a 100644 --- a/scipost_django/scipost/views.py +++ b/scipost_django/scipost/views.py @@ -17,6 +17,7 @@ from django.contrib.auth.views import ( LoginView, LogoutView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView) from django.contrib.messages.views import SuccessMessageMixin +from django.contrib.sites.models import Site from django.core import mail from django.core.exceptions import PermissionDenied from django.core.mail import EmailMessage, EmailMultiAlternatives @@ -55,9 +56,11 @@ from .utils import EMAIL_FOOTER, SCIPOST_SUMMARY_FOOTER, SCIPOST_SUMMARY_FOOTER_ from colleges.permissions import fellowship_or_admin_required from commentaries.models import Commentary from comments.models import Comment +from comments.forms import CommentSearchForm from invitations.constants import STATUS_REGISTERED from invitations.models import RegistrationInvitation from journals.models import Journal, Publication, PublicationAuthorsTable +from journals.forms import PublicationSearchForm from mails.utils import DirectMailUtil from news.models import NewsItem from organizations.decorators import has_contact @@ -65,6 +68,7 @@ from organizations.models import Organization, Contact from organizations.forms import UpdateContactDataForm from profiles.models import Profile from submissions.models import Submission, RefereeInvitation, Report, EICRecommendation +from submissions.forms import SubmissionSearchForm, ReportSearchForm from theses.models import ThesisLink @@ -173,12 +177,240 @@ def index(request): return render(request, 'scipost/index.html', context) -def index_alt(request): +@permission_required('scipost.can_preview_new_features', return_403=True) +def index2(request): """Homepage view of SciPost.""" - if not request.user.is_authenticated or not request.user.is_superuser: - # Only superusers may get to see secure files without an explicit serve method! - raise Http404 + if NewsItem.objects.homepage().exists(): + latest_newsitem = NewsItem.objects.homepage().order_by('-date').first() + else: + latest_newsitem = NewsItem.objects.none() + context = { + 'latest_newsitem': latest_newsitem + } + return render(request, 'scipost/index2.html', context) + + +@permission_required('scipost.can_preview_new_features', return_403=True) +def index4(request): + if request.GET.get('field', None): + request.session['session_acad_field_slug'] = request.GET.get('field', None) + request.session['session_specialty_slug'] = '' + return render(request, 'scipost/portal/portal4.html') + +@permission_required('scipost.can_preview_new_features', return_403=True) +def portal(request): + """ + Academic portal entryway. + """ + if request.GET.get('field', None): + request.session['session_acad_field_slug'] = request.GET.get('field', None) + request.session['session_specialty_slug'] = '' + return render(request, 'scipost/portal/portal.html') + + +@permission_required('scipost.can_preview_new_features', return_403=True) +def portal2p2(request): + """ + Academic portal entryway. + """ + if request.GET.get('field', None): + request.session['session_acad_field_slug'] = request.GET.get('field', None) + request.session['session_specialty_slug'] = '' + return render(request, 'scipost/portal/portal2p2.html') + + +def portal_hx_home(request): + """Homepage view of SciPost.""" + if NewsItem.objects.homepage().exists(): + latest_newsitem = NewsItem.objects.homepage().order_by('-date').first() + else: + latest_newsitem = NewsItem.objects.none() + context = { + 'latest_newsitem': latest_newsitem + } + return render(request, 'scipost/portal/_hx_home.html', context) + + +def portal_hx_publications(request): + form = PublicationSearchForm( + acad_field_slug=request.session.get('session_acad_field_slug', None), + specialty_slug=request.session.get('session_specialty_slug', None) + ) + context = { + 'publications_search_form': form + } + return render(request, 'scipost/portal/_hx_publications.html', context) + + +def portal_hx_publications_page(request): + session_acad_field_slug = request.session.get('session_acad_field_slug', None) + session_specialty_slug = request.session.get('session_specialty_slug', None) + form = PublicationSearchForm( + request.POST or None, + acad_field_slug=session_acad_field_slug, + specialty_slug=session_specialty_slug, + ) + if form.is_valid(): + publications = form.search_results() + else: + publications = Publication.objects.published() + if session_acad_field_slug and session_acad_field_slug != 'all': + publications = publications.filter(acad_field__slug=session_acad_field_slug) + if session_specialty_slug: + publications = publications.filter(specialties__slug=session_specialty_slug) + paginator = Paginator(publications, 10) + page_nr = request.GET.get('page') + page_obj = paginator.get_page(page_nr) + context = { 'page_obj': page_obj } + return render(request, 'scipost/portal/_hx_publications_page.html', context) + + +def portal_hx_submissions(request): + reports_needed = request.GET.get('reports_needed', False) + form = SubmissionSearchForm( + acad_field_slug=request.session.get('session_acad_field_slug', None), + specialty_slug=request.session.get('session_specialty_slug', None), + reports_needed=reports_needed + ) + context = { + 'submissions_search_form': form, + 'reports_needed': reports_needed + } + return render(request, 'scipost/portal/_hx_submissions.html', context) + + +def portal_hx_submissions_page(request): + session_acad_field_slug = request.session.get('session_acad_field_slug', None) + session_specialty_slug = request.session.get('session_specialty_slug', None) + reports_needed = request.GET.get('reports_needed', False) + form = SubmissionSearchForm( + request.POST or None, + acad_field_slug=session_acad_field_slug, + specialty_slug=session_specialty_slug, + reports_needed=reports_needed + ) + if form.is_valid(): + submissions = form.search_results() + else: + submissions = Submission.objects.public() + if session_acad_field_slug and session_acad_field_slug != 'all': + submissions = submissions.filter(acad_field__slug=session_acad_field_slug) + if session_specialty_slug: + submissions = submissions.filter(specialties__slug=session_specialty_slug) + paginator = Paginator(submissions, 10) + page_nr = request.GET.get('page') + page_obj = paginator.get_page(page_nr) + context = { + 'page_obj': page_obj, + 'reports_needed': reports_needed + } + return render(request, 'scipost/portal/_hx_submissions_page.html', context) + + +def portal_hx_reports(request): + form = ReportSearchForm( + acad_field_slug=request.session.get('session_acad_field_slug', None), + specialty_slug=request.session.get('session_specialty_slug', None) + ) + context = { + 'reports_search_form': form + } + return render(request, 'scipost/portal/_hx_reports.html', context) + + +def portal_hx_reports_page(request): + session_acad_field_slug = request.session.get('session_acad_field_slug', None) + session_specialty_slug = request.session.get('session_specialty_slug', None) + form = ReportSearchForm( + request.POST or None, + acad_field_slug=session_acad_field_slug, + specialty_slug=session_specialty_slug, + ) + if form.is_valid(): + reports = form.search_results() + else: + reports = Report.objects.accepted() + if session_acad_field_slug and session_acad_field_slug != 'all': + reports = reports.filter(submission__acad_field__slug=session_acad_field_slug) + if session_specialty_slug: + reports = reports.filter(submission__specialties__slug=session_specialty_slug) + paginator = Paginator(reports, 10) + page_nr = request.GET.get('page') + page_obj = paginator.get_page(page_nr) + context = { 'page_obj': page_obj } + return render(request, 'scipost/portal/_hx_reports_page.html', context) + + +def portal_hx_comments(request): + form = CommentSearchForm( + acad_field_slug=request.session.get('session_acad_field_slug', None), + specialty_slug=request.session.get('session_specialty_slug', None) + ) + context = { + 'comments_search_form': form + } + return render(request, 'scipost/portal/_hx_comments.html', context) + + +def portal_hx_comments_page(request): + session_acad_field_slug = request.session.get('session_acad_field_slug', None) + session_specialty_slug = request.session.get('session_specialty_slug', None) + form = CommentSearchForm( + request.POST or None, + acad_field_slug=session_acad_field_slug, + specialty_slug=session_specialty_slug, + ) + if form.is_valid(): + comments = form.search_results() + else: + comments = Comment.objects.vetted() + if session_acad_field_slug and session_acad_field_slug != 'all': + comments = comments.filter( + Q(submissions__acad_field__slug=session_acad_field_slug) | + Q(reports__submission__acad_field__slug=session_acad_field_slug) | + Q(commentaries__acad_field__slug=session_acad_field_slug) + ) + if session_specialty_slug: + comments = comments.filter( + Q(submissions__specialties__slug=session_specialty_slug) | + Q(reports__submission__specialties__slug=session_specialty_slug) | + Q(commentaries__specialties__slug=session_specialty_slug) + ) + paginator = Paginator(comments.distinct(), 10) + page_nr = request.GET.get('page') + page_obj = paginator.get_page(page_nr) + context = { 'page_obj': page_obj } + return render(request, 'scipost/portal/_hx_comments_page.html', context) + + +def _hx_news(request): + if NewsItem.objects.homepage().exists(): + latest_newsitem_id = NewsItem.objects.homepage().order_by('-date').first().id + news = NewsItem.objects.homepage().exclude( + pk=latest_newsitem_id).order_by('?').first() + else: + news = NewsItem.objects.none() + context = { + 'news': news + } + return render(request, 'scipost/_hx_news.html', context) + + +def _hx_sponsors(request): + if Organization.objects.current_sponsors().exists(): + current_sponsors = Organization.objects.current_sponsors().order_by('?')[:1] + else: + current_sponsors = Organization.objects.none() + context = { + 'current_sponsors': current_sponsors + } + return render(request, 'scipost/_hx_sponsors.html', context) + + +@permission_required('scipost.can_preview_new_features', return_403=True) +def index3(request): + """Homepage view of SciPost.""" context = { 'news_items': NewsItem.objects.homepage().order_by('-date')[:4], 'publications': Publication.objects.published().order_by('-publication_date', @@ -186,7 +418,7 @@ def index_alt(request): 'submissions': Submission.objects.public().order_by('-submission_date')[:10], 'current_sponsors': Organization.objects.current_sponsors().order_by('?')[:2] } - return render(request, 'scipost/index_alt.html', context) + return render(request, 'scipost/index3.html', context) def protected_serve(request, path, show_indexes=False): @@ -369,6 +601,7 @@ def vet_registration_request_ack(request, contributor_id): form = VetRegistrationForm(request.POST or None) contributor = Contributor.objects.get(pk=contributor_id) if form.is_valid(): + domain = Site.objects.get_current().domain if form.promote_to_registered_contributor(): contributor.status = NORMAL_CONTRIBUTOR contributor.vetted_by = request.user.contributor @@ -390,18 +623,18 @@ def vet_registration_request_ack(request, contributor_id): 'Dear ' + contributor.profile.get_title_display() + ' ' + contributor.user.last_name + ', \n\nYour registration to the SciPost publication portal has been accepted. ' - 'You can now login at https://scipost.org and contribute. \n\n') + 'You can now login at https://' + domain + ' and contribute. \n\n') if pending_ref_inv_exists: email_text += ( 'Note that you have pending refereeing invitations; please navigate to ' - 'https://scipost.org/submissions/accept_or_decline_ref_invitations ' + 'https://' + domain + '/submissions/accept_or_decline_ref_invitations ' '(login required) to accept or decline them.\n\n') email_text += 'Thank you very much in advance, \nThe SciPost Team.' emailmessage = EmailMessage('SciPost registration accepted', email_text, - 'SciPost registration <registration@scipost.org>', + 'SciPost registration <registration@%s>' % domain, [contributor.user.email], - bcc=['registration@scipost.org'], - reply_to=['registration@scipost.org']) + bcc=['registration@%s' % domain], + reply_to=['registration@%s' % domain]) emailmessage.send(fail_silently=False) else: ref_reason = form.cleaned_data['refusal_reason'] @@ -417,10 +650,10 @@ def vet_registration_request_ack(request, contributor_id): '\n\nFurther explanations: ' + form.cleaned_data['email_response_field']) emailmessage = EmailMessage('SciPost registration: unsuccessful', email_text, - 'SciPost registration <registration@scipost.org>', + 'SciPost registration <registration@%s>' % domain, [contributor.user.email], - bcc=['registration@scipost.org'], - reply_to=['registration@scipost.org']) + bcc=['registration@%s' % domain], + reply_to=['registration@%s' % domain]) emailmessage.send(fail_silently=False) contributor.status = form.cleaned_data['refusal_reason'] contributor.save() @@ -483,6 +716,13 @@ class SciPostLoginView(LoginView): def get_initial(self): return self.request.GET + def get_success_url(self): + """Add the `acad_field_view` item to session.""" + self.request.session['session_acad_field_slug'] = \ + self.request.user.contributor.profile.acad_field.slug if \ + self.request.user.contributor.profile.acad_field else '' + return super().get_success_url() + def get_redirect_url(self): """Redirect to the requested url if safe, otherwise to personal page or org dashboard.""" redirect_to = self.request.POST.get( @@ -1031,12 +1271,14 @@ def claim_sub_authorship(request, submission_id, claim): if request.method == 'POST': contributor = Contributor.objects.get(user=request.user) submission = get_object_or_404(Submission, pk=submission_id) - if claim == '1': + if claim == 1: submission.authors_claims.add(contributor) newclaim = AuthorshipClaim(claimant=contributor, submission=submission) newclaim.save() - elif claim == '0': + elif claim == 0: submission.authors_false_claims.add(contributor) + else: + raise Http404 submission.save() return redirect('scipost:claim_authorships') @@ -1047,12 +1289,14 @@ def claim_com_authorship(request, commentary_id, claim): if request.method == 'POST': contributor = Contributor.objects.get(user=request.user) commentary = get_object_or_404(Commentary, pk=commentary_id) - if claim == '1': + if claim == 1: commentary.authors_claims.add(contributor) newclaim = AuthorshipClaim(claimant=contributor, commentary=commentary) newclaim.save() - elif claim == '0': + elif claim == 0: commentary.authors_false_claims.add(contributor) + else: + raise Http404 commentary.save() return redirect('scipost:claim_authorships') @@ -1063,12 +1307,14 @@ def claim_thesis_authorship(request, thesis_id, claim): if request.method == 'POST': contributor = Contributor.objects.get(user=request.user) thesislink = get_object_or_404(ThesisLink, pk=thesis_id) - if claim == '1': + if claim == 1: thesislink.author_claims.add(contributor) newclaim = AuthorshipClaim(claimant=contributor, thesislink=thesislink) newclaim.save() - elif claim == '0': + elif claim == 0: thesislink.author_false_claims.add(contributor) + else: + raise Http404 thesislink.save() return redirect('scipost:claim_authorships') @@ -1245,6 +1491,7 @@ def email_group_members(request): """ form = EmailGroupMembersForm(request.POST or None) if form.is_valid(): + domain = Site.objects.get_current().domain group_members = form.cleaned_data['group'].user_set.filter( contributor__isnull=False).order_by('last_name') # to make pagination consistent p = Paginator(group_members, 32) @@ -1284,7 +1531,7 @@ def email_group_members(request): html_version = html_template.render(Context(email_context)) message = EmailMultiAlternatives( form.cleaned_data['email_subject'], - email_text, 'SciPost Admin <admin@scipost.org>', + email_text, 'SciPost Admin <admin@%s>' % domain, [member.email], connection=connection) message.attach_alternative(html_version, 'text/html') message.send() @@ -1306,6 +1553,7 @@ def email_particular(request): if request.method == 'POST': form = EmailParticularForm(request.POST) if form.is_valid(): + domain = Site.objects.get_current().domain email_text = form.cleaned_data['email_text'] email_text_html = '{{ email_text|linebreaks }}' email_context = {'email_text': form.cleaned_data['email_text']} @@ -1318,9 +1566,9 @@ def email_particular(request): html_version = html_template.render(Context(email_context)) message = EmailMultiAlternatives( form.cleaned_data['email_subject'], - email_text, 'SciPost Admin <admin@scipost.org>', + email_text, 'SciPost Admin <admin@%s>' % domain, [form.cleaned_data['email_address']], - bcc=['admin@scipost.org']) + bcc=['admin@%s' % domain]) message.attach_alternative(html_version, 'text/html') message.send() context = {'ack_header': 'The email has been sent.', @@ -1340,6 +1588,7 @@ def send_precooked_email(request): """ form = SendPrecookedEmailForm(request.POST or None) if form.is_valid(): + domain = Site.objects.get_current().domain precookedEmail = form.cleaned_data['email_option'] if form.cleaned_data['email_address'] in precookedEmail.emailed_to: errormessage = 'This message has already been sent to this address' @@ -1363,7 +1612,7 @@ def send_precooked_email(request): email_text, SciPost_from_addresses_dict[form.cleaned_data['from_address']], [form.cleaned_data['email_address']], - bcc=['admin@scipost.org']) + bcc=['admin@%s' % domain]) message.attach_alternative(html_version, 'text/html') message.send() context = {'ack_header': 'The email has been sent.', diff --git a/scipost_django/security/templates/security/check_email.html b/scipost_django/security/templates/security/check_email.html index a388e89fe9571a98249415f6fff19ac6f5864dae..2784e4abf9966208233b35cce53ed2d7e13c25b1 100644 --- a/scipost_django/security/templates/security/check_email.html +++ b/scipost_django/security/templates/security/check_email.html @@ -39,7 +39,7 @@ <h4 class="highlight p-2 bg-danger text-white"> Your email address is associated to {{ breaches_json|length }} known breach{{ breaches_json|pluralize:"es" }} - (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpawned.com</a>) + (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpwned.com</a>) </h4> <div class="m-4"> <p>Click on items in the list below to see details.</p> @@ -62,7 +62,7 @@ {% else %} <h4 class="highlight p-2 bg-success text-white"> Your email address is not associated to any known breach - (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpawned.com</a>) + (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpwned.com</a>) </h4> {% endif %} <h3 class="highlight">Pastes <a href="https://haveibeenpwned.com/Pastes" target="_blank" rel="noopener">(what are pastes?)</a></h3> @@ -70,7 +70,7 @@ <h4 class="highlight p-2 bg-danger text-white"> Your email address is associated to {{ pastes_json|length }} known paste{{ pastes_json|pluralize }} - (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpawned.com</a>) + (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpwned.com</a>) </h4> <div class="m-4"> <p>Click on items in the list below to see details.</p> @@ -90,7 +90,7 @@ {% else %} <h4 class="highlight p-2 bg-success text-white"> Your email address is not associated to any known paste - (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpawned.com</a>) + (according to <a href="https://haveibeenpwned.com" target="_blank" rel="noopener" class="text-info">haveibeenpwned.com</a>) </h4> {% endif %} diff --git a/scipost_django/sponsors/templates/sponsors/sponsor_petition_email.html b/scipost_django/sponsors/templates/sponsors/sponsor_petition_email.html index 52e3d7bec89840887d161d05aa74382979253a87..382e0e5152e9942890d8785d264469179ea5c93d 100644 --- a/scipost_django/sponsors/templates/sponsors/sponsor_petition_email.html +++ b/scipost_django/sponsors/templates/sponsors/sponsor_petition_email.html @@ -1,4 +1,4 @@ -[PLEASE FILL IN THE TO FIELD ABOVE (keeping admin@scipost.org in cc)]%0D%0A +[PLEASE FILL IN THE TO FIELD ABOVE (keeping admin@{{ request.get_host }} in cc)]%0D%0A %0D%0A Dear ...%0D%0A %0D%0A @@ -11,8 +11,8 @@ Sincerely,%0D%0A %0D%0A %0D%0A %0D%0A -SciPost (https://scipost.org) is a top-quality next-generation Genuine Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://scipost.org/about and https://scipost.org/FAQ.%0D%0A +SciPost (https://{{ request.get_host }}) is a top-quality next-generation Genuine Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://{{ request.get_host }}/about and https://{{ request.get_host }}/FAQ.%0D%0A %0D%0A SciPost operates on an entirely not-for-profit basis, and charges neither subscription fees nor article processing charges; instead, its activities are financed through a cost-slashing consortial model.%0D%0A %0D%0A -Institutions and organizations that benefit from SciPost’s activities (listed on https://scipost.org/organizations) are cordially invited to become Sponsors. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the sponsorship scheme and how to join can be found at https://scipost.org/sponsors or by emailing admin@scipost.org.%0D%0A +Institutions and organizations that benefit from SciPost’s activities (listed on https://{{ request.get_host }}/organizations) are cordially invited to become Sponsors. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the sponsorship scheme and how to join can be found at https://{{ request.get_host }}/sponsors or by emailing admin@{{ request.get_host }}.%0D%0A diff --git a/scipost_django/sponsors/templates/sponsors/sponsors.html b/scipost_django/sponsors/templates/sponsors/sponsors.html index bd580e6f617f880c4ce3740be9302d65ed41ebab..d4da8daf74c3a635b4ee58f37429bfa3cf051e31 100644 --- a/scipost_django/sponsors/templates/sponsors/sponsors.html +++ b/scipost_django/sponsors/templates/sponsors/sponsors.html @@ -29,9 +29,9 @@ Is your organization benefitting from SciPost's activities (check our <a href="{% url 'organizations:organizations' %}">organizations page</a>), and does it not appear in our list of Sponsors below? Then consider helping SciPost: <br/> <strong>Are you a scientist?</strong><br/> - Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@scipost.org">template</a>. + Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@{{ request.get_host }}">template</a>. <strong>Are you a librarian, funding agency representative or other potential supporter?</strong><br/> - Take a look at our <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement</a> template, and contact us at <a href="mailto:sponsors@scipost.org?subject=Sponsors enquiry">sponsors@scipost.org</a> to enquire about further details or initiate your sponsorship. + Take a look at our <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement</a> template, and contact us at <a href="mailto:sponsors@{{ request.get_host }}?subject=Sponsors enquiry">sponsors@{{ request.get_host }}</a> to enquire about further details or initiate your sponsorship. </p> </div> </div> diff --git a/scipost_django/submissions/admin.py b/scipost_django/submissions/admin.py index 591fa9028007267d5a80cb89a0549bc3338c27ed..a84d8f17857747744ea765dc8dfc421334e5be8b 100644 --- a/scipost_django/submissions/admin.py +++ b/scipost_django/submissions/admin.py @@ -86,7 +86,6 @@ class SubmissionAdmin(GuardedModelAdmin): 'is_resubmission_of', 'fellows', 'submitted_by', - 'voting_fellows', 'submitted_to', 'proceedings', 'authors', @@ -157,8 +156,7 @@ class SubmissionAdmin(GuardedModelAdmin): 'submitted_to', 'pdf_refereeing_pack', 'plagiarism_report', - 'fellows', - 'voting_fellows'), + 'fellows'), }), ('Meta', { 'classes': ('collapse',), diff --git a/scipost_django/submissions/constants.py b/scipost_django/submissions/constants.py index 655e047c05e4b6eca7d463c4c40a56435e4e5c97..3b06523e78334bec4661c26e15c30d49faa5ff81 100644 --- a/scipost_django/submissions/constants.py +++ b/scipost_django/submissions/constants.py @@ -74,9 +74,11 @@ ASSIGNMENT_REFUSAL_REASONS = ( ('DNP', 'SciPost should not even consider this paper'), ) -STATUS_PREASSIGNED, STATUS_INVITED = 'preassigned', 'invited' +STATUS_PREASSIGNED = 'preassigned' +STATUS_INVITED = 'invited' STATUS_DECLINED = 'declined' -STATUS_DEPRECATED, STATUS_COMPLETED = 'deprecated', 'completed' +STATUS_COMPLETED = 'completed' +STATUS_DEPRECATED = 'deprecated' STATUS_REPLACED = 'replaced' ASSIGNMENT_STATUSES = ( (STATUS_PREASSIGNED, 'Pre-assigned'), @@ -187,10 +189,12 @@ SUBMISSION_CYCLE_CHOICES = ( SUBMISSION_CYCLES = ((CYCLE_UNDETERMINED, 'Cycle undetermined'),) + SUBMISSION_CYCLE_CHOICES EVENT_GENERAL = 'gen' +EVENT_FOR_EDADMIN = 'edad' EVENT_FOR_EIC = 'eic' EVENT_FOR_AUTHOR = 'auth' EVENT_TYPES = ( (EVENT_GENERAL, 'General comment'), + (EVENT_FOR_EDADMIN, 'Comment for EdAdmin'), (EVENT_FOR_EIC, 'Comment for Editor-in-charge'), (EVENT_FOR_AUTHOR, 'Comment for author'), ) @@ -271,35 +275,3 @@ FIGSHARE_PREPRINT_SERVERS = ( 'TechRxiv', 'Advance' ) - -# Preprint-related regexes -scipost_regex_wo_vn = 'scipost_[0-9]{4,}_[0-9]{4,}' -scipost_regex_w_vn = 'scipost_[0-9]{4,}_[0-9]{4,}v[0-9]{1,2}' -arxiv_regex_wo_vn = '[0-9]{4,}.[0-9]{4,}' -arxiv_regex_w_vn = '[0-9]{4,}.[0-9]{4,}v[0-9]{1,2}' -chemrxiv_regex_wo_vn = 'chemrxiv_[0-9]+' -chemrxiv_regex_w_vn = 'chemrxiv_[0-9]+.v[0-9]{1,2}' -techrxiv_regex_wo_vn = 'techrxiv_[0-9]+' -techrxiv_regex_w_vn = 'techrxiv_[0-9]+.v[0-9]{1,2}' -advance_regex_wo_vn = 'advance_[0-9]+' -advance_regex_w_vn = 'advance_[0-9]+.v[0-9]{1,2}' -socarxiv_regex = 'socarxiv_[a-z0-9]+' - -# Preprints with structurally no version number -# (like OSFPreprints-based ones: SocArXiv, ...) -# must not match SUBMISSIONS_WO_VN_REGEX to avoid ambiguities. -SUBMISSIONS_WO_VN_REGEX = '(?P<identifier_wo_vn_nr>(%s|%s|%s|%s|%s))' % ( - scipost_regex_wo_vn, - arxiv_regex_wo_vn, - chemrxiv_regex_wo_vn, - techrxiv_regex_wo_vn, - advance_regex_wo_vn, -) -SUBMISSIONS_COMPLETE_REGEX = '(?P<identifier_w_vn_nr>(%s|%s|%s|%s|%s|%s))' % ( - scipost_regex_w_vn, - arxiv_regex_w_vn, - chemrxiv_regex_w_vn, - techrxiv_regex_w_vn, - advance_regex_w_vn, - socarxiv_regex -) diff --git a/scipost_django/submissions/converters.py b/scipost_django/submissions/converters.py new file mode 100644 index 0000000000000000000000000000000000000000..5d67cc9a04e8ab43a2fa59a7285dea0315f0e8c0 --- /dev/null +++ b/scipost_django/submissions/converters.py @@ -0,0 +1,34 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + +from django.urls.converters import StringConverter + +from .regexes import IDENTIFIER_WO_VN_NR_REGEX, IDENTIFIER_REGEX + + +class IdentifierWithoutVersionNumberConverter(StringConverter): + regex = IDENTIFIER_WO_VN_NR_REGEX + + +class IdentifierConverter(StringConverter): + regex = IDENTIFIER_REGEX + + +class ReportDOILabelConverter: + regex = r'^(10.21468/)?SciPost.Report.[0-9]+' + + def to_python(self, value): + """Strip the DOI prefix if present; check if Comment exists.""" + doi_label = value + if doi_label.startswith('10.21468/'): + doi_label = doi_label.partition('10.21468/')[2] + from submissions.models import Report + try: + return Report.objects.get(doi_label=doi_label).doi_label + except Report.DoesNotExist: + return ValueError + return doi_label + + def to_url(self, value): + return value diff --git a/scipost_django/submissions/exceptions.py b/scipost_django/submissions/exceptions.py index 1349a3c6769337ec18faf21e9700793538cc6f17..3c2a868570e86c6cac1b136e98b16d61d54dfab0 100644 --- a/scipost_django/submissions/exceptions.py +++ b/scipost_django/submissions/exceptions.py @@ -18,6 +18,10 @@ class InvalidReportVettingValue(BaseCustomException): pass +class PreprintDocumentNotFoundError(BaseCustomException): + pass + + class ArxivPDFNotFound(Exception): pass diff --git a/scipost_django/submissions/forms.py b/scipost_django/submissions/forms.py index 2fea60365dd15eb372662967447341a8c07dc781..6ab1920f66c382844c0996988f37e26af77bc626 100644 --- a/scipost_django/submissions/forms.py +++ b/scipost_django/submissions/forms.py @@ -3,7 +3,6 @@ __license__ = "AGPL v3" import datetime -import re from django import forms from django.conf import settings @@ -13,13 +12,20 @@ from django.db.models import Q from django.forms.formsets import ORDERING_FIELD_NAME from django.utils import timezone +from crispy_forms.helper import FormHelper +from crispy_forms.layout import Layout, Div +from crispy_forms.bootstrap import InlineRadios +from crispy_bootstrap5.bootstrap5 import FloatingField + from dal import autocomplete from .constants import ( ASSIGNMENT_BOOL, ASSIGNMENT_REFUSAL_REASONS, STATUS_RESUBMITTED, REPORT_ACTION_CHOICES, REPORT_REFUSAL_CHOICES, STATUS_REJECTED, STATUS_INCOMING, REPORT_POST_EDREC, REPORT_NORMAL, STATUS_DRAFT, STATUS_UNVETTED, REPORT_ACTION_ACCEPT, REPORT_ACTION_REFUSE, STATUS_UNASSIGNED, - SUBMISSION_STATUS, PUT_TO_VOTING, + SUBMISSION_STATUS, + STATUS_ASSIGNMENT_FAILED, STATUS_ACCEPTED_AWAITING_PUBOFFER_ACCEPTANCE, STATUS_PUBLISHED, + PUT_TO_VOTING, SUBMISSION_CYCLE_CHOICES, CYCLE_UNDETERMINED, CYCLE_DEFAULT, CYCLE_SHORT, CYCLE_DIRECT_REC, EIC_REC_PUBLISH, EIC_REC_MINOR_REVISION, EIC_REC_MAJOR_REVISION, EIC_REC_REJECT, @@ -28,7 +34,8 @@ from .constants import ( STATUS_EIC_ASSIGNED, STATUS_PREASSIGNED, STATUS_REPLACED, STATUS_FAILED_PRESCREENING, STATUS_DEPRECATED, - STATUS_ACCEPTED, STATUS_DECLINED, STATUS_WITHDRAWN) + STATUS_ACCEPTED, STATUS_DECLINED, STATUS_WITHDRAWN, +) from . import exceptions, helpers from .helpers import to_ascii_only from .models import ( @@ -36,6 +43,7 @@ from .models import ( RefereeInvitation, Report, EICRecommendation, EditorialAssignment, SubmissionTiering, EditorialDecision, iThenticateReport, EditorialCommunication) +from .regexes import CHEMRXIV_DOI_PATTERN from colleges.models import Fellowship from common.utils import Q_with_alternative_spellings @@ -44,8 +52,9 @@ from mails.utils import DirectMailUtil from ontology.models import AcademicField, Specialty from preprints.helpers import get_new_scipost_identifier from preprints.models import Preprint +from proceedings.models import Proceedings from profiles.models import Profile -from scipost.services import ArxivCaller, FigshareCaller, OSFPreprintsCaller +from scipost.services import DOICaller, ArxivCaller, FigshareCaller, OSFPreprintsCaller from scipost.models import Contributor, Remark import strings @@ -57,6 +66,314 @@ OSFPREPRINTS_IDENTIFIER_PATTERN = r'^[a-z0-9]+$' class SubmissionSearchForm(forms.Form): + author = forms.CharField( + max_length=100, + required=False, + label="Author(s)" + ) + title = forms.CharField( + max_length=100, + required=False + ) + submitted_to = forms.ModelChoiceField( + queryset=Journal.objects.active(), + required=False + ) + identifier = forms.CharField( + max_length=128, + required=False + ) + proceedings = forms.ModelChoiceField( + queryset=Proceedings.objects.order_by('-submissions_close'), + required=False + ) + def __init__(self, *args, **kwargs): + self.acad_field_slug = kwargs.pop('acad_field_slug') + self.specialty_slug = kwargs.pop('specialty_slug') + self.reports_needed = kwargs.pop('reports_needed') + super().__init__(*args, **kwargs) + if self.acad_field_slug: + self.fields['submitted_to'].queryset = Journal.objects.filter( + college__acad_field__slug=self.acad_field_slug + ) + self.helper = FormHelper() + self.helper.layout = Layout( + Div( + Div(FloatingField('author'), css_class='col-lg-6'), + Div(FloatingField('title'), css_class='col-lg-6'), + css_class='row mb-0' + ), + Div( + Div(FloatingField('submitted_to'), css_class='col-lg-6'), + Div(FloatingField('identifier'), css_class='col-lg-6'), + css_class='row mb-0' + ), + Div( + Div(FloatingField('proceedings'), css_class='col-lg-6'), + css_class='row mb-0', + css_id='row_proceedings', + style='display: none' + ), + ) + + def search_results(self): + """ + Return all Submission objects fitting search criteria. + """ + submissions = Submission.objects.public_newest().unpublished() + if self.acad_field_slug != 'all': + submissions = submissions.filter(acad_field__slug=self.acad_field_slug) + if self.specialty_slug: + submissions = submissions.filter(specialties__slug=self.specialty_slug) + if self.cleaned_data.get('submitted_to'): + submissions = submissions.filter(submitted_to=self.cleaned_data.get('submitted_to')) + if self.cleaned_data.get('proceedings'): + submissions = submissions.filter(proceedings=self.cleaned_data.get('proceedings')) + if self.cleaned_data.get('author'): + submissions = submissions.filter(author_list__icontains=self.cleaned_data.get('author')) + if self.cleaned_data.get('title'): + submissions = submissions.filter(title__icontains=self.cleaned_data.get('title')) + if self.cleaned_data.get('identifier'): + submissions = submissions.filter( + preprint__identifier_w_vn_nr__icontains=self.cleaned_data.get('identifier') + ) + if self.reports_needed: + submissions = submissions.actively_refereeing( + ).open_for_reporting().order_by('submission_date') + return submissions + + +class SubmissionPoolSearchForm(forms.Form): + """Filter a Submission queryset using basic search fields.""" + + submitted_to = forms.ModelChoiceField( + queryset=Journal.objects.active(), + required=False + ) + specialties = forms.ModelMultipleChoiceField( + queryset=Specialty.objects.all(), + widget=autocomplete.ModelSelect2Multiple( + url='/ontology/specialty-autocomplete', + attrs={'data-html': True} + ), + label='Specialties', + required=False + ) + proceedings = forms.ModelChoiceField( + queryset=Proceedings.objects.order_by('-submissions_close'), + required=False + ) + author = forms.CharField( + max_length=100, + required=False, + label="Author(s)" + ) + title = forms.CharField( + max_length=100, + required=False + ) + identifier = forms.CharField( + max_length=128, + required=False + ) + status = forms.ChoiceField( + choices=( + ('All', ( + ('all', 'All Submissions'), + )), + ('Pre-screening', ( + (STATUS_INCOMING, 'In pre-screening'), + (STATUS_FAILED_PRESCREENING, 'Failed pre-screening'), + )), + ('Screening', ( + (STATUS_UNASSIGNED, 'Unassigned, awaiting editor assignment'), + ('unassigned_1', '... unassigned for > 1 week'), + ('unassigned_2', '... unassigned for > 2 weeks'), + ('unassigned_4', '... unassigned for > 4 weeks'), + (STATUS_ASSIGNMENT_FAILED, 'Failed to assign Editor-in-charge; manuscript rejected'), + )), + ('Refereeing', ( + (STATUS_EIC_ASSIGNED, 'Editor-in-charge assigned; in refereeing'), + ('unvetted_reports', '... with unvetted Reports'), + )), + ('Voting', ( + ('voting_prepare', 'Voting in preparation'), + ('voting_ongoing', 'Voting ongoing'), + ('voting_1', '... in voting for > 1 week'), + ('voting_2', '... in voting for > 2 weeks'), + ('voting_4', '... in voting for > 4 weeks'), + )), + ('Decided', ( + (STATUS_ACCEPTED, 'Accepted'), + (STATUS_ACCEPTED_AWAITING_PUBOFFER_ACCEPTANCE, + 'Accepted in other journal; awaiting puboffer acceptance'), + (STATUS_REJECTED, 'Rejected'), + (STATUS_WITHDRAWN, 'Withdrawn by the Authors'), + )), + ('Processed', ( + (STATUS_PUBLISHED, 'Published'), + )), + ), + ) + editor_in_charge = forms.ModelChoiceField( + queryset=Fellowship.objects.active(), + required=False + ) + search_set = forms.ChoiceField( + widget=forms.RadioSelect, + choices=( + ('eic', 'I am Editor-in-charge'), + ('current', 'All currently in processing'), + ('historical', 'All accessible history') + ), + initial='current' + ) + + def __init__(self, *args, **kwargs): + user = kwargs.pop('user') + super().__init__(*args, **kwargs) + if not user.contributor.is_ed_admin: + # restrict journals to those of Colleges of user's Fellowships + college_id_list = [f.college.id for f in user.contributor.fellowships.active()] + self.fields['submitted_to'].queryset = Journal.objects.filter(college__in=college_id_list) + if user.contributor.is_ed_admin: + # Remove 'I am Editor-in-charge' choice + self.fields['search_set'].choices = ( + ('current', 'All currently in processing'), + ('historical', 'All accessible history') + ) + self.helper = FormHelper() + self.helper.layout = Layout( + Div( + Div(FloatingField('submitted_to'), css_class='col-lg-6'), + Div(FloatingField('specialties'), css_class='col-lg-6'), + css_class='row mb-0' + ), + Div( + Div(FloatingField('proceedings'), css_class='col-lg-6'), + css_class='row mb-0', + css_id='row_proceedings', + style='display: none' + ), + Div( + Div(FloatingField('author'), css_class='col-lg-6'), + Div(FloatingField('title'), css_class='col-lg-6'), + css_class='row mb-0' + ), + Div( + Div(FloatingField('identifier'), css_class='col-lg-3'), + Div(FloatingField('status'), css_class='col-lg-5'), + Div(FloatingField('editor_in_charge'), css_class='col-lg-4', css_id='col_eic'), + css_class='row mb-0' + ), + Div( + Div(InlineRadios('search_set'), css_class='col'), + css_class='row mb-0' + ), + ) + + def search_results(self, user): + """ + Return all Submission objects fitting search criteria. + """ + if self.cleaned_data.get('search_set') == 'eic': + submissions = Submission.objects.filter_for_eic(user) + elif self.cleaned_data.get('search_set') == 'current': + submissions = Submission.objects.pool(user) + else: # include historical items + submissions = Submission.objects.pool_editable(user) + if self.cleaned_data.get('specialties'): + submissions = submissions.filter( + specialties__in=self.cleaned_data.get('specialties') + ) + if self.cleaned_data.get('submitted_to'): + submissions = submissions.filter(submitted_to=self.cleaned_data.get('submitted_to')) + if self.cleaned_data.get('proceedings'): + submissions = submissions.filter(proceedings=self.cleaned_data.get('proceedings')) + if self.cleaned_data.get('author'): + submissions = submissions.filter(author_list__icontains=self.cleaned_data.get('author')) + if self.cleaned_data.get('title'): + submissions = submissions.filter(title__icontains=self.cleaned_data.get('title')) + if self.cleaned_data.get('identifier'): + submissions = submissions.filter( + preprint__identifier_w_vn_nr__icontains=self.cleaned_data.get('identifier') + ) + + # filter by status + status = self.cleaned_data.get('status') + if status == 'all': + pass + elif status == 'unassigned_1': + submissions = submissions.filter( + status=STATUS_UNASSIGNED, + submission_date__lt=timezone.now() - datetime.timedelta(days=7) + ) + elif status == 'unassigned_2': + submissions = submissions.filter( + status=STATUS_UNASSIGNED, + submission_date__lt=timezone.now() - datetime.timedelta(days=14) + ) + elif status == 'unassigned_4': + submissions = submissions.filter( + status=STATUS_UNASSIGNED, + submission_date__lt=timezone.now() - datetime.timedelta(days=28) + ) + elif status == 'unvetted_reports': + reports_to_vet = Report.objects.awaiting_vetting() + id_list = [r.submission.id for r in reports_to_vet.all()] + submissions = submissions.filter(id__in=id_list) + elif status == 'voting_prepare': + submissions = submissions.voting_in_preparation() + elif status == 'voting_ongoing': + submissions = submissions.undergoing_voting() + elif status == 'voting_1': + submissions = submissions.undergoing_voting(longer_than_days=7) + elif status == 'voting_2': + submissions = submissions.undergoing_voting(longer_than_days=14) + elif status == 'voting_4': + submissions = submissions.undergoing_voting(longer_than_days=28) + else: + submissions = submissions.filter(status=status) + + # filter by EIC + if self.cleaned_data.get('editor_in_charge'): + submissions = submissions.filter( + editor_in_charge=self.cleaned_data.get('editor_in_charge').contributor + ) + return submissions + + +class ReportSearchForm(forms.Form): + submission_title = forms.CharField( + max_length=100, + required=False + ) + + def __init__(self, *args, **kwargs): + self.acad_field_slug = kwargs.pop('acad_field_slug') + self.specialty_slug = kwargs.pop('specialty_slug') + super().__init__(*args, **kwargs) + self.helper = FormHelper() + self.helper.layout = Layout( + Div( + Div(FloatingField('submission_title'), css_class='col-lg-6'), + ), + ) + + def search_results(self): + reports = Report.objects.accepted() + if self.acad_field_slug != 'all': + reports = reports.filter(submission__acad_field__slug=self.acad_field_slug) + if self.specialty_slug: + reports = reports.filter(submission__specialties__slug=self.specialty_slug) + if self.cleaned_data.get('submission_title'): + reports = reports.filter( + submission__title__icontains=self.cleaned_data.get('submission_title')) + return reports + + +# Marked for deprecation +class SubmissionOldSearchForm(forms.Form): """Filter a Submission queryset using basic search fields.""" author = forms.CharField(max_length=100, required=False, label="Author(s)") @@ -100,6 +417,8 @@ class SubmissionPoolFilterForm(forms.Form): return '' + + ###################################################################### # # SubmissionForm prefill facilities. One class per integrated server. @@ -171,6 +490,45 @@ def check_arxiv_identifier_w_vn_nr(identifier): return arxiv_data, metadata, identifier +def check_chemrxiv_doi(doi): + """ + Call Crossref to get ChemRxiv preprint data. + """ + caller = DOICaller(doi) + if caller.is_valid: + data = caller.data + metadata = caller.data['crossref_data'] + else: + error_message = 'A preprint associated to this DOI does not exist.' + raise forms.ValidationError(error_message) + + # Check if the type of this resource is indeed a preprint + if 'subtype' in metadata: + if metadata['subtype'] != 'preprint': + error_message = ('This does not seem to be a preprint: the type ' + 'returned by Crossref on behalf of ' + '%(preprint_server) is %(subtype). ' + 'Please contact techsupport.') + raise forms.ValidationError( + error_message, code='wrong_subtype', + params={ + 'preprint_server': preprint_server.name, + 'subtype': metadata['subtype'] + }) + else: + raise forms.ValidationError( + 'Crossref failed to return a subtype. Please contact techsupport.', + code='wrong_subtype') + + # Explicitly add ChemRxiv as the preprint server: + data['preprint_server'] = PreprintServer.objects.get(name='ChemRxiv') + data['preprint_link'] = 'https://doi.org/%s' % doi + # Build the identifier by stripping the DOI prefix: + identifier = doi + data['identifier_w_vn_nr'] = identifier + return data, metadata, identifier + + def check_figshare_identifier_w_vn_nr(preprint_server, figshare_identifier_w_vn_nr): """ Call Figshare to retrieve submission prefill data and perform basic checks. @@ -218,7 +576,8 @@ def check_figshare_identifier_w_vn_nr(preprint_server, figshare_identifier_w_vn_ return figshare_data, metadata, identifier -def check_chemrxiv_identifier_w_vn_nr(chemrxiv_identifier_w_vn_nr): +# DEPRECATED +def check_chemrxiv_figshare_identifier_w_vn_nr(chemrxiv_identifier_w_vn_nr): """ Call `check_figshare_identifier_w_vn_nr` but correct identifier by substituting `chemrxiv` for `figshare`. @@ -424,11 +783,56 @@ class ArXivPrefillForm(SubmissionPrefillForm): return form_data +class ChemRxivPrefillForm(SubmissionPrefillForm): + """ + Provide initial data for SubmissionForm from ChemRxiv + (metadata actually collected from Crossref API, not ChemRxiv). + + This form is used by the ChemRxiv route (post-2021-07 style). + """ + chemrxiv_doi = forms.RegexField( + label='', + regex=CHEMRXIV_DOI_PATTERN, strip=True, + error_messages={'invalid': 'Invalid ChemRxiv DOI'}, + widget=forms.TextInput() + ) + + def __init__(self, *args, **kwargs): + self.crossref_data = {} + self.metadata = {} + super().__init__(*args, **kwargs) + + def clean_chemrxiv_doi(self): + # To get the identifier, strip the DOI prefix + identifier = self.cleaned_data.get('chemrxiv_doi', None).partition('/')[2] + + check_identifier_is_unused(identifier) + self.crossref_data, self.metadata, identifier = check_chemrxiv_doi(self.cleaned_data['chemrxiv_doi']) + return identifier + + def get_prefill_data(self): + """ + Return dictionary to prefill `SubmissionForm`. + """ + form_data = super().get_prefill_data() + form_data.update(self.crossref_data) + + if self.is_resubmission(): + form_data.update({ + 'approaches': self.latest_submission.approaches, + 'referees_flagged': self.latest_submission.referees_flagged, + 'referees_suggested': self.latest_submission.referees_suggested, + 'acad_field': self.latest_submission.acad_field, + 'specialties': [s.id for s in self.latest_submission.specialties.all()] + }) + return form_data + + class FigsharePrefillForm(SubmissionPrefillForm): """ Provide initial data for SubmissionForm from Figshare. - This form is used by the ChemRxiv, TechRxiv and Advance routes. + This form is used by the ChemRxiv (pre-2021-07), TechRxiv and Advance routes. """ figshare_preprint_server = forms.ModelChoiceField( queryset=PreprintServer.objects.filter(served_by__name='Figshare'), @@ -730,8 +1134,7 @@ class SubmissionForm(forms.ModelForm): check_arxiv_identifier_w_vn_nr(identifier) elif self.preprint_server.name == 'ChemRxiv': self.preprint_data, self.metadata, identifier = \ - check_chemrxiv_identifier_w_vn_nr( - identifier.replace('chemrxiv_', '')) + check_chemrxiv_doi(identifier) elif self.preprint_server.name == 'TechRxiv': self.preprint_data, self.metadata, identifier = \ check_techrxiv_identifier_w_vn_nr( @@ -1037,9 +1440,17 @@ class SubmissionPrescreeningForm(forms.ModelForm): status=STATUS_UNASSIGNED, visible_pool=True, visible_public=False) self.instance.add_general_event('Submission passed pre-screening.') elif self.cleaned_data['decision'] == self.FAIL: + EditorialAssignment.objects.filter(submission=self.instance).invited().update( + status=STATUS_DEPRECATED) Submission.objects.filter(id=self.instance.id).update( status=STATUS_FAILED_PRESCREENING, visible_pool=False, visible_public=False) self.instance.add_general_event('Submission failed pre-screening.') + mail_sender = DirectMailUtil( + 'prescreening_failed', + instance=self.instance, + header_template='submissions/admin/prescreening_failed.html' + ) + mail_sender.send_mail() if self.cleaned_data['remark_for_pool']: Remark.objects.create( @@ -1107,27 +1518,6 @@ class WithdrawSubmissionForm(forms.Form): # Editorial workflow # ###################### -class InviteEditorialAssignmentForm(forms.ModelForm): - """Invite new Fellow; create EditorialAssignment for Submission.""" - - class Meta: - model = EditorialAssignment - fields = ('to',) - labels = { - 'to': 'Fellow', - } - - def __init__(self, *args, **kwargs): - """Add related submission as argument.""" - self.submission = kwargs.pop('submission') - super().__init__(*args, **kwargs) - self.fields['to'].queryset = Contributor.objects.available().filter( - fellowships__pool=self.submission).distinct().order_by('user__last_name') - - def save(self, commit=True): - self.instance.submission = self.submission - return super().save(commit) - class EditorialAssignmentForm(forms.ModelForm): """Create and/or process new EditorialAssignment for Submission.""" @@ -1262,6 +1652,8 @@ class SetRefereeingDeadlineForm(forms.Form): def clean_deadline(self): if not self.cleaned_data.get('deadline'): self.add_error('deadline', 'Please use a valid date.') + if not (self.cleaned_data.get('deadline') >= timezone.now().date()): + self.add_error('deadline', 'Please choose a future date!') return self.cleaned_data.get('deadline') @@ -1833,12 +2225,13 @@ class iThenticateReportForm(forms.ModelForm): doc_id = self.instance.doc_id if not doc_id and not self.fields.get('file'): try: - cleaned_data['document'] = helpers.retrieve_pdf_from_arxiv( - self.submission.preprint.identifier_w_vn_nr) - except exceptions.ArxivPDFNotFound: + # cleaned_data['document'] = helpers.retrieve_pdf_from_arxiv( + # self.submission.preprint.identifier_w_vn_nr) + cleaned_data['document'] = self.submission.preprint.get_document() + except exceptions.PreprintDocumentNotFoundError: self.add_error( - None, 'The pdf could not be found at arXiv. Please upload the pdf manually.') - self.fields['file'] = forms.FileField() + None, 'Preprint document not found. Please upload the pdf manually.') + self.fields['file'] = forms.FileField() # Add this field now it's needed elif not doc_id and cleaned_data.get('file'): cleaned_data['document'] = cleaned_data['file'].read() elif doc_id: @@ -1853,19 +2246,8 @@ class iThenticateReportForm(forms.ModelForm): # Document (id) is found if cleaned_data.get('document'): self.document = cleaned_data['document'] - try: - self.response = self.call_ithenticate() - except AttributeError: - if not self.fields.get('file'): - # The document is invalid. - self.add_error(None, ('A valid pdf could not be found at arXiv.' - ' Please upload the pdf manually.')) - else: - self.add_error(None, ('The uploaded file is not valid.' - ' Please upload a valid pdf.')) - self.fields['file'] = forms.FileField() - elif hasattr(self, 'document_id'): - self.response = self.call_ithenticate() + + self.response = self.call_ithenticate() if hasattr(self, 'response') and self.response: return cleaned_data diff --git a/scipost_django/submissions/managers/recommendation.py b/scipost_django/submissions/managers/recommendation.py index 3aeb7b6b195ae444d05b1e5421f884ec887f9d50..5cae4947a041ed4be5b82b4f73ed5be6394506aa 100644 --- a/scipost_django/submissions/managers/recommendation.py +++ b/scipost_django/submissions/managers/recommendation.py @@ -2,7 +2,10 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" +import datetime + from django.db import models +from django.utils import timezone from .. import constants @@ -38,9 +41,12 @@ class EICRecommendationQuerySet(models.QuerySet): constants.STATUS_PUBLISHED, constants.STATUS_WITHDRAWN]).distinct() - def put_to_voting(self): + def put_to_voting(self, longer_than_days=None): """Return the subset of EICRecommendation currently undergoing voting.""" - return self.filter(status=constants.PUT_TO_VOTING) + qs = self.filter(status=constants.PUT_TO_VOTING) + if longer_than_days: + qs = qs.filter(date_submitted__lt=timezone.now() - datetime.timedelta(days=longer_than_days)) + return qs def voting_in_preparation(self): """Return the subset of EICRecommendation currently undergoing preparation for voting.""" diff --git a/scipost_django/submissions/managers/referee_invitation.py b/scipost_django/submissions/managers/referee_invitation.py index b992a905ec4759ecc8d632fff804361368f08734..0596bfc362473818629d561ced7b27407babb707 100644 --- a/scipost_django/submissions/managers/referee_invitation.py +++ b/scipost_django/submissions/managers/referee_invitation.py @@ -15,8 +15,8 @@ class RefereeInvitationQuerySet(models.QuerySet): return self.filter(auto_reminders_allowed=True) def awaiting_response(self): - """Filter invitations awaiting response by referee.""" - return self.filter(accepted=None, cancelled=False) + """Filter sent invitations awaiting response by referee.""" + return self.filter(date_invited__isnull=False, accepted=None, cancelled=False) def accepted(self): """Filter invitations (non-cancelled) accepted by referee.""" diff --git a/scipost_django/submissions/managers/submission.py b/scipost_django/submissions/managers/submission.py index 8377b6ae6aa80e24664b60bf6d8a2820921f04d9..009dd716dee0f87791954ef462d8dccb248d67bd 100644 --- a/scipost_django/submissions/managers/submission.py +++ b/scipost_django/submissions/managers/submission.py @@ -67,11 +67,16 @@ class SubmissionQuerySet(models.QuerySet): def pool(self, user): """Return the user-dependent pool of Submissions in active referee phase.""" - return self.pool_editable(user).filter(is_current=True, status__in=[ + allowed_statuses = [ constants.STATUS_UNASSIGNED, constants.STATUS_EIC_ASSIGNED, constants.STATUS_ACCEPTED, - constants.STATUS_ACCEPTED_AWAITING_PUBOFFER_ACCEPTANCE]) + constants.STATUS_ACCEPTED_AWAITING_PUBOFFER_ACCEPTANCE + ] + if (user.has_perm('scipost.can_oversee_refereeing') or + user.contributor.is_active_senior_fellow): + allowed_statuses.append(constants.STATUS_INCOMING) + return self.pool_editable(user).filter(is_current=True, status__in=allowed_statuses) def pool_editable(self, user): """Return the editable pool for a certain user. @@ -225,16 +230,34 @@ class SubmissionQuerySet(models.QuerySet): constants.STATUS_INCOMING, constants.STATUS_UNASSIGNED, constants.STATUS_EIC_ASSIGNED, ], authors=user.contributor) + def voting_in_preparation(self): + from submissions.models import EICRecommendation + ids_list = [r.submission.id for r in EICRecommendation.objects.voting_in_preparation()] + return self.filter(id__in=ids_list) + + def undergoing_voting(self, longer_than_days=None): + from submissions.models import EICRecommendation + ids_list = [r.submission.id for r in EICRecommendation.objects.put_to_voting(longer_than_days)] + return self.filter(id__in=ids_list) + class SubmissionEventQuerySet(models.QuerySet): - def for_author(self): - """Return all events that are meant to be for the author(s) of a submission.""" - return self.filter(event__in=[constants.EVENT_FOR_AUTHOR, constants.EVENT_GENERAL]) + def for_edadmin(self): + """Return all events that are visible to EdAdmin.""" + return self.filter(event__in=[ + constants.EVENT_FOR_EDADMIN, + constants.EVENT_FOR_EIC, + constants.EVENT_GENERAL + ]) def for_eic(self): - """Return all events that are meant to be for the Editor-in-charge of a submission.""" + """Return all events that are visible to Editor-in-charge of a submission.""" return self.filter(event__in=[constants.EVENT_FOR_EIC, constants.EVENT_GENERAL]) + def for_author(self): + """Return all events that are visible to author(s) of a submission.""" + return self.filter(event__in=[constants.EVENT_FOR_AUTHOR, constants.EVENT_GENERAL]) + def last_hours(self, hours=24): """Return all events of the last `hours` hours.""" return self.filter(created__gte=timezone.now() - datetime.timedelta(hours=hours)) diff --git a/scipost_django/submissions/migrations/0109_alter_submission_proceedings.py b/scipost_django/submissions/migrations/0109_alter_submission_proceedings.py new file mode 100644 index 0000000000000000000000000000000000000000..4a716b4479e7438d2886ddb5128d2af487191a59 --- /dev/null +++ b/scipost_django/submissions/migrations/0109_alter_submission_proceedings.py @@ -0,0 +1,20 @@ +# Generated by Django 3.2.5 on 2021-09-13 14:44 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('proceedings', '0009_auto_20210422_0833'), + ('submissions', '0108_auto_20210716_0937'), + ] + + operations = [ + migrations.AlterField( + model_name='submission', + name='proceedings', + field=models.ForeignKey(blank=True, help_text="Don't find the Proceedings you are looking for? Ask the conference organizers to contact our admin to set things up.", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='submissions', to='proceedings.proceedings'), + ), + ] diff --git a/scipost_django/submissions/migrations/0110_alter_refereeinvitation_accepted.py b/scipost_django/submissions/migrations/0110_alter_refereeinvitation_accepted.py new file mode 100644 index 0000000000000000000000000000000000000000..1e9ec6064133c88312ed4b847a8b31d869c88dd5 --- /dev/null +++ b/scipost_django/submissions/migrations/0110_alter_refereeinvitation_accepted.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-10-08 05:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('submissions', '0109_alter_submission_proceedings'), + ] + + operations = [ + migrations.AlterField( + model_name='refereeinvitation', + name='accepted', + field=models.BooleanField(blank=True, choices=[(None, 'Response pending'), (True, 'Accept'), (False, 'Decline')], default=None, null=True), + ), + ] diff --git a/scipost_django/submissions/migrations/0111_remove_submission_voting_fellows.py b/scipost_django/submissions/migrations/0111_remove_submission_voting_fellows.py new file mode 100644 index 0000000000000000000000000000000000000000..27c05f54c0a2c47c20e6e483ebe92061f9763413 --- /dev/null +++ b/scipost_django/submissions/migrations/0111_remove_submission_voting_fellows.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.5 on 2021-10-18 18:00 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('submissions', '0110_alter_refereeinvitation_accepted'), + ] + + operations = [ + migrations.RemoveField( + model_name='submission', + name='voting_fellows', + ), + ] diff --git a/scipost_django/submissions/migrations/0112_alter_submissionevent_event.py b/scipost_django/submissions/migrations/0112_alter_submissionevent_event.py new file mode 100644 index 0000000000000000000000000000000000000000..0ba9f72b960d342e305809cbb40f7d9ff8597094 --- /dev/null +++ b/scipost_django/submissions/migrations/0112_alter_submissionevent_event.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-10-21 04:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('submissions', '0111_remove_submission_voting_fellows'), + ] + + operations = [ + migrations.AlterField( + model_name='submissionevent', + name='event', + field=models.CharField(choices=[('gen', 'General comment'), ('edad', 'Comment for EdAdmin'), ('eic', 'Comment for Editor-in-charge'), ('auth', 'Comment for author')], default='gen', max_length=4), + ), + ] diff --git a/scipost_django/submissions/models/recommendation.py b/scipost_django/submissions/models/recommendation.py index 638ecd669ada1bf69d98140af838e83f91cbc6d6..85f59791a5bff1926d48c482a9c0eca7069a1682 100644 --- a/scipost_django/submissions/models/recommendation.py +++ b/scipost_django/submissions/models/recommendation.py @@ -9,7 +9,7 @@ from ..behaviors import SubmissionRelatedObjectMixin from ..constants import ( STATUS_EIC_ASSIGNED, EIC_REC_CHOICES, EIC_REC_STATUSES, DECISION_FIXED, DEPRECATED, - VOTING_IN_PREP, ALT_REC_CHOICES) + VOTING_IN_PREP, PUT_TO_VOTING, ALT_REC_CHOICES) from ..managers import EICRecommendationQuerySet @@ -104,17 +104,28 @@ class EICRecommendation(SubmissionRelatedObjectMixin, models.Model): return self.submission.eicrecommendations.last() == self return self.status != DECISION_FIXED + @property + def voting_in_preparation(self): + return self.status == VOTING_IN_PREP + + @property + def undergoing_voting(self): + return self.status == PUT_TO_VOTING + + @property + def decision_fixed(self): + return self.status == DECISION_FIXED + def get_other_versions(self): """Return other versions of EICRecommendations for this Submission.""" return self.submission.eicrecommendations.exclude(id=self.id) def get_full_status_display(self): - """Return `status` field display plus possible `recommendation` display.""" - _str = self.get_status_display() - if self.status == DECISION_FIXED and self.submission.status == STATUS_EIC_ASSIGNED: - return '{} ({})'.format(_str, self.get_recommendation_display()) - return _str - + """Return `recommendation` and `status` field display.""" + return '{} ({})'.format( + self.get_recommendation_display(), + self.get_status_display(), + ) class AlternativeRecommendation(models.Model): diff --git a/scipost_django/submissions/models/referee_invitation.py b/scipost_django/submissions/models/referee_invitation.py index 1e180dd26a22625255cd3fb877c4afbfe53ba56b..0578c91e2bcab20100b0388b6877df39b1c48357 100644 --- a/scipost_django/submissions/models/referee_invitation.py +++ b/scipost_django/submissions/models/referee_invitation.py @@ -56,7 +56,7 @@ class RefereeInvitation(SubmissionRelatedObjectMixin, models.Model): nr_reminders = models.PositiveSmallIntegerField(default=0) date_last_reminded = models.DateTimeField(blank=True, null=True) accepted = models.BooleanField( - null=True, + blank=True, null=True, choices=ASSIGNMENT_NULLBOOL, default=None ) diff --git a/scipost_django/submissions/models/submission.py b/scipost_django/submissions/models/submission.py index aef954194e439157422d4cc8339e16227d1fcfab..429dd0fa12fd757d01b1dad63a05832529acaed3 100644 --- a/scipost_django/submissions/models/submission.py +++ b/scipost_django/submissions/models/submission.py @@ -27,7 +27,7 @@ from ..constants import ( STATUS_FAILED_PRESCREENING, STATUS_RESUBMITTED, STATUS_ACCEPTED, STATUS_REJECTED, STATUS_WITHDRAWN, STATUS_PUBLISHED, SUBMISSION_CYCLES, CYCLE_DEFAULT, CYCLE_SHORT, CYCLE_DIRECT_REC, - EVENT_TYPES, EVENT_GENERAL, EVENT_FOR_AUTHOR, EVENT_FOR_EIC, + EVENT_TYPES, EVENT_GENERAL, EVENT_FOR_EDADMIN, EVENT_FOR_AUTHOR, EVENT_FOR_EIC, SUBMISSION_TIERS) from ..managers import SubmissionQuerySet, SubmissionEventQuerySet from ..refereeing_cycles import ShortCycle, DirectCycle, RegularCycle @@ -89,16 +89,13 @@ class Submission(models.Model): submitted_by = models.ForeignKey('scipost.Contributor', on_delete=models.CASCADE, related_name='submitted_submissions') - voting_fellows = models.ManyToManyField('colleges.Fellowship', blank=True, - related_name='voting_pool') - submitted_to = models.ForeignKey('journals.Journal', on_delete=models.CASCADE) proceedings = models.ForeignKey('proceedings.Proceedings', null=True, blank=True, on_delete=models.SET_NULL, related_name='submissions', help_text=( 'Don\'t find the Proceedings you are looking for? ' 'Ask the conference organizers to contact our admin ' - 'at admin@scipost.org to set things up.')) + 'to set things up.')) title = models.CharField(max_length=300) # Authors which have been mapped to contributors: @@ -191,9 +188,14 @@ class Submission(models.Model): def comments_set_complete(self): """Return Comments on Submissions, Reports and other Comments.""" - return Comment.objects.filter( + qs = Comment.objects.filter( Q(submissions=self) | Q(reports__submission=self) | - Q(comments__reports__submission=self) | Q(comments__submissions=self)).distinct() + Q(comments__reports__submission=self) | Q(comments__submissions=self)) + # Add recursive comments: + for c in qs: + if c.nested_comments: + qs = qs | c.all_nested_comments().all() + return qs.distinct() @property def cycle(self): @@ -276,7 +278,7 @@ class Submission(models.Model): return timezone.now() > self.reporting_deadline - datetime.timedelta(days=7) @property - def is_open_for_reporting(self): + def is_open_for_reporting_within_deadline(self): """Check if Submission is open for reporting and within deadlines.""" return self.open_for_reporting and not self.reporting_deadline_has_passed @@ -291,6 +293,10 @@ class Submission(models.Model): return Submission.objects.filter( thread_hash=self.thread_hash, is_resubmission_of__isnull=True).first().submission_date + @property + def in_prescreening(self): + return self.status == STATUS_INCOMING + @property def in_refereeing_phase(self): """Check if Submission is in active refereeing phase. @@ -314,7 +320,7 @@ class Submission(models.Model): return True # Maybe: Check for unvetted Reports? - return self.status == STATUS_EIC_ASSIGNED and self.is_open_for_reporting + return self.status == STATUS_EIC_ASSIGNED and self.is_open_for_reporting_within_deadline @property def can_reset_reporting_deadline(self): @@ -331,6 +337,12 @@ class Submission(models.Model): return self.editor_in_charge is not None + @property + def thread_full(self): + """Return all Submissions in the database in this thread.""" + return Submission.objects.filter(thread_hash=self.thread_hash).order_by( + '-submission_date', '-preprint') + @property def thread(self): """Return all (public) Submissions in the database in this thread.""" @@ -355,32 +367,25 @@ class Submission(models.Model): """Return the latest known version in the thread of this Submission.""" return self.thread.first() - def add_general_event(self, message): - """Generate message meant for EIC and authors.""" - event = SubmissionEvent( - submission=self, - event=EVENT_GENERAL, - text=message, - ) + def _add_event(self, sort, message): + event = SubmissionEvent(submission=self, event=sort, text=message) event.save() - def add_event_for_author(self, message): - """Generate message meant for authors only.""" - event = SubmissionEvent( - submission=self, - event=EVENT_FOR_AUTHOR, - text=message, - ) - event.save() + def add_general_event(self, message): + """Generate message meant for EdAdmin, EIC and authors.""" + self._add_event(EVENT_GENERAL, message) + + def add_event_for_edadmin(self, message): + """Generate message meant for EdAdmin only.""" + self._add_event(EVENT_FOR_EDADMIN, message) def add_event_for_eic(self, message): """Generate message meant for EIC and Editorial Administration only.""" - event = SubmissionEvent( - submission=self, - event=EVENT_FOR_EIC, - text=message, - ) - event.save() + self._add_event(EVENT_FOR_EIC, message) + + def add_event_for_author(self, message): + """Generate message meant for authors only.""" + self._add_event(EVENT_FOR_AUTHOR, message) def flag_coauthorships_arxiv(self, fellows): """Identify coauthorships from arXiv, using author surname matching.""" diff --git a/scipost_django/submissions/permissions.py b/scipost_django/submissions/permissions.py new file mode 100644 index 0000000000000000000000000000000000000000..b9cd3d3f0a00ab133d82a10d05f417c341186651 --- /dev/null +++ b/scipost_django/submissions/permissions.py @@ -0,0 +1,14 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + +from colleges.models import Fellowship + +def is_edadmin_or_senior_fellow(user): + if not user.has_perm('scipost.can_run_pre_screening'): + try: + fellow = Fellowship.objects.get(contributor__user=user) + return fellow.senior + except: + return False + return True diff --git a/scipost_django/submissions/plagiarism.py b/scipost_django/submissions/plagiarism.py index 9ed5ea933a1710d8aeaf733cfd2575e815e08cad..823775c091f12ed03a38e064d198273f8ca28e28 100644 --- a/scipost_django/submissions/plagiarism.py +++ b/scipost_django/submissions/plagiarism.py @@ -5,6 +5,7 @@ __license__ = "AGPL v3" from django.conf import settings from .exceptions import InvalidDocumentError +from common.utils import unaccent import iThenticate as iThenticateAPI @@ -87,9 +88,9 @@ class iThenticate: response = self.client.documents.add( document, folder_id, - author.user.first_name, - author.user.last_name, - submission.title, + unaccent(author.user.first_name), + unaccent(author.user.last_name), + unaccent(submission.title), ) if response['status'] == 200: diff --git a/scipost_django/submissions/refereeing_cycles.py b/scipost_django/submissions/refereeing_cycles.py index b0260c951ac9af024f6b58057c5d7a035377f8c1..01b1528f3d2e58a7d493e600a3f71e80b8456a6d 100644 --- a/scipost_django/submissions/refereeing_cycles.py +++ b/scipost_django/submissions/refereeing_cycles.py @@ -241,8 +241,8 @@ class BaseCycle: action.needs_referees = not self._submission.reports.non_draft().exists() self.add_action(action) - # Submission is a resubmission: EIC has to determine which cycle to proceed with. - comments_to_vet = self._submission.comments.awaiting_vetting() + # Comments requiring vetting (including replies and recursive comments) + comments_to_vet = self._submission.comments_set_complete().awaiting_vetting() for comment in comments_to_vet: self.add_action(VettingAction(comment)) diff --git a/scipost_django/submissions/regexes.py b/scipost_django/submissions/regexes.py new file mode 100644 index 0000000000000000000000000000000000000000..fc441af822d0c47c3baf7bcce1273970f82888b1 --- /dev/null +++ b/scipost_django/submissions/regexes.py @@ -0,0 +1,40 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + +# Preprint-related regexes +scipost_regex_wo_vn = 'scipost_[0-9]{4,}_[0-9]{4,}' +scipost_regex_w_vn = 'scipost_[0-9]{4,}_[0-9]{4,}v[0-9]{1,2}' +arxiv_regex_wo_vn = '[0-9]{4,}.[0-9]{4,}' +arxiv_regex_w_vn = '[0-9]{4,}.[0-9]{4,}v[0-9]{1,2}' +# pre-2021-07 ChemRxiv: to be removed/deprecated +chemrxiv_regex_wo_vn = 'chemrxiv_[0-9]+' +chemrxiv_regex_w_vn = 'chemrxiv_[0-9]+.v[0-9]{1,2}' +# post-2021-07 ChemRxiv: fits both 10.####(#)/chemrxiv.#####(.v#)? and 10.####(#)/chemrxiv-YYYY-****(-v#)? +CHEMRXIV_DOI_PATTERN = '10.[0-9]{4,5}/chemrxiv([.-][0-9]{4,})?[.-][\w]+([.-]v[0-9]+)?' +techrxiv_regex_wo_vn = 'techrxiv_[0-9]+' +techrxiv_regex_w_vn = 'techrxiv_[0-9]+.v[0-9]{1,2}' +advance_regex_wo_vn = 'advance_[0-9]+' +advance_regex_w_vn = 'advance_[0-9]+.v[0-9]{1,2}' +socarxiv_regex = 'socarxiv_[a-z0-9]+' + +# Preprints with structurally no version number +# (like OSFPreprints-based ones: SocArXiv, ...) +# must not match IDENTIFIER_REGEX to avoid ambiguities. +IDENTIFIER_WO_VN_NR_REGEX = '|'.join([ + scipost_regex_wo_vn, + arxiv_regex_wo_vn, + chemrxiv_regex_wo_vn, + techrxiv_regex_wo_vn, + advance_regex_wo_vn, +]) + +IDENTIFIER_REGEX = '|'.join([ + scipost_regex_w_vn, + arxiv_regex_w_vn, + chemrxiv_regex_w_vn, + CHEMRXIV_DOI_PATTERN, + techrxiv_regex_w_vn, + advance_regex_w_vn, + socarxiv_regex +]) diff --git a/scipost_django/submissions/templates/submissions/_author_guidelines.html b/scipost_django/submissions/templates/submissions/_author_guidelines.html index 003de168944e8bd8703ec6ef82eb684714354eb5..e62e78a1c24f34e4f80a98c116aacc2723dbd0fe 100644 --- a/scipost_django/submissions/templates/submissions/_author_guidelines.html +++ b/scipost_django/submissions/templates/submissions/_author_guidelines.html @@ -133,7 +133,7 @@ <li> <h4>My submission has been sitting in pre-screening for longer than 5 days. What is happening?</h4> <p> - We strive to keep the pre-screening process to under 5 days. SciPost is still growing; since the number of Fellows we have (and their availability) in each specialty varies, it can be that pre-screening lasts a bit longer. Our Editorial Administration does its best to minimize delays, and will get in touch with you if these become too big. If you are concerned, <a href="mailto:edadmin@scipost.org">email us</a>. + We strive to keep the pre-screening process to under 5 days. SciPost is still growing; since the number of Fellows we have (and their availability) in each specialty varies, it can be that pre-screening lasts a bit longer. Our Editorial Administration does its best to minimize delays, and will get in touch with you if these become too big. If you are concerned, <a href="mailto:edadmin@{{ request.get_host }}">email us</a>. </p> </li> <li> @@ -184,7 +184,7 @@ <li> <h4>How long does the Editorial College take to do its voting?</h4> <p> - In simple cases, it is usually possible to gather the relevant votes within one week. If a discussion ensues within the College, the voting period can sometimes take longer. If you are concerned with the status of your submission, you can <a href="mailto:edadmin@scipost.org">email us</a>. + In simple cases, it is usually possible to gather the relevant votes within one week. If a discussion ensues within the College, the voting period can sometimes take longer. If you are concerned with the status of your submission, you can <a href="mailto:edadmin@{{ request.get_host }}">email us</a>. </p> </li> </ul> diff --git a/scipost_django/submissions/templates/submissions/_referee_guidelines.html b/scipost_django/submissions/templates/submissions/_referee_guidelines.html index 6da30667da0841b8a0f930be5b86509f6ad87b92..466f541abee543a9bd785b4ce74e71890c0c7d2b 100644 --- a/scipost_django/submissions/templates/submissions/_referee_guidelines.html +++ b/scipost_django/submissions/templates/submissions/_referee_guidelines.html @@ -91,7 +91,7 @@ </p> <p> If you feel that a conflict of interest exists, or if you have doubts, you should email our - <a href="mailto:edadmin@scipost.org">editorial administration</a>, explaining the matter. + <a href="mailto:edadmin@{{ request.get_host }}">editorial administration</a>, explaining the matter. </p> </li> <li> @@ -240,7 +240,7 @@ </p> <p> Should you wish to be permanently removed from our list of referees, - please email our <a href="mailto:edadmin@scipost.org">editorial administration</a>. + please email our <a href="mailto:edadmin@{{ request.get_host }}">editorial administration</a>. </p> </li> <li> diff --git a/scipost_django/submissions/templates/submissions/_refereeing_pack_tex_template.html b/scipost_django/submissions/templates/submissions/_refereeing_pack_tex_template.html index cbaa84614b1b48773bcb8d67dc47a98db6cfb098..6b68885e8954f525a959975509c9fc6876877654 100644 --- a/scipost_django/submissions/templates/submissions/_refereeing_pack_tex_template.html +++ b/scipost_django/submissions/templates/submissions/_refereeing_pack_tex_template.html @@ -16,10 +16,10 @@ urlcolor={blue!80!black} \fancypagestyle{SPstyle}{ \fancyhf{} -\lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} +\lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://{{ domain }}}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} {% if report.doi_string %} - \rhead{\small \href{https://scipost.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} + \rhead{\small \href{https://{{ domain }}{{ report.doi_string|safe_tex_url }} }{ {{ report.doi_string|safe_tex_url }} ({{ report.date_submitted|date:'Y' }})}} {% endif %} \renewcommand{\headrulewidth}{1pt} @@ -33,23 +33,23 @@ urlcolor={blue!80!black} \begin{center} \Large\color{scipostdeepblue}{\textbf{ %%%%%%%%%% TITLE + AUTHORS -Refereeing Package of\href{https://scipost.org{{submission.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{submission.title}} }}by {{submission.author_list}} +Refereeing Package of\href{https://{{ domain }}{{ submission.get_absolute_url|safe_tex_url }} }{\color{scipostdeepblue}{ {{ submission.title }} }}by {{ submission.author_list }} }} \end{center} \begin{center} \Large\color{scipostdeepblue}{\textbf{ %%%%%%%%%% ARXIV CODE -\href{https://scipost.org{{submission.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{ submission.preprint.identifier_w_vn_nr }} }} +\href{https://{{ domain }}{{ submission.get_absolute_url|safe_tex_url }} }{\color{scipostdeepblue}{ {{ submission.preprint.identifier_w_vn_nr }} }} }} \end{center} \vspace{10pt} %%%%%%%%%% DATES -\small{\ \\Received {{submission.submission_date|date:'d-m-Y'}}\newline -{% if submission.acceptance_date %}Accepted {{submission.acceptance_date|date:'d-m-Y'}} \newline{% endif %} -Submitted to {{submission.submitted_to}} +\small{\ \\Received {{ submission.submission_date|date:'d-m-Y' }}\newline +{% if submission.acceptance_date %}Accepted {{ submission.acceptance_date|date:'d-m-Y' }} \newline{% endif %} +Submitted to {{ submission.submitted_to }} } @@ -67,25 +67,25 @@ Submitted to {{submission.submitted_to}} \newpage \setcounter{section}{0} - \addcontentsline{toc}{section}{\protect\numberline{}Report {{report.report_nr}}{% if report.doi_string %} $\cdot$ doi: {{report.doi_string|safe_tex_url}}{% endif %} } + \addcontentsline{toc}{section}{\protect\numberline{}Report {{ report.report_nr }}{% if report.doi_string %} $\cdot$ doi: {{ report.doi_string|safe_tex_url }}{% endif %} } - \fancypagestyle{SPstylereport{{report.id}} }{ + \fancypagestyle{SPstylereport{{ report.id }} }{ \fancyhf{} - \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} + \lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://{{ domain }}}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} {% if report.doi_string %} - \rhead{\small \href{https://scipost.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} + \rhead{\small \href{https://{{ domain }}{{ report.doi_string|safe_tex_url }} }{ {{ report.doi_string|safe_tex_url }} ({{ report.date_submitted|date:'Y' }})}} {% endif %} \renewcommand{\headrulewidth}{1pt} \fancyfoot[C]{\textbf{\thepage}} } - \pagestyle{SPstylereport{{report.id}} } + \pagestyle{SPstylereport{{ report.id }} } \begin{center} \Large\color{scipostdeepblue}{\textbf{ %%%%%%%%%% TITLE - Report {{report.report_nr}} on\href{https://scipost.org{{report.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{report.submission.title}} }}by {{report.submission.author_list}} + Report {{ report.report_nr }} on\href{https://{{ domain }}{{ report.get_absolute_url|safe_tex_url }} }{\color{scipostdeepblue}{ {{ report.submission.title }} }}by {{ report.submission.author_list }} }} \end{center} @@ -93,7 +93,7 @@ Submitted to {{submission.submitted_to}} \begin{center} \Large\color{scipostdeepblue}{\textbf{ %%%%%%%%%% TITLE - doi:\href{https://scipost.org{{report.get_absolute_url|safe_tex_url}} }{\color{scipostdeepblue}{ {{report.doi_string|safe_tex_url}} }} + doi:\href{https://{{ domain }}{{ report.get_absolute_url|safe_tex_url }} }{\color{scipostdeepblue}{ {{ report.doi_string|safe_tex_url }} }} }} \end{center} {% endif %} @@ -101,14 +101,14 @@ Submitted to {{submission.submitted_to}} \begin{center} \large\textbf{ %%%%%%%%%% AUTHORS - Report by {% if report.anonymous %}anonymous{% else %}{{report.author.user.first_name}} {{report.author.user.last_name}}\textsuperscript{1}{% endif %} + Report by {% if report.anonymous %}anonymous{% else %}{{ report.author.user.first_name }} {{ report.author.user.last_name }}\textsuperscript{1}{% endif %} } \end{center} {% if not report.anonymous %} \begin{center} %%%%%%%%%% AFFILIATIONS - {\bf 1} {{report.author.affiliation}}\\ + {\bf 1} {{ report.author.affiliation }}\\ \end{center} {% endif %} @@ -123,7 +123,7 @@ Submitted to {{submission.submitted_to}} %%%%%%%%%% COPYRIGHT - {\small Copyright {% if report.anonymous %}anonymous{% else %}{{report.author.user.first_name}} {{report.author.user.last_name}}{% endif %}. \newline + {\small Copyright {% if report.anonymous %}anonymous{% else %}{{ report.author.user.first_name }} {{ report.author.user.last_name }}{% endif %}. \newline This work is licensed under the Creative Commons \newline \href{http://creativecommons.org/licenses/by/4.0/}{Attribution 4.0 International License}. \newline Published by the SciPost Foundation. @@ -132,9 +132,9 @@ Submitted to {{submission.submitted_to}} & \begin{minipage}{0.5\textwidth} %%%%%%%%%% DATES - {\small Received {{report.date_submitted|date:'d-m-Y'}} + {\small Received {{ report.date_submitted|date:'d-m-Y' }} {% if report.doi_string %} - doi:\href{//dx.doi.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} } + doi:\href{//doi.org{{ report.doi_string|safe_tex_url }} }{ {{ report.doi_string|safe_tex_url }} } {% endif %} } \end{minipage} @@ -149,24 +149,24 @@ Submitted to {{submission.submitted_to}} \section*{Ratings} \begin{center} \begin{tabular}{r p{0.15\columnwidth} r l} - {\bf Validity} & {{report.get_validity_display}} & {\bf Clarity} & {{report.get_clarity_display}} \\ - {\bf Significance} & {{report.get_significance_display}} & {\bf Formatting} & {{report.get_formatting_display}} \\ - {\bf Originality} & {{report.get_originality_display}} & {\bf Grammar} & {{report.get_grammar_display}} + {\bf Validity} & {{ report.get_validity_display }} & {\bf Clarity} & {{ report.get_clarity_display }} \\ + {\bf Significance} & {{ report.get_significance_display }} & {\bf Formatting} & {{ report.get_formatting_display }} \\ + {\bf Originality} & {{ report.get_originality_display }} & {\bf Grammar} & {{ report.get_grammar_display }} \end{tabular} \end{center} \section*{Strengths} - {{report.strengths|linebreaktex}} + {{ report.strengths|linebreaktex }} \section*{Weaknesses} - {{report.weaknesses|linebreaktex}} + {{ report.weaknesses|linebreaktex }} \section*{Report} - {{report.report|linebreaktex}} + {{ report.report|linebreaktex }} \section*{Requested changes} - {{report.requested_changes|linebreaktex}} + {{ report.requested_changes|linebreaktex }} {% if report.comments.vetted %} @@ -175,9 +175,9 @@ Submitted to {{submission.submitted_to}} \section*{Comments and Author Replies to this Report} {% for comment in report.comments.vetted %} - \addcontentsline{toc}{subsection}{\protect\numberline{}{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} to Report by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + \addcontentsline{toc}{subsection}{\protect\numberline{}{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{ forloop.counter }} to Report by {% if comment.anonymous %}anonymous{% else %}{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}{% endif %} } - \subsection*{ {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} to Report by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + \subsection*{ {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{ forloop.counter }} to Report by {% if comment.anonymous %}anonymous{% else %}{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}{% endif %} } {% include 'comments/_comment_tex_template.html' with comment=comment %} {% endfor %} {% endif %} @@ -190,9 +190,9 @@ Submitted to {{submission.submitted_to}} \pagestyle{SPstyle} {% for comment in submission.comments.vetted %} - \addcontentsline{toc}{section}{\protect\numberline{}{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + \addcontentsline{toc}{section}{\protect\numberline{}{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{ forloop.counter }} by {% if comment.anonymous %}anonymous{% else %}{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}{% endif %} } - \section*{ {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{forloop.counter}} by {% if comment.anonymous %}anonymous{% else %}{{comment.author.user.first_name}} {{comment.author.user.last_name}}{% endif %} } + \section*{ {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} {{ forloop.counter }} by {% if comment.anonymous %}anonymous{% else %}{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}{% endif %} } {% include 'comments/_comment_tex_template.html' with comment=comment %} {% endfor %} {% endif %} diff --git a/scipost_django/submissions/templates/submissions/_report_li_content.html b/scipost_django/submissions/templates/submissions/_report_li_content.html new file mode 100644 index 0000000000000000000000000000000000000000..b257e06ed039bd71c14af4303e67154b9f06b6b1 --- /dev/null +++ b/scipost_django/submissions/templates/submissions/_report_li_content.html @@ -0,0 +1,6 @@ +{% include 'submissions/_submission_li.html' with submission=report.submission %} + +<div class="card-body {% block cardblock_class_block %}{% endblock %}"> + <h3><a href="{{ report.get_absolute_url }}">Report {{ report.report_nr }}</a> by {% if report.anonymous %}<em>anonymous</em>{% else %}<a href="{{ report.author.get_absolute_url }}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a>{% endif %}</h3> + <h4>Received: {{ report.date_submitted|date:'Y-n-j' }}</h4> +</div> diff --git a/scipost_django/submissions/templates/submissions/_report_summary.html b/scipost_django/submissions/templates/submissions/_report_summary.html index 1db60b76f8432420a1018639353ad9bd9342caca..9cd93e526d071c832e772fc5b96515eb5f84ef97 100644 --- a/scipost_django/submissions/templates/submissions/_report_summary.html +++ b/scipost_django/submissions/templates/submissions/_report_summary.html @@ -1,5 +1,5 @@ <div class="card-body {% block cardblock_class_block %}{% endblock %}"> - <h3>{{report.get_status_display}} Report {{report.report_nr}} by {% if report.anonymous %}<em>anonymous</em>{% else %}<a href="{{report.author.get_absolute_url}}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a>{% endif %}</h3> + <h3>{{ report.get_status_display }} Report {{ report.report_nr }} by {% if report.anonymous %}<em>anonymous</em>{% else %}<a href="{{ report.author.get_absolute_url }}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a>{% endif %}</h3> <h4>Received: {{ report.date_submitted|date:'Y-n-j' }}</h4> - On Submission: <a href="{{report.submission.get_absolute_url}}">{{report.submission}}</a> + On Submission: <a href="{{ report.submission.get_absolute_url }}">{{ report.submission }}</a> </div> diff --git a/scipost_django/submissions/templates/submissions/_report_tex_template.html b/scipost_django/submissions/templates/submissions/_report_tex_template.html index f68d275bad5f586f80dd1b260562a7ec8627c2c6..2920948be9db444c9a20c7d3b23b5437aa9fe535 100644 --- a/scipost_django/submissions/templates/submissions/_report_tex_template.html +++ b/scipost_django/submissions/templates/submissions/_report_tex_template.html @@ -16,10 +16,10 @@ urlcolor={blue!80!black} \fancypagestyle{SPstyle}{ \fancyhf{} -\lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://scipost.org}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} +\lhead{\raisebox{-1.5mm}[0pt][0pt]{\href{https://{{ domain }}}{\includegraphics[width=20mm]{logo_scipost_with_bgd.pdf}}}} {% if report.doi_string %} - \rhead{\small \href{https://scipost.org{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} + \rhead{\small \href{https://{{ domain }}{{report.doi_string|safe_tex_url}} }{ {{report.doi_string|safe_tex_url}} ({{report.date_submitted|date:'Y'}})}} {% endif %} \renewcommand{\headrulewidth}{1pt} @@ -34,7 +34,7 @@ urlcolor={blue!80!black} \Large\color{scipostdeepblue}{\textbf{ %%%%%%%%%% TITLE Report nr {{report.report_nr}} on Submission {{ report.submission.preprint.identifier_w_vn_nr }},\\ -\href{https://scipost.org{{report.submission.get_absolute_url|safe_tex_url}}}{\color{scipostdeepblue}{ {{report.submission.title}} }}by {{report.submission.author_list}} +\href{https://{{ domain }}{{report.submission.get_absolute_url|safe_tex_url}}}{\color{scipostdeepblue}{ {{report.submission.title}} }}by {{report.submission.author_list}} }} \end{center} diff --git a/scipost_django/submissions/templates/submissions/_submission_quick_actions.html b/scipost_django/submissions/templates/submissions/_submission_quick_actions.html index 5af59426dbee368e2d86237a3e9a8bc3538f3095..de0e4616b877e92920bf89eb288b10a76536c593 100644 --- a/scipost_django/submissions/templates/submissions/_submission_quick_actions.html +++ b/scipost_django/submissions/templates/submissions/_submission_quick_actions.html @@ -2,13 +2,16 @@ <div class="submission-quick-actions"> <h3>Actions</h3> <ul class="my-2 ps-4"> - {% if submission.is_open_for_reporting and perms.scipost.can_referee %} + {% if unfinished_report_for_user %} + <li>{% include 'bi/exclamation-circle-fill.html' %} You have an unfinished report for this submission. You can <a href="{% url 'submissions:submit_report' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">finish your report here</a>.</li> + {% endif %} + {% if submission.open_for_reporting and perms.scipost.can_referee %} <li> <h4> {% if not is_author and not is_author_unchecked %} - <a href="mailto:?subject=Contribute a Report on a Submission to SciPost?&body={% autoescape on %}{% include 'submissions/contributor_referee_invitation_email.html' %}{% endautoescape %}&cc=edadmin@scipost.org">Invite an expert you know to contribute a Report</a> + <a href="mailto:?subject=Contribute a Report on a Submission to SciPost?&body={% autoescape on %}{% include 'submissions/contributor_referee_invitation_email.html' %}{% endautoescape %}&cc=edadmin@{{ request.get_host }}">Invite an expert you know to contribute a Report</a> {% else %} - <a href="mailto:?subject=Contribute a Report on a Submission to SciPost?&body={% autoescape on %}{% include 'submissions/author_referee_invitation_email.html' %}{% endautoescape %}&cc=edadmin@scipost.org">Invite an expert you know to contribute a Report</a> + <a href="mailto:?subject=Contribute a Report on a Submission to SciPost?&body={% autoescape on %}{% include 'submissions/author_referee_invitation_email.html' %}{% endautoescape %}&cc=edadmin@{{ request.get_host }}">Invite an expert you know to contribute a Report</a> {% endif %} </h4> </li> @@ -44,8 +47,6 @@ </div> </li> {% endif %} - {% elif unfinished_report_for_user %} - <li>{% include 'bi/exclamation-circle-fill.html' %} You have an unfinished report for this submission. You can <a href="{% url 'submissions:submit_report' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">finish your report here</a>.</li> {% else %} <li class="py-1">Reporting for this Submission is closed.</li> {% endif %} diff --git a/scipost_django/submissions/templates/submissions/_submission_refereeing_history.html b/scipost_django/submissions/templates/submissions/_submission_refereeing_history.html index ed2ea876148433c7851734f86760582e9f5bbc1a..a5f9b4afebfd6ee9a5d32ac92f6890a6924b462b 100644 --- a/scipost_django/submissions/templates/submissions/_submission_refereeing_history.html +++ b/scipost_django/submissions/templates/submissions/_submission_refereeing_history.html @@ -1,29 +1,29 @@ +{% load submissions_extras %} {% load request_filters %} <div class="submission-contents"> <h3>Submission & Refereeing History</h3> {% if perms.scipost.can_oversee_refereeing %} <small class="text-muted">Thread {{ submission.thread_hash }} - <br/>(all emails concerning this stream contain this uuid)</small> + <br/>(all emails concerning this stream contain this uuid)</small> {% endif %} - {% for sibling in submission.thread.public %} - <div class="p-2{% if sibling.preprint.identifier_w_vn_nr in request.path %} border border-secondary{% endif %}"> - {% if sibling.preprint.identifier_w_vn_nr in request.path %} - <p class="text-center bg-info"><em>You are currently on this page</em></p> - {% endif %} - <div class="mt-3 mb-1"> - {% if sibling.is_resubmission_of %}Resubmission{% else %}Submission{% endif %} <a href="{{ sibling.get_absolute_url }}" class="pubtitleli"{% if target_blank %} target="_blank"{% endif %}>{{ sibling.preprint.identifier_w_vn_nr }}</a> on {{ sibling.submission_date|date:'j F Y' }} + {% if perms.scipost.can_oversee_refereeing or request.user|is_in_submission_fellowship:submission %} + {% for sibling in submission.thread_full %} + <div class="p-2{% if sibling.preprint.identifier_w_vn_nr in request.path %} border border-secondary{% endif %}"> + {% include 'submissions/_submission_refereeing_history_entry.html' with sibling=sibling %} + {% include 'comments/_comments_list.html' with comments=sibling.comments.vetted css_class='my-2 ps-4' target_blank=target_blank %} </div> - <ul class="my-2 ps-4"> - {% for report in sibling.reports.accepted %} - <li><a href="{{ report.get_absolute_url }}"{% if target_blank %} target="_blank"{% endif %}>Report {{ report.report_nr }} submitted on {{ report.date_submitted }} by {% if report.anonymous %}<em>Anonymous</em>{% else %}{{ report.author.profile.get_title_display }} {{ report.author.user.last_name }}{% endif %}</a></li> - {% include 'comments/_comments_list.html' with comments=report.comments.vetted css_class='my-1 ps-4' target_blank=target_blank %} - {% endfor %} - </ul> - </div> - - {% include 'comments/_comments_list.html' with comments=sibling.comments.vetted css_class='my-2 ps-4' target_blank=target_blank %} - {% empty %} - <em>There are no publicly visible links available yet.</em> - {% endfor %} + {% empty %} + <em>There are no visible links available yet.</em> + {% endfor %} + {% else %} + {% for sibling in submission.thread %} + <div class="p-2{% if sibling.preprint.identifier_w_vn_nr in request.path %} border border-secondary{% endif %}"> + {% include 'submissions/_submission_refereeing_history_entry.html' with sibling=sibling %} + {% include 'comments/_comments_list.html' with comments=sibling.comments.vetted css_class='my-2 ps-4' target_blank=target_blank %} + </div> + {% empty %} + <em>There are no publicly visible links available yet.</em> + {% endfor %} + {% endif %} </div> diff --git a/scipost_django/submissions/templates/submissions/_submission_refereeing_history_entry.html b/scipost_django/submissions/templates/submissions/_submission_refereeing_history_entry.html new file mode 100644 index 0000000000000000000000000000000000000000..8917b787920cfa45f899385216b28fc6089a7d92 --- /dev/null +++ b/scipost_django/submissions/templates/submissions/_submission_refereeing_history_entry.html @@ -0,0 +1,12 @@ +{% if sibling.preprint.identifier_w_vn_nr in request.path %} + <p class="text-center bg-info"><em>You are currently on this page</em></p> +{% endif %} +<div class="mt-3 mb-1"> + {% if sibling.is_resubmission_of %}Resubmission{% else %}Submission{% endif %} <a href="{{ sibling.get_absolute_url }}" class="pubtitleli"{% if target_blank %} target="_blank"{% endif %}>{{ sibling.preprint.identifier_w_vn_nr }}</a> on {{ sibling.submission_date|date:'j F Y' }} +</div> +<ul class="my-2 ps-4"> + {% for report in sibling.reports.accepted %} + <li><a href="{{ report.get_absolute_url }}"{% if target_blank %} target="_blank"{% endif %}>Report {{ report.report_nr }} submitted on {{ report.date_submitted }} by {% if report.anonymous %}<em>Anonymous</em>{% else %}{{ report.author.profile.get_title_display }} {{ report.author.user.last_name }}{% endif %}</a></li> + {% include 'comments/_comments_list.html' with comments=report.comments.vetted css_class='my-1 ps-4' target_blank=target_blank %} + {% endfor %} +</ul> diff --git a/scipost_django/submissions/templates/submissions/admin/editorial_assignment_form.html b/scipost_django/submissions/templates/submissions/admin/editorial_assignment_form.html deleted file mode 100644 index 8d2f558f0ca502fa49eb5ad51dd44c52d15e2fed..0000000000000000000000000000000000000000 --- a/scipost_django/submissions/templates/submissions/admin/editorial_assignment_form.html +++ /dev/null @@ -1,101 +0,0 @@ -{% extends 'submissions/pool/base.html' %} - -{% load bootstrap %} - -{% block pagetitle %}: assign submission{% endblock pagetitle %} - -{% block breadcrumb_items %} - {{block.super}} - <a href="{% url 'submissions:pool' %}" class="breadcrumb-item">Pool</a> - <a href="{% url 'submissions:editorial_page' submission_to_assign.preprint.identifier_w_vn_nr %}" class="breadcrumb-item">Editorial Page ({{submission_to_assign.preprint.identifier_w_vn_nr}})</a> - <span class="breadcrumb-item">Assign Submission</span> -{% endblock %} - -{% block content %} - - <div class="row"> - <div class="col-12"> - <h1 class="highlight">SciPost Submission: send an Assignment Request</h1> - </div> - </div> - - {% include 'submissions/_submission_summary.html' with submission=submission_to_assign show_abstract=1 %} - - <div class="row"> - <div class="col-12"> - {% if submission_to_assign.referees_suggested %} - <h3>Referees suggested by the authors upon submission (treat with due care):</h3> - <p>{{ submission_to_assign.referees_suggested }}</p> - {% endif %} - - {% if submission_to_assign.referees_flagged %} - <h3>Referees flagged upon submission (treat reports with caution):</h3> - <p>{{ submission_to_assign.referees_flagged }}</p> - {% endif %} - - {% include 'submissions/_submission_status.html' with submission=submission_to_assign %} - </div> - </div> - - <div class="row"> - <div class="col-12"> - {% if submission_to_assign.editorial_assignments.exists %} - <h4>EIC Assignment requests already sent:</h4> - <h3>If more than 5 Fellows have declined an assignment for a red-marked reason, the Submission should be rejected.</h3> - <ul> - {% for assignment in sub.editorial_assignments.all %} - {% include 'submissions/pool/_assignment_info.html' with assignment=assignment %} - {% endfor %} - </ul> - {% endif %} - </div> - </div> - - <div class="row mb-md-4"> - <div class="col-12"> - <h2 class="highlight">Send a new assignment request:</h2> - <form action="{% url 'submissions:assign_submission' identifier_w_vn_nr=submission_to_assign.preprint.identifier_w_vn_nr %}" method="post"> - {% csrf_token %} - {{ form|bootstrap }} - <input class="btn btn-outline-secondary" type="submit" value="Submit" /> - </form> - </div> - </div> - - - <div class="row"> - <div class="col-12"> - <a href="?flag=1">Refresh all conflicts</a> - <br> - {% if coauthorships %} - <div class="card border-danger"> - <div class="card-body"> - <h3 class="card-title text-danger">The system identified the following potential coauthorships (from arXiv database)</h3> - <p class="card-text text-danger">(only up to 5 most recent shown; if within the last 3 years, referee is disqualified):</p> - </div> - <div class="card-body"> - <ul class="list-group list-group-flush"> - {% for author, entries in coauthorships.items %} - <li class="list-group-item pt-3"> - <div class="card-content"> - <h3>For Fellow: {{ author }}</h3> - </div>{{ value}} - </li> - {% for entry in entries %} - <li class="list-group-item"> - {% include 'submissions/_arxiv_queryresult.html' with item=entry id=forloop.counter id2=forloop.parentloop.counter %} - </li> - {% endfor %} - {% endfor %} - </ul> - </div> - </div> - {% else %} - <h3 class="text-success">The system has not identified any coauthorships (from arXiv database)</h3> - {% endif %} - </div> - </div> - - - -{% endblock %} diff --git a/scipost_django/submissions/templates/submissions/admin/report_compile_form.html b/scipost_django/submissions/templates/submissions/admin/report_compile_form.html index afdecada047f863fccfa58e1086f37c72650f216..ae062997952204372625970db18bd0758bd66587 100644 --- a/scipost_django/submissions/templates/submissions/admin/report_compile_form.html +++ b/scipost_django/submissions/templates/submissions/admin/report_compile_form.html @@ -25,7 +25,7 @@ <div class="row"> <div class="col-12"> <h3>Please process this code in your Tex Compiler:</h3> - <p>To compile, one needs the SciPost Latex Package. Please <a href="mailto: info@scipost.org">contact SciPost</a> if you did not receive it.</p> + <p>To compile, one needs the SciPost Latex Package. Please <a href="mailto: edadmin@{{ request.get_host }}">contact SciPost</a> if you did not receive it.</p> <pre class="clickfocus" style="max-height: 200px;"><code>{% include 'submissions/_report_tex_template.html' with report=report %}</code></pre> </div> </div> diff --git a/scipost_django/submissions/templates/submissions/admin/submission_preassign_editors.html b/scipost_django/submissions/templates/submissions/admin/submission_preassign_editors.html index ec4594e316b58a345537e35457bf58808c8e7b79..ab51dde39e1aad00d2943723af0a15faf212f102 100644 --- a/scipost_django/submissions/templates/submissions/admin/submission_preassign_editors.html +++ b/scipost_django/submissions/templates/submissions/admin/submission_preassign_editors.html @@ -2,6 +2,7 @@ {% load bootstrap %} {% load scipost_extras %} +{% load user_groups %} {% load conflict_tags %} {% block pagetitle %}: Submission Editors{% endblock pagetitle %} @@ -18,6 +19,7 @@ {% block content %} + {% is_ed_admin request.user as is_ed_admin %} <h1 class="highlight">Submission editor invitations</h1> <h3><a href="{{ submission.get_absolute_url }}">{{ submission.title }}</a></h3> @@ -29,18 +31,22 @@ <br> - <ul> - <li><a href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}">Go to editorial page</a></li> - {% if submission.status == 'incoming' %} - <li><a href="{% url 'submissions:do_prescreening' submission.preprint.identifier_w_vn_nr %}">Go to pre-screening page</a></li> - {% else %} - <li><a href="{% url 'submissions:prescreening_failed' submission.preprint.identifier_w_vn_nr %}">Close: pre-screening failed</a></li> - <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 1 %}">Update authors by email (1 week into screening)</a></li> - <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 2 %}">Update authors by email (2 weeks into screening)</a></li> - <li><a href="{% url 'submissions:assignment_failed' submission.preprint.identifier_w_vn_nr %}">Close: screening failed (failure to find EIC)</a></li> - {% endif %} - </ul> - + {% if is_ed_admin %} + <div class="border border-danger mt-3 p-2"> + <h3>Editorial Administration</h3> + <ul> + <li><a href="{% url 'colleges:submission' submission.preprint.identifier_w_vn_nr %}">Manage this Submission's Fellowship</a></li> + <li><a href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}">Go to editorial page</a></li> + {% if submission.status == 'incoming' %} + <li><a href="{% url 'submissions:do_prescreening' submission.preprint.identifier_w_vn_nr %}">Go to pre-screening page</a></li> + {% else %} + <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 1 %}">Update authors by email (1 week into screening)</a></li> + <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 2 %}">Update authors by email (2 weeks into screening)</a></li> + <li><a href="{% url 'submissions:assignment_failed' submission.preprint.identifier_w_vn_nr %}">Close: screening failed (failure to find EIC)</a></li> + {% endif %} + </ul> + </div> + {% endif %} <h3 class="highlight">Current invitations</h3> <table class="submission" id="current-status"> @@ -59,7 +65,7 @@ <td style="min-width: 200px;">Conflict of interests:</td> <td> {% if submission.needs_conflicts_update %} - Conflict of interest awaiting update. <a href="mailto:techsupport@scipost.org">Contact techsupport</a> if this is not automatically resolved soon. + Conflict of interest awaiting update. <a href="mailto:techsupport@{{ request.get_host }}">Contact techsupport</a> if this is not automatically resolved soon. {% else %} Conflict of interest updated {% endif %} @@ -127,7 +133,7 @@ </td> <td> {{ assignment.date_invited|default:'<i>Not invited (yet)</i>' }} - {% if assignment.status == 'preassigned' %} + {% if is_ed_admin and assignment.status == 'preassigned' %} <br> <a href="{% url 'submissions:send_editorial_assignment_invitation' submission.preprint.identifier_w_vn_nr assignment.id %}">Send invitation now</a> {% endif %} @@ -192,7 +198,6 @@ </tbody> </table> <button class="btn btn-primary" type="submit">Save pre-assignments</button> - <a class="btn btn-default" href="{% url 'colleges:submission' submission.preprint.identifier_w_vn_nr %}">Manage this Submission's Fellowship</a> </form> {% endif %} diff --git a/scipost_django/submissions/templates/submissions/admin/submission_prescreening.html b/scipost_django/submissions/templates/submissions/admin/submission_prescreening.html index 1d178f9583465de5c9c7405ec792353849187515..ead9818aaaaa8c32182793a3383e8eb675054b9e 100644 --- a/scipost_django/submissions/templates/submissions/admin/submission_prescreening.html +++ b/scipost_django/submissions/templates/submissions/admin/submission_prescreening.html @@ -26,7 +26,11 @@ <h3 class="mt-4">Pre-screening steps</h3> <ul> <li> - <span class="text-success">{% include 'bi/check-square-fill.html' %}</span> + <span class="text-success">{% include 'bi/arrow-right.html' %}</span> + <a href="{% url 'submissions:conflicts' submission.preprint.identifier_w_vn_nr %}">See conflicts of interests</a> + </li> + <li> + <span class="text-success">{% include 'bi/arrow-right.html' %}</span> <a href="{% url 'colleges:submission' submission.preprint.identifier_w_vn_nr %}">Manage this submission's Fellowship ({{ submission.fellows.count }} fellows)</a><br> </li> <li> diff --git a/scipost_django/submissions/templates/submissions/author_referee_invitation_email.html b/scipost_django/submissions/templates/submissions/author_referee_invitation_email.html index ad372e3801b7d7118e04ad5cdf86809b164d3119..daeaddb0f43462da13a73b2dfd162b1c95f079fd 100644 --- a/scipost_django/submissions/templates/submissions/author_referee_invitation_email.html +++ b/scipost_django/submissions/templates/submissions/author_referee_invitation_email.html @@ -1,4 +1,4 @@ -[PLEASE FILL IN THE "TO" FIELD ABOVE (keeping edadmin@scipost.org in cc)]%0D%0A +[PLEASE FILL IN THE "TO" FIELD ABOVE (keeping edadmin@{{ request.get_host }} in cc)]%0D%0A %0D%0A Dear ..., %0D%0A @@ -9,13 +9,13 @@ I would like to bring your attention to a manuscript of mine which was recently {{ submission.title }} %0D%0A by {{ submission.author_list }}%0D%0A -(see https://scipost.org{{ submission.get_absolute_url }} ). +(see https://{{ request.get_host }}{{ submission.get_absolute_url }} ). %0D%0A %0D%0A The refereeing deadline is currently set at {{ submission.reporting_deadline|date:"d M Y" }}. %0D%0A %0D%0A -Since SciPost runs an open peer-witnessed refereeing process, your input could help in the evaluation of this manuscript. To provide your expert opinion, after logging in, you can simply follow the "Contribute a Report" link on the submission page linked above. You will find refereeing guidelines at https://scipost.org/submissions/referee_guidelines and further links therein. +Since SciPost runs an open peer-witnessed refereeing process, your input could help in the evaluation of this manuscript. To provide your expert opinion, after logging in, you can simply follow the "Contribute a Report" link on the submission page linked above. You will find refereeing guidelines at https://{{ request.get_host }}{% url 'submissions:referee_guidelines' %} and further links therein. %0D%0A %0D%0A [YOUR SIGNATURE] diff --git a/scipost_django/submissions/templates/submissions/contributor_referee_invitation_email.html b/scipost_django/submissions/templates/submissions/contributor_referee_invitation_email.html index 4e5baca3541470003cee2e0c48fbd4f264431311..8444e93cdf30331e0d28ca686d1ee39f779c0081 100644 --- a/scipost_django/submissions/templates/submissions/contributor_referee_invitation_email.html +++ b/scipost_django/submissions/templates/submissions/contributor_referee_invitation_email.html @@ -1,4 +1,4 @@ -[PLEASE FILL IN THE "TO" FIELD ABOVE (keeping edadmin@scipost.org in cc)]%0D%0A +[PLEASE FILL IN THE "TO" FIELD ABOVE (keeping edadmin@{{ request.get_host }} in cc)]%0D%0A %0D%0A Dear ..., %0D%0A @@ -9,13 +9,13 @@ I noticed that there is a Submission undergoing refereeing at SciPost for which, {{ submission.title }} %0D%0A by {{ submission.author_list }}%0D%0A -(see https://scipost.org{{ submission.get_absolute_url }} ). +(see https://{{ request.get_host }}{{ submission.get_absolute_url }} ). %0D%0A %0D%0A The refereeing deadline is currently set at {{ submission.reporting_deadline|date:"d M Y" }}. %0D%0A %0D%0A -Since SciPost runs an open peer-witnessed refereeing process, your input could help in the evaluation of this manuscript. To provide your expert opinion, after logging in, you can simply follow the "Contribute a Report" link on the submission page linked above. You will find refereeing guidelines at https://scipost.org/submissions/referee_guidelines and further links therein. +Since SciPost runs an open peer-witnessed refereeing process, your input could help in the evaluation of this manuscript. To provide your expert opinion, after logging in, you can simply follow the "Contribute a Report" link on the submission page linked above. You will find refereeing guidelines at https://{{ request.get_host }}{% url 'submissions:referee_guidelines' %} and further links therein. %0D%0A %0D%0A [YOUR SIGNATURE] diff --git a/scipost_django/submissions/templates/submissions/pool/_assignment_info.html b/scipost_django/submissions/templates/submissions/pool/_assignment_info.html index 00f70f705ded0714be83843106db307638d4ae89..aede93c8e81c3be7483c063eb1515719238e7b8e 100644 --- a/scipost_django/submissions/templates/submissions/pool/_assignment_info.html +++ b/scipost_django/submissions/templates/submissions/pool/_assignment_info.html @@ -1,20 +1,20 @@ <li class="py-1"> - {{ assignment.to.user.first_name }} {{ assignment.to.user.last_name }} + {{ assignment.to.user.first_name }} {{ assignment.to.user.last_name }} {% if assignment.invited %} - <span class="label label-sm label-info">invited</span> + <span class="label label-sm label-info p-1">invited</span> {% endif %} {% if assignment.accepted %} - <span class="label label-sm label-outline-success">accepted</span> + <span class="label label-sm label-outline-success p-1">accepted</span> {% endif %} {% if assignment.deprecated %} - <span class="label label-sm label-outline-info">deprecated</span> + <span class="label label-sm label-outline-info p-1">deprecated</span> {% endif %} {% if assignment.replaced %} - <span class="label label-sm label-outline-warning">replaced</span> + <span class="label label-sm label-outline-warning p-1">replaced</span> {% endif %} {% if assignment.refusal_reason %} - <span class="label label-sm label-outline-{% if assignment.refusal_reason == 'NIE' or assignment.refusal_reason == 'DNP' %}danger{% else %}warning{% endif %}">declined + <span class="label label-sm p-1 label-outline-{% if assignment.refusal_reason == 'NIE' or assignment.refusal_reason == 'DNP' %}danger{% else %}warning{% endif %}">declined | Reason: {{ assignment.get_refusal_reason_display }} </span> {% endif %} diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_recommendation_claim_voting_right.html b/scipost_django/submissions/templates/submissions/pool/_hx_recommendation_claim_voting_right.html new file mode 100644 index 0000000000000000000000000000000000000000..df0b849bfda3b3a2b4d814c463b9f2dc9d75b8e0 --- /dev/null +++ b/scipost_django/submissions/templates/submissions/pool/_hx_recommendation_claim_voting_right.html @@ -0,0 +1,5 @@ +{% if granted %} + <p>Voting right granted. You can go <a href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}">cast your vote</a>.</p> +{% else %} + <p>Voting rights could not be granted.</p> +{% endif %} diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html new file mode 100644 index 0000000000000000000000000000000000000000..709daf9a6b626547e6d0f2e60ab14573364a361e --- /dev/null +++ b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html @@ -0,0 +1,208 @@ +{% load scipost_extras %} +{% load submissions_extras %} +{% load user_groups %} + +{% is_editor_in_charge request.user submission as is_editor_in_charge %} +{% is_ed_admin request.user as is_ed_admin %} + + +<button type="button" class="btn btn-primary p-1" + data-bs-toggle="collapse" data-bs-target="#collapse_{{ submission.id }}" + aria-expanded="true" aria-controls="collapse_{{ submission.id }}"> + <small>Toggle details visibility</small> +</button> + +<div class="collapse show bg-light submission-detail mt-1 p-2" id="collapse_{{ submission.id }}"> + <div class="card-body px-0"> + <div class="row"> + <div class="col-md-8"> + {% include 'submissions/pool/_submission_info_table.html' with submission=submission %} + </div> + <div class="col-md-4"> + {% include 'submissions/_submission_refereeing_history.html' with submission=submission target_blank=1 %} + </div> + </div> + </div> + + <div> + <hr> + <h3>Remarks on this submission:</h3> + {% if remark_form %} + {% include 'submissions/_remark_form.html' with submission=submission form=remark_form auto_show=1 %} + {% endif %} + <p class="mb-1">Current remarks:</p> + <ul> + {% for rem in submission.remarks.all %} + {% include 'scipost/_remark_li.html' with remark=rem %} + {% empty %} + <li>No Remarks found.</li> + {% endfor %} + </ul> + + {% if is_editor_in_charge or is_ed_admin %} + <div class="my-4 p-3 border{% if submission.cycle.has_required_actions %} border-danger bg-light{% endif %}" id="required-actions" {% if submission.cycle.has_required_actions %}style="border-width: 2px !important;"{% endif %}> + <h3> + {% if submission.cycle.has_required_actions %} + <span class="text-danger">{% include 'bi/exclamation-triangle-fill.html' %}</span> + {% else %} + {% include 'bi/check-circle-fill.html' %} + {% endif %} + Required actions + </h3> + {{ submission.cycle.required_actions }} + </div> + <h4> + <a href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}">Go to this Submission's Editorial Page</a> + </h4> + {% endif %} + + {% if is_ed_admin or request.user.contributor.is_active_senior_fellow %} + <div class="border border-danger mt-3 p-2"> + <h3>Editorial Administration</h3> + <ul class="ps-4 mb-3"> + {% if is_ed_admin %} + <li> + {% if submission.in_prescreening %} + <a href="{% url 'submissions:do_prescreening' submission.preprint.identifier_w_vn_nr %}">Pre-screening</a> + {% else %} + Pre-screening completed + {% endif %} + </li> + {% endif %} + + {# EIC Assignments #} + <li>Screening: invitations to take charge + {% if not submission.editor_in_charge %} + <span class="border border-danger text-danger ms-2 p-1"> + There is no Editor-in-charge yet {% include 'bi/arrow-right.html' %} + <a href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}">Manage editor invitations</a> + </span> + {% endif %} + <ul class="mt-2 ps-3"> + {% for assignment in submission.editorial_assignments.all %} + {% include 'submissions/pool/_assignment_info.html' with assignment=assignment %} + {% empty %} + <li>No assignment requests have been sent</li> + {% endfor %} + + {% if is_ed_admin %} + {% if not submission.editor_in_charge %} + <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 1 %}"> + No EIC yet, update authors by email (1 week into screening) + </a></li> + <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 2 %}"> + No EIC yet, update authors by email (2 weeks into screening) + </a></li> + <li><a href="{% url 'submissions:assignment_failed' submission.preprint.identifier_w_vn_nr %}">Close: screening failed (failure to find EIC)</a></li> + {% endif %} + {% endif %} + </ul> + </li> + + <li>Refereeing: + <ul class="ps-3"> + {% if submission.editor_in_charge and perms.scipost.can_reassign_submissions %} + <li><a href="{% url 'submissions:reassign_submission' submission.preprint.identifier_w_vn_nr %}">Reassign Editor-in-charge</a></li> + {% endif %} + </ul> + </li> + + {# Compile pdfs #} + {% if submission.reports.accepted.exists %} + <li><a href="{% url 'submissions:reports_accepted_list' %}?submission={{ submission.preprint.identifier_w_vn_nr }}">Compile accepted reports</a></li> + {% endif %} + + {# Communication #} + {% if is_ed_admin %} + {% if submission.editor_in_charge %} + <li><a href="{% url 'submissions:communication' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr comtype='StoE' %}">Send a communication to the Editor-in-charge</a></li> + {% endif %} + {% endif %} + + {# EIC Recommendations #} + {% if submission.eicrecommendations.exists %} + <li>See Editorial Recommendations:</li> + <ul class="ps-3"> + {% for rec in submission.eicrecommendations.all %} + <li> + <a href="{% url 'submissions:eic_recommendation_detail' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">{{ rec.get_full_status_display }}</a> + {% if is_ed_admin %} + {% if rec.voting_in_preparation %} + <a class="btn btn-sm btn-primary ms-4 px-1 py-0" role="button" href="{% url 'submissions:prepare_for_voting' rec_id=rec.id %}">Prepare for voting</a> + {% endif %} + {% endif %} + </li> + {% endfor %} + </ul> + {% endif %} + + {# Accepted submission actions #} + {% if is_ed_admin %} + {% if submission.status == 'accepted' %} + <li><a href="{% url 'submissions:treated_submission_pdf_compile' submission.preprint.identifier_w_vn_nr %}">Update the Refereeing Package pdf</a></li> + <li><a href="{% url 'journals:update_publication' submission.preprint.identifier_w_vn_nr %}">Draft Publication</a></li> + {% endif %} + {% endif %} + + </ul> + </div> + {% endif %} + + {# EIC Recommendations #} + {% if submission.eicrecommendations.exists %} + <hr> + <h3 class="mt-3">Editorial Recommendations:</h3> + <ul class="ps-3"> + {% for rec in submission.eicrecommendations.all %} + <li> + {{ rec.get_full_status_display }}  + {% if rec.undergoing_voting %} + {% if rec|user_can_vote:request.user %} + <a href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}"> + See Recommendation, view votes and/or revise your vote + </a> + {% elif not is_ed_admin %} + <div id="rights-{{ rec.id }}"> + <button type="button" class="btn btn-outline-danger px-1 py-0" + hx-get="{% url 'submissions:claim_voting_right' rec_id=rec.id %}" + hx-target="#rights-{{ rec.id }}"> + <strong>Claim visibility and voting right</strong>  + <em><small>only if you can certify that you have no conflict of interest</small></em> + </button> + </div> + {% else %} + <a href="{% url 'submissions:eic_recommendation_detail' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">See Recommendation</a> + {% endif %} + {% elif rec.decision_fixed %} + {% if is_ed_admin or rec|user_can_vote:request.user %} + <a href="{% url 'submissions:eic_recommendation_detail' identifier_w_vn_nr=rec.submission.preprint.identifier_w_vn_nr %}"> + See Recommendation + </a> + {% endif %} + {% endif %} + </li> + {% endfor %} + </ul> + {% endif %} + + <hr> + <h3 class="mt-3">Events</h3> + <div id="eventslist"> + {% if is_ed_admin %} + {% include 'submissions/_submission_events.html' with events=submission.events.for_edadmin %} + {% elif is_editor_in_charge %} + {% include 'submissions/_submission_events.html' with events=submission.events.for_eic %} + {% else %} + {% include 'submissions/_submission_events.html' with events=submission.events.for_author %} + {% endif %} + </div> + + </div> + + <button type="button" class="btn btn-primary p-1" + data-bs-toggle="collapse" data-bs-target="#collapse_{{ submission.id }}" + aria-expanded="true" aria-controls="collapse_{{ submission.id }}"> + <small>Toggle details visibility</small> + </button> + +</div> diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submission_li.html b/scipost_django/submissions/templates/submissions/pool/_hx_submission_li.html new file mode 100644 index 0000000000000000000000000000000000000000..4a175d73cc3beeac462be79de880650bac20504c --- /dev/null +++ b/scipost_django/submissions/templates/submissions/pool/_hx_submission_li.html @@ -0,0 +1,131 @@ +{% load static %} +{% load submissions_pool %} +{% load user_groups %} + +{% is_ed_admin request.user as is_ed_admin %} + + +<div class="pool-item"> + <div class="row"> + <div class="col-md-7"> + <a href="{% url 'submissions:submission' submission.preprint.identifier_w_vn_nr %}">{{ submission.title }}</a> + <br> + <em>by {{ submission.author_list }}</em> + <br> + <div class="my-2"> + <span class="text-secondary">{% include 'bi/bullseye.html' %}: </span> + {{ submission.submitted_to }} + </div> + </div> + <div class="col-md-5"> + <ul class="bg-secondary py-1"> + {% for specialty in submission.specialties.all %} + <li><small>{{ specialty }}</small></li> + {% endfor %} + </ul> + </div> + </div> + + <div class="row mb-0"> + <div class="col-md-3"> + <small class="text-muted">Editor-in-charge</small> + <br> + <ul class="list list-unstyled"> + {% if submission.status == 'unassigned' %} + {% if is_ed_admin %} + <li>Unassigned</li> + {% else %} + <li>You can + <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">volunteer to become Editor-in-charge</strong></a> + </li> + {% endif %} + {% if request.user.contributor.is_active_senior_fellow %} + <li>As Senior Fellow: <a href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">view/update editor invitations</strong></a></li> + {% endif %} + {% elif submission.editor_in_charge == request.user.contributor %} + <li> + <strong>You are the EIC</strong> + <a role="button" class="btn btn-info px-1 py-0" href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}"><small>{% include 'bi/arrow-right.html' %} Editorial page</small></a> + </li> + {% else %} + <li>{{ submission.editor_in_charge }}</li> + {% endif %} + </ul> + </div> + <div class="col-md-3"> + <small class="text-muted">Original submission date</small> + <br> + {{ submission.original_submission_date|date:'Y-m-d' }} + </div> + <div class="col-md-2"> + <small class="text-muted">Latest activity</small> + <br> + {{ submission.latest_activity }} + </div> + <div class="col-md-4"> + <small class="text-muted">Submission Status</small> + <br> + <span class="label label-sm label-secondary text-wrap">{{ submission.get_status_display }}</span> + {% with recommendation=submission.eicrecommendations.active.first %} + {% if recommendation %} + <br> + <small class="text-muted">EIC Recommendation & Status</small> + <br> + <span class="label label-sm label-secondary text-wrap">{{ recommendation.get_full_status_display }}</span> + <br> + <small class="text-muted">{{ recommendation.eligible_to_vote.count }} voting: {{ recommendation.voted_for.count }} agreed, {{ recommendation.voted_against.count }} disagreed, {{ recommendation.voted_abstain.count }} abstained</small> + {% endif %} + {% endwith %} + {% if submission.editorial_decision %} + <br> + <small class="text-muted">Editorial Decision Status</small> + <br> + <span class="label label-sm label-secondary text-wrap">{{ submission.editorial_decision.get_status_display }}</span> + {% endif %} + </div> + </div> + {% if is_ed_admin and submission.has_inadequate_pool_composition %} + <div class="border border-danger text-danger mt-1 py-1 px-2"> + <strong> + {% include 'bi/exclamation-triangle-fill.html' %} + Notice to admin: The current editor is not assigned to the pool. Therefore, the editor will not be able to reach the editorial page. + </strong> + </div> + {% endif %} + + {% if submission.cycle.has_required_actions %} + <div class="card-text bg-danger text-white mt-1 py-1 px-2"> + <button type="button" class="btn p-0" disabled> + <small class="text-white">This Submission contains required actions.</small> + </button> + {% if is_ed_admin %}{% include 'submissions/pool/_required_actions_tooltip.html' with submission=submission classes='text-white' %}{% endif %} + </div> + {% endif %} + + {% if submission.status == 'unassigned' %} + {% get_editor_invitations submission request.user as invitations %} + {% if invitations %} + <div class="border border-warning mt-1 py-1 px-2"> + <span class="mt-1 px-1 text-danger">{% include 'bi/exclamation.html' %}</i> + You are invited to become Editor-in-charge of this Submission. <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">You can reply to this invitation here</a>. + </div> + {% endif %} + {% endif %} + + <div id="details_{{ submission.id }}" class="mt-2"> + <button type="button" class="btn btn-primary p-1 mx-auto" + hx-get="{% url 'submissions:pool_hx_submission_details' submission.preprint.identifier_w_vn_nr %}" + hx-target="#details_{{ submission.id }}" + hx-indicator="#indicator-details-{{ submission.id }}" + > + <small>View details</small> + </button> + <span id="indicator-details-{{ submission.id }}" class="htmx-indicator p-1"> + <button class="btn btn-sm btn-warning p-2" type="button" disabled> + <small><strong>Loading...</strong></small> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </span> + </div> + +</div> diff --git a/scipost_django/submissions/templates/submissions/pool/_referee_invitations.html b/scipost_django/submissions/templates/submissions/pool/_referee_invitations.html index a998d47dc575e865112e3a175261b46236268fa4..fbbf24fcb84245d8cc0248ac7914280e667ee32f 100644 --- a/scipost_django/submissions/templates/submissions/pool/_referee_invitations.html +++ b/scipost_django/submissions/templates/submissions/pool/_referee_invitations.html @@ -133,7 +133,6 @@ </tr> {% endfor %} - {# {% if submission.refereeing_cycle != 'direct_rec' and submission.is_open_for_reporting %} #} {% if submission.in_refereeing_phase %} <tr class="bg-white"> <td class="text-center py-3" colspan="9"> diff --git a/scipost_django/submissions/templates/submissions/pool/_submission_details.html b/scipost_django/submissions/templates/submissions/pool/_submission_details.html index 8498ab2f5fb4e4363975d633cceea6aaef191b41..a6bc04b8f94d218b65a45076c13febd239a55722 100644 --- a/scipost_django/submissions/templates/submissions/pool/_submission_details.html +++ b/scipost_django/submissions/templates/submissions/pool/_submission_details.html @@ -56,7 +56,6 @@ <ul class="ps-4 mb-3"> <li><a href="{% url 'submissions:conflicts' submission.preprint.identifier_w_vn_nr %}">See conflicts of interests</a></li> <li><a href="{% url 'colleges:submission' submission.preprint.identifier_w_vn_nr %}">Manage this Submission's Fellowship</a></li> - <li><a href="{% url 'colleges:submission_voting_fellows' submission.preprint.identifier_w_vn_nr %}">Manage Voting Fellows</a></li> {% if not submission.editor_in_charge %} <li><a href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}">Manage editor invitations</a></li> {% elif perms.scipost.can_reassign_submissions %} @@ -74,7 +73,6 @@ {% endfor %} {% if not submission.editor_in_charge %} - <li><a href="{% url 'submissions:prescreening_failed' submission.preprint.identifier_w_vn_nr %}">Close: pre-screening failed</a></li> <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 1 %}">Update authors by email (1 week into screening)</a></li> <li><a href="{% url 'submissions:update_authors_screening' submission.preprint.identifier_w_vn_nr 2 %}">Update authors by email (2 weeks into screening)</a></li> <li><a href="{% url 'submissions:assignment_failed' submission.preprint.identifier_w_vn_nr %}">Close: screening failed (failure to find EIC)</a></li> diff --git a/scipost_django/submissions/templates/submissions/pool/_submission_info_table.html b/scipost_django/submissions/templates/submissions/pool/_submission_info_table.html index 253d09d7d394feec11bc5fc6723b2e5b1c92232f..e5f8016c002155f88783554df995d8c2e475a9c4 100644 --- a/scipost_django/submissions/templates/submissions/pool/_submission_info_table.html +++ b/scipost_django/submissions/templates/submissions/pool/_submission_info_table.html @@ -44,13 +44,27 @@ <tr> <td>Editor-in-charge</td> <td> - {% if submission.editor_in_charge %} - {{ submission.editor_in_charge }} - {% elif perms.scipost.can_assign_submissions %} - <a href="{% url 'submissions:assign_submission' submission.preprint.identifier_w_vn_nr %}">Send a new assignment request</a> - {% else %} - <strong class="text-danger">You can volunteer to become Editor-in-charge by <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">clicking here</a>.</strong> - {% endif %} + <ul class="list list-unstyled"> + {% if submission.status == 'unassigned' %} + {% if is_ed_admin %} + <li>Unassigned</li> + {% else %} + <li>You can + <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">volunteer to become Editor-in-charge</strong></a> + </li> + {% endif %} + {% if request.user.contributor.is_active_senior_fellow %} + <li>As Senior Fellow: <a href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">view/update editor invitations</strong></a></li> + {% endif %} + {% elif submission.editor_in_charge == request.user.contributor %} + <li> + <strong>You are the EIC</strong> + <a role="button" class="btn btn-info px-1 py-0" href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}"><small>{% include 'bi/arrow-right.html' %} Editorial page</small></a> + </li> + {% else %} + <li>{{ submission.editor_in_charge }}</li> + {% endif %} + </ul> </td> </tr> <tr> @@ -101,11 +115,6 @@ <td>This Submission's Fellowship</td> <td><a href="{% url 'colleges:submission' submission.preprint.identifier_w_vn_nr %}">{{ submission.fellows.count }} Fellowship{{ submission.fellows.count|pluralize }}</a></td> </tr> - <tr> - <td>Fellows voting</td> - <td><a href="{% url 'colleges:submission_voting_fellows' submission.preprint.identifier_w_vn_nr %}">{{ submission.voting_fellows.count }} Fellowship{{ submission.voting_fellows.count|pluralize }}</a></td> - </tr> - {% endif %} {% block extended_info_table %}{% endblock %} diff --git a/scipost_django/submissions/templates/submissions/pool/_submission_li.html b/scipost_django/submissions/templates/submissions/pool/_submission_li.html index 567a95432a10f033b0ed3c75a17a3fc093438d54..16e9fca9a3caa922623ebe50d692661ae31e9e58 100644 --- a/scipost_django/submissions/templates/submissions/pool/_submission_li.html +++ b/scipost_django/submissions/templates/submissions/pool/_submission_li.html @@ -97,7 +97,7 @@ {% if invitations %} <div class="border border-warning mt-1 py-1 px-2"> <span class="mt-1 px-1 text-danger">{% include 'bi/exclamation.html' %}</i> - You are invited to become Editor-in-charge of this Submission. <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">You can reply to this invitation here</a>. + You are invited to become Editor-in-charge of this Submission. <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">You can reply to this invitation here</a>. </div> {% endif %} {% endif %} diff --git a/scipost_django/submissions/templates/submissions/pool/editorial_page.html b/scipost_django/submissions/templates/submissions/pool/editorial_page.html index 4223ebdcd3f19ad9959478c6d7d7d9b6abd35afc..e82fc435154790fc4acb16699f61299c4e4454dc 100644 --- a/scipost_django/submissions/templates/submissions/pool/editorial_page.html +++ b/scipost_django/submissions/templates/submissions/pool/editorial_page.html @@ -196,7 +196,7 @@ <tr id="reporting-deadline"> <td>Open for refereeing:</td> <td> - {% if submission.is_open_for_reporting %} + {% if submission.is_open_for_reporting_within_deadline %} <span class="text-success" aria-hidden="true">{% include 'bi/check-circle-fill.html' %}</span> <span class="text-muted">Open for refereeing. Deadline: {{ submission.reporting_deadline|date:"SHORT_DATE_FORMAT" }}.</span> {% else %} @@ -224,7 +224,7 @@ {% endif %} {% if submission.can_reset_reporting_deadline %} - {% if submission.is_open_for_reporting %} + {% if submission.is_open_for_reporting_within_deadline %} <div class="my-1"> You may extend the refereeing deadline by <a href="{% url 'submissions:extend_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr days=2 %}">2 days</a>, @@ -232,33 +232,35 @@ <a href="{% url 'submissions:extend_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr days=14 %}">2 weeks</a>, or set a refereeing deadline: - <form class="form-inline d-inline-block" action="{% url 'submissions:set_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post"> + <form class="d-inline-block" action="{% url 'submissions:set_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post"> {% csrf_token %} - <div class="d-inline-block mx-2"> + <div class="row mx-2"> {% for field in set_deadline_form.visible_fields %} - {{ field|add_css_class:'form-control' }} + {{ field|add_css_class:'form-control col' }} {{ field }} {% endfor %} + <div class="col"> + <input class="btn btn-secondary" type="submit" value="Set deadline"/> + </div> </div> - - <input class="btn btn-outline-secondary" type="submit" value="Set deadline"/> - </form>. + </form> </div> {% else %} <div class="mt-1"> Open the refereeing round by setting a refereeing deadline: - <form class="form-inline d-inline-block" action="{% url 'submissions:set_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post"> + <form class="d-inline-block" action="{% url 'submissions:set_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post"> {% csrf_token %} - <div class="d-inline-block mx-2"> + <div class="row mx-2"> {% for field in set_deadline_form.visible_fields %} - {{ field|add_css_class:'form-control' }} + {{ field|add_css_class:'form-control col' }} {{ field }} {% endfor %} - </div> - - <input class="btn btn-outline-secondary" type="submit" value="Set deadline"/> + <div class="col"> + <input class="btn btn-secondary" type="submit" value="Set deadline"/> + </div> + </div> </form> - </div> + </div> {% endif %} {% endif %} @@ -337,21 +339,22 @@ {% if submission.can_reset_reporting_deadline %} <li> Set refereeing deadline: - <form class="form-inline d-inline-block" action="{% url 'submissions:set_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post"> + <form class="d-inline-block" action="{% url 'submissions:set_refereeing_deadline' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post"> {% csrf_token %} - <div class="d-inline-block mx-2"> + <div class="row mx-2"> {% for field in set_deadline_form.visible_fields %} - {{ field|add_css_class:'form-control' }} + {{ field|add_css_class:'form-control col' }} {{ field }} {% endfor %} + <div class="col"> + <input class="btn btn-secondary" type="submit" value="Set deadline"/> + </div> </div> - - <input class="btn btn-outline-secondary btn-sm" type="submit" value="Set deadline"/> </form> </li> {% endif %} - {% if submission.is_open_for_reporting %} + {% if submission.is_open_for_reporting_within_deadline %} <li><a href="{% url 'submissions:close_refereeing_round' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">Close the refereeing round</a> (deactivates submission of new Reports and Comments)</li> {% endif %} {% endif %} @@ -376,7 +379,7 @@ Vet submitted Comment{{ comments|pluralize }}: <ul class="mb-1"> {% for comment in comments %} - <li><a href="{% url 'comments:vet_submitted_comment' comment.id %}">{{comment}}</a></li> + <li><a href="{% url 'comments:vet_submitted_comment' comment.id %}">{{ comment }}</a></li> {% endfor %} </ul> </li> diff --git a/scipost_django/submissions/templates/submissions/pool/hx_submissions_list.html b/scipost_django/submissions/templates/submissions/pool/hx_submissions_list.html new file mode 100644 index 0000000000000000000000000000000000000000..72741e68b3b4901254a6978e77a9cf841f6d3c69 --- /dev/null +++ b/scipost_django/submissions/templates/submissions/pool/hx_submissions_list.html @@ -0,0 +1,22 @@ +{% for submission in page_obj %} + <li class="submission p-2 mb-2" id="submission_{{ submission.id }}"> + {% include 'submissions/pool/_hx_submission_li.html' with submission=submission %} + </li> +{% empty %} + <li>No Submission could be found</li> +{% endfor %} +{% if page_obj.has_next %} + <li hx-post="{% url 'submissions:pool_hx_submissions_list' %}?page={{ page_obj.next_page_number }}" + hx-include="#search-form" + hx-trigger="revealed" + hx-swap="afterend" + hx-indicator="#indicator-search-page-{{ page_obj.number }}" + > + <div id="indicator-search-page-{{ page_obj.number }}" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading page {{ page_obj.next_page_number }} out of {{ page_obj.paginator.num_pages }}</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </div> + </li> +{% endif %} diff --git a/scipost_django/submissions/templates/submissions/pool/pool.html b/scipost_django/submissions/templates/submissions/pool/pool.html index 8d24682d9246d1bba548d88e084386f23614e6e8..511c4c31ebe64642ff2981f338ad2271e73ad5a3 100644 --- a/scipost_django/submissions/templates/submissions/pool/pool.html +++ b/scipost_django/submissions/templates/submissions/pool/pool.html @@ -40,6 +40,13 @@ <div class="row"> <div class="col-12"> + <div class="border border-danger my-4 p-2"> + <strong> + Try the beta version of the + <a href="{% url 'submissions:pool2' %}">new pool page</a> + </strong> + </div> + {% if is_ed_admin %} {% if recommendations.voting_in_preparation or recommendations.put_to_voting or latest_submission_events or pre_screening_subs %} diff --git a/scipost_django/submissions/templates/submissions/pool/pool2.html b/scipost_django/submissions/templates/submissions/pool/pool2.html new file mode 100644 index 0000000000000000000000000000000000000000..087b6218e819380035f08eb483f8a3f78d20b146 --- /dev/null +++ b/scipost_django/submissions/templates/submissions/pool/pool2.html @@ -0,0 +1,109 @@ +{% extends 'scipost/base.html' %} + +{% load static %} + +{% load crispy_forms_tags %} + +{% block body_class %}{{ block.super }} pool{% endblock %} + +{% block breadcrumb %} + <div class="breadcrumb-container"> + <div class="container"> + <nav class="breadcrumb hidden-sm-down"> + {% block breadcrumb_items %} + <a href="{% url 'submissions:pool2' %}" class="breadcrumb-item">Pool2</a> + {% endblock %} + </nav> + </div> + </div> +{% endblock %} + +{% block pagetitle %}: Submissions Pool{% endblock pagetitle %} + +{% block content %} + + <div class="row"> + <div class="col-6"> + <h1>SciPost Submissions Pool</h1> + </div> + <div class="col-6"> + <div class="border border-danger p-2"> + Do you know qualified candidates who could serve as Fellow in a College?<br/> + Nominate them by <a href="{% url 'colleges:potential_fellowship_create' %}">adding a Potential Fellowship</a>. + {% if nr_potfels_to_vote_on > 0 %} + <br/> + <span class="text-danger">You can vote on {{ nr_potfels_to_vote_on }} nomination{{ nr_potfels_to_vote_on|pluralize }}: please go to the <a href="{% url 'colleges:potential_fellowships' %}">Potential Fellowships</a> page.</span> + {% endif %} + </div> + </div> + </div> + + <div class="border border-danger my-4 p-2"> + <strong><a href="{% url 'submissions:pool' %}">Take me back to the old pool...</a></strong> + </div> + + {% if assignments_to_consider or recs_to_vote_on or recs_current_voted %} + {% if assignments_to_consider %} + <h3>Your open Assignment Requests <span class="text-warning">{% include 'bi/exclamation-circle-fill.html' %}</span></h3> + <ul> + {% for assignment in assignments_to_consider %} + <li>On submission: {{ assignment.submission }}<br> + <a href="{% url 'submissions:assignment_request' assignment.id %}">Accept or decline here</a> + </li> + {% endfor %} + </ul> + {% endif %} + + {% if recs_to_vote_on %} + <h3>Recommendations to vote on <span class="text-warning">{% include 'bi/exclamation-circle-fill.html' %}</span></h3> + <ul> + {% for recommendation in recs_to_vote_on %} + <li>On Editorial Recommendation of: {{ recommendation.submission }}<br> + <a href="{% url 'submissions:vote_on_rec' rec_id=recommendation.id %}">See the Editorial Recommendation</a> + </li> + {% endfor %} + </ul> + {% endif %} + + {% if recs_current_voted %} + <h3>Current recommendations you have voted on:</h3> + <ul> + {% for recommendation in recs_current_voted %} + <li>On Editorial Recommendation of: {{ recommendation.submission }}<br> + <a href="{% url 'submissions:vote_on_rec' rec_id=recommendation.id %}">See the Editorial Recommendation, view votes and/or revise your vote</a> + </li> + {% endfor %} + </ul> + {% endif %} + + <hr> + {% endif %} + + <div class="card"> + <div class="card-header"> + Search / filter + </div> + <div class="card-body"> + <form + hx-post="{% url 'submissions:pool_hx_submissions_list' %}" + hx-trigger="load, keyup delay:500ms, change" + hx-target="#search-results" + hx-indicator="#indicator-search" + > + <div id="search-form">{% crispy form %}</div> + </form> + </div> + </div> + <div id="indicator-search" class="htmx-indicator p-2"> + <button class="btn btn-warning" type="button" disabled> + <strong>Loading...</strong> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </div> + <ul id="search-results" class="list-unstyled pool-list mt-2"></ul> + +{% endblock content %} +{% block footer_script %} + <script nonce="{{ request.csp_nonce }}" src="{% static 'scipost/toggle-proceedings.js' %}"> + </script> +{% endblock %} diff --git a/scipost_django/submissions/templates/submissions/report_form.html b/scipost_django/submissions/templates/submissions/report_form.html index 7d32133035a947ec0c80def632be2b597dbd343a..a10389b3349d69fd04a871c67fe1c76d5541c488 100644 --- a/scipost_django/submissions/templates/submissions/report_form.html +++ b/scipost_django/submissions/templates/submissions/report_form.html @@ -33,7 +33,7 @@ <div class="card-body"> <h2>Your {% if form.instance.is_followup_report %}followup {% endif %}report:</h2> <p>A preview of text areas will appear below as you type (you can use $\LaTeX$ \$...\$ for in-text equations or \ [ ... \ ] for on-line equations).</p> - <p>Before you get started, please make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}" target="_blank">referee guidelines</a>, <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}" target="_blank">refereeing procedure</a> and <a href="{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct" target="_blank">referee code of conduct</a>.</p> + <p>Before you get started, please make sure you are familiar with our <a href="https://{{ request.get_host }}{% url 'submissions:referee_guidelines' %}" target="_blank">referee guidelines</a>, <a href="https://{{ request.get_host }}{% url 'submissions:refereeing_procedure' %}" target="_blank">refereeing procedure</a> and <a href="{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct" target="_blank">referee code of conduct</a>.</p> <div class="card border-danger mx-1 mt-2 mb-4"> <div class="card-header text-white bg-danger"> diff --git a/scipost_django/submissions/templates/submissions/submission_form.html b/scipost_django/submissions/templates/submissions/submission_form.html index f7887cad2e055cd6b89e653230f2bddd78289435..5bf9dc5e07698871dd085965f321629a7083d2ff 100644 --- a/scipost_django/submissions/templates/submissions/submission_form.html +++ b/scipost_django/submissions/templates/submissions/submission_form.html @@ -37,6 +37,22 @@ {% if form %} <h2>Please provide these last bits of information, and carefully check all prefilled fields</h2> + + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-danger"> + <strong>{{ field.name }} - {{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-danger"> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} + <form class="mt-4" id="full_submission_form" method="post" enctype="multipart/form-data"> {% csrf_token %} {{ form|bootstrap }} diff --git a/scipost_django/submissions/templates/submissions/submit_choose_preprint_server.html b/scipost_django/submissions/templates/submissions/submit_choose_preprint_server.html index 6e8598de71cb21b34d4b39f8f909f240a2bb9270..23cd5b34999788f652e8cce17320c0690b1e7d0c 100644 --- a/scipost_django/submissions/templates/submissions/submit_choose_preprint_server.html +++ b/scipost_django/submissions/templates/submissions/submit_choose_preprint_server.html @@ -70,6 +70,22 @@ {% include 'bi/arrow-right.html' %} <input type="submit" class="btn btn-primary text-white" value="Query arXiv"/> </form> + {% elif preprint_server.server.name == 'ChemRxiv' %} + <h3>Please provide the ChemRxiv DOI for your Submission</h3> + <p class="mb-0">Pattern: either + <ul> + <li>old style: <em>10.#####/chemrxiv.#######(.v#)</em></li> + <li>new style: <em>10.#####/chemrxiv-*****(-v#)</em></li> + </ul> + </p> + <form action="{% url 'submissions:submit_manuscript_chemrxiv' journal_doi_label=journal.doi_label %}" method="get"> + {{ preprint_server.prefill_form }} + {% if thread_hash %} + <input type="hidden" name="thread_hash" value="{{ thread_hash }}"/> + {% endif %} + {% include 'bi/arrow-right.html' %} + <input type="submit" class="btn btn-primary text-white" value="Query ChemRxiv"/> + </form> {% elif preprint_server.server.served_by and preprint_server.server.served_by.name == 'OSFPreprints' %} <h3>Please provide the {{ preprint_server.server.name }} identifier for your Submission</h3> <p><em>just a few lowercase alphanumeric characters, e.g. #####</em></p> diff --git a/scipost_django/submissions/templates/submissions/treated_submission_pdf_compile.html b/scipost_django/submissions/templates/submissions/treated_submission_pdf_compile.html index 25301ba9ab50773421e2ae67665a1e37f34459f7..935a3cb949b4c9b88720a1dd42a54248c758d888 100644 --- a/scipost_django/submissions/templates/submissions/treated_submission_pdf_compile.html +++ b/scipost_django/submissions/templates/submissions/treated_submission_pdf_compile.html @@ -28,7 +28,7 @@ <h3>Please process this code in your Tex Compiler</h3> <p> You may need to compile twice because of the Table of Content.<br> - To compile, one needs the SciPost Latex Package. Please <a href="mailto: info@scipost.org">contact SciPost</a> if you did not receive it. + To compile, one needs the SciPost Latex Package. Please <a href="mailto: edadmin@{{ request.get_host }}">contact SciPost</a> if you did not receive it. </p> <h3>Content of the Refereeing Package</h3> <p> diff --git a/scipost_django/submissions/templatetags/submissions_extras.py b/scipost_django/submissions/templatetags/submissions_extras.py index 5374faf7571146459f0d97cc81fac3caf215c416..e04f7e49f3db46ae82fd0bb7e8667aa2f3da3be3 100644 --- a/scipost_django/submissions/templatetags/submissions_extras.py +++ b/scipost_django/submissions/templatetags/submissions_extras.py @@ -16,6 +16,11 @@ def filter_for_submission(qs, submission): return qs.filter(submission=submission) +@register.filter +def is_in_submission_fellowship(user, submission): + return submission.fellows.filter(contributor__user=user).exists() + + @register.filter def is_possible_author_of_submission(user, submission): """Check if User may be related to the Submission as author.""" @@ -45,6 +50,11 @@ def is_viewable_by_authors(recommendation): return recommendation.status == DECISION_FIXED +@register.filter +def user_can_vote(recommendation, user): + return recommendation.eligible_to_vote.filter(user=user).exists() + + @register.filter def user_is_referee(submission, user): """Check if the User is invited to be Referee of the Submission.""" diff --git a/scipost_django/submissions/urls.py b/scipost_django/submissions/urls.py index 4b44fd3467e853db4d8923627d41e873d5b9bd62..91c4202ac3555c1200336f3d59e84483c19e080b 100644 --- a/scipost_django/submissions/urls.py +++ b/scipost_django/submissions/urls.py @@ -2,12 +2,10 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import url -from django.urls import path +from django.urls import path, re_path from django.views.generic import TemplateView from . import views -from .constants import SUBMISSIONS_WO_VN_REGEX, SUBMISSIONS_COMPLETE_REGEX app_name = 'submissions' @@ -20,105 +18,169 @@ urlpatterns = [ name='submission-autocomplete' ), # Submissions - url(r'^$', views.SubmissionListView.as_view(), name='submissions'), - url(r'^author_guidelines$', - TemplateView.as_view(template_name='submissions/author_guidelines.html'), - name='author_guidelines'), - url(r'^refereeing_procedure$', - TemplateView.as_view(template_name='submissions/refereeing_procedure.html'), - name='refereeing_procedure'), - url(r'^referee_guidelines$', - TemplateView.as_view(template_name='submissions/referee_guidelines.html'), - name='referee_guidelines'), - url(r'^{regex}/$'.format(regex=SUBMISSIONS_WO_VN_REGEX), views.submission_detail_wo_vn_nr, - name='submission_wo_vn_nr'), - url(r'^{regex}/$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.submission_detail, name='submission'), - url(r'^{regex}/reports/(?P<report_nr>[0-9]+)/pdf$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.report_detail_pdf, name='report_detail_pdf'), - url(r'^{regex}/reports/(?P<report_nr>[0-9]+)/attachment$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.report_attachment, name='report_attachment'), - url(r'^{regex}/reports/pdf$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.submission_refereeing_package_pdf, name='refereeing_package_pdf'), + path( + '', + views.SubmissionListView.as_view(), + name='submissions' + ), + path( + 'author_guidelines', + TemplateView.as_view( + template_name='submissions/author_guidelines.html'), + name='author_guidelines' + ), + path( + 'refereeing_procedure', + TemplateView.as_view( + template_name='submissions/refereeing_procedure.html'), + name='refereeing_procedure' + ), + path( + 'referee_guidelines', + TemplateView.as_view( + template_name='submissions/referee_guidelines.html'), + name='referee_guidelines' + ), + path( + '<identifier_wo_vn_nr:identifier_wo_vn_nr>/', + views.submission_detail_wo_vn_nr, + name='submission_wo_vn_nr' + ), + path( + '<identifier:identifier_w_vn_nr>/', + views.submission_detail, + name='submission' + ), + path( + '<identifier:identifier_w_vn_nr>/reports/<int:report_nr>/pdf', + views.report_detail_pdf, + name='report_detail_pdf' + ), + path( + '<identifier:identifier_w_vn_nr>/reports/<int:report_nr>/attachment', + views.report_attachment, + name='report_attachment' + ), + path( + '<identifier:identifier_w_vn_nr>/reports/pdf', + views.submission_refereeing_package_pdf, + name='refereeing_package_pdf' + ), # Topics - url(r'^submission_add_topic/{regex}/'.format(regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'submission_add_topic/<identifier:identifier_w_vn_nr>/', views.submission_add_topic, - name='submission_add_topic'), - url(r'^submission_remove_topic/{regex}/(?P<slug>[-\w]+)/'.format(regex=SUBMISSIONS_COMPLETE_REGEX), + name='submission_add_topic' + ), + path( + 'submission_remove_topic/<identifier:identifier_w_vn_nr>/<slug:slug>/', views.submission_remove_topic, - name='submission_remove_topic'), + name='submission_remove_topic' + ), # Editorial Administration - url(r'^admin/treated$', views.treated_submissions_list, name='treated_submissions_list'), - url(r'^admin/{regex}/prescreening$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.PreScreeningView.as_view(), name='do_prescreening'), - url(r'^admin/{regex}/conflicts$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.SubmissionConflictsView.as_view(), name='conflicts'), - url(r'^admin/{regex}/editor_invitations$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.editor_invitations, name='editor_invitations'), - url(r'^admin/{regex}/editor_invitations/(?P<assignment_id>[0-9]+)$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.send_editorial_assignment_invitation, - name='send_editorial_assignment_invitation'), - url(r'^admin/{regex}/reassign_editor$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.SubmissionReassignmentView.as_view(), - name='reassign_submission'), - url(r'^admin/{regex}/reports/compile$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.treated_submission_pdf_compile, name='treated_submission_pdf_compile'), - url(r'^admin/{regex}/plagiarism$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.PlagiarismView.as_view(), name='plagiarism'), - url(r'^admin/{regex}/plagiarism/report$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.PlagiarismReportPDFView.as_view(), name='plagiarism_report'), -url(r'^admin/{regex}/plagiarism/internal$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.PlagiarismInternalView.as_view(), name='plagiarism_internal'), - url( - r'^admin/{regex}/recommendation$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.EICRecommendationDetailView.as_view(), + path( + 'admin/treated', + views.treated_submissions_list, + name='treated_submissions_list' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/prescreening', + views.PreScreeningView.as_view(), + name='do_prescreening' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/conflicts', + views.SubmissionConflictsView.as_view(), + name='conflicts' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/editor_invitations', + views.editor_invitations, + name='editor_invitations' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/editor_invitations/<int:assignment_id>', + views.send_editorial_assignment_invitation, + name='send_editorial_assignment_invitation' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/reassign_editor', + views.SubmissionReassignmentView.as_view(), + name='reassign_submission' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/reports/compile', + views.treated_submission_pdf_compile, + name='treated_submission_pdf_compile' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/plagiarism', + views.PlagiarismView.as_view(), + name='plagiarism' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/plagiarism/report', + views.PlagiarismReportPDFView.as_view(), + name='plagiarism_report' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/plagiarism/internal', + views.PlagiarismInternalView.as_view(), + name='plagiarism_internal' + ), + path( + 'admin/<identifier:identifier_w_vn_nr>/recommendation', + views.EICRecommendationDetailView.as_view(), name='eic_recommendation_detail' ), - url( - r'^admin/{regex}/editorial_decision/create$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'admin/<identifier:identifier_w_vn_nr>/editorial_decision/create', views.EditorialDecisionCreateView.as_view(), name='editorial_decision_create' ), - url( - r'^admin/{regex}/editorial_decision$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'admin/<identifier:identifier_w_vn_nr>/editorial_decision', views.EditorialDecisionDetailView.as_view(), name='editorial_decision_detail' ), - url( - r'^admin/{regex}/editorial_decision/update$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'admin/<identifier:identifier_w_vn_nr>/editorial_decision/update', views.EditorialDecisionUpdateView.as_view(), name='editorial_decision_update' ), - url( - r'^admin/{regex}/editorial_decision/fix$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'admin/<identifier:identifier_w_vn_nr>/editorial_decision/fix', views.fix_editorial_decision, name='fix_editorial_decision' ), - url( - r'^{regex}/accept_puboffer$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), + path( + '<identifier:identifier_w_vn_nr>/accept_puboffer', views.accept_puboffer, name='accept_puboffer' ), - url( - r'admin/{regex}/restart_refereeing$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'admin/<identifier:identifier_w_vn_nr>/restart_refereeing', views.restart_refereeing, name='restart_refereeing' ), - - url(r'^admin/reports$', views.reports_accepted_list, name='reports_accepted_list'), - url(r'^admin/reports/(?P<report_id>[0-9]+)/compile$', - views.report_pdf_compile, name='report_pdf_compile'), - url(r'^admin/reports/(?P<report_id>[0-9]+)/compile$', - views.report_pdf_compile, name='report_pdf_compile'), + path( + 'admin/reports', + views.reports_accepted_list, + name='reports_accepted_list' + ), + path( + 'admin/reports/<int:report_id>/compile', + views.report_pdf_compile, + name='report_pdf_compile' + ), + path( + 'admin/reports/<int:report_id>/compile', + views.report_pdf_compile, + name='report_pdf_compile' + ), # Submission, resubmission, withdrawal @@ -149,6 +211,11 @@ url(r'^admin/{regex}/plagiarism/internal$'.format(regex=SUBMISSIONS_COMPLETE_REG views.RequestSubmissionUsingArXivView.as_view(), name='submit_manuscript_arxiv' ), + path( # Submit using ChemRxiv (thread_hash as GET param if resubmission) + 'submit_manuscript/<journal_doi_label:journal_doi_label>/chemrxiv', + views.RequestSubmissionUsingChemRxivView.as_view(), + name='submit_manuscript_chemrxiv' + ), path( # Submit using a Figshare-related preprint server (thread_hash as GET param if resubmission) 'submit_manuscript/<journal_doi_label:journal_doi_label>/figshare', views.RequestSubmissionUsingFigshareView.as_view(), @@ -160,98 +227,216 @@ url(r'^admin/{regex}/plagiarism/internal$'.format(regex=SUBMISSIONS_COMPLETE_REG name='submit_manuscript_osfpreprints' ), - url( - r'^withdraw_manuscript/{regex}/$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), + path( + 'withdraw_manuscript/<identifier:identifier_w_vn_nr>/', views.withdraw_manuscript, name='withdraw_manuscript' ), # Pool - url(r'^pool/$', views.pool, name='pool'), - url(r'^pool/{regex}/$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), views.pool, name='pool'), - url(r'^add_remark/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.add_remark, name='add_remark'), + path( + 'pool2', + views.pool2, + name='pool2' + ), + path( + 'pool/submissions', + views.pool_hx_submissions_list, + name='pool_hx_submissions_list' + ), + path( + 'pool/submissions/<identifier:identifier_w_vn_nr>', + views.pool_hx_submission_details, + name='pool_hx_submission_details' + ), + path( + 'pool/', + views.pool, + name='pool' + ), + path( + 'pool/<identifier:identifier_w_vn_nr>/', + views.pool, + name='pool' + ), + path( + 'add_remark/<identifier:identifier_w_vn_nr>', + views.add_remark, + name='add_remark' + ), # Assignment of Editor-in-charge - url(r'^assign_submission/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.assign_submission, name='assign_submission'), - url(r'^pool/assignment_request/(?P<assignment_id>[0-9]+)$', - views.assignment_request, name='assignment_request'), - url(r'^pool/{regex}/editorial_assignment/$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.editorial_assignment, - name='editorial_assignment'), - url(r'^pool/{regex}/editorial_assignment/(?P<assignment_id>[0-9]+)/$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), views.editorial_assignment, - name='editorial_assignment'), - url(r'^prescreening_failed/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.prescreening_failed, name='prescreening_failed'), - url(r'^update_authors_screening/{regex}/(?P<nrweeks>[1-2])$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.update_authors_screening, name='update_authors_screening'), - url(r'^assignment_failed/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.assignment_failed, name='assignment_failed'), + path( + 'pool/assignment_request/<int:assignment_id>', + views.assignment_request, + name='assignment_request' + ), + path( + 'pool/<identifier:identifier_w_vn_nr>/editorial_assignment/', + views.editorial_assignment, + name='editorial_assignment' + ), + path( + 'pool/<identifier:identifier_w_vn_nr>/editorial_assignment/<int:assignment_id>/', + views.editorial_assignment, + name='editorial_assignment' + ), + path( + 'update_authors_screening/<identifier:identifier_w_vn_nr>/<int:nrweeks>', + views.update_authors_screening, + name='update_authors_screening' + ), + path( + 'assignment_failed/<identifier:identifier_w_vn_nr>', + views.assignment_failed, + name='assignment_failed' + ), # Editorial workflow and refereeing - url(r'^editorial_workflow$', views.editorial_workflow, name='editorial_workflow'), - url(r'^assignments$', views.assignments, name='assignments'), - url(r'^editorial_page/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.editorial_page, name='editorial_page'), - url(r'^select_referee/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.select_referee, name='select_referee'), - url(r'^add_referee_profile/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.add_referee_profile, name='add_referee_profile'), - url(r'^invite_referee/{regex}/(?P<profile_id>[0-9]+)' - '/(?P<auto_reminders_allowed>[0-1])$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.invite_referee, name='invite_referee'), - url(r'^set_refinv_auto_reminder/(?P<invitation_id>[0-9]+)/(?P<auto_reminders>[0-1])$', - views.set_refinv_auto_reminder, name='set_refinv_auto_reminder'), - url(r'^accept_or_decline_ref_invitations/$', - views.accept_or_decline_ref_invitations, name='accept_or_decline_ref_invitations'), - url(r'^accept_or_decline_ref_invitations/(?P<invitation_id>[0-9]+)$', - views.accept_or_decline_ref_invitations, name='accept_or_decline_ref_invitations'), - url(r'^decline_ref_invitation/(?P<invitation_key>.+)$', - views.decline_ref_invitation, name='decline_ref_invitation'), - url(r'^ref_invitation_reminder/{regex}/(?P<invitation_id>[0-9]+)$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.ref_invitation_reminder, name='ref_invitation_reminder'), - url(r'^cancel_ref_invitation/{regex}/(?P<invitation_id>[0-9]+)$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.cancel_ref_invitation, name='cancel_ref_invitation'), - url(r'^extend_refereeing_deadline/{regex}/(?P<days>[0-9]+)$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.extend_refereeing_deadline, name='extend_refereeing_deadline'), - url(r'^set_refereeing_deadline/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.set_refereeing_deadline, name='set_refereeing_deadline'), - url(r'^close_refereeing_round/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.close_refereeing_round, name='close_refereeing_round'), - url(r'^refereeing_overview$', views.refereeing_overview, name='refereeing_overview'), - url(r'^communication/{regex}/(?P<comtype>[a-zA-Z]{{4,}})$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.communication, name='communication'), - url(r'^communication/{regex}/(?P<comtype>[a-zA-Z]{{4,}})/(?P<referee_id>[0-9]+)$'.format( - regex=SUBMISSIONS_COMPLETE_REGEX), - views.communication, name='communication'), - url(r'^eic_recommendation/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.eic_recommendation, name='eic_recommendation'), - url(r'^eic_recommendation/{regex}/reformulate$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.reformulate_eic_recommendation, name='reformulate_eic_recommendation'), - url(r'^cycle/{regex}/submit$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.cycle_form_submit, name='cycle_confirmation'), + path( + 'editorial_workflow', + views.editorial_workflow, + name='editorial_workflow' + ), + path( + 'assignments', + views.assignments, + name='assignments' + ), + path( + 'editorial_page/<identifier:identifier_w_vn_nr>', + views.editorial_page, + name='editorial_page' + ), + path( + 'select_referee/<identifier:identifier_w_vn_nr>', + views.select_referee, + name='select_referee' + ), + path( + 'add_referee_profile/<identifier:identifier_w_vn_nr>', + views.add_referee_profile, + name='add_referee_profile' + ), + path( + 'invite_referee/<identifier:identifier_w_vn_nr>/<int:profile_id>/<int:auto_reminders_allowed>', + views.invite_referee, + name='invite_referee' + ), + path( + 'set_refinv_auto_reminder/<int:invitation_id>/<int:auto_reminders>', + views.set_refinv_auto_reminder, + name='set_refinv_auto_reminder' + ), + path( + 'accept_or_decline_ref_invitations/', + views.accept_or_decline_ref_invitations, + name='accept_or_decline_ref_invitations' + ), + path( + 'accept_or_decline_ref_invitations/<int:invitation_id>', + views.accept_or_decline_ref_invitations, + name='accept_or_decline_ref_invitations' + ), + path( + 'decline_ref_invitation/<str:invitation_key>', + views.decline_ref_invitation, + name='decline_ref_invitation' + ), + path( + 'ref_invitation_reminder/<identifier:identifier_w_vn_nr>/<int:invitation_id>', + views.ref_invitation_reminder, + name='ref_invitation_reminder' + ), + path( + 'cancel_ref_invitation/<identifier:identifier_w_vn_nr>/<int:invitation_id>', + views.cancel_ref_invitation, + name='cancel_ref_invitation' + ), + path( + 'extend_refereeing_deadline/<identifier:identifier_w_vn_nr>/<int:days>', + views.extend_refereeing_deadline, + name='extend_refereeing_deadline' + ), + path( + 'set_refereeing_deadline/<identifier:identifier_w_vn_nr>', + views.set_refereeing_deadline, + name='set_refereeing_deadline' + ), + path( + 'close_refereeing_round/<identifier:identifier_w_vn_nr>', + views.close_refereeing_round, + name='close_refereeing_round' + ), + path( + 'refereeing_overview', + views.refereeing_overview, + name='refereeing_overview' + ), + path( + 'communication/<identifier:identifier_w_vn_nr>/<str:comtype>', + views.communication, + name='communication' + ), + path( + 'communication/<identifier:identifier_w_vn_nr>/<str:comtype>/<int:referee_id>', + views.communication, + name='communication' + ), + path( + 'eic_recommendation/<identifier:identifier_w_vn_nr>', + views.eic_recommendation, + name='eic_recommendation' + ), + path( + 'eic_recommendation/<identifier:identifier_w_vn_nr>/reformulate', + views.reformulate_eic_recommendation, + name='reformulate_eic_recommendation' + ), + path( + 'cycle/<identifier:identifier_w_vn_nr>/submit', + views.cycle_form_submit, + name='cycle_confirmation' + ), # Reports - url(r'^{regex}/reports/submit$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.submit_report, name='submit_report'), - url(r'^reports/vet$', views.vet_submitted_reports_list, name='vet_submitted_reports_list'), - url(r'^reports/(?P<report_id>[0-9]+)/vet$', views.vet_submitted_report, - name='vet_submitted_report'), + path( + '<identifier:identifier_w_vn_nr>/reports/submit', + views.submit_report, + name='submit_report' + ), + path( + 'reports/vet', + views.vet_submitted_reports_list, + name='vet_submitted_reports_list' + ), + path( + 'reports/<int:report_id>/vet', + views.vet_submitted_report, + name='vet_submitted_report' + ), # Voting - url(r'^prepare_for_voting/(?P<rec_id>[0-9]+)$', views.prepare_for_voting, - name='prepare_for_voting'), - url(r'^vote_on_rec/(?P<rec_id>[0-9]+)$', views.vote_on_rec, name='vote_on_rec'), - url(r'^remind_Fellows_to_vote/(?P<rec_id>[0-9]+)$', views.remind_Fellows_to_vote, - name='remind_Fellows_to_vote'), + path( + 'prepare_for_voting/<int:rec_id>', + views.prepare_for_voting, + name='prepare_for_voting' + ), + path( + 'vote_on_rec/<int:rec_id>', + views.vote_on_rec, + name='vote_on_rec' + ), + path( + 'claim_voting_right/<int:rec_id>', + views.claim_voting_right, + name='claim_voting_right' + ), + path( + 'remind_Fellows_to_vote/<int:rec_id>', + views.remind_Fellows_to_vote, + name='remind_Fellows_to_vote' + ), # Monitoring path( diff --git a/scipost_django/submissions/utils.py b/scipost_django/submissions/utils.py index 82ead94ea12fce8893dff0e7325e1d8bb3cfee0e..696c3bfb8422c465df3cbd51ddde7f8d5a2358e1 100644 --- a/scipost_django/submissions/utils.py +++ b/scipost_django/submissions/utils.py @@ -4,6 +4,7 @@ __license__ = "AGPL v3" import datetime +from django.contrib.sites.models import Site from django.core.mail import EmailMessage, EmailMultiAlternatives from django.template import Context, Template @@ -13,64 +14,13 @@ from .constants import ( from scipost.utils import EMAIL_FOOTER from common.utils import BaseMailUtil +domain = Site.objects.get_current().domain + class SubmissionUtils(BaseMailUtil): - mail_sender = 'submissions@scipost.org' + mail_sender = f'submissions@{domain}' mail_sender_title = 'SciPost Editorial Admin' - @classmethod - def send_assignment_request_email(cls): - """ Requires loading 'assignment' attribute. """ - email_text = ('Dear ' + cls.assignment.to.profile.get_title_display() + ' ' + - cls.assignment.to.user.last_name + - ', \n\nWe have received a Submission to SciPost ' + - 'for which we would like you to consider becoming Editor-in-charge:\n\n' + - cls.assignment.submission.title + ' by ' - + cls.assignment.submission.author_list + '.' + - '\n\nPlease visit https://scipost.org/submissions/pool ' + - 'in order to accept or decline (it is important for you to inform us ' - 'even if you decline, since this affects the result ' - 'of the pre-screening process). ' - 'Note that this assignment request is automatically ' - 'deprecated if another Fellow ' - 'takes charge of this Submission or if pre-screening ' - 'fails in the meantime.' - '\n\nMany thanks in advance for your collaboration,' + - '\n\nThe SciPost Team.') - email_text_html = ( - '<p>Dear {{ title }} {{ last_name }},</p>' - '<p>We have received a Submission to SciPost ' + - 'for which we would like you to consider becoming Editor-in-charge:</p>' - '<p>{{ sub_title }}</p>\n<p>by {{ author_list }}.</p>' - '\n<p>Please visit the ' - '<a href="https://scipost.org/submissions/pool">Submissions Pool</a> ' - 'in order to accept or decline (it is important for you to inform us ' - 'even if you decline, since this affects the result ' - 'of the pre-screening process).</p>' - '<p>Note that this assignment request is automatically ' - 'deprecated if another Fellow ' - 'takes charge of this Submission or if pre-screening ' - 'fails in the meantime.</p>' - '\n<p>Many thanks in advance for your collaboration,</p>' - '<p>The SciPost Team.</p>') - email_context = { - 'title': cls.assignment.to.profile.get_title_display(), - 'last_name': cls.assignment.to.user.last_name, - 'sub_title': cls.assignment.submission.title, - 'author_list': cls.assignment.submission.author_list, - } - email_text_html += '<br/>' + EMAIL_FOOTER - html_template = Template(email_text_html) - html_version = html_template.render(Context(email_context)) - emailmessage = EmailMultiAlternatives( - 'SciPost: potential Submission assignment', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', - [cls.assignment.to.user.email], - bcc=['submissions@scipost.org'], - reply_to=['submissions@scipost.org']) - emailmessage.attach_alternative(html_version, 'text/html') - emailmessage.send(fail_silently=False) - @classmethod def send_EIC_appointment_email(cls): """ Requires loading 'assignment' attribute. """ @@ -82,15 +32,15 @@ class SubmissionUtils(BaseMailUtil): + cls.assignment.submission.title + ' by ' + cls.assignment.submission.author_list + '.' '\n\nYou can take your editorial actions from the editorial page ' - 'https://scipost.org/submission/editorial_page/' + f'https://{domain}/submission/editorial_page/' + cls.assignment.submission.preprint.identifier_w_vn_nr + ' (also accessible from your personal page ' - 'https://scipost.org/personal_page under the Editorial Actions tab). ' + f'https://{domain}/personal_page under the Editorial Actions tab). ' 'In particular, unless you choose to directly formulate a Recommendation, ' 'you should now start a refereeing round and invite at least 3 referees; ' 'you might want to make sure you are aware of the ' 'detailed procedure described in the Editorial College by-laws at ' - 'https://scipost.org/EdCol_by-laws.' + f'https://{domain}/EdCol_by-laws.' '\n\nMany thanks in advance for your collaboration,' '\n\nThe SciPost Team.') email_text_html = ( @@ -100,16 +50,16 @@ class SubmissionUtils(BaseMailUtil): '<p>{{ sub_title }}</p>' '\n<p>by {{ author_list }}.</p>' '\n<p>You can take your editorial actions from the ' - '<a href="https://scipost.org/submission/editorial_page/' + f'<a href="https://{domain}/submission/editorial_page/' '{{ identifier_w_vn_nr }}">editorial page</a> ' '(also accessible from your ' - '<a href="https://scipost.org/personal_page">personal page</a> ' + f'<a href="https://{domain}/personal_page">personal page</a> ' 'under the Editorial Actions tab).</p>' '\n<p>In particular, unless you choose to directly formulate a Recommendation, ' 'you should now start a refereeing round and invite at least 3 referees; ' 'you might want to make sure you are aware of the ' 'detailed procedure described in the ' - '<a href="https://scipost.org/EdCol_by-laws">Editorial College by-laws</a>.</p>' + f'<a href="https://{domain}/EdCol_by-laws">Editorial College by-laws</a>.</p>' '<p>Many thanks in advance for your collaboration,</p>' '<p>The SciPost Team.</p>') email_context = { @@ -124,10 +74,10 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: assignment as EIC', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', + f'SciPost Editorial Admin <submissions@{domain}>', [cls.assignment.to.user.email], - bcc=['submissions@scipost.org'], - reply_to=['submissions@scipost.org']) + bcc=[f'submissions@{domain}'], + reply_to=[f'submissions@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -140,7 +90,7 @@ class SubmissionUtils(BaseMailUtil): + cls.assignment.submission.title + ' by ' + cls.assignment.submission.author_list + '\n\nhas successfully passed the pre-screening stage. ' '\n\nA Submission Page has been activated at ' - 'https://scipost.org/submission/' + f'https://{domain}/submission/' + cls.assignment.submission.preprint.identifier_w_vn_nr + ' and a refereeing round has been started, with deadline ' 'currently set at ' @@ -167,7 +117,7 @@ class SubmissionUtils(BaseMailUtil): '<p>{{ sub_title }}</p>' '\n<p>by {{ author_list }}</p>' '\n<p>has successfully passed the pre-screening stage.</p>' - '\n<p>A <a href="https://scipost.org/submission/{{ identifier_w_vn_nr }}">' + f'\n<p>A <a href="https://{domain}/submission/' + '{{ identifier_w_vn_nr }}">' 'Submission Page</a> has been activated ' 'and a refereeing round has been started, with deadline ' 'currently set at {{ deadline }}.</p>' @@ -202,10 +152,10 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: pre-screening passed', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', + f'SciPost Editorial Admin <submissions@{domain}>', [cls.assignment.submission.submitted_by.user.email], - bcc=['submissions@scipost.org'], - reply_to=['submissions@scipost.org']) + bcc=[f'submissions@{domain}'], + reply_to=[f'submissions@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -236,7 +186,7 @@ class SubmissionUtils(BaseMailUtil): 'our invitation to become a Contributor on SciPost ' '(our records show that you are not yet registered); ' 'your partially pre-filled registration form is still available at\n\n' - 'https://scipost.org/invitation/' + cls.invitation.invitation_key + '\n\n' + f'https://{domain}/invitation/' + cls.invitation.invitation_key + '\n\n' 'after which your registration will be activated, giving you full access to ' 'the portal\'s facilities (in particular allowing you to ' 'provide referee reports).\n\n' @@ -244,20 +194,20 @@ class SubmissionUtils(BaseMailUtil): 'we would appreciate a quick accept/decline response from you, ' 'ideally within the next 2 days.\n\n' 'If you are not able to provide a Report, you can quickly let us know by simply ' - 'navigating to \n\nhttps://scipost.org/submissions/decline_ref_invitation/' + f'navigating to \n\nhttps://{domain}/submissions/decline_ref_invitation/' + cls.invitation.invitation_key + '\n\n' 'If you are able to provide a Report, you can confirm this after registering ' 'and logging in (you will automatically be prompted for a confirmation). ' 'Your report can thereafter be submitted by simply clicking on ' 'the "Contribute a Report" link at ' - 'https://scipost.org/submission/' + f'https://{domain}/submission/' + cls.invitation.submission.preprint.identifier_w_vn_nr + ' before the reporting deadline (currently set at ' + datetime.datetime.strftime(cls.invitation.submission.reporting_deadline, "%Y-%m-%d") + '; your report will be automatically recognized as an invited report). ' 'You might want to make sure you are familiar with our refereeing code of conduct ' - 'https://scipost.org/journals/journals_terms_and_conditions and with the ' - 'refereeing procedure https://scipost.org/submissions/refereeing_procedure.' + f'https://{domain}/journals/journals_terms_and_conditions and with the ' + f'refereeing procedure https://{domain}/submissions/refereeing_procedure.' '\n\nWe very much hope we can count on your expertise,' '\n\nMany thanks in advance,\n\nThe SciPost Team' ) @@ -266,7 +216,7 @@ class SubmissionUtils(BaseMailUtil): 'our invitation to become a Contributor on SciPost ' '(our records show that you are not yet registered); ' 'your partially pre-filled ' - '<a href="https://scipost.org/invitation/{{ invitation_key }}">' + f'<a href="https://{domain}' + '/invitation/{{ invitation_key }}">' 'registration form</a> is still available, ' 'after which your registration will be activated, giving you full access to ' 'the portal\'s facilities (in particular allowing you to provide referee reports).</p>' @@ -275,19 +225,19 @@ class SubmissionUtils(BaseMailUtil): 'ideally within the next 2 days.</p>' '<p>If you are <strong>not</strong> able to provide a Report, ' 'you can quickly let us know by simply ' - '<a href="https://scipost.org/submissions/decline_ref_invitation/{{ invitation_key }}">' + f'<a href="https://{domain}' + '/submissions/decline_ref_invitation/{{ invitation_key }}">' 'clicking here</a>.</p>' '<p>If you are able to provide a Report, you can confirm this after registering ' 'and logging in (you will automatically be prompted for a confirmation). ' 'Your report can thereafter be submitted by simply clicking on ' 'the "Contribute a Report" link at ' - 'the <a href="https://scipost.org/submission/{{ identifier_w_vn_nr }}">' + f'the <a href="https://{domain}' + '/submission/{{ identifier_w_vn_nr }}">' 'Submission\'s page</a> before the reporting deadline (currently set at ' '{{ deadline }}; your report will be automatically recognized as an invited report).</p>' '\n<p>You might want to make sure you are familiar with our ' - '<a href="https://scipost.org/journals/journals_terms_and_conditions">' + f'<a href="https://{domain}/journals/journals_terms_and_conditions">' 'refereeing code of conduct</a> and with the ' - '<a href="https://scipost.org/submissions/refereeing_procedure">' + f'<a href="https://{domain}/submissions/refereeing_procedure">' 'refereeing procedure</a>.</p>' '<p>We very much hope we can count on your expertise,</p>' '<p>Many thanks in advance,</p>' @@ -309,11 +259,11 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: reminder (refereeing request and registration invitation)', email_text, - 'SciPost Refereeing <refereeing@scipost.org>', + f'SciPost Refereeing <refereeing@{domain}>', [cls.invitation.email_address], bcc=[cls.invitation.submission.editor_in_charge.user.email, - 'refereeing@scipost.org'], - reply_to=['refereeing@scipost.org']) + f'refereeing@{domain}'], + reply_to=[f'refereeing@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -342,38 +292,38 @@ class SubmissionUtils(BaseMailUtil): if cls.invitation.accepted is None: email_text += ( '\n\nPlease visit ' - 'https://scipost.org/submissions/accept_or_decline_ref_invitations ' + f'https://{domain}/submissions/accept_or_decline_ref_invitations ' '(login required) as soon as possible (ideally within the next 2 days) ' 'in order to accept or decline this invitation.') email_text_html += ( '\n<p>Please ' - '<a href="https://scipost.org/submissions/accept_or_decline_ref_invitations">' + f'<a href="https://{domain}/submissions/accept_or_decline_ref_invitations">' 'accept or decline the invitation</a> ' '(login required) as soon as possible (ideally within the next 2 days) ' 'in order to ensure rapid processing of the submission.') email_text += ( '\n\nYour report can be submitted by simply clicking on ' 'the "Contribute a Report" link at ' - 'https://scipost.org/submission/' + f'https://{domain}/submission/' + cls.invitation.submission.preprint.identifier_w_vn_nr + ' before the reporting deadline (currently set at ' + datetime.datetime.strftime(cls.invitation.submission.reporting_deadline, "%Y-%m-%d") + '; your report will be automatically recognized as an invited report). ' 'You might want to make sure you are familiar with our refereeing code of conduct ' - 'https://scipost.org/journals/journals_terms_and_conditions and with the ' - 'refereeing procedure https://scipost.org/submissions/refereeing_procedure.' + f'https://{domain}/journals/journals_terms_and_conditions and with the ' + f'refereeing procedure https://{domain}/submissions/refereeing_procedure.' '\n\nWe very much hope we can count on your expertise,' '\n\nMany thanks in advance,\n\nThe SciPost Team') email_text_html += ( '\n<p>Your report can be submitted by simply clicking on ' 'the "Contribute a Report" link at ' - 'the <a href="https://scipost.org/submission/{{ identifier_w_vn_nr }}">' + f'the <a href="https://{domain}' + '/submission/{{ identifier_w_vn_nr }}">' 'Submission\'s page</a> before the reporting deadline (currently set at ' '{{ deadline }}; your report will be automatically recognized as an invited report).</p>' '\n<p>You might want to make sure you are familiar with our ' - '<a href="https://scipost.org/journals/journals_terms_and_conditions">' + f'<a href="https://{domain}/journals/journals_terms_and_conditions">' 'refereeing code of conduct</a> and with the ' - '<a href="https://scipost.org/submissions/refereeing_procedure">' + f'<a href="https://{domain}/submissions/refereeing_procedure">' 'refereeing procedure</a>.</p>' '<p>We very much hope we can count on your expertise,</p>' '<p>Many thanks in advance,</p>' @@ -395,11 +345,11 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: reminder (refereeing request and registration invitation)', email_text, - 'SciPost Refereeing <refereeing@scipost.org>', + f'SciPost Refereeing <refereeing@{domain}>', [cls.invitation.email_address], bcc=[cls.invitation.submission.editor_in_charge.user.email, - 'refereeing@scipost.org'], - reply_to=['refereeing@scipost.org']) + f'refereeing@{domain}'], + reply_to=[f'refereeing@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -437,7 +387,7 @@ class SubmissionUtils(BaseMailUtil): 'our invitation to become a Contributor on SciPost ' '(our records show that you are not yet registered); ' 'your partially pre-filled registration form is still available at\n\n' - 'https://scipost.org/invitation/' + cls.invitation.invitation_key + '\n\n' + f'https://{domain}/invitation/' + cls.invitation.invitation_key + '\n\n' 'after which your registration will be activated, giving you full access to ' 'the portal\'s facilities (in particular allowing you to provide referee reports).') email_text_html += ( @@ -445,7 +395,7 @@ class SubmissionUtils(BaseMailUtil): 'our invitation to become a Contributor on SciPost ' '(our records show that you are not yet registered); ' 'your partially pre-filled ' - '<a href="https://scipost.org/invitation/{{ invitation_key }}">' + f'<a href="https://{domain}' + '/invitation/{{ invitation_key }}">' 'registration form</a> is still available ' 'after which your registration will be activated, giving you full access to ' 'the portal\'s facilities (in particular allowing you to provide referee reports).</p>') @@ -463,11 +413,11 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: report no longer needed', email_text, - 'SciPost Refereeing <refereeing@scipost.org>', + f'SciPost Refereeing <refereeing@{domain}>', [cls.invitation.email_address], bcc=[cls.invitation.submission.editor_in_charge.user.email, - 'refereeing@scipost.org'], - reply_to=['refereeing@scipost.org']) + f'refereeing@{domain}'], + reply_to=[f'refereeing@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -485,11 +435,11 @@ class SubmissionUtils(BaseMailUtil): '<p>{{ sub_title }}</p>\n<p>by {{ author_list }}.</p>') if cls.report.status == STATUS_VETTED: email_text += ('\n\nYour Report has been vetted through and is viewable at ' - 'https://scipost.org/submissions/' + f'https://{domain}/submissions/' + cls.report.submission.preprint.identifier_w_vn_nr + '.') email_text_html += ( '\n<p>Your Report has been vetted through and is viewable at ' - 'the <a href="https://scipost.org/submissions/' + f'the <a href="https://{domain}/submissions/' '{{ identifier_w_vn_nr }}">Submission\'s page</a>.</p>') else: email_text += ('\n\nYour Report has been reviewed by the Editor-in-charge of the Submission, ' @@ -546,11 +496,11 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: Report acknowledgement', email_text, - 'SciPost Refereeing <refereeing@scipost.org>', + f'SciPost Refereeing <refereeing@{domain}>', [cls.report.author.user.email], bcc=[cls.report.submission.editor_in_charge.user.email, - 'refereeing@scipost.org'], - reply_to=['refereeing@scipost.org']) + f'refereeing@{domain}'], + reply_to=[f'refereeing@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -562,7 +512,7 @@ class SubmissionUtils(BaseMailUtil): ', \n\nA Report has been posted on your recent Submission to SciPost,\n\n' + cls.report.submission.title + ' by ' + cls.report.submission.author_list + '.' '\n\nYou can view it at the Submission Page ' - 'https://scipost.org/submission/' + f'https://{domain}/submission/' + cls.report.submission.preprint.identifier_w_vn_nr + '.' '\n\nWe remind you that you can provide an author reply ' '(only if you wish, to clarify points raised ' @@ -577,7 +527,7 @@ class SubmissionUtils(BaseMailUtil): '<p>A Report has been posted on your recent Submission to SciPost,</p>' '<p>{{ sub_title }}</p>\n<p>by {{ author_list }}.</p>' '\n<p>You can view it at the ' - '<a href="https://scipost.org/submission/{{ identifier_w_vn_nr }}">' + f'<a href="https://{domain}' + '/submission/{{ identifier_w_vn_nr }}">' 'Submission\'s page</a>.</p>' '<p>We remind you that you can provide an author reply ' '(only if you wish, to clarify points raised ' @@ -599,10 +549,10 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: Report received on your Submission', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', + f'SciPost Editorial Admin <submissions@{domain}>', [cls.report.submission.submitted_by.user.email], - bcc=['submissions@scipost.org'], - reply_to=['submissions@scipost.org']) + bcc=[f'submissions@{domain}'], + reply_to=[f'submissions@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -622,30 +572,30 @@ class SubmissionUtils(BaseMailUtil): recipient_greeting = ('Dear ' + cls.communication.submission.editor_in_charge.profile.get_title_display() + ' ' + cls.communication.submission.editor_in_charge.user.last_name) - further_action_page = ('https://scipost.org/submission/editorial_page/' + further_action_page = (f'https://{domain}/submission/editorial_page/' + cls.communication.submission.preprint.identifier_w_vn_nr) if cls.communication.comtype == 'RtoE': bcc_emails.append(cls.communication.referee.user.email) - bcc_emails.append('submissions@scipost.org') + bcc_emails.append(f'submissions@{domain}') elif cls.communication.comtype in ['EtoA']: recipient_email.append(cls.communication.submission.submitted_by.user.email) recipient_greeting = ('Dear ' + cls.communication.submission.submitted_by.profile.get_title_display() + ' ' + cls.communication.submission.submitted_by.user.last_name) bcc_emails.append(cls.communication.submission.editor_in_charge.user.email) - bcc_emails.append('submissions@scipost.org') + bcc_emails.append(f'submissions@{domain}') elif cls.communication.comtype in ['EtoR']: recipient_email.append(cls.communication.referee.user.email) recipient_greeting = ('Dear ' + cls.communication.referee.profile.get_title_display() + ' ' + cls.communication.referee.user.last_name) bcc_emails.append(cls.communication.submission.editor_in_charge.user.email) - bcc_emails.append('submissions@scipost.org') + bcc_emails.append(f'submissions@{domain}') elif cls.communication.comtype in ['EtoS']: - recipient_email.append('submissions@scipost.org') + recipient_email.append(f'submissions@{domain}') recipient_greeting = 'Dear Editorial Administrators' bcc_emails.append(cls.communication.submission.editor_in_charge.user.email) - further_action_page = 'https://scipost.org/submissions/pool' + further_action_page = f'https://{domain}/submissions/pool' email_text = (recipient_greeting + ', \n\nPlease find here a communication (' + @@ -663,10 +613,10 @@ class SubmissionUtils(BaseMailUtil): emailmessage = EmailMessage( 'SciPost: communication (' + cls.communication.get_comtype_display() + ')', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', + f'SciPost Editorial Admin <submissions@{domain}>', recipient_email, bcc_emails, - reply_to=['submissions@scipost.org']) + reply_to=[f'submissions@{domain}']) emailmessage.send(fail_silently=False) @classmethod @@ -690,13 +640,13 @@ class SubmissionUtils(BaseMailUtil): email_text_html += 'major' email_text += (' revision.' '\n\nYou can view it at the Submission Page ' - 'https://scipost.org/submission/' + f'https://{domain}/submission/' + cls.submission.preprint.identifier_w_vn_nr + '. ' 'Note that the recommendation is viewable only by ' 'the registered authors of the submission.' 'To resubmit your paper, please first update the version ' 'on the arXiv; after appearance, go to the submission page ' - 'https://scipost.org/submissions/submit_manuscript and fill ' + f'https://{domain}/submissions/submit_manuscript and fill ' 'in the forms. Your submission will be automatically recognized ' 'as a resubmission.' '\n\nWe thank you very much for your contribution.' @@ -705,13 +655,13 @@ class SubmissionUtils(BaseMailUtil): email_text_html += ( ' revision.</p>' '\n<p>You can view it at the ' - '<a href="https://scipost.org/submission/' + f'<a href="https://{domain}/submission/' '{{ identifier_w_vn_nr }}">Submission\'s Page</a>.</p>' '<p>Note that the recommendation is viewable only by ' 'the registered authors of the submission.</p>' '<p>To resubmit your paper, please first update the version ' 'on the arXiv; after appearance, go to the ' - '<a href="https://scipost.org/submissions/submit_manuscript">' + f'<a href="https://{domain}/submissions/submit_manuscript">' 'submission page</a> and fill ' 'the forms in. Your submission will be automatically recognized ' 'as a resubmission.</p>' @@ -730,11 +680,11 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: revision requested', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', + f'SciPost Editorial Admin <submissions@{domain}>', [cls.submission.submitted_by.user.email], bcc=[cls.submission.editor_in_charge.user.email, - 'submissions@scipost.org'], - reply_to=['submissions@scipost.org']) + f'submissions@{domain}'], + reply_to=[f'submissions@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -782,7 +732,7 @@ class SubmissionUtils(BaseMailUtil): email_text += ('We are sorry to inform you that your Submission ' 'has not been accepted for publication. ' '\n\nYou can view more details at the Submission Page ' - 'https://scipost.org/submission/' + f'https://{domain}/submission/' + cls.submission.preprint.identifier_w_vn_nr + '. ' 'Note that these details are viewable only by ' 'the registered authors of the submission.' @@ -793,7 +743,7 @@ class SubmissionUtils(BaseMailUtil): '<p>We are sorry to inform you that your Submission ' 'has not been accepted for publication.</p>' '\n<p>You can view more details at the ' - '<a href="https://scipost.org/submission/' + f'<a href="https://{domain}/submission/' '{{ identifier_w_vn_nr }}">Submission\'s Page</a>. ' 'Note that these details are viewable only by ' 'the registered authors of the submission.</p>' @@ -820,11 +770,11 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: College decision', email_text, - 'SciPost Editorial Admin <submissions@scipost.org>', + f'SciPost Editorial Admin <submissions@{domain}>', [cls.submission.submitted_by.user.email], bcc=[cls.submission.editor_in_charge.user.email, - 'submissions@scipost.org'], - reply_to=['submissions@scipost.org']) + f'submissions@{domain}'], + reply_to=[f'submissions@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) @@ -835,9 +785,9 @@ class SubmissionUtils(BaseMailUtil): """ email_text = ('Dear Fellow,' '\n\nYou have pending voting duties in the SciPost ' - 'submissions pool at https://scipost.org/submissions/pool' + f'submissions pool at https://{domain}/submissions/pool' ' (also accessible from your personal page ' - 'https://scipost.org/personal_page under the Editorial Actions tab). ' + f'https://{domain}/personal_page under the Editorial Actions tab). ' 'Could you please have a quick look within the next couple of days, ' 'so we can finish processing these submissions?' '\n\nMany thanks in advance,' @@ -845,9 +795,9 @@ class SubmissionUtils(BaseMailUtil): email_text_html = ( '<p>Dear Fellow,</p>' '<p>You have pending voting duties in the SciPost ' - 'submissions pool https://scipost.org/submissions/pool' + f'submissions pool https://{domain}/submissions/pool' ' (also accessible from your personal page ' - 'https://scipost.org/personal_page under the Editorial Actions tab).</p>' + f'https://{domain}/personal_page under the Editorial Actions tab).</p>' '<p>Could you please have a quick look within the next couple of days, ' 'so we can finish processing these submissions?</p>' '<p>Many thanks in advance,</p>' @@ -857,9 +807,9 @@ class SubmissionUtils(BaseMailUtil): html_version = html_template.render(Context(email_context)) emailmessage = EmailMultiAlternatives( 'SciPost: voting duties', email_text, - 'SciPost Editorial Admin <edadmin@scipost.org>', - to=['edadmin@scipost.org'], + f'SciPost Editorial Admin <edadmin@{domain}>', + to=[f'edadmin@{domain}'], bcc=cls.Fellow_emails, - reply_to=['edadmin@scipost.org']) + reply_to=[f'edadmin@{domain}']) emailmessage.attach_alternative(html_version, 'text/html') emailmessage.send(fail_silently=False) diff --git a/scipost_django/submissions/views.py b/scipost_django/submissions/views.py index 7a9a6572953a29ea3844f2391a09a7ce8b8c4fe2..733e104d7fc9f1b12af250d28105e33deacf56a9 100644 --- a/scipost_django/submissions/views.py +++ b/scipost_django/submissions/views.py @@ -8,11 +8,13 @@ import feedparser import strings from django.contrib import messages -from django.contrib.auth.decorators import login_required, permission_required +from django.contrib.auth.decorators import user_passes_test, login_required, permission_required from django.contrib.auth.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin) from django.contrib.messages.views import SuccessMessageMixin +from django.contrib.sites.models import Site from django.core.exceptions import PermissionDenied +from django.core.paginator import Paginator from django.db import transaction, IntegrityError from django.db.models import Q from django.http import Http404, HttpResponse, HttpResponseRedirect @@ -30,7 +32,8 @@ from dal import autocomplete from .constants import ( STATUS_ACCEPTED_AWAITING_PUBOFFER_ACCEPTANCE, STATUS_ACCEPTED, STATUS_REJECTED, - STATUS_VETTED, SUBMISSION_STATUS, STATUS_FAILED_PRESCREENING, STATUS_ASSIGNMENT_FAILED, + STATUS_VETTED, SUBMISSION_STATUS, STATUS_FAILED_PRESCREENING, + STATUS_UNASSIGNED, STATUS_ASSIGNMENT_FAILED, STATUS_DRAFT, CYCLE_DIRECT_REC, STATUS_COMPLETED, STATUS_DEPRECATED, EIC_REC_PUBLISH, EIC_REC_REJECT, DECISION_FIXED, FIGSHARE_PREPRINT_SERVERS) @@ -42,9 +45,10 @@ from .models import ( EditorialAssignment, RefereeInvitation, Report, SubmissionEvent) from .mixins import SubmissionMixin, SubmissionAdminViewMixin from .forms import ( - SciPostPrefillForm, ArXivPrefillForm, FigsharePrefillForm, OSFPreprintsPrefillForm, - SubmissionForm, SubmissionSearchForm, RecommendationVoteForm, - ConsiderAssignmentForm, InviteEditorialAssignmentForm, EditorialAssignmentForm, VetReportForm, + SciPostPrefillForm, ArXivPrefillForm, ChemRxivPrefillForm, + FigsharePrefillForm, OSFPreprintsPrefillForm, + SubmissionForm, SubmissionPoolSearchForm, SubmissionOldSearchForm, RecommendationVoteForm, + ConsiderAssignmentForm, EditorialAssignmentForm, VetReportForm, SetRefereeingDeadlineForm, RefereeSearchForm, iThenticateReportForm, VotingEligibilityForm, WithdrawSubmissionForm, ConsiderRefereeInvitationForm, EditorialCommunicationForm, ReportForm, @@ -55,9 +59,10 @@ from .forms import ( EditorialDecisionForm, SubmissionPrescreeningForm, PreassignEditorsFormSet, SubmissionReassignmentForm) +from .permissions import is_edadmin_or_senior_fellow from .utils import SubmissionUtils -from colleges.models import PotentialFellowship +from colleges.models import PotentialFellowship, Fellowship from colleges.permissions import fellowship_required, fellowship_or_admin_required from comments.forms import CommentForm from common.helpers import get_new_secrets_key @@ -75,7 +80,7 @@ from profiles.models import Profile from profiles.forms import SimpleProfileForm, ProfileEmailForm from scipost.constants import TITLE_DR, INVITATION_REFEREEING from scipost.decorators import is_contributor_user -from scipost.forms import RemarkForm +from scipost.forms import RemarkForm, SearchTextForm from scipost.mixins import PaginationMixin, PermissionsMixin from scipost.models import Contributor, Remark @@ -178,6 +183,16 @@ def submit_choose_preprint_server(request, journal_doi_label): thread_hash=thread_hash) }) + # ChemRxiv + if preprint_servers.filter(name='ChemRxiv').exists(): + preprint_server_list.append({ + 'server': preprint_servers.get(name='ChemRxiv'), + 'prefill_form': ChemRxivPrefillForm( + requested_by=request.user, + journal_doi_label=journal_doi_label, + thread_hash=thread_hash) + }) + # then all OSF-based preprint servers for ps in preprint_servers.filter(served_by__name='OSFPreprints'): preprint_server_list.append({ @@ -278,8 +293,7 @@ class RequestSubmissionView(LoginRequiredMixin, PermissionRequiredMixin, CreateV def form_valid(self, form): """Redirect and send out mails if all data is valid.""" submission = form.save() - submission.add_general_event('The manuscript has been submitted to %s.' - % str(submission.submitted_to)) + submission.add_general_event('Submitted to %s.' % str(submission.submitted_to)) text = ('<h3>Thank you for your Submission to SciPost</h3>' 'Your Submission will soon be handled by an Editor.') @@ -330,6 +344,21 @@ class RequestSubmissionUsingArXivView(RequestSubmissionView): return super().get(request, journal_doi_label) +class RequestSubmissionUsingChemRxivView(RequestSubmissionView): + """Formview to submit a new Submission using ChemRxiv.""" + + def get(self, request, journal_doi_label): + """ + Redirect to `submit_choose_preprint_server` if ChemRxiv identifier is not known. + """ + self.prefill_form = ChemRxivPrefillForm( + request.GET or None, + requested_by=self.request.user, + journal_doi_label=journal_doi_label, + thread_hash=request.GET.get('thread_hash')) + return super().get(request, journal_doi_label) + + class RequestSubmissionUsingFigshareView(RequestSubmissionView): """Formview to submit a new Submission using Figshare-related servers.""" @@ -414,11 +443,12 @@ def withdraw_manuscript(request, identifier_w_vn_nr): return render(request, 'submissions/withdraw_manuscript.html', context) +# Marked for deprecation class SubmissionListView(PaginationMixin, ListView): """List all publicly available Submissions.""" model = Submission - form = SubmissionSearchForm + form = SubmissionOldSearchForm submission_search_list = [] paginate_by = 10 @@ -511,7 +541,7 @@ def submission_detail(request, identifier_w_vn_nr): # their permission level is. context['can_read_editorial_information'] = False else: - # User may read eg. Editorial Recommendations if they are in the Pool. + # User may read eg. Editorial Recommendations if they are in the Fellowship. context['can_read_editorial_information'] = submission.fellows.filter( contributor__user=request.user).exists() @@ -608,6 +638,7 @@ def report_pdf_compile(request, report_id): messages.success(request, 'Upload complete.') return redirect(reverse('submissions:reports_accepted_list')) context = { + 'domain': Site.objects.get_current().domain, 'report': report, 'form': form } @@ -639,6 +670,7 @@ def treated_submission_pdf_compile(request, identifier_w_vn_nr): messages.success(request, 'Upload complete.') return redirect(reverse('submissions:treated_submissions_list')) context = { + 'domain': Site.objects.get_current().domain, 'submission': submission, 'form': form } @@ -734,6 +766,56 @@ def pool(request, identifier_w_vn_nr=None): return render(request, template, context) +@login_required +@fellowship_or_admin_required() +def pool2(request): + """ + Listing of Submissions for purposes of editorial handling. + """ + nr_potfels_to_vote_on = PotentialFellowship.objects.to_vote_on( + request.user.contributor).count() + recs_to_vote_on = EICRecommendation.objects.user_must_vote_on(request.user) + recs_current_voted = EICRecommendation.objects.user_current_voted(request.user) + assignments_to_consider = EditorialAssignment.objects.invited().filter( + to=request.user.contributor) + + context = { + 'nr_potfels_to_vote_on': nr_potfels_to_vote_on, + 'recs_to_vote_on': recs_to_vote_on, + 'recs_current_voted': recs_current_voted, + 'assignments_to_consider': assignments_to_consider, + + 'form': SubmissionPoolSearchForm( + initial={ 'status': STATUS_UNASSIGNED }, + user=request.user + ) + } + return render(request, 'submissions/pool/pool2.html', context) + + +def pool_hx_submissions_list(request): + form = SubmissionPoolSearchForm(request.POST or None, user=request.user) + if form.is_valid(): + submissions = form.search_results(request.user) + else: + submissions = Submission.objects.pool(request.user)[:16] + paginator = Paginator(submissions, 16) + page_nr = request.GET.get('page') + page_obj = paginator.get_page(page_nr) + context = { 'page_obj': page_obj } + return render(request, 'submissions/pool/hx_submissions_list.html', context) + + +def pool_hx_submission_details(request, identifier_w_vn_nr): + submission = get_object_or_404(Submission.objects.pool_editable(request.user), + preprint__identifier_w_vn_nr=identifier_w_vn_nr) + context = { + 'remark_form': RemarkForm(), + 'submission': submission + } + return render(request, 'submissions/pool/_hx_submission_details.html', context) + + @login_required @fellowship_or_admin_required() def add_remark(request, identifier_w_vn_nr): @@ -802,35 +884,6 @@ def submission_remove_topic(request, identifier_w_vn_nr, slug): return redirect(submission.get_absolute_url()) -@login_required -@permission_required('scipost.can_assign_submissions', raise_exception=True) -def assign_submission(request, identifier_w_vn_nr): - """Assign Editor-in-charge to Submission. - - Action done by SciPost Administration or Editorial College Administration. - """ - submission = get_object_or_404(Submission.objects.pool_editable(request.user), - preprint__identifier_w_vn_nr=identifier_w_vn_nr) - form = InviteEditorialAssignmentForm(request.POST or None, submission=submission) - - if form.is_valid(): - ed_assignment = form.save() - SubmissionUtils.load({'assignment': ed_assignment}) - SubmissionUtils.send_assignment_request_email() - messages.success(request, 'Your assignment request has been sent successfully.') - return redirect('submissions:pool') - - context = { - 'submission_to_assign': submission, - 'form': form - } - - if request.GET.get('flag'): - fellows_with_expertise = submission.fellows.all() - context['coauthorships'] = submission.flag_coauthorships_arxiv(fellows_with_expertise) - return render(request, 'submissions/admin/editorial_assignment_form.html', context) - - @login_required @fellowship_required() @transaction.atomic @@ -909,7 +962,7 @@ def editorial_assignment(request, identifier_w_vn_nr, assignment_id=None): def assignment_request(request, assignment_id): """Redirect to Editorial Assignment form view. - Exists for historical reasons; email are send with this url construction. + Exists for historical reasons; email are sent with this url construction. """ assignment = get_object_or_404(EditorialAssignment.objects.invited(), to=request.user.contributor, pk=assignment_id) @@ -919,38 +972,6 @@ def assignment_request(request, assignment_id): })) -@login_required -@permission_required('scipost.can_assign_submissions', raise_exception=True) -@transaction.atomic -def prescreening_failed(request, identifier_w_vn_nr): - """ - Reject a Submission because pre-screening has failed. - """ - submission = get_object_or_404(Submission.objects.pool(request.user).unassigned(), - preprint__identifier_w_vn_nr=identifier_w_vn_nr) - - mail_editor_view = MailEditorSubview( - request, mail_code='prescreening_failed', instance=submission, - header_template='submissions/admin/prescreening_failed.html') - if mail_editor_view.is_valid(): - # Deprecate old Editorial Assignments - EditorialAssignment.objects.filter(submission=submission).invited().update( - status=STATUS_DEPRECATED) - - # Update status of Submission - submission.touch() - Submission.objects.filter(id=submission.id).update( - status=STATUS_FAILED_PRESCREENING, visible_pool=False, visible_public=False) - - messages.success( - request, 'Submission {identifier} has failed pre-screening and been rejected.'.format( - identifier=submission.preprint.identifier_w_vn_nr)) - messages.success(request, 'Authors have been informed by email.') - mail_editor_view.send_mail() - return redirect(reverse('submissions:pool')) - return mail_editor_view.interrupt() - - @login_required @permission_required('scipost.can_assign_submissions', raise_exception=True) def update_authors_screening(request, identifier_w_vn_nr, nrweeks): @@ -959,10 +980,12 @@ def update_authors_screening(request, identifier_w_vn_nr, nrweeks): """ submission = get_object_or_404(Submission.objects.pool(request.user).unassigned(), preprint__identifier_w_vn_nr=identifier_w_vn_nr) - mail_code = 'authors/update_authors_screening_1week' - if nrweeks == '2': + if nrweeks == 1: + mail_code = 'authors/update_authors_screening_1week' + elif nrweeks == 2: mail_code = 'authors/update_authors_screening_2weeks' - + else: + raise Http404 mail_editor_view = MailEditorSubview( request, mail_code=mail_code, instance=submission) if mail_editor_view.is_valid(): @@ -1047,8 +1070,6 @@ def editorial_page(request, identifier_w_vn_nr): if submission.editor_in_charge != request.user.contributor: # The current user is not EIC of the Submission! full_access = False - if not submission.voting_fellows.filter(contributor__user=request.user).exists(): - raise Http404 context = { 'submission': submission, @@ -1100,7 +1121,7 @@ def select_referee(request, identifier_w_vn_nr): submission = get_object_or_404(Submission.objects.filter_for_eic(request.user), preprint__identifier_w_vn_nr=identifier_w_vn_nr) - if not submission.is_open_for_reporting: + if not submission.is_open_for_reporting_within_deadline: txt = ( 'The refereeing deadline has passed. You cannot invite a referee anymore.' ' Please, first extend the deadline of the refereeing to invite a referee.') @@ -1461,12 +1482,12 @@ def set_refereeing_deadline(request, identifier_w_vn_nr): if form.is_valid(): Submission.objects.filter(pk=submission.id).update( reporting_deadline=form.cleaned_data['deadline'], - open_for_reporting=(form.cleaned_data['deadline'] >= timezone.now().date()), + open_for_reporting=True, latest_activity = timezone.now()) submission.add_general_event('A new refereeing deadline is set.') - messages.success(request, 'New reporting deadline set.') + messages.success(request, 'New reporting deadline set to %s.' % submission.reporting_deadline.date()) else: - messages.error(request, 'The deadline has not been set. Please try again.') + messages.error(request, 'The deadline has not been set: %s Please try again.' % form.errors) return redirect(reverse('submissions:editorial_page', kwargs={'identifier_w_vn_nr': identifier_w_vn_nr})) @@ -1603,8 +1624,7 @@ def eic_recommendation(request, identifier_w_vn_nr): if not form.has_assignment(): messages.warning(request, ('You cannot formulate an Editorial Recommendation,' ' because the Editorial Assignment has not been set properly.' - ' Please ' - '<a href="mailto:admin@scipost.org">report the problem</a>.')) + ' Please contact EdAdmin to report the problem.')) return redirect(reverse('submissions:editorial_page', args=[submission.preprint.identifier_w_vn_nr])) @@ -1700,10 +1720,11 @@ def submit_report(request, identifier_w_vn_nr): ' to clarify this.') elif not invitation: # User is going to contribute a Report. Check deadlines for doing so. - if timezone.now() > submission.reporting_deadline + datetime.timedelta(days=1): - errormessage = ('The reporting deadline has passed. You cannot submit' - ' a Report anymore.') - elif not submission.open_for_reporting: + # Allow post-deadline reporting: + # if timezone.now() > submission.reporting_deadline + datetime.timedelta(days=1): + # errormessage = ('The reporting deadline has passed. You cannot submit' + # ' a Report anymore.') + if not submission.open_for_reporting: errormessage = ('Reporting for this submission has closed. You cannot submit' ' a Report anymore.') @@ -1863,6 +1884,19 @@ def prepare_for_voting(request, rec_id): return render(request, 'submissions/admin/recommendation_prepare_for_voting.html', context) +@login_required +@fellowship_or_admin_required() +def claim_voting_right(request, rec_id): + """Claim voting right on EICRecommendation.""" + rec = get_object_or_404(EICRecommendation, pk=rec_id) + granted = False + if rec.submission.fellows.filter(contributor=request.user.contributor).exists(): + rec.eligible_to_vote.add(request.user.contributor) + granted = True + context = { 'rec': rec, 'granted': granted } + return render(request, 'submissions/pool/_hx_recommendation_claim_voting_right.html', context) + + @login_required @fellowship_or_admin_required() @transaction.atomic @@ -1999,12 +2033,14 @@ def remind_Fellows_to_vote(request, rec_id): return render(request, 'scipost/acknowledgement.html', context) -@permission_required('scipost.can_run_pre_screening', raise_exception=True) +@login_required +@user_passes_test(is_edadmin_or_senior_fellow) def editor_invitations(request, identifier_w_vn_nr): - """Update/show invitations of editors for incoming Submission.""" + """ + Update/show invitations of editors for incoming Submission. + """ submission = get_object_or_404( Submission.objects.without_eic(), preprint__identifier_w_vn_nr=identifier_w_vn_nr) - assignments = submission.editorial_assignments.order_by('invitation_order') context = { 'submission': submission, @@ -2020,6 +2056,9 @@ def editor_invitations(request, identifier_w_vn_nr): if formset.is_valid(): formset.save() + submission.add_event_for_edadmin( + f'{request.user.first_name} {request.user.last_name} has edited the assignments.' + ) messages.success(request, 'Editor pre-assignments saved.') return redirect( reverse('submissions:editor_invitations', args=(submission.preprint.identifier_w_vn_nr,))) @@ -2082,19 +2121,20 @@ class SubmissionConflictsView(SubmissionAdminViewMixin, DetailView): class EICRecommendationDetailView(SubmissionMixin, LoginRequiredMixin, UserPassesTestMixin, DetailView): - """EICRecommendation detail page, visible to EdAdmin, voting Fellows (but NOT authors).""" + """ + EICRecommendation detail, visible to EdAdmin. + """ model = EICRecommendation template_name = 'submissions/pool/recommendation.html' context_object_name = 'recommendation' def test_func(self): - """Grants access to EdAdmin, voting Fellows and authors.""" + """Grants access to EdAdmin.""" if self.request.user.has_perm('scipost.can_fix_College_decision'): return True - # eicrec = get_object_or_404(EICRecommendation, pk=self.kwargs.get('rec_id')) submission = get_object_or_404( - Submission, preprint__identifier_w_vn_nr=kwargs.get('identifier_w_vn_nr')) + Submission, preprint__identifier_w_vn_nr=self.kwargs.get('identifier_w_vn_nr')) eicrec = submission.eicrecommendations.last() if eicrec.eligible_to_vote.filter(user=self.request.user).exists(): return True @@ -2227,11 +2267,7 @@ def fix_editorial_decision(request, identifier_w_vn_nr): else: # paper is accepted, but in subsidiary journal decision.status = EditorialDecision.AWAITING_PUBOFFER_ACCEPTANCE decision.save() - submission.add_event_for_author( - 'The Editorial Decision has been fixed for Journal %s: %s (with status: %s).' % ( - str(decision.for_journal), decision.get_decision_display(), - decision.get_status_display())) - submission.add_event_for_eic( + submission.add_general_event( 'The Editorial Decision has been fixed for Journal %s: %s (with status: %s).' % ( str(decision.for_journal), decision.get_decision_display(), decision.get_status_display())) diff --git a/scipost_django/templates/403.html b/scipost_django/templates/403.html index 7275c78062b6f5f21b136921d8c3dc722568aad9..76a9efcff2a6f2ae2e9fe6a3a4e002a8b1da254d 100644 --- a/scipost_django/templates/403.html +++ b/scipost_django/templates/403.html @@ -1,4 +1,5 @@ {% extends 'scipost/base.html' %} +{% load static %} {% block pagetitle %}: 403{% endblock pagetitle %} @@ -7,8 +8,8 @@ <div class="row"> <div class="col-12"> <div style="text-align: center;"> - <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> - <h1>You are not authorized to view the requested page.</h1> + <img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <h1>You are not authorized to view the requested page.</h1> <h2>403</h2> {% if request.user.is_anonymous %} <p style="margin-top: 20px;">Please <a href="{% url 'scipost:login' %}">login</a> first, and try again.</p> diff --git a/scipost_django/templates/404.html b/scipost_django/templates/404.html index aa58a2b1843fd80b62b275156850071484aae13d..50913f1a51f9fc520726a407b042f0c2b0fff90e 100644 --- a/scipost_django/templates/404.html +++ b/scipost_django/templates/404.html @@ -1,19 +1,20 @@ {% extends 'scipost/base.html' %} +{% load static %} {% block pagetitle %}: 404{% endblock pagetitle %} {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> <div style="text-align: center;"> - <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> - <h1>The page you requested could not be found.</h1> - <h2>404</h2> - <p style="margin-top: 20px;">Continue to the <a href="{% url 'submissions:submissions' %}">submissions</a>, <a href="{% url 'commentaries:commentaries' %}">commentaries</a> or <a href="{% url 'theses:theses' %}">theses</a> page.</p> + <img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <h1>The page you requested could not be found.</h1> + <h2>404</h2> + <p style="margin-top: 20px;">Continue to the <a href="{% url 'submissions:submissions' %}">submissions</a>, <a href="{% url 'commentaries:commentaries' %}">commentaries</a> or <a href="{% url 'theses:theses' %}">theses</a> page.</p> </div> </div> -</div> + </div> {% endblock %} diff --git a/scipost_django/templates/500.html b/scipost_django/templates/500.html index fea9d3baa473f2a2d2bda5ccd4cc497e8f613646..8293300aa32dfce86443c0dd4c9dd905bcf9bc8b 100644 --- a/scipost_django/templates/500.html +++ b/scipost_django/templates/500.html @@ -1,15 +1,16 @@ {% extends 'scipost/base.html' %} +{% load static %} {% block pagetitle %}: 500{% endblock pagetitle %} {% block content %} -<div style="text-align: center;"> - <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <div style="text-align: center;"> + <img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> <h1>We are sorry, something went wrong.</h1> <h2>500</h2> <h3>The SciPost administrators have been informed.</h3> - <p style="margin-top: 20px;">Go back to <a href="//scipost.org">the homepage</a>.</p> -</div> + <p style="margin-top: 20px;">Go back to <a href="{% url 'scipost:index' %}">the homepage</a>.</p> + </div> {% endblock %} diff --git a/scipost_django/templates/503.html b/scipost_django/templates/503.html index f90a6dc609a41007459896c9d6c86f274ade2578..3b9626391b008f375593bf846fdd15ff810b76cb 100644 --- a/scipost_django/templates/503.html +++ b/scipost_django/templates/503.html @@ -1,13 +1,14 @@ {% extends 'scipost/base.html' %} +{% load static %} {% block pagetitle %}: 503{% endblock pagetitle %} {% block content %} -<div style="text-align: center;"> - <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <div style="text-align: center;"> + <img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> <h1>We are currently in maintenance, please try again in a few minutes!</h1> <h2>503</h2> -</div> + </div> {% endblock %} diff --git a/scipost_django/templates/bi/alarm-fill.html b/scipost_django/templates/bi/alarm-fill.html new file mode 100644 index 0000000000000000000000000000000000000000..a1a37ea465b6567d95227a59eb834aad74ffd086 --- /dev/null +++ b/scipost_django/templates/bi/alarm-fill.html @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-alarm-fill" viewBox="0 0 16 16"> + <path d="M6 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1H9v1.07a7.001 7.001 0 0 1 3.274 12.474l.601.602a.5.5 0 0 1-.707.708l-.746-.746A6.97 6.97 0 0 1 8 16a6.97 6.97 0 0 1-3.422-.892l-.746.746a.5.5 0 0 1-.707-.708l.602-.602A7.001 7.001 0 0 1 7 2.07V1h-.5A.5.5 0 0 1 6 .5zm2.5 5a.5.5 0 0 0-1 0v3.362l-1.429 2.38a.5.5 0 1 0 .858.515l1.5-2.5A.5.5 0 0 0 8.5 9V5.5zM.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z"/> +</svg> diff --git a/scipost_django/templates/bi/alarm.html b/scipost_django/templates/bi/alarm.html new file mode 100644 index 0000000000000000000000000000000000000000..b637b5e32bd0ef5b1901355ecbee291d019369d7 --- /dev/null +++ b/scipost_django/templates/bi/alarm.html @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-alarm" viewBox="0 0 16 16"> + <path d="M8.5 5.5a.5.5 0 0 0-1 0v3.362l-1.429 2.38a.5.5 0 1 0 .858.515l1.5-2.5A.5.5 0 0 0 8.5 9V5.5z"/> + <path d="M6.5 0a.5.5 0 0 0 0 1H7v1.07a7.001 7.001 0 0 0-3.273 12.474l-.602.602a.5.5 0 0 0 .707.708l.746-.746A6.97 6.97 0 0 0 8 16a6.97 6.97 0 0 0 3.422-.892l.746.746a.5.5 0 0 0 .707-.708l-.601-.602A7.001 7.001 0 0 0 9 2.07V1h.5a.5.5 0 0 0 0-1h-3zm1.038 3.018a6.093 6.093 0 0 1 .924 0 6 6 0 1 1-.924 0zM0 3.5c0 .753.333 1.429.86 1.887A8.035 8.035 0 0 1 4.387 1.86 2.5 2.5 0 0 0 0 3.5zM13.5 1c-.753 0-1.429.333-1.887.86a8.035 8.035 0 0 1 3.527 3.527A2.5 2.5 0 0 0 13.5 1z"/> +</svg> diff --git a/scipost_django/templates/bi/binoculars-fill.html b/scipost_django/templates/bi/binoculars-fill.html new file mode 100644 index 0000000000000000000000000000000000000000..adc01cf9912bd8a1c90f8696ace280bbfec4a894 --- /dev/null +++ b/scipost_django/templates/bi/binoculars-fill.html @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-binoculars-fill" viewBox="0 0 16 16"> + <path d="M4.5 1A1.5 1.5 0 0 0 3 2.5V3h4v-.5A1.5 1.5 0 0 0 5.5 1h-1zM7 4v1h2V4h4v.882a.5.5 0 0 0 .276.447l.895.447A1.5 1.5 0 0 1 15 7.118V13H9v-1.5a.5.5 0 0 1 .146-.354l.854-.853V9.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v.793l.854.853A.5.5 0 0 1 7 11.5V13H1V7.118a1.5 1.5 0 0 1 .83-1.342l.894-.447A.5.5 0 0 0 3 4.882V4h4zM1 14v.5A1.5 1.5 0 0 0 2.5 16h3A1.5 1.5 0 0 0 7 14.5V14H1zm8 0v.5a1.5 1.5 0 0 0 1.5 1.5h3a1.5 1.5 0 0 0 1.5-1.5V14H9zm4-11H9v-.5A1.5 1.5 0 0 1 10.5 1h1A1.5 1.5 0 0 1 13 2.5V3z"/> +</svg> diff --git a/scipost_django/templates/bi/chat-right-text.html b/scipost_django/templates/bi/chat-right-text.html new file mode 100644 index 0000000000000000000000000000000000000000..49ff14754b81fb4c3104d7c06dcc44cd499bb651 --- /dev/null +++ b/scipost_django/templates/bi/chat-right-text.html @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chat-right-text" viewBox="0 0 16 16"> + <path d="M2 1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h9.586a2 2 0 0 1 1.414.586l2 2V2a1 1 0 0 0-1-1H2zm12-1a2 2 0 0 1 2 2v12.793a.5.5 0 0 1-.854.353l-2.853-2.853a1 1 0 0 0-.707-.293H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h12z"/> + <path d="M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3 6a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 6zm0 2.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"/> +</svg> diff --git a/scipost_django/templates/bi/person-workspace.html b/scipost_django/templates/bi/person-workspace.html new file mode 100644 index 0000000000000000000000000000000000000000..14756bf6270364e6405b8a8c7cb404f43add91fe --- /dev/null +++ b/scipost_django/templates/bi/person-workspace.html @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-workspace" viewBox="0 0 16 16"> + <path d="M4 16s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H4Zm4-5.95a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/> + <path d="M2 1a2 2 0 0 0-2 2v9.5A1.5 1.5 0 0 0 1.5 14h.653a5.373 5.373 0 0 1 1.066-2H1V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v9h-2.219c.554.654.89 1.373 1.066 2h.653a1.5 1.5 0 0 0 1.5-1.5V3a2 2 0 0 0-2-2H2Z"/> +</svg> diff --git a/scipost_django/templates/bi/question-square-fill.html b/scipost_django/templates/bi/question-square-fill.html new file mode 100644 index 0000000000000000000000000000000000000000..29b68a5ef929d657fbbe945eabfc6b3c3f4b8291 --- /dev/null +++ b/scipost_django/templates/bi/question-square-fill.html @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-square-fill" viewBox="0 0 16 16"> + <path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm3.496 6.033a.237.237 0 0 1-.24-.247C5.35 4.091 6.737 3.5 8.005 3.5c1.396 0 2.672.73 2.672 2.24 0 1.08-.635 1.594-1.244 2.057-.737.559-1.01.768-1.01 1.486v.105a.25.25 0 0 1-.25.25h-.81a.25.25 0 0 1-.25-.246l-.004-.217c-.038-.927.495-1.498 1.168-1.987.59-.444.965-.736.965-1.371 0-.825-.628-1.168-1.314-1.168-.803 0-1.253.478-1.342 1.134-.018.137-.128.25-.266.25h-.825zm2.325 6.443c-.584 0-1.009-.394-1.009-.927 0-.552.425-.94 1.01-.94.609 0 1.028.388 1.028.94 0 .533-.42.927-1.029.927z"/> +</svg> diff --git a/scipost_django/templates/bi/question-square.html b/scipost_django/templates/bi/question-square.html new file mode 100644 index 0000000000000000000000000000000000000000..b8b35553bce524678d46d7d14f4aa34ee3b53023 --- /dev/null +++ b/scipost_django/templates/bi/question-square.html @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-square" viewBox="0 0 16 16"> + <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/> + <path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286zm1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z"/> +</svg> diff --git a/scipost_django/templates/csrf-failure.html b/scipost_django/templates/csrf-failure.html index 7e25a404915c936c45da1998f321007f5f16eaf5..f6aa9734eb0e98b28e8af45cc76eabf8dbc36d7f 100644 --- a/scipost_django/templates/csrf-failure.html +++ b/scipost_django/templates/csrf-failure.html @@ -1,14 +1,15 @@ {% extends 'scipost/base.html' %} +{% load static %} {% block pagetitle %}: CSRF Failure{% endblock pagetitle %} {% block content %} -<div style="text-align: center;"> - <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <div style="text-align: center;"> + <img src="{% static 'scipost/images/logo_scipost_RGB_HTML_groot.png' %}" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> <h2>We are sorry, your security token seem to have expired. Please refresh your page and try again.</h2> <h3>The SciPost administrators have been informed.</h3> - <p style="margin-top: 20px;">Go back to <a href="//scipost.org">the homepage</a>.</p> -</div> + <p style="margin-top: 20px;">Go back to <a href="{% url 'scipost:index' %}">the homepage</a>.</p> + </div> {% endblock %} diff --git a/scipost_django/templates/email/_footer.html b/scipost_django/templates/email/_footer.html index c97423ac22b5d5b4da5b6f7a180b9254765a70bf..7fb8c03e09603ba0b8565e2debdb454af0e004b1 100644 --- a/scipost_django/templates/email/_footer.html +++ b/scipost_django/templates/email/_footer.html @@ -2,7 +2,7 @@ <div style="display: flex; flex-flow: row-wrap; color: #333333; background-color: #eeeeee; font-size: 75%; justify-content: space-evenly; align-items: center; width: 100%;"> <div style="background-color: #002b49;"> - <a href="https://scipost.org/" style="vertical-align: middle;"> + <a href="https://{{ domain }}" style="vertical-align: middle;"> <img src="{% static 'scipost/images/logo_scipost_RGB_HTML.png' %}" style="background-color: #002b49; padding: 1rem; vertical-align: middle;" width="100rem"> </a> </div> @@ -12,7 +12,7 @@ <li>Institute of Physics, University of Amsterdam</li> <li>Postbus 94485, 1090 GL Amsterdam</li> <li>The Netherlands</li> - <li>+31 (0)20 525 5775 <a href="mailto:admin@scipost.org">admin@scipost.org</a></li> + <li>+31 (0)20 525 5775 <a href="mailto:admin@{{ domain }}">admin@{{ domain }}</a></li> </ul> </div> </div> diff --git a/scipost_django/templates/email/authors/acknowledge_resubmission.html b/scipost_django/templates/email/authors/acknowledge_resubmission.html index 56cfe1721c795963a06329dfc08a6e9c2c04e63c..7fa7b7f13bcdf21de39b9e18cff4fb487e549760 100644 --- a/scipost_django/templates/email/authors/acknowledge_resubmission.html +++ b/scipost_django/templates/email/authors/acknowledge_resubmission.html @@ -7,7 +7,7 @@ </p> <p>Your manuscript will soon be handled by the Editor-in-charge.</p> -<p>You can track your Submission at any time from your <a href="https://scipost.org/personal_page">personal page</a>.</p> +<p>You can track your Submission at any time from your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a>.</p> <p>With many thanks,</p> <p>The SciPost Team</p> diff --git a/scipost_django/templates/email/authors/acknowledge_resubmission.json b/scipost_django/templates/email/authors/acknowledge_resubmission.json index 48c7e87d0171cc8b7b34d4ace063453b007f3fee..f6112fea3995000fcf6f4027e69d4cfa7b1dc171 100644 --- a/scipost_django/templates/email/authors/acknowledge_resubmission.json +++ b/scipost_django/templates/email/authors/acknowledge_resubmission.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/authors/acknowledge_submission.html b/scipost_django/templates/email/authors/acknowledge_submission.html index 065a74dc312f7079772614f02642ee3936b764f9..35d8e880fd22cebb48db3956053c2231317bd47c 100644 --- a/scipost_django/templates/email/authors/acknowledge_submission.html +++ b/scipost_django/templates/email/authors/acknowledge_submission.html @@ -7,7 +7,7 @@ </p> <p>We will update you on the results of the pre-screening process within the next 5 working days.</p> -<p>You can track your Submission at any time from your <a href="https://scipost.org/personal_page">personal page</a>.</p> +<p>You can track your Submission at any time from your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a>.</p> <p>With many thanks,</p> <p>The SciPost Team</p> diff --git a/scipost_django/templates/email/authors/acknowledge_submission.json b/scipost_django/templates/email/authors/acknowledge_submission.json index 485cad6312ea05d7ec5bc3091e6997857d47c2c2..7ecaf7d4471e3c9ca7703366535b780ad813e054 100644 --- a/scipost_django/templates/email/authors/acknowledge_submission.json +++ b/scipost_django/templates/email/authors/acknowledge_submission.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/authors/confirm_puboffer_acceptance.json b/scipost_django/templates/email/authors/confirm_puboffer_acceptance.json index 3b6516881fb4f61c59bdbf9b6a0ebe3a54110a62..820b96d3dba42c3fae9c61ad728cd2992e91e15f 100644 --- a/scipost_django/templates/email/authors/confirm_puboffer_acceptance.json +++ b/scipost_django/templates/email/authors/confirm_puboffer_acceptance.json @@ -4,9 +4,9 @@ "submitted_by.user.email" ], "bcc": [ - "edadmin@scipost.org", + "edadmin@", "editor_in_charge.user.email" ], "from_name": "SciPost Editorial Administration", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/authors/inform_authors_comment_received.html b/scipost_django/templates/email/authors/inform_authors_comment_received.html index 0272dd015e32dd5e71fbfa2274d5bc98f353b028..896e319d5842f896b3b56e690d21fc532cfa1ed6 100644 --- a/scipost_django/templates/email/authors/inform_authors_comment_received.html +++ b/scipost_django/templates/email/authors/inform_authors_comment_received.html @@ -6,10 +6,10 @@ <br><br> {{ submission.title }} <br>by {{ submission.author_list }}<br> - (see https://scipost.org{{ submission.get_absolute_url }} - first submitted {{ submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ submission.get_absolute_url }} - first submitted {{ submission.original_submission_date|date:"d M Y" }}). </p> <p> - You can view it <a href="https://scipost.org{{ comment.get_absolute_url }}">here</a>, embedded within your <a href="https://scipost.org/submission/{{ submission.get_absolute_url }}">Submission\'s Page</a>. + You can view it <a href="https://{{ domain }}{{ comment.get_absolute_url }}">here</a>, embedded within your <a href="https://{{ domain }}/submission/{{ submission.get_absolute_url }}">Submission\'s Page</a>. </p> <p>Sincerely,</p> <p>The SciPost Team</p> diff --git a/scipost_django/templates/email/authors/inform_authors_comment_received.json b/scipost_django/templates/email/authors/inform_authors_comment_received.json index 3ffa95f031fb58527bc50b4991feddc793cd5202..8559981db4ec2d6b5636244433c6b67766c485a3 100644 --- a/scipost_django/templates/email/authors/inform_authors_comment_received.json +++ b/scipost_django/templates/email/authors/inform_authors_comment_received.json @@ -5,8 +5,8 @@ ], "bcc": [ "editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.html b/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.html index c8cfe615d4219557b641342eb94378f3517c5f5e..31eaae893c16d6f0b14cdd56c5888cb29b2d8077 100644 --- a/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.html +++ b/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.html @@ -6,11 +6,11 @@ <br><br> {{ report.submission.title }} <br>by {{ report.submission.author_list }}<br> - (see https://scipost.org{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). </p> <p> You can view this Report and the associated Comment directly at - <a href="https://scipost.org{{ report.get_absolute_url }}">this link</a>. + <a href="https://{{ domain }}{{ report.get_absolute_url }}">this link</a>. </p> <p> We thank you very much for your contribution.<br/><br/>The SciPost Team. diff --git a/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.json b/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.json index 54dd252d27560cf8301775318380182ec6175ee7..444eac7102db6843cf06f3f506645be1bce54429 100644 --- a/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.json +++ b/scipost_django/templates/email/authors/inform_authors_contributor_commented_report.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/authors/inform_authors_editorial_decision.html b/scipost_django/templates/email/authors/inform_authors_editorial_decision.html index 1cdd11c4feab85d4f4f9ee7d90adbd10e7702727..5cd7228393ff72c110fbe176f23f600d44416e16 100644 --- a/scipost_django/templates/email/authors/inform_authors_editorial_decision.html +++ b/scipost_django/templates/email/authors/inform_authors_editorial_decision.html @@ -65,7 +65,7 @@ </p> <p> You can view more details at the Submission's page at - <a href="https://scipost.org{{ decision.submission.get_absolute_url }}">https://scipost.org{{ decision.submission.get_absolute_url }}</a> . + <a href="https://{{ domain }}{{ decision.submission.get_absolute_url }}">https://{{ domain }}{{ decision.submission.get_absolute_url }}</a> . Note that these details are viewable only by the registered authors of the submission. </p> <p> diff --git a/scipost_django/templates/email/authors/inform_authors_editorial_decision.json b/scipost_django/templates/email/authors/inform_authors_editorial_decision.json index 11b5270d2f26ce3f40dfeafbf9bc680103950d88..31507cd8826f6a8a32be32cfbf3502a96bdc7200 100644 --- a/scipost_django/templates/email/authors/inform_authors_editorial_decision.json +++ b/scipost_django/templates/email/authors/inform_authors_editorial_decision.json @@ -4,9 +4,9 @@ "submission.submitted_by.user.email" ], "bcc": [ - "edadmin@scipost.org", + "edadmin@", "submission.editor_in_charge.user.email" ], "from_name": "SciPost Editorial Administration", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.html b/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.html index 8edaa0ab33e4ca6f7c831e99af3ad25a1b7115cb..8443ab044d7b2e74012c10ade5094eecc06df31c 100644 --- a/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.html +++ b/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.html @@ -6,7 +6,7 @@ <br><br> {{ assignment.submission.title }} <br>by {{ assignment.submission.author_list }}<br> - (see https://scipost.org{{ assignment.submission.get_absolute_url }}. + (see https://{{ domain }}{{ assignment.submission.get_absolute_url }}. </p> <p>has been assigned to an editor. The editor chose to directly formulate an Editorial Recommendation.</p> diff --git a/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.json b/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.json index 80399d1b57d929fc8b62f13d941650a8a2e09db3..ac9babed7a27c9f7733a386f572581236ce05b08 100644 --- a/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.json +++ b/scipost_django/templates/email/authors/inform_authors_eic_assigned_direct_rec.json @@ -5,8 +5,8 @@ ], "bcc": [ "to.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.html b/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.html index cf9d4de40a9db53cfb71ff69ff232fbe7d4ff8d3..ee27ba40605bfdba6a9a80c6c142232a68c2aed4 100644 --- a/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.html +++ b/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.html @@ -13,7 +13,7 @@ Editorial processing of your manuscript is hereby terminated, and the associated submission page has been removed from public view. You are now free to send your manuscript to an alternative journal. </p> <p> - Despite this outcome, we thank you very much for your contribution. If you have further questions or comments, please feel free to get in touch with our <a href="mailto:edadmin@scipost.org">editorial administration</a>. + Despite this outcome, we thank you very much for your contribution. If you have further questions or comments, please feel free to get in touch with our <a href="mailto:edadmin@{{ domain }}">editorial administration</a>. </p> <p>Sincerely,</p> <p>The SciPost Team</p> diff --git a/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.json b/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.json index fbd9cad1b91436122d5a52a7bce1c5852f60426b..07ffb1b3a248a66c2c461c0153227db41aea28dc 100644 --- a/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.json +++ b/scipost_django/templates/email/authors/inform_authors_manuscript_withdrawn.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Submissions", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/authors/request_pubfrac_check.html b/scipost_django/templates/email/authors/request_pubfrac_check.html index 37c4bb79a96b1139104b37c45d76e9d1fe9c6734..3172794f4b73c166664d67879ff538ea18f80ffa 100644 --- a/scipost_django/templates/email/authors/request_pubfrac_check.html +++ b/scipost_django/templates/email/authors/request_pubfrac_check.html @@ -5,14 +5,14 @@ For your recent SciPost publication, </p> <p> - <a href="https://scipost.org/{{ publication.get_absolute_url }}">{{ publication.title }}</a><br> + <a href="https://{{ domain }}/{{ publication.get_absolute_url }}">{{ publication.title }}</a><br> by {{ publication.author_list }} </p> <p> we would like you to help us determine who supported the research contained in this publication. This info is of great use for our sustainability efforts. One or two minutes of your attention are all that is required. </p> <p> - Could we beg you to navigate (login required) to <a href="https://scipost.org{% url 'journals:allocate_orgpubfractions' doi_label=publication.doi_label %}">this page</a> and check/correct the data we have prepared? + Could we beg you to navigate (login required) to <a href="https://{{ domain }}{% url 'journals:allocate_orgpubfractions' doi_label=publication.doi_label %}">this page</a> and check/correct the data we have prepared? </p> <p> Many thanks in advance, diff --git a/scipost_django/templates/email/authors/request_pubfrac_check.json b/scipost_django/templates/email/authors/request_pubfrac_check.json index 6503832bc0bf3af78077dacd6eef8fa5d66fc5a6..25feeddd5acad9f49e8466c97bff0a8c923dc0b6 100644 --- a/scipost_django/templates/email/authors/request_pubfrac_check.json +++ b/scipost_django/templates/email/authors/request_pubfrac_check.json @@ -4,8 +4,8 @@ "accepted_submission.submitted_by.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Editorial Administration", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/authors/submissions_assignment_failed.json b/scipost_django/templates/email/authors/submissions_assignment_failed.json index dc64745300097cb6fafd0c1e2134439d78482161..4697306c6747fd92fca4cce3948a5f18a3ffeb71 100644 --- a/scipost_django/templates/email/authors/submissions_assignment_failed.json +++ b/scipost_django/templates/email/authors/submissions_assignment_failed.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/authors/update_authors_screening_1week.json b/scipost_django/templates/email/authors/update_authors_screening_1week.json index c71830e607d592200a3cf0c9e0572986eefc4798..66da4cb0b922d5528243ca4b3627598ff191b59c 100644 --- a/scipost_django/templates/email/authors/update_authors_screening_1week.json +++ b/scipost_django/templates/email/authors/update_authors_screening_1week.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Submissions", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/authors/update_authors_screening_2weeks.json b/scipost_django/templates/email/authors/update_authors_screening_2weeks.json index c71830e607d592200a3cf0c9e0572986eefc4798..66da4cb0b922d5528243ca4b3627598ff191b59c 100644 --- a/scipost_django/templates/email/authors/update_authors_screening_2weeks.json +++ b/scipost_django/templates/email/authors/update_authors_screening_2weeks.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Submissions", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/careers/jobapplication_ack.html b/scipost_django/templates/email/careers/jobapplication_ack.html index 521a116a0f91964479c1f704b5155140c3bfaf2b..631a2e07c99ca90d514234e213dfc56ad8f21b0f 100644 --- a/scipost_django/templates/email/careers/jobapplication_ack.html +++ b/scipost_django/templates/email/careers/jobapplication_ack.html @@ -13,8 +13,8 @@ verification link (to certify your email): </p> <p> - <a href="https://scipost.org{% url 'careers:jobapplication_verify' uuid=jobapplication.uuid %}"> - https://scipost.org{% url 'careers:jobapplication_verify' uuid=jobapplication.uuid %}</a> + <a href="https://{{ domain }}{% url 'careers:jobapplication_verify' uuid=jobapplication.uuid %}"> + https://{{ domain }}{% url 'careers:jobapplication_verify' uuid=jobapplication.uuid %}</a> </p> <p> We thank you very much for your interest, and will keep you updated on the diff --git a/scipost_django/templates/email/careers/jobapplication_ack.json b/scipost_django/templates/email/careers/jobapplication_ack.json index c6971193e045785659544a44bb1fcc4ad6fc9ca9..38f4d40e21e7c11198a3b7e8f75805969d6dec1c 100644 --- a/scipost_django/templates/email/careers/jobapplication_ack.json +++ b/scipost_django/templates/email/careers/jobapplication_ack.json @@ -4,8 +4,8 @@ "email" ], "bcc": [ - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Admin", - "from_email": "admin@scipost.org" + "from_email": "admin@" } diff --git a/scipost_django/templates/email/citation_notification.html b/scipost_django/templates/email/citation_notification.html index b8b73a5aadbf88fb5518c6d602faa2eea9bc20d3..73a32ff84f04adfc93c90c78cf0f2790ce726b02 100644 --- a/scipost_django/templates/email/citation_notification.html +++ b/scipost_django/templates/email/citation_notification.html @@ -35,7 +35,7 @@ Dear {{ object.get_title }} {{ object.last_name }}, <br> <i>by {{ object.submission.author_list }}</i> <br> - <a href="https://scipost.org/{{ object.submission.get_absolute_url }}">View the submission's page</a> + <a href="https://{{ domain }}/{{ object.submission.get_absolute_url }}">View the submission's page</a> </li> {% endfor %} </ul> @@ -56,7 +56,7 @@ Dear {{ object.get_title }} {{ object.last_name }}, {% if object.get_first_related_contributor and object.get_first_related_contributor.activation_key %} <p style="font-size: 10px;"> - Don\'t want to receive such emails? <a href="https://scipost.org{% url 'scipost:unsubscribe' object.get_first_related_contributor.id object.get_first_related_contributor.activation_key %}">Unsubscribe</a> + Don\'t want to receive such emails? <a href="https://{{ domain }}{% url 'scipost:unsubscribe' object.get_first_related_contributor.id object.get_first_related_contributor.activation_key %}">Unsubscribe</a> </p> {% endif %} diff --git a/scipost_django/templates/email/citation_notification.json b/scipost_django/templates/email/citation_notification.json index 0bf1884a8fbe721323fb12d56fab6d7d09622093..f5f824313745b130bc15d68d9d921b428e7e4e4b 100644 --- a/scipost_django/templates/email/citation_notification.json +++ b/scipost_django/templates/email/citation_notification.json @@ -4,8 +4,8 @@ "email" ], "bcc": [ - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Admin", - "from_email": "admin@scipost.org" + "from_email": "admin@" } diff --git a/scipost_django/templates/email/commenters/inform_commenter_comment_received.json b/scipost_django/templates/email/commenters/inform_commenter_comment_received.json index 89c4b3c1fa0ba11a286a4b90831a2a110e3982ab..d3a24bb6fc89af8ee6f9f286f73dce7d3b051e8e 100644 --- a/scipost_django/templates/email/commenters/inform_commenter_comment_received.json +++ b/scipost_django/templates/email/commenters/inform_commenter_comment_received.json @@ -4,8 +4,8 @@ "author.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Comments", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.html b/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.html index e97476e2be576c727965cdbcd93521180d6ba353..2e8e8f0656d13da40fcd81aa11dea56740909014 100644 --- a/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.html +++ b/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.html @@ -4,7 +4,7 @@ <p> The {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} you have submitted, concerning <br/> - {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://scipost.org{{ comment.get_absolute_url }}">see on SciPost.org</a>) + {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://{{ domain }}{{ comment.get_absolute_url }}">see on SciPost.org</a>) <br/> has been rejected for the following reason: {{ comment.get_status_display }}. </p> diff --git a/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.json b/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.json index e73d0881db5832c4a554c548bdd95141d6f47c8a..733120f2a59def817374fc6842c90ef0d3da0bda 100644 --- a/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.json +++ b/scipost_django/templates/email/commenters/inform_commenter_comment_rejected.json @@ -4,8 +4,8 @@ "author.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Comments", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.html b/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.html index bc9393592d7ab0f99b1a269c3adfa16cd2c1f01e..7124941d4afc8747862e2196664355a86e8f59b9 100644 --- a/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.html +++ b/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.html @@ -5,7 +5,7 @@ <p> The {% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} you have submitted, concerning <br/> - {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://scipost.org{{ comment.get_absolute_url }}">see on SciPost.org</a>) + {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://{{ domain }}{{ comment.get_absolute_url }}">see on SciPost.org</a>) <br/> has been accepted and published online. </p> diff --git a/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.json b/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.json index 1ed14eaf4105941a700d895526f8ee0019c422bf..b6d62391d122e6932caf027bf29785396e5e2a32 100644 --- a/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.json +++ b/scipost_django/templates/email/commenters/inform_commenter_comment_vetted.json @@ -4,8 +4,8 @@ "author.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Comments", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.html b/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.html index 89b8d7c54a1692c845c8825dbed2753d3cc21185..a89d7e79564e218285b814904d3eec1514756c25 100644 --- a/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.html +++ b/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.html @@ -8,7 +8,7 @@ Your alternate account with username <strong><em style="color: red;">{{ object.user.username }}</em></strong> has been deactivated, but all the data associated to it has been transferred to your active account. </p> <p> - Please get in touch with us at <a href="mailto:techsupport@scipost.org">SciPost techsupport</a> (or by simply replying to this email) if you have any questions. + Please get in touch with us at <a href="mailto:techsupport@{{ domain }}">SciPost techsupport</a> (or by simply replying to this email) if you have any questions. </p> <p> Many thanks, diff --git a/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.json b/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.json index ce01ee12c709c4fb7a4553e73937351a1358dada..ddcdb3329f157e721456f9feab7ecbc228506ed8 100644 --- a/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.json +++ b/scipost_django/templates/email/contributors/inform_contributor_duplicate_accounts_merged.json @@ -4,8 +4,8 @@ "user.email" ], "bcc": [ - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Admin", - "from_email": "admin@scipost.org" + "from_email": "admin@" } diff --git a/scipost_django/templates/email/contributors/new_activitation_link.html b/scipost_django/templates/email/contributors/new_activitation_link.html index d94a7b4d20cbba013096fc2207e670bc110b1e0d..9c3f753297d000542828c3df54eaa2c401699844 100644 --- a/scipost_django/templates/email/contributors/new_activitation_link.html +++ b/scipost_django/templates/email/contributors/new_activitation_link.html @@ -4,7 +4,7 @@ Your request for a new email activation link for registration to the SciPost publication portal has been received. You now need to visit this link within the next 48 hours: </p> <p> - <a href="https://scipost.org{% url 'scipost:activation' contributor.id contributor.activation_key %}">Activate your account</a> + <a href="https://{{ domain }}{% url 'scipost:activation' contributor.id contributor.activation_key %}">Activate your account</a> </p> <p> diff --git a/scipost_django/templates/email/contributors/new_activitation_link.json b/scipost_django/templates/email/contributors/new_activitation_link.json index ad971746175a020f14a387b78a2ed6d5ff716b7f..05779a3879199431ea264b266a643d29efe81b11 100644 --- a/scipost_django/templates/email/contributors/new_activitation_link.json +++ b/scipost_django/templates/email/contributors/new_activitation_link.json @@ -4,8 +4,8 @@ "user.email" ], "bcc": [ - "registration@scipost.org" + "registration@" ], "from_name": "SciPost registration", - "from_email": "registration@scipost.org" + "from_email": "registration@" } diff --git a/scipost_django/templates/email/contributors/registration_received.html b/scipost_django/templates/email/contributors/registration_received.html index 823e9ca93719fd47eac87215ec830a7bc6ce1f24..c6b012232f3de3322915230e4e722596beb0b4a2 100644 --- a/scipost_django/templates/email/contributors/registration_received.html +++ b/scipost_django/templates/email/contributors/registration_received.html @@ -5,7 +5,7 @@ Your request for registration to the SciPost publication portal has been received. You now need to validate your email by visiting this link within the next 48 hours: </p> <p> - <a href="https://scipost.org{% url 'scipost:activation' contributor.id contributor.activation_key %}">Activate your account</a> + <a href="https://{{ domain }}{% url 'scipost:activation' contributor.id contributor.activation_key %}">Activate your account</a> </p> <h3>What happens now?</h3> <ul> diff --git a/scipost_django/templates/email/contributors/registration_received.json b/scipost_django/templates/email/contributors/registration_received.json index dd1b94b84ea8778e1369f04217441b3d6bb66393..2609ebfebdd6b2e11381fdb0b9eae6421c3cd056 100644 --- a/scipost_django/templates/email/contributors/registration_received.json +++ b/scipost_django/templates/email/contributors/registration_received.json @@ -4,8 +4,8 @@ "user.email" ], "bcc": [ - "registration@scipost.org" + "registration@" ], "from_name": "SciPost registration", - "from_email": "registration@scipost.org" + "from_email": "registration@" } diff --git a/scipost_django/templates/email/eic/assignment_request.html b/scipost_django/templates/email/eic/assignment_request.html index 1f24672965c5628ae28bd33aa8c78fc8125941d3..b460b7d7525333470fb6e2fd275626fc795b1653 100644 --- a/scipost_django/templates/email/eic/assignment_request.html +++ b/scipost_django/templates/email/eic/assignment_request.html @@ -10,7 +10,7 @@ </p> <p> - Please visit the <a href="https://scipost.org/submissions/pool">Submissions Pool</a> in order to accept or decline (it is important for you to inform us even if you decline, since this affects the result of the pre-screening process). + Please visit the <a href="https://{{ domain }}{% url 'submissions:pool' %}">Submissions Pool</a> in order to accept or decline (it is important for you to inform us even if you decline, since this affects the result of the pre-screening process). </p> <p> Note that this assignment request is automatically deprecated if another Fellow takes charge of this Submission or if pre-screening fails in the meantime. diff --git a/scipost_django/templates/email/eic/assignment_request.json b/scipost_django/templates/email/eic/assignment_request.json index 3ac75a5a8e8647ad9d10780d8fff45d40df95d95..848380f477d7af77b5562b80fa04ff89845c3a34 100644 --- a/scipost_django/templates/email/eic/assignment_request.json +++ b/scipost_django/templates/email/eic/assignment_request.json @@ -4,8 +4,8 @@ "to.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/eic/inform_eic_comment_received.html b/scipost_django/templates/email/eic/inform_eic_comment_received.html index 940d843fccd8745de2f5f6f32854f1d7cc94cf19..98079c13eaced2416f25f7a229679f033df521a3 100644 --- a/scipost_django/templates/email/eic/inform_eic_comment_received.html +++ b/scipost_django/templates/email/eic/inform_eic_comment_received.html @@ -9,7 +9,7 @@ by {{ comment.core_content_object.author_list }}. </p> <p> - This Comment now requires vetting, which you can perform from <a href="https://scipost.org{% url 'submissions:editorial_page' comment.core_content_object.preprint.identifier_w_vn_nr %}">the editorial page</a> (please be careful when doing this, avoiding for example to vet doubly-submitted comments, or comments with improper language etc; in case you have any doubt, please contact our <a href="mailto:edadmin@scipost.org">editorial administration</a>). + This Comment now requires vetting, which you can perform from <a href="https://{{ domain }}{% url 'submissions:editorial_page' comment.core_content_object.preprint.identifier_w_vn_nr %}">the editorial page</a> (please be careful when doing this, avoiding for example to vet doubly-submitted comments, or comments with improper language etc; in case you have any doubt, please contact our <a href="mailto:edadmin@{{ domain }}">editorial administration</a>). </p> <p> Many thanks in advance for your collaboration,<br> diff --git a/scipost_django/templates/email/eic/inform_eic_comment_received.json b/scipost_django/templates/email/eic/inform_eic_comment_received.json index 588bc0bc658b0776afb5d6e4c9a2989650ffdba7..3605bd9e02e11039f6b284818b4485359a1f66f5 100644 --- a/scipost_django/templates/email/eic/inform_eic_comment_received.json +++ b/scipost_django/templates/email/eic/inform_eic_comment_received.json @@ -4,8 +4,8 @@ "core_content_object.editor_in_charge.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/eic/inform_eic_manuscript_withdrawn.json b/scipost_django/templates/email/eic/inform_eic_manuscript_withdrawn.json index f6975b6d636dc92b79f366366b7edd7e251c095b..7b3e63b3a6538c4400b9fe7aa08f2d5a0bf4b4ea 100644 --- a/scipost_django/templates/email/eic/inform_eic_manuscript_withdrawn.json +++ b/scipost_django/templates/email/eic/inform_eic_manuscript_withdrawn.json @@ -4,8 +4,8 @@ "editor_in_charge.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/eic/inform_eic_report_received.html b/scipost_django/templates/email/eic/inform_eic_report_received.html index dd5cd56c57fb1cfcb5fe7e5608beab99e95f09b1..de9d7f34758d6d20787ab790808c533fba24c83e 100644 --- a/scipost_django/templates/email/eic/inform_eic_report_received.html +++ b/scipost_django/templates/email/eic/inform_eic_report_received.html @@ -9,7 +9,7 @@ by {{ report.submission.author_list }}. </p> <p> - Please vet this Report via your <a href="https://scipost.org{% url 'scipost:personal_page' %}">personal page</a> under the Editorial Actions tab. + Please vet this Report via your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a> under the Editorial Actions tab. </p> <p> Many thanks in advance for your collaboration,<br> diff --git a/scipost_django/templates/email/eic/inform_eic_report_received.json b/scipost_django/templates/email/eic/inform_eic_report_received.json index 04f1e138f6b2c16b292881d588af664e25c04143..09edb684ef08ccbd51641446f478d5234c0e68b4 100644 --- a/scipost_django/templates/email/eic/inform_eic_report_received.json +++ b/scipost_django/templates/email/eic/inform_eic_report_received.json @@ -4,8 +4,8 @@ "submission.editor_in_charge.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/eic/referee_response.html b/scipost_django/templates/email/eic/referee_response.html index 653fe8ec463b321257266cc5aa6f97c6aba3b322..bde0688f68bd71bfb15b5b316aedd106f2d40e5f 100644 --- a/scipost_django/templates/email/eic/referee_response.html +++ b/scipost_django/templates/email/eic/referee_response.html @@ -11,7 +11,7 @@ {% if not invitation.accepted %} <p> - Please invite another referee from the Submission's <a href="https://scipost.org{% url 'submissions:editorial_page' invitation.submission.preprint.identifier_w_vn_nr %}">editorial page</a>. + Please invite another referee from the Submission's <a href="https://{{ domain }}{% url 'submissions:editorial_page' invitation.submission.preprint.identifier_w_vn_nr %}">editorial page</a>. </p> {% endif %} diff --git a/scipost_django/templates/email/eic/referee_response.json b/scipost_django/templates/email/eic/referee_response.json index 6902694008c0828ff917f98dfe308c66e551404b..afd8f077f7e21ac4dddf93a79a67ca0d6cd9ac35 100644 --- a/scipost_django/templates/email/eic/referee_response.json +++ b/scipost_django/templates/email/eic/referee_response.json @@ -4,8 +4,8 @@ "submission.editor_in_charge.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/eic/referee_unresponsive.html b/scipost_django/templates/email/eic/referee_unresponsive.html index 89c905eec86acc73f0ceaacaea64bedc39152b45..0edde5f2bdab05c3974a72f37c455ae2fd9c0026 100644 --- a/scipost_django/templates/email/eic/referee_unresponsive.html +++ b/scipost_django/templates/email/eic/referee_unresponsive.html @@ -5,13 +5,13 @@ Referee {{ invitation.get_title_display }} {{ invitation.last_name }}, whom you invited to referee Submission <br><br> - <a href="https://scipost.org{{ invitation.submission.get_absolute_url }}">{{ invitation.submission.title }}</a> + <a href="https://{{ domain }}{{ invitation.submission.get_absolute_url }}">{{ invitation.submission.title }}</a> <br>by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}),<br> + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}),<br> has failed to respond to the invitation (after being sent {{ invitation.nr_reminders }} reminders). </p> <p> - Unless you are confident that this referee will really deliver a Report, and to ensure that this Submission does not suffer from unnecessary delays in processing, you should ideally invite a replacement referee using the tools on the <a href="https://scipost.org{% url 'submissions:editorial_page' invitation.submission.preprint.identifier_w_vn_nr %}">Editorial page</a>. + Unless you are confident that this referee will really deliver a Report, and to ensure that this Submission does not suffer from unnecessary delays in processing, you should ideally invite a replacement referee using the tools on the <a href="https://{{ domain }}{% url 'submissions:editorial_page' invitation.submission.preprint.identifier_w_vn_nr %}">Editorial page</a>. </p> <p> We are very grateful for your prompt action. diff --git a/scipost_django/templates/email/eic/referee_unresponsive.json b/scipost_django/templates/email/eic/referee_unresponsive.json index 0dfc174d9b8968d9e4350eaf1881d9ce9b9e0e6d..262825f3094ef98fb82aa6725bc7d83d80a0a195 100644 --- a/scipost_django/templates/email/eic/referee_unresponsive.json +++ b/scipost_django/templates/email/eic/referee_unresponsive.json @@ -4,8 +4,8 @@ "submission.editor_in_charge.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/eic/submission_reappointment.html b/scipost_django/templates/email/eic/submission_reappointment.html index 7595e5b5772aca5e16d1d1a98b301c3de5dc1671..74f007efda3102eceb46b144cd56e09423c9b6b1 100644 --- a/scipost_django/templates/email/eic/submission_reappointment.html +++ b/scipost_django/templates/email/eic/submission_reappointment.html @@ -12,10 +12,10 @@ have resubmitted their manuscript. </p> <p> - As Editor-in-charge, you can take your editorial actions from the submission's <a href="https://scipost.org{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}">editorial page</a>, which is also accessible from your <a href="https://scipost.org{% url 'scipost:personal_page' %}">personal page</a> under the Editorial Actions tab. + As Editor-in-charge, you can take your editorial actions from the submission's <a href="https://{{ domain }}{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}">editorial page</a>, which is also accessible from your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a> under the Editorial Actions tab. </p> <p> - You can either take an immediate acceptance/rejection decision, quickly consult previous referees or run a new refereeing round, in which case you should now invite at least 3 referees; you might want to make sure you are aware of the detailed procedure described in the <a href="https://scipost.org{% url 'scipost:EdCol_by-laws' %}">Editorial College by-laws</a>. + You can either take an immediate acceptance/rejection decision, quickly consult previous referees or run a new refereeing round, in which case you should now invite at least 3 referees; you might want to make sure you are aware of the detailed procedure described in the <a href="https://{{ domain }}{% url 'scipost:EdCol_by-laws' %}">Editorial College by-laws</a>. </p> <p> Many thanks in advance for your collaboration,<br> diff --git a/scipost_django/templates/email/eic/submission_reappointment.json b/scipost_django/templates/email/eic/submission_reappointment.json index 4a45ed86672f44b59c63f80f2135a59410dfc24b..3fc737f2f0d8eb27edb88f3747c327fc826ecfe4 100644 --- a/scipost_django/templates/email/eic/submission_reappointment.json +++ b/scipost_django/templates/email/eic/submission_reappointment.json @@ -4,8 +4,8 @@ "editor_in_charge.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/email_assigned_invitation_officer.html b/scipost_django/templates/email/email_assigned_invitation_officer.html index ffd8a1d428982391ef5e01d59e8e60b32117ebfe..38b2e384ae1192c879caba52ca13c02c55156f36 100644 --- a/scipost_django/templates/email/email_assigned_invitation_officer.html +++ b/scipost_django/templates/email/email_assigned_invitation_officer.html @@ -11,7 +11,7 @@ Production Supervisor: {{ stream.supervisor }} </p> <p> - The stream will now be open for you on the <a href="https://scipost.org{% url 'production:production' %}">Production page</a>. + The stream will now be open for you on the <a href="https://{{ domain }}{% url 'production:production' %}">Production page</a>. </p> diff --git a/scipost_django/templates/email/email_assigned_invitation_officer.txt b/scipost_django/templates/email/email_assigned_invitation_officer.txt index 360e1388d3714631cad0843b668842bd9bcbaa2d..eff57aa55183b4e88e8d8f2b00f5ccb5f295937c 100644 --- a/scipost_django/templates/email/email_assigned_invitation_officer.txt +++ b/scipost_django/templates/email/email_assigned_invitation_officer.txt @@ -6,6 +6,6 @@ You are now assigned as Invitations Officer to the stream Production Supervisor: {{ stream.supervisor }} -The stream will now be open for you on the Production page (https://scipost.org{% url 'production:production' %}). +The stream will now be open for you on the Production page (https://{{ domain }}{% url 'production:production' %}). This mail is automatically generated and therefore not signed. diff --git a/scipost_django/templates/email/email_assigned_production_officer.html b/scipost_django/templates/email/email_assigned_production_officer.html index 3fe0ad19628825d462bb022dd93be8fc9a872b65..ea86777a8133090d8124996e1bea998c702a8566 100644 --- a/scipost_django/templates/email/email_assigned_production_officer.html +++ b/scipost_django/templates/email/email_assigned_production_officer.html @@ -11,7 +11,7 @@ Production Supervisor: {{ stream.supervisor }} </p> <p> - The stream will now be open for you on the <a href="https://scipost.org{% url 'production:production' %}">Production page</a>. + The stream will now be open for you on the <a href="https://{{ domain }}{% url 'production:production' %}">Production page</a>. </p> diff --git a/scipost_django/templates/email/email_assigned_production_officer.txt b/scipost_django/templates/email/email_assigned_production_officer.txt index e1ae345fe3fbc306f3ac8a7b23086089a241b950..36964529eb1526ad7cf850d5dc0e1f049121309f 100644 --- a/scipost_django/templates/email/email_assigned_production_officer.txt +++ b/scipost_django/templates/email/email_assigned_production_officer.txt @@ -6,6 +6,6 @@ You are now assigned as Production Officer to the stream Production Supervisor: {{ stream.supervisor }} -The stream will now be open for you on the Production page (https://scipost.org{% url 'production:production' %}). +The stream will now be open for you on the Production page (https://{{ domain }}{% url 'production:production' %}). This mail is automatically generated and therefore not signed. diff --git a/scipost_django/templates/email/email_assigned_supervisor.html b/scipost_django/templates/email/email_assigned_supervisor.html index e615b0a1a46c33fcb32a6d32daa70528efa99ed3..b83eddd5efdc4de6855adb361dce5bfc8995063a 100644 --- a/scipost_django/templates/email/email_assigned_supervisor.html +++ b/scipost_django/templates/email/email_assigned_supervisor.html @@ -9,7 +9,7 @@ {{ stream }} </p> <p> - The stream will now be open for you on the <a href="https://scipost.org{% url 'production:production' %}">Production page</a>. + The stream will now be open for you on the <a href="https://{{ domain }}{% url 'production:production' %}">Production page</a>. </p> diff --git a/scipost_django/templates/email/email_assigned_supervisor.txt b/scipost_django/templates/email/email_assigned_supervisor.txt index f4f08883196c2c097a9177aab4c58cc8fc4b4404..3fd36a20ac49cd5c76a6a42865a775e3eabc32ae 100644 --- a/scipost_django/templates/email/email_assigned_supervisor.txt +++ b/scipost_django/templates/email/email_assigned_supervisor.txt @@ -4,6 +4,6 @@ You are now assigned as Production Supervisor to the stream {{ stream }} -The stream will now be open for you on the Production page (https://scipost.org{% url 'production:production' %}). +The stream will now be open for you on the Production page (https://{{ domain }}{% url 'production:production' %}). This mail is automatically generated and therefore not signed. diff --git a/scipost_django/templates/email/email_comment_made_citable.html b/scipost_django/templates/email/email_comment_made_citable.html index 5d84301c825f44db392f639f9568a0c0e2d15be3..c49dc6a4f7e2b398dc983ef9defbad3eb7f479f9 100644 --- a/scipost_django/templates/email/email_comment_made_citable.html +++ b/scipost_django/templates/email/email_comment_made_citable.html @@ -3,7 +3,7 @@ <p> The Comment you have submitted, concerning publication with title - {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://scipost.org{{ comment.get_absolute_url }}">see on SciPost.org</a>) + {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://{{ domain }}{{ comment.get_absolute_url }}">see on SciPost.org</a>) has been ascribed DOI <a href="//doi.org/{{ comment.doi_string }}">{{ comment.doi_string }}</a> (https://doi.org/{{ comment.doi_string }}), and is thus now citable in the form: </p> <p> diff --git a/scipost_django/templates/email/email_comment_made_citable.txt b/scipost_django/templates/email/email_comment_made_citable.txt index 19ca71e2b72e432edad065bec437614e23d618a8..19ce7c6f55ecc3c2368a037ff4697317c92f8d55 100644 --- a/scipost_django/templates/email/email_comment_made_citable.txt +++ b/scipost_django/templates/email/email_comment_made_citable.txt @@ -1,7 +1,7 @@ Dear {{ comment.author.get_title_display }} {{ comment.author.user.last_name }}, The Comment you have submitted, concerning publication with title -{{comment.core_content_object.title}} by {% if comment.core_content_object.author_list %}{{comment.core_content_object.author_list}}{% elif comment.core_content_object.author %}{{comment.core_content_object.author}}{% endif %} (https://scipost.org{{comment.get_absolute_url}}) +{{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (https://{{ domain }}{{ comment.get_absolute_url }}) has been ascribed DOI {{ comment.doi_string }} (https://doi.org/{{ comment.doi_string }}), and is thus now citable in the form: {{ comment.citation }}. diff --git a/scipost_django/templates/email/email_report_made_citable.html b/scipost_django/templates/email/email_report_made_citable.html index ca9b259714e9728b70364f45309df33b10e41537..43eecf7dbc88d0ea92a43c1502ba15060be5242b 100644 --- a/scipost_django/templates/email/email_report_made_citable.html +++ b/scipost_django/templates/email/email_report_made_citable.html @@ -23,8 +23,8 @@ The SciPost Team </p> {% if report.anonymous %} -<p> - P.S.: When submitting your Report, you chose to remain anonymous. We generally encourage (but in no way require) our referees to sign their contributions, in order to foster greater transparency and allow you to get full recognition for your valuable refereeing work. Should you wish to sign your Report (even post-facto; this can be done at any time), simply navigate to your <a href="https://scipost.org/personal_page">personal page</a> under the Refereeing tab, where you will find a link allowing you to do so (after which we will update your Report's DOI metadata, and make your signature publicly visible). + <p> + P.S.: When submitting your Report, you chose to remain anonymous. We generally encourage (but in no way require) our referees to sign their contributions, in order to foster greater transparency and allow you to get full recognition for your valuable refereeing work. Should you wish to sign your Report (even post-facto; this can be done at any time), simply navigate to your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a> under the Refereeing tab, where you will find a link allowing you to do so (after which we will update your Report's DOI metadata, and make your signature publicly visible). </p> {% endif %} diff --git a/scipost_django/templates/email/email_report_made_citable.txt b/scipost_django/templates/email/email_report_made_citable.txt index a6c85f85470a84ac934fd6b202312a3ca092dc5f..f5bee0d7d0b95bf800e53b9f64cd2b5909347267 100644 --- a/scipost_django/templates/email/email_report_made_citable.txt +++ b/scipost_django/templates/email/email_report_made_citable.txt @@ -15,5 +15,5 @@ We thank you again very much for your contribution. The SciPost Team {% if report.anonymous %} -P.S.: When submitting your Report, you chose to remain anonymous. We generally encourage (but in no way require) our referees to sign their contributions, in order to foster greater transparency and allow you to get full recognition for your valuable refereeing work. Should you wish to sign your Report (even post-facto; this can be done at any time), simply navigate to your <a href="https://scipost.org/personal_page">personal page</a> under the Refereeing tab, where you will find a link allowing you to do so (after which we will update your Report's DOI metadata, and make your signature publicly visible). +P.S.: When submitting your Report, you chose to remain anonymous. We generally encourage (but in no way require) our referees to sign their contributions, in order to foster greater transparency and allow you to get full recognition for your valuable refereeing work. Should you wish to sign your Report (even post-facto; this can be done at any time), simply navigate to your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a> under the Refereeing tab, where you will find a link allowing you to do so (after which we will update your Report's DOI metadata, and make your signature publicly visible). {% endif %} diff --git a/scipost_django/templates/email/fellows/email_fellow_assigned_submission.html b/scipost_django/templates/email/fellows/email_fellow_assigned_submission.html index 6720176d84c5803eda3a8043e7422d09d2fc291f..045bddb2f4ab24f7ec9f657b2e1539799a5de247 100644 --- a/scipost_django/templates/email/fellows/email_fellow_assigned_submission.html +++ b/scipost_django/templates/email/fellows/email_fellow_assigned_submission.html @@ -4,9 +4,9 @@ Thank you for accepting to become Editor-in-charge of the SciPost Submission {{ assignment.submission.title }} by {{ assignment.submission.author_list }}. -You can take your editorial actions from <a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">the editorial page</a>. +You can take your editorial actions from <a href="https://{{ domain }}{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">the editorial page</a>. -In particular, you should now make sure at least 3 referees have been invited; you might want to make sure you are aware of the detailed procedure described in <a href="https://scipost.org{% url 'scipost:EdCol_by-laws' %}">the Editorial College by-laws</a>. +In particular, you should now make sure at least 3 referees have been invited; you might want to make sure you are aware of the detailed procedure described in <a href="https://{{ domain }}{% url 'scipost:EdCol_by-laws' %}">the Editorial College by-laws</a>. Many thanks in advance for your collaboration, diff --git a/scipost_django/templates/email/fellows/email_fellow_assigned_submission.json b/scipost_django/templates/email/fellows/email_fellow_assigned_submission.json index 0ab50a7a0a3da1bcf46fbbf3de48ba15dc76c91d..52ebc507ac675f3492288c68f8a739a6df3bb6a7 100644 --- a/scipost_django/templates/email/fellows/email_fellow_assigned_submission.json +++ b/scipost_django/templates/email/fellows/email_fellow_assigned_submission.json @@ -4,8 +4,8 @@ "to.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost EdAdmin", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/fellows/email_fellow_fellowship_start.html b/scipost_django/templates/email/fellows/email_fellow_fellowship_start.html index ea75797a4eb992d4ef4d305b3aaa6cfba10e670a..8a31a178d7358e70fa359715ae20531d0129f764 100644 --- a/scipost_django/templates/email/fellows/email_fellow_fellowship_start.html +++ b/scipost_django/templates/email/fellows/email_fellow_fellowship_start.html @@ -1,17 +1,17 @@ <p>Dear {{ object.contributor.profile.get_title_display }} {{ object.contributor.user.last_name }},</p> <p>Many thanks for accepting to become an Editorial Fellow at SciPost! We wish you a very warm welcome, and very much appreciate your willingness to help out.</p> -<p>Your account has now been given Fellow-level rights, so you now have access to a few additional Fellows-only pages. We have also included you in our list of Fellows at our <a href="https://scipost.org{% url 'colleges:colleges' %}">Colleges page</a>.</p> +<p>Your account has now been given Fellow-level rights, so you now have access to a few additional Fellows-only pages. We have also included you in our list of Fellows at our <a href="https://{{ domain }}{% url 'colleges:colleges' %}">Colleges page</a>.</p> <p>This email is meant as a quick helper to make sure everything is set up properly, and to help you start finding your way around our systems.</p> <h3>Making sure your data is correct</h3> -<p>From your <a href="https://scipost.org{% url 'scipost:personal_page' %}">personal page</a>, please have a look at the basic information associated to your account (in particular, your areas of specialization). If necessary, please update the data by following the "Update your personal data" link.</p> -<p>Though we do not require it, we greatly encourage you to use our two-factor authentication setup (see <a a href="https://scipost.org{% url 'scipost:totp' %}">this link</a>) to ensure that your account is robust against hacking attempts.</p> +<p>From your <a href="https://{{ domain }}{% url 'scipost:personal_page' %}">personal page</a>, please have a look at the basic information associated to your account (in particular, your areas of specialization). If necessary, please update the data by following the "Update your personal data" link.</p> +<p>Though we do not require it, we greatly encourage you to use our two-factor authentication setup (see <a a href="https://{{ domain }}{% url 'scipost:totp' %}">this link</a>) to ensure that your account is robust against hacking attempts.</p> <h3>Your new Fellows-only pages</h3> -<p>Again on your personal page, you should now see an "Editorial Actions" tab. This contains a number of links relevant to our editorial processes, most importantly to the <a href="https://scipost.org{% url 'submissions:pool' %}">submissions pool</a>, which is the place where all submissions currently under consideration are listed. As a newcomer, this will be more or less empty for you, but will fill as new submissions come in.</p> -<p>To get an idea of the editorial workflow, the best is to look at the <a href="https://scipost.org{% url 'submissions:editorial_workflow' %}">editorial workflow summary</a>.</p> +<p>Again on your personal page, you should now see an "Editorial Actions" tab. This contains a number of links relevant to our editorial processes, most importantly to the <a href="https://{{ domain }}{% url 'submissions:pool' %}">submissions pool</a>, which is the place where all submissions currently under consideration are listed. As a newcomer, this will be more or less empty for you, but will fill as new submissions come in.</p> +<p>To get an idea of the editorial workflow, the best is to look at the <a href="https://{{ domain }}{% url 'submissions:editorial_workflow' %}">editorial workflow summary</a>.</p> <h3>What happens now?</h3> <p>As new submissions come in for which your expertises match, you will start receiving assignment request emails inviting you to take charge of a particular Submission. You are never obliged to do so. Once you do take charge of one, you will be given access to that Submission's Editorial Page from which you will be able to run the refereeing process.</p> <p>You will also regularly be invited to vote on Editorial Recommendations on Submissions which have undergone our refereeing process (we remind you that publication decisions are taken by the College, as a collective).</p> -<p>Everything is more or less self-explanatory, but you are most welcome to email our Editorial Administration at edadmin@scipost.org if you have any questions.</p> +<p>Everything is more or less self-explanatory, but you are most welcome to email our Editorial Administration at edadmin@{{ domain }} if you have any questions.</p> <p>Once per week, you will also receive an email containing a weekly summary of tasks or activities relevant to your activities as Fellow. This email contains handy direct links to the instances concerned.</p> <p>At least once per year, you will be invited to a Virtual General Meeting where SciPost Administration, Advisory Board and Editorial Colleges gather to discuss important points about our activities. You will receive separate email communications concerning these. You can find links to past meetings on our site's top navbar, under the "Logged in as ..." submenu.</p> <h3>Thank you again</h3> diff --git a/scipost_django/templates/email/fellows/email_fellow_fellowship_start.json b/scipost_django/templates/email/fellows/email_fellow_fellowship_start.json index 709ed642b8a12e6c0c45a27939fe3c00f5e13e8a..c5966b37aec9b5be86d46ab6effa24ea883d8465 100644 --- a/scipost_django/templates/email/fellows/email_fellow_fellowship_start.json +++ b/scipost_django/templates/email/fellows/email_fellow_fellowship_start.json @@ -4,8 +4,8 @@ "contributor.user.email" ], "bcc": [ - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Admin", - "from_email": "admin@scipost.org" + "from_email": "admin@" } diff --git a/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.html b/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.html index 7ca463e87c5caacd477dc04a03db8eb4743c6fb4..8adb78387761abe8826eec904ec1e9c03ede890d 100644 --- a/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.html +++ b/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.html @@ -4,7 +4,7 @@ We have deprecated your assignment as Editor-in-charge of Submission {{ assignment.submission.title }} by {{ assignment.submission.author_list }}. -To see your current active assignments, check <a href="https://scipost.org{% url 'submissions:pool' %}?editor_in_charge=on.">the Pool</a>. +To see your current active assignments, check <a href="https://{{ domain }}{% url 'submissions:pool' %}?editor_in_charge=on.">the Pool</a>. Many thanks for your valuable work, diff --git a/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.json b/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.json index e5a453db84d05b1d4a7e9630f01b6ddace110b7d..d80e9d3ed04fc731b76fb87acff132bb31a16623 100644 --- a/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.json +++ b/scipost_django/templates/email/fellows/email_fellow_replaced_by_other.json @@ -4,8 +4,8 @@ "to.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost EdAdmin", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/fellows/email_fellow_tasklist.html b/scipost_django/templates/email/fellows/email_fellow_tasklist.html index e31fe3710860fd20cdad38d2c6efba640358467f..2daa866fb9c2cf9df94d4c0de4de0f9b6dd882f6 100644 --- a/scipost_django/templates/email/fellows/email_fellow_tasklist.html +++ b/scipost_django/templates/email/fellows/email_fellow_tasklist.html @@ -5,13 +5,13 @@ {% if nr_potfels_to_vote_on > 0 %} <br/> <h3>Nominations to the Editorial College</h3> -<p>You have {{ nr_potfels_to_vote_on }} nomination{{ nr_potfels_to_vote_on|pluralize }} to vote on, please visit the <a href="https://scipost.org{% url 'colleges:potential_fellowships' %}">Potential Fellowships</a> page to cast your vote{{ nr_potfels_to_vote_on|pluralize }}.</p> +<p>You have {{ nr_potfels_to_vote_on }} nomination{{ nr_potfels_to_vote_on|pluralize }} to vote on, please visit the <a href="https://{{ domain }}{% url 'colleges:potential_fellowships' %}">Potential Fellowships</a> page to cast your vote{{ nr_potfels_to_vote_on|pluralize }}.</p> {% endif %} {% if recs_to_vote_on %} <br/> <h3>Recommendations for you to vote on</h3> - <p>Please go to the <a href="https://scipost.org{% url 'submissions:pool' %}">pool</a> to cast your vote on:</p> + <p>Please go to the <a href="https://{{ domain }}{% url 'submissions:pool' %}">pool</a> to cast your vote on:</p> <ul> {% for rec in recs_to_vote_on %} <li>{{ rec.submission.title }}</li> @@ -26,7 +26,7 @@ {% for assignment in assignments_to_consider %} <li> On submission: {{ assignment.submission }}<br> - <a href="https://scipost.org{% url 'submissions:assignment_request' assignment.id %}">Accept or decline here</a> + <a href="https://{{ domain }}{% url 'submissions:assignment_request' assignment.id %}">Accept or decline here</a> </li> {% endfor %} </ul> @@ -38,12 +38,12 @@ <ul> {% for assignment in assignments_ongoing %} <li> - <h3><a href="https://scipost.org{% url 'submissions:submission' assignment.submission.preprint.identifier_w_vn_nr %}">{{ assignment.submission.title }}</a></h3> + <h3><a href="https://{{ domain }}{% url 'submissions:submission' assignment.submission.preprint.identifier_w_vn_nr %}">{{ assignment.submission.title }}</a></h3> <p> <em>by {{ assignment.submission.author_list }}</em> </p> {% if assignment.submission.cycle.has_required_actions %} - <h3>Required actions (go to the <a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">Editorial page</a> to carry them out):</h3> + <h3>Required actions (go to the <a href="https://{{ domain }}{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">Editorial page</a> to carry them out):</h3> <ul> {% for code, action in assignment.submission.cycle.required_actions.items %} <li>{{ action|safe }}</li> @@ -65,12 +65,12 @@ <ul> {% for assignment in assignments_upcoming_deadline %} <li> - <h3><a href="https://scipost.org{% url 'submissions:pool' assignment.submission.preprint.identifier_w_vn_nr %}">{{ assignment.submission.title }}</a></h3> + <h3><a href="https://{{ domain }}{% url 'submissions:pool' assignment.submission.preprint.identifier_w_vn_nr %}">{{ assignment.submission.title }}</a></h3> <p> <em>by {{ assignment.submission.author_list }}</em> </p> <p>Refereeing deadline: {{ assignment.submission.reporting_deadline|date:"Y-m-d" }}.</p> - <p><em>You can manage this Submission from its </em><a href="https://scipost.org{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">Editorial page</a>.</p> + <p><em>You can manage this Submission from its </em><a href="https://{{ domain }}{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">Editorial page</a>.</p> </li> {% endfor %} </ul> @@ -79,7 +79,7 @@ <br/> <h3>Need help or assistance?</h3> <p> - Don't hesitate to <a href="mailto:edadmin@scipost.org">email the editorial administration</a> if you need any assistance. + Don't hesitate to <a href="mailto:edadmin@{{ domain }}">email the editorial administration</a> if you need any assistance. </p> <p> Many thanks for your valuable work,<br> diff --git a/scipost_django/templates/email/fellows/email_fellow_tasklist.json b/scipost_django/templates/email/fellows/email_fellow_tasklist.json index b273b97f2ef16bc80452d340111ca36163017f85..b8319cf289ddd6becd6e774f24f7f431f5778725 100644 --- a/scipost_django/templates/email/fellows/email_fellow_tasklist.json +++ b/scipost_django/templates/email/fellows/email_fellow_tasklist.json @@ -4,8 +4,8 @@ "user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost EdAdmin", - "from_email": "edadmin@scipost.org" + "from_email": "edadmin@" } diff --git a/scipost_django/templates/email/helpdesk/followup_on_ticket.html b/scipost_django/templates/email/helpdesk/followup_on_ticket.html index e39d6640b6951bce0952430a49b731d643871b10..12200bcc1a1af5c37283dd03f0753586607bd6b0 100644 --- a/scipost_django/templates/email/helpdesk/followup_on_ticket.html +++ b/scipost_django/templates/email/helpdesk/followup_on_ticket.html @@ -6,7 +6,7 @@ <hr> {{ followup.text|automarkup }} <hr> -<p>You can view details (and optionally take further steps) by navigating to the <a href="https://scipost.org{{ followup.ticket.get_absolute_url }}">ticket's page</a> (login required). You can also see this ticket on your personal list at our online <a href="https://scipost.org/helpdesk/">helpdesk</a>.</p> +<p>You can view details (and optionally take further steps) by navigating to the <a href="https://{{ domain }}{{ followup.ticket.get_absolute_url }}">ticket's page</a> (login required). You can also see this ticket on your personal list at our online <a href="https://{{ domain }}{% url 'helpdesk:helpdesk' %}"</a>.</p> <p> Many thanks,<br> The SciPost Team. diff --git a/scipost_django/templates/email/helpdesk/followup_on_ticket.json b/scipost_django/templates/email/helpdesk/followup_on_ticket.json index 7a2e5acb499fcc0269e673949428056df6708571..4ffbde3cdbeacac683d432280dcb65360fdbf56a 100644 --- a/scipost_django/templates/email/helpdesk/followup_on_ticket.json +++ b/scipost_django/templates/email/helpdesk/followup_on_ticket.json @@ -4,14 +4,14 @@ "ticket.defined_by.email" ], "bcc": [ - "admin@scipost.org", - "edadmin@scipost.org", - "refereeing@scipost.org", - "submissions@scipost.org", - "jscaux@scipost.org", + "admin@", + "edadmin@", + "refereeing@", + "submissions@", + "jscaux@", "J.S.Caux@uva.nl", "prof@jscaux.org" ], "from_name": "SciPost Helpdesk", - "from_email": "helpdesk@scipost.org" + "from_email": "helpdesk@" } diff --git a/scipost_django/templates/email/org_contacts/contactperson_followup_mail.html b/scipost_django/templates/email/org_contacts/contactperson_followup_mail.html index d9e293ba65efe828fd883dbbfef6719a9e653617..32defc7fd5d306a5cdafdddb6a211e601c6c24d6 100644 --- a/scipost_django/templates/email/org_contacts/contactperson_followup_mail.html +++ b/scipost_django/templates/email/org_contacts/contactperson_followup_mail.html @@ -1,3 +1,4 @@ +{% load static %} <p> Dear {% if contactperson %}{{ contactperson.get_title_display }} {{ contactperson.last_name }}{% else %}colleagues{% endif %}, </p> @@ -5,13 +6,13 @@ We recently contacted you concerning SciPost, to probe your organization's interest in becoming a Sponsor. With this follow-up email, I would simply like to check whether you got the original message. </p> <p> - <a href="https://scipost.org">SciPost</a> is a next-generation publication portal aiming to transform the business of scientific publishing. You can find a one-page summary in <a href="https://scipost.org/static/sponsors/SciPost_Sponsors_Board_Prospectus.pdf">our online prospectus</a> outlining the reasons why joining would be beneficial for your institution. + <a href="https://{% url 'scipost:index' %}">SciPost</a> is a next-generation publication portal aiming to transform the business of scientific publishing. You can find a one-page summary in <a href="https://{{ domain }}{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">our online prospectus</a> outlining the reasons why joining would be beneficial for your institution. </p> <p> - You can also find a summary of how your organization has benefitted from our activities at <a href="https://scipost.org{{ contactperson.organization.get_absolute_url }}">this link</a>. + You can also find a summary of how your organization has benefitted from our activities at <a href="https://{{ domain }}{{ contactperson.organization.get_absolute_url }}">this link</a>. </p> <p> - I will be happy to provide any required further details. If you are interested, you can simply get in touch via this address (sponsors@scipost.org). I sincerely hope that SciPost will be able to count on your support. + I will be happy to provide any required further details. If you are interested, you can simply get in touch via this address (sponsors@{{ domain }}). I sincerely hope that SciPost will be able to count on your support. </p> <p> If you not the right representative to get in touch with, could you please forward this to the right person, or let us know? @@ -22,7 +23,7 @@ <p> On behalf of the SciPost Foundation,<br><br> Prof. dr Jean-Sébastien Caux<br> - J.S.Caux@uva.nl jscaux@scipost.org<br> + J.S.Caux@uva.nl jscaux@{{ domain }}<br> https://jscaux.org<br> ---------------------------------------------<br> Institute for Theoretical Physics<br> diff --git a/scipost_django/templates/email/org_contacts/contactperson_followup_mail.json b/scipost_django/templates/email/org_contacts/contactperson_followup_mail.json index a7c8edb0203a48c702edbf80d096c99261cecb97..8b4715c1394364fd9175de3a3253a95b9dcb6f6b 100644 --- a/scipost_django/templates/email/org_contacts/contactperson_followup_mail.json +++ b/scipost_django/templates/email/org_contacts/contactperson_followup_mail.json @@ -4,8 +4,8 @@ "email" ], "bcc": [ - "sponsors@scipost.org" + "sponsors@" ], "from_name": "SciPost Sponsors", - "from_email": "sponsors@scipost.org" + "from_email": "sponsors@" } diff --git a/scipost_django/templates/email/org_contacts/contactperson_initial_mail.html b/scipost_django/templates/email/org_contacts/contactperson_initial_mail.html index ff574324bd62ab2bd623572d9e88e84e64a7c5ac..bfcaebcc4d73b14b9d91eb676f8829705b48452a 100644 --- a/scipost_django/templates/email/org_contacts/contactperson_initial_mail.html +++ b/scipost_django/templates/email/org_contacts/contactperson_initial_mail.html @@ -1,3 +1,4 @@ +{% load static %} <p> Dear {% if contactperson %}{{ contactperson.get_title_display }} {{ contactperson.last_name }}{% else %}colleagues{% endif %}, </p> @@ -5,22 +6,22 @@ You might by now have heard of SciPost, a scientists-driven not-for-profit initiative whose mission is to provide an improved academic publishing infrastructure. </p> <p> - The site is anchored at <a href="https://scipost.org">SciPost.org</a>. Many further details about SciPost, its principles, ideals and implementation can be found at the <a href="https://scipost.org/about">about page</a> and <a href="https://scipost.org/FAQ">our FAQ</a>. + The site is anchored at <a href="https://{{ domain }}{% url 'scipost:index' %}">SciPost.org</a>. Many further details about SciPost, its principles, ideals and implementation can be found at the <a href="https://{{ domain }}{% url 'scipost:about' %}">about page</a> and <a href="https://{{ domain }}{% url 'scipost:FAQ' %}">our FAQ</a>. </p> <p> - You can also find a summary of how your organization has benefitted from our activities at <a href="https://scipost.org{{ contactperson.organization.get_absolute_url }}">this link</a>. There, you will find an overview of publications, authors and Fellows (our editors) which have an affiliation to your organization. + You can also find a summary of how your organization has benefitted from our activities at <a href="https://{{ domain }}{{ contactperson.organization.get_absolute_url }}">this link</a>. There, you will find an overview of publications, authors and Fellows (our editors) which have an affiliation to your organization. </p> <p> - As explained on our <a href="https://scipost.org/finances/business_model/">business model</a> page, SciPost follows a completely different funding model than traditional publishers, and provides a cost-slashing alternative to existing platforms. SciPost charges neither subscription fees, nor article processing charges; its activities are instead collectively financed by a worldwide consortium of Sponsors, formed by institutions and organizations which directly or indirectly benefit from SciPost’s activities. + As explained on our <a href="https://{{ domain }}{% url 'finances:business_model' %}">business model</a> page, SciPost follows a completely different funding model than traditional publishers, and provides a cost-slashing alternative to existing platforms. SciPost charges neither subscription fees, nor article processing charges; its activities are instead collectively financed by a worldwide consortium of Sponsors, formed by institutions and organizations which directly or indirectly benefit from SciPost’s activities. </p> <p> - A short summary, together with motivations for your organization to become a sponsor, are given in <a href="https://scipost.org/static/sponsors/SciPost_Sponsors_Board_Prospectus.pdf">our one-page prospectus</a>. + A short summary, together with motivations for your organization to become a sponsor, are given in <a href="https://{{ domain }}{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">our one-page prospectus</a>. </p> <p> - In <a href="https://scipost.org/static/sponsors/SciPost_Sponsorship_Agreement.pdf">the agreement template</a>, you will find many more specific details about our operations, requirements and funding strategy. + In <a href="https://{{ domain }}{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">the agreement template</a>, you will find many more specific details about our operations, requirements and funding strategy. </p> <p> - It would be a privilege to welcome your organization as a Sponsor. I am hereby contacting you to enquire whether your institution would consider joining? If you are interested, you can simply get in touch via this address (sponsors@scipost.org). I sincerely hope that SciPost will be able to count on your support. + It would be a privilege to welcome your organization as a Sponsor. I am hereby contacting you to enquire whether your institution would consider joining? If you are interested, you can simply get in touch via this address (sponsors@{{ domain }}). I sincerely hope that SciPost will be able to count on your support. </p> <p> diff --git a/scipost_django/templates/email/org_contacts/contactperson_initial_mail.json b/scipost_django/templates/email/org_contacts/contactperson_initial_mail.json index a7c8edb0203a48c702edbf80d096c99261cecb97..8b4715c1394364fd9175de3a3253a95b9dcb6f6b 100644 --- a/scipost_django/templates/email/org_contacts/contactperson_initial_mail.json +++ b/scipost_django/templates/email/org_contacts/contactperson_initial_mail.json @@ -4,8 +4,8 @@ "email" ], "bcc": [ - "sponsors@scipost.org" + "sponsors@" ], "from_name": "SciPost Sponsors", - "from_email": "sponsors@scipost.org" + "from_email": "sponsors@" } diff --git a/scipost_django/templates/email/org_contacts/contactrole_generic_mail.json b/scipost_django/templates/email/org_contacts/contactrole_generic_mail.json index d48e2bcf74409850e4575f88a36efc58144ddae5..88284a572901d90ac7f593175dfeaf0dfdd0ac5a 100644 --- a/scipost_django/templates/email/org_contacts/contactrole_generic_mail.json +++ b/scipost_django/templates/email/org_contacts/contactrole_generic_mail.json @@ -4,8 +4,8 @@ "contact.user.email" ], "bcc": [ - "sponsors@scipost.org" + "sponsors@" ], "from_name": "SciPost Sponsors", - "from_email": "sponsors@scipost.org" + "from_email": "sponsors@" } diff --git a/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.html b/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.html index 1f025d919b8518b008d8c194ef7044017026f846..8e42d4683203854310b8d630dc283e0cbd2e5bbc 100644 --- a/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.html +++ b/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.html @@ -2,7 +2,7 @@ Dear {{ object.contact.get_title_display }} {{ object.contact.user.last_name }}, </p> <p> - Your organization ({{ object.organization }}) has been sponsoring SciPost (see details at <a href="https://scipost.org{{ object.organization.get_absolute_url }}">this link</a>), for which we are extremely grateful. + Your organization ({{ object.organization }}) has been sponsoring SciPost (see details at <a href="https://{{ domain }}{{ object.organization.get_absolute_url }}">this link</a>), for which we are extremely grateful. </p> <p> Your latest sponsorship period ends on {{ object.organization.latest_subsidy_date_until }}. We would be extremely grateful for your continued support, and would hereby like to enquire whether we can start the renewal procedure. diff --git a/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.json b/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.json index e1748f5e03623642cdb6116e144962e9dfebcda3..f21a824fba1ca21d86451af292ea3b475fb0f8d9 100644 --- a/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.json +++ b/scipost_django/templates/email/org_contacts/contactrole_subsidy_renewal_mail.json @@ -4,8 +4,8 @@ "contact.user.email" ], "bcc": [ - "sponsors@scipost.org" + "sponsors@" ], "from_name": "SciPost Sponsors", - "from_email": "sponsors@scipost.org" + "from_email": "sponsors@" } diff --git a/scipost_django/templates/email/org_contacts/email_contact_for_activation.html b/scipost_django/templates/email/org_contacts/email_contact_for_activation.html index d7f37d8fba43b6a2e4e61da704f798c6a20e1e72..f3e255a60dd8e4f65683535d981b0bdc86e0d62d 100644 --- a/scipost_django/templates/email/org_contacts/email_contact_for_activation.html +++ b/scipost_django/templates/email/org_contacts/email_contact_for_activation.html @@ -1,10 +1,10 @@ <p>Dear {{ contact.get_title_display }} {{ contact.user.last_name }},</p> <p> - Many thanks for sponsoring SciPost. We have now created a personal account for you on scipost.org, which will allow you to access all relevant information and functionalities related to sponsoring. + Many thanks for sponsoring SciPost. We have now created a personal account for you on {{ domain }}, which will allow you to access all relevant information and functionalities related to sponsoring. </p> <p> - In order to activate your account, please navigate to <a href="https://scipost.org{% url 'organizations:activate_account' contact.activation_key %}?email={{ contact.user.email }}">this link</a>. You will be asked to choose a password, after which you will be able to login (your username being defined as your email address). + In order to activate your account, please navigate to <a href="https://{{ domain }}{% url 'organizations:activate_account' contact.activation_key %}?email={{ contact.user.email }}">this link</a>. You will be asked to choose a password, after which you will be able to login (your username being defined as your email address). </p> <p> After logging in, you will find a “Org dashboard†link in the top menu, which will take you to your info page, where you will find further links for managing your account and the associated data (in particular, the public visibility settings of your sponsorship amounts and associated documents). diff --git a/scipost_django/templates/email/org_contacts/email_contact_for_activation.json b/scipost_django/templates/email/org_contacts/email_contact_for_activation.json index f85e0c889eb89edaa1db3f5dec0d68824eeafaf6..fee059a1546335c96bb0e2c68ef1568f5fda5930 100644 --- a/scipost_django/templates/email/org_contacts/email_contact_for_activation.json +++ b/scipost_django/templates/email/org_contacts/email_contact_for_activation.json @@ -4,8 +4,8 @@ "user.email" ], "bcc": [ - "sponsors@scipost.org" + "sponsors@" ], "from_name": "SciPost Sponsors Admin", - "from_email": "sponsors@scipost.org" + "from_email": "sponsors@" } diff --git a/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.html b/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.html index 3c44bce45780d2df154eff978dedd1e3359da628..fe42bc9d9a40cfca887d0c26ca1c8cfc1dcbdb28 100644 --- a/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.html +++ b/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.html @@ -1,14 +1,14 @@ <p>Dear {{ object.profile.get_title_display }} {{ object.profile.last_name }},</p> -<p>Hopefully you're aware of <a href="https://scipost.org{% url 'scipost:index' %}">SciPost</a> and of its mission to establish a healthier community-run, open and not-for-profit infrastructure for scientific publishing (see our <a href="https://scipost.org{% url 'scipost:about' %}">about page</a> for a quick introduction or reminder).</p> +<p>Hopefully you're aware of <a href="https://{{ domain }}{% url 'scipost:index' %}">SciPost</a> and of its mission to establish a healthier community-run, open and not-for-profit infrastructure for scientific publishing (see our <a href="https://{{ domain }}{% url 'scipost:about' %}">about page</a> for a quick introduction or reminder).</p> -{% if object.profile.acad_field %}{% if object.profile.acad_field.slug != 'physics' %}<p>Having successfully initiated our activities in the field of Physics, we would now like to bring the benefits of our approach to scientists in other fields of science, in particular {{ object.profile.acad_field }}. We are therefore launching <a href="https://scipost.org{% url 'journals:journals' %}?field={{ object.profile.acad_field }}">new journals in {{ object.profile.acad_field }}</a>, aiming to achieve the same success we have had with our <a href="https://scipost.org{% url 'journals:journals' %}?field=physics">Physics journals</a>.{% endif %}{% endif %} +{% if object.profile.acad_field %}{% if object.profile.acad_field.slug != 'physics' %}<p>Having successfully initiated our activities in the field of Physics, we would now like to bring the benefits of our approach to scientists in other fields of science, in particular {{ object.profile.acad_field }}. We are therefore launching <a href="https://{{ domain }}{% url 'journals:journals' %}?field={{ object.profile.acad_field }}">new journals in {{ object.profile.acad_field }}</a>, aiming to achieve the same success we have had with our <a href="https://{{ domain }}{% url 'journals:journals' %}?field=physics">Physics journals</a>.{% endif %}{% endif %} <p>On behalf of the SciPost Foundation and in view of your professional expertise and reputation, I hereby would like to invite you to join the {{ object.college }} by becoming one of our Editorial Fellows.</p> -<p>Academic reputation is the most important criterion guiding our considerations of who should belong to our Editorial Colleges. The current list of Colleges and their Fellows can be found at <a href="https://scipost.org{% url 'colleges:colleges' %}">this page</a>. Our ambition is none other than to assemble the most reputed editorial team of any publishing system available worldwide.</p> +<p>Academic reputation is the most important criterion guiding our considerations of who should belong to our Editorial Colleges. The current list of Colleges and their Fellows can be found at <a href="https://{{ domain }}{% url 'colleges:colleges' %}">this page</a>. Our ambition is none other than to assemble the most reputed editorial team of any publishing system available worldwide.</p> -<p>We do not pose any conditions on your involvement, and you will always remain in complete control of your level of commitment (a couple of hours per month would already be significant). Functioning of the Colleges proceeds according to the <a href="https://scipost.org{% url 'scipost:EdCol_by-laws' %}">by-laws</a>, and a short summary of the editorial workflow can be found at <a href="https://scipost.org{% url 'submissions:editorial_workflow' %}">this page</a>.</p> +<p>We do not pose any conditions on your involvement, and you will always remain in complete control of your level of commitment (a couple of hours per month would already be significant). Functioning of the Colleges proceeds according to the <a href="https://{{ domain }}{% url 'scipost:EdCol_by-laws' %}">by-laws</a>, and a short summary of the editorial workflow can be found at <a href="https://{{ domain }}{% url 'submissions:editorial_workflow' %}">this page</a>.</p> <p>I would be very happy to provide you with more information should you require it. Could I beg you to give us a response (by replying to this email) within the next couple of weeks?</p> diff --git a/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.json b/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.json index 35a85dbf0128e0d76278bc1d557e9d0763f009dd..74a212f1cc720c6b09d61f283d704f724d55f067 100644 --- a/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.json +++ b/scipost_django/templates/email/potentialfellowships/invite_potential_fellow_initial.json @@ -4,8 +4,8 @@ "profile.email" ], "bcc": [ - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Admin", - "from_email": "admin@scipost.org" + "from_email": "admin@" } diff --git a/scipost_django/templates/email/prescreening_failed.json b/scipost_django/templates/email/prescreening_failed.json index 8f6266bfddcf7d2d220c4464182689269f28fb12..4899759bf9ff7eb8c7a3ee129358d17fe779b14d 100644 --- a/scipost_django/templates/email/prescreening_failed.json +++ b/scipost_django/templates/email/prescreening_failed.json @@ -4,8 +4,8 @@ "submitted_by.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/production_send_proofs.html b/scipost_django/templates/email/production_send_proofs.html index a6c1c084ba7afd4172c2010156ace93705e1be36..7c64ccd0e489d796b55be62d813e414798270200 100644 --- a/scipost_django/templates/email/production_send_proofs.html +++ b/scipost_django/templates/email/production_send_proofs.html @@ -3,7 +3,7 @@ </p> <p> - The SciPost production team has finished the proofs of your manuscript (version {{ proofs.version }}). You can find the proofs on your <a href="https://scipost.org{{ proofs.stream.submission.get_absolute_url }}">submission's page</a>. + The SciPost production team has finished the proofs of your manuscript (version {{ proofs.version }}). You can find the proofs on your <a href="https://{{ domain }}{{ proofs.stream.submission.get_absolute_url }}">submission's page</a>. </p> <p> diff --git a/scipost_django/templates/email/production_send_proofs.json b/scipost_django/templates/email/production_send_proofs.json index a6f298c108c11833bb42e51bf1a3c0d18cc1da92..2684d0c222ddde0cc67c168cb7a001364175457a 100644 --- a/scipost_django/templates/email/production_send_proofs.json +++ b/scipost_django/templates/email/production_send_proofs.json @@ -4,5 +4,5 @@ "stream.submission.submitted_by.user.email" ], "from_name": "SciPost Production", - "from_email": "proofs@scipost.org" + "from_email": "proofs@" } diff --git a/scipost_django/templates/email/publication_ready.html b/scipost_django/templates/email/publication_ready.html index 1f84f558391acd312cba0f51de9fb9ad7a6c0740..7fc41ac0c0d87e954702b02e55fba1df04014551 100644 --- a/scipost_django/templates/email/publication_ready.html +++ b/scipost_django/templates/email/publication_ready.html @@ -2,7 +2,7 @@ The following Publication is drafted and ready for publication. </p> <p> - <a href="https://scipost.org/{{ object.get_absolute_url }}">{{ object.title }}</a><br> + <a href="https://{{ domain }}/{{ object.get_absolute_url }}">{{ object.title }}</a><br> by {{ object.author_list }} </p> <p> diff --git a/scipost_django/templates/email/publication_ready.json b/scipost_django/templates/email/publication_ready.json index 7de2ee6b388e37caeb657089ff1d87cd7cd89652..a3d15bede25de3fd93487e1013fef11b222d34dc 100644 --- a/scipost_django/templates/email/publication_ready.json +++ b/scipost_django/templates/email/publication_ready.json @@ -1,6 +1,6 @@ { "subject": "SciPost: Manuscript ready for publication", "recipient_list": [ - "admin@scipost.org" + "admin@" ] } diff --git a/scipost_django/templates/email/referees/confirmation_invitation_response.json b/scipost_django/templates/email/referees/confirmation_invitation_response.json index b3b1aeefa04092365cbe479c034e2efcde0c959c..d5c9acff2572c06dbea553d3d3a91b4734639e80 100644 --- a/scipost_django/templates/email/referees/confirmation_invitation_response.json +++ b/scipost_django/templates/email/referees/confirmation_invitation_response.json @@ -4,8 +4,8 @@ "referee.user.email" ], "bcc": [ - "submissions@scipost.org" + "submissions@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.html b/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.html index f851931e2cfc29777ca0ecf0f6f32f926cf635a8..b875d8d67d678cd13c7c78468014e0a3a8ac2700 100644 --- a/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.html +++ b/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.html @@ -6,11 +6,11 @@ <br><br> {{ report.submission.title }} <br>by {{ report.submission.author_list }}<br> - (see https://scipost.org{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). </p> <p> You can view your Report and the associated reply directly at - <a href="https://scipost.org{{ report.get_absolute_url }}">this link</a>. + <a href="https://{{ domain }}{{ report.get_absolute_url }}">this link</a>. </p> <p> We thank you very much for your contribution.<br/><br/>The SciPost Team. diff --git a/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.json b/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.json index d12ef7eeaf5c39f1b17a478ee2059c1094f6414c..308dbb3e051e27a773b51a1f0d1163c8de57b866 100644 --- a/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.json +++ b/scipost_django/templates/email/referees/inform_referee_authors_replied_to_report.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.html b/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.html index 518f9efd5a49cd2d28ef7487f9f41853894378e8..aca1ecc4592b1378639b1d24b20bf701bbed159f 100644 --- a/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.html +++ b/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.html @@ -6,11 +6,11 @@ <br><br> {{ report.submission.title }} <br>by {{ report.submission.author_list }}<br> - (see https://scipost.org{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). </p> <p> You can view your Report and the associated Comment directly at - <a href="https://scipost.org{{ report.get_absolute_url }}">this link</a>. + <a href="https://{{ domain }}{{ report.get_absolute_url }}">this link</a>. </p> <p> We thank you very much for your contribution.<br/><br/>The SciPost Team. diff --git a/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.json b/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.json index d36ac08861a80c42a28bb1f98dfc497a4da73cdc..8b4623f4ccd27eaac71e432c634544fbb044fd6e 100644 --- a/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.json +++ b/scipost_django/templates/email/referees/inform_referee_contributor_commented_report.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/inform_referee_manuscript_withdrawn.json b/scipost_django/templates/email/referees/inform_referee_manuscript_withdrawn.json index a4907c6f4896b2e671b2661669299da841178b22..b4027a641f9535caa674d72085a034b24207ee6d 100644 --- a/scipost_django/templates/email/referees/inform_referee_manuscript_withdrawn.json +++ b/scipost_django/templates/email/referees/inform_referee_manuscript_withdrawn.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/inform_referee_report_received.json b/scipost_django/templates/email/referees/inform_referee_report_received.json index 818c0a4a33f7568620e0ec4d891202a625c11ee0..636ec2378785904eef5fefeae502d61466f86c08 100644 --- a/scipost_django/templates/email/referees/inform_referee_report_received.json +++ b/scipost_django/templates/email/referees/inform_referee_report_received.json @@ -4,8 +4,8 @@ "author.user.email" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Editorial Admin", - "from_email": "submissions@scipost.org" + "from_email": "submissions@" } diff --git a/scipost_django/templates/email/referees/invite_contributor_to_referee.html b/scipost_django/templates/email/referees/invite_contributor_to_referee.html index fa1f39e951550393dc345bf5dead035a237ec2d9..a5af7e8a440893eae2c62f2622b0e722cad8f580 100644 --- a/scipost_django/templates/email/referees/invite_contributor_to_referee.html +++ b/scipost_django/templates/email/referees/invite_contributor_to_referee.html @@ -6,16 +6,16 @@ <br><br> {{ invitation.submission.title }} <br>by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> - Please <a href="https://scipost.org/submissions/accept_or_decline_ref_invitations">accept or decline</a> (login required) this invitation as soon as possible (ideally within the next 2 days). + Please <a href="https://{{ domain }}{% url 'submissions:accept_or_decline_ref_invitations' %}">accept or decline</a> (login required) this invitation as soon as possible (ideally within the next 2 days). </p> <p> - If you accept, your report can be submitted by simply clicking on the "Contribute a Report" link on <a href="https://scipost.org{{ invitation.submission.get_absolute_url }}">the Submission Page</a> before the reporting deadline (currently set at {{ invitation.submission.reporting_deadline|date:'d-m-Y' }}; your report will be automatically recognized as an invited report). + If you accept, your report can be submitted by simply clicking on the "Contribute a Report" link on <a href="https://{{ domain }}{{ invitation.submission.get_absolute_url }}">the Submission Page</a> before the reporting deadline (currently set at {{ invitation.submission.reporting_deadline|date:'d-m-Y' }}; your report will be automatically recognized as an invited report). </p> <p> - You might want to make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://scipost.org{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. + You might want to make sure you are familiar with our <a href="https://{{ domain }}{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://{{ domain }}{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://{{ domain }}{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. </p> <p> We would be extremely grateful for your contribution, and thank you in advance for your consideration. diff --git a/scipost_django/templates/email/referees/invite_contributor_to_referee.json b/scipost_django/templates/email/referees/invite_contributor_to_referee.json index cafe036680de1bb3c9a30e64b5fb56e7277bf1f1..bda0a1957f1194bad36355fdeecb024d331344b7 100644 --- a/scipost_django/templates/email/referees/invite_contributor_to_referee.json +++ b/scipost_django/templates/email/referees/invite_contributor_to_referee.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.html b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.html index aa656086e521857304f7078212bb4e1c5aa45940..750923bc2f8cce6851d4a08d62eebb77a8db3a20 100644 --- a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.html +++ b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.html @@ -6,7 +6,7 @@ Recently, on behalf of the Editor-in-charge {{ invitation.submission.editor_in_charge.profile.get_title_display }} {{ invitation.submission.editor_in_charge.user.last_name }}, we invited you to consider refereeing a Submission to {{ invitation.submission.submitted_to }}, namely<br><br> {{ invitation.submission.title }}<br> by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> We are still awaiting your response to this invitation. @@ -14,13 +14,13 @@ could you please let us know whether we can count on your expertise? </p> <p> - Please <a href="https://scipost.org/submissions/accept_or_decline_ref_invitations">accept or decline</a> (login required) this invitation. + Please <a href="https://{{ domain }}{% url 'submissions:accept_or_decline_ref_invitations' %}">accept or decline</a> (login required) this invitation. </p> <p> - If you accept, your report can be submitted by simply clicking on the "Contribute a Report" link on <a href="https://scipost.org{{ invitation.submission.get_absolute_url }}">the Submission Page</a> before the reporting deadline (currently set at {{ invitation.submission.reporting_deadline|date:'d M Y' }}; your report will be automatically recognized as an invited report). + If you accept, your report can be submitted by simply clicking on the "Contribute a Report" link on <a href="https://{{ domain }}{{ invitation.submission.get_absolute_url }}">the Submission Page</a> before the reporting deadline (currently set at {{ invitation.submission.reporting_deadline|date:'d M Y' }}; your report will be automatically recognized as an invited report). </p> <p> - You might want to make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://scipost.org{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. + You might want to make sure you are familiar with our <a href="https://{{ domain }}{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://{{ domain }}{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://{{ domain }}{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. </p> <p> We would be extremely grateful for your contribution, and thank you in advance for your consideration. diff --git a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.json b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.json index 850218aefe600a8318a1faaeb001d57129ea7b6d..5c18b1fc6888d1867c3ae5da33c249f84ffbc65a 100644 --- a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.json +++ b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder1.json @@ -1,11 +1,11 @@ { "subject": "SciPost: refereeing request reminder", "recipient_list": [ - "jscaux@scipost.org" + "jscaux@" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.html b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.html index 4b29f182525e5f34e8963340e7e0c531f2701295..72e872b4516acd72891ba286a41b441c0b7446d1 100644 --- a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.html +++ b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.html @@ -6,7 +6,7 @@ Recently, on behalf of the Editor-in-charge {{ invitation.submission.editor_in_charge.profile.get_title_display }} {{ invitation.submission.editor_in_charge.user.last_name }}, we invited you to consider refereeing a Submission to {{ invitation.submission.submitted_to }}, namely<br><br> {{ invitation.submission.title }}<br> by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> We are still awaiting your response to this invitation. @@ -14,13 +14,13 @@ could you please let us know whether we can count on your expertise? </p> <p> - Please <a href="https://scipost.org/submissions/accept_or_decline_ref_invitations">accept or decline</a> (login required) this invitation. + Please <a href="https://{{ domain }}{% url 'submissions:accept_or_decline_ref_invitations' %}">accept or decline</a> (login required) this invitation. </p> <p> - If you accept, your report can be submitted by simply clicking on the "Contribute a Report" link on <a href="https://scipost.org{{ invitation.submission.get_absolute_url }}">the Submission Page</a> before the reporting deadline (currently set at {{ invitation.submission.reporting_deadline|date:'d M Y' }}; your report will be automatically recognized as an invited report). + If you accept, your report can be submitted by simply clicking on the "Contribute a Report" link on <a href="https://{{ domain }}{{ invitation.submission.get_absolute_url }}">the Submission Page</a> before the reporting deadline (currently set at {{ invitation.submission.reporting_deadline|date:'d M Y' }}; your report will be automatically recognized as an invited report). </p> <p> - You might want to make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://scipost.org{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. + You might want to make sure you are familiar with our <a href="https://{{ domain }}{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://{{ domain }}{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://{{ domain }}{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. </p> <p> We would be extremely grateful for your contribution, and thank you in advance for your consideration. diff --git a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.json b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.json index 850218aefe600a8318a1faaeb001d57129ea7b6d..5c18b1fc6888d1867c3ae5da33c249f84ffbc65a 100644 --- a/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.json +++ b/scipost_django/templates/email/referees/invite_contributor_to_referee_reminder2.json @@ -1,11 +1,11 @@ { "subject": "SciPost: refereeing request reminder", "recipient_list": [ - "jscaux@scipost.org" + "jscaux@" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/invite_unregistered_to_referee.html b/scipost_django/templates/email/referees/invite_unregistered_to_referee.html index 54847e20f65147cc8550ae63138ba61cf83b9bd5..d21e8e8b891b7f21c017d3137a1b93c08bb2aa47 100644 --- a/scipost_django/templates/email/referees/invite_unregistered_to_referee.html +++ b/scipost_django/templates/email/referees/invite_unregistered_to_referee.html @@ -5,25 +5,25 @@ On behalf of the Editor-in-charge {{ invitation.submission.editor_in_charge.profile.get_title_display }} {{ invitation.submission.editor_in_charge.user.last_name }}, we would like to invite you to referee a Submission to {{ invitation.submission.submitted_to }}, namely<br><br> {{ invitation.submission.title }}<br> by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> To ensure timely processing of the submission (out of respect for the authors), we would appreciate a quick accept/decline response from you, ideally within the next 2 days. </p> <p> - If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://scipost.org/submissions/decline_ref_invitation/{{ invitation.invitation_key }}"> clicking here</a>. + If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://{{ domain }}/submissions/decline_ref_invitation/{{ invitation.invitation_key }}"> clicking here</a>. </p> <p> If you are able to provide a Report, you can confirm this after registering and logging in (you will automatically be prompted for a confirmation). </p> <p> We would thus hereby like to cordially invite you to become a Contributor on SciPost (this is required in order to deliver reports; our records show that you are not yet registered); - for your convenience, we have prepared a pre-filled <a href="https://scipost.org/invitation/{{ invitation.invitation_key }}">registration form</a> for you. + for your convenience, we have prepared a pre-filled <a href="https://{{ domain }}/invitation/{{ invitation.invitation_key }}">registration form</a> for you. After activation of your registration, you will be allowed to contribute, in particular by providing referee reports. </p> <p> - You might want to make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://scipost.org{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. + You might want to make sure you are familiar with our <a href="https://{{ domain }}{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://{{ domain }}{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://{{ domain }}{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. </p> <p> We very much hope that we can count on your expertise, diff --git a/scipost_django/templates/email/referees/invite_unregistered_to_referee.json b/scipost_django/templates/email/referees/invite_unregistered_to_referee.json index 5611c1628a145e5b453f483dbf9a3a9d49b4ed9a..df8338246ebe1e6723b91cce838d262f7ab848aa 100644 --- a/scipost_django/templates/email/referees/invite_unregistered_to_referee.json +++ b/scipost_django/templates/email/referees/invite_unregistered_to_referee.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.html b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.html index 4c743ed61af95680a6b1397d75e123506fc062fa..096113866b1c8a9c9ee81b51c3ff9515f7dad965 100644 --- a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.html +++ b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.html @@ -6,7 +6,7 @@ Recently, on behalf of the Editor-in-charge {{ invitation.submission.editor_in_charge.profile.get_title_display }} {{ invitation.submission.editor_in_charge.user.last_name }}, we invited you to consider refereeing a Submission to {{ invitation.submission.submitted_to }}, namely<br><br> {{ invitation.submission.title }}<br> by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> We are still awaiting your response to this invitation. @@ -14,18 +14,18 @@ could you please let us know whether we can count on your expertise? </p> <p> - If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://scipost.org/submissions/decline_ref_invitation/{{ invitation.invitation_key }}"> clicking here</a>. + If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://{{ domain }}/submissions/decline_ref_invitation/{{ invitation.invitation_key }}"> clicking here</a>. </p> <p> If you are able to provide a Report, you can confirm this after registering and logging in (you will automatically be prompted for a confirmation). </p> <p> We would thus hereby like to cordially invite you to become a Contributor on SciPost (this is required in order to deliver reports; our records show that you are not yet registered); - for your convenience, we have prepared a pre-filled <a href="https://scipost.org/invitation/{{ invitation.invitation_key }}">registration form</a> for you. + for your convenience, we have prepared a pre-filled <a href="https://{{ domain }}/invitation/{{ invitation.invitation_key }}">registration form</a> for you. After activation of your registration, you will be allowed to contribute, in particular by providing referee reports. </p> <p> - You might want to make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://scipost.org{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. + You might want to make sure you are familiar with our <a href="https://{{ domain }}{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://{{ domain }}{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://{{ domain }}{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. </p> <p> We very much hope that we can count on your expertise, diff --git a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.json b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.json index 13c8e8e99f448c00809eedcaf8448958f31b93ed..51852dc5c0b5f4af9c0e2ad764f982bf2f0031b1 100644 --- a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.json +++ b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder1.json @@ -1,11 +1,11 @@ { "subject": "SciPost: refereeing and registration invitation reminder", "recipient_list": [ - "jscaux@scipost.org" + "jscaux@" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.html b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.html index b12720fc40c2459f7387022e1ff56382819f4a3f..f6932a93e5891115145ce0be85fa771d516db390 100644 --- a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.html +++ b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.html @@ -6,7 +6,7 @@ Recently, on behalf of the Editor-in-charge {{ invitation.submission.editor_in_charge.profile.get_title_display }} {{ invitation.submission.editor_in_charge.user.last_name }}, we invited you to consider refereeing a Submission to {{ invitation.submission.submitted_to }}, namely<br><br> {{ invitation.submission.title }}<br> by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> We are still awaiting your response to this invitation. @@ -14,18 +14,18 @@ could you please let us know whether we can count on your expertise? </p> <p> - If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://scipost.org/submissions/decline_ref_invitation/{{ invitation.invitation_key }}"> clicking here</a>. + If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://{{ domain }}/submissions/decline_ref_invitation/{{ invitation.invitation_key }}"> clicking here</a>. </p> <p> If you are able to provide a Report, you can confirm this after registering and logging in (you will automatically be prompted for a confirmation). </p> <p> We would thus hereby like to cordially invite you to become a Contributor on SciPost (this is required in order to deliver reports; our records show that you are not yet registered); - for your convenience, we have prepared a pre-filled <a href="https://scipost.org/invitation/{{ invitation.invitation_key }}">registration form</a> for you. + for your convenience, we have prepared a pre-filled <a href="https://{{ domain }}/invitation/{{ invitation.invitation_key }}">registration form</a> for you. After activation of your registration, you will be allowed to contribute, in particular by providing referee reports. </p> <p> - You might want to make sure you are familiar with our <a href="https://scipost.org{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://scipost.org{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://scipost.org{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. + You might want to make sure you are familiar with our <a href="https://{{ domain }}{% url 'submissions:refereeing_procedure' %}">refereeing procedure</a>, <a href="https://{{ domain }}{% url 'submissions:referee_guidelines' %}">referee guidelines</a> and <a href="https://{{ domain }}{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>. </p> <p> We very much hope that we can count on your expertise, diff --git a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.json b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.json index 13c8e8e99f448c00809eedcaf8448958f31b93ed..51852dc5c0b5f4af9c0e2ad764f982bf2f0031b1 100644 --- a/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.json +++ b/scipost_django/templates/email/referees/invite_unregistered_to_referee_reminder2.json @@ -1,11 +1,11 @@ { "subject": "SciPost: refereeing and registration invitation reminder", "recipient_list": [ - "jscaux@scipost.org" + "jscaux@" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/reinvite_contributor_to_referee.html b/scipost_django/templates/email/referees/reinvite_contributor_to_referee.html index d87395665b457aa39b87d474fbc1311352686e79..262cf70694cf5a8f06c2db5a36ddf7696a6ca591 100644 --- a/scipost_django/templates/email/referees/reinvite_contributor_to_referee.html +++ b/scipost_django/templates/email/referees/reinvite_contributor_to_referee.html @@ -7,7 +7,7 @@ <br> by {{ invitation.submission.author_list }} <br> - (<a href="https://scipost.org{{ invitation.submission.get_absolute_url }}">see on SciPost.org</a>) + (<a href="https://{{ domain }}{{ invitation.submission.get_absolute_url }}">see on SciPost.org</a>) </p> <p> have resubmitted their manuscript to SciPost. On behalf of the Editor-in-charge {{ invitation.submission.editor_in_charge.profile.get_title_display }} {{ invitation.submission.editor_in_charge.user.last_name }}, we would like to invite you to quickly review this new version. diff --git a/scipost_django/templates/email/referees/reinvite_contributor_to_referee.json b/scipost_django/templates/email/referees/reinvite_contributor_to_referee.json index b4c34c7929934f5102f41d85c46c02929d31e3ac..369d54b07b520d6f774506dec63df931aefc6b45 100644 --- a/scipost_django/templates/email/referees/reinvite_contributor_to_referee.json +++ b/scipost_django/templates/email/referees/reinvite_contributor_to_referee.json @@ -5,8 +5,8 @@ ], "bcc": [ "submission.editor_in_charge.user.email", - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/referees/remind_referee_deadline_1week.html b/scipost_django/templates/email/referees/remind_referee_deadline_1week.html index 65bf441dd1c6e14223277c8dbe90b64a8c1f5baf..083f688f041131e60410400805559b32189f9613 100644 --- a/scipost_django/templates/email/referees/remind_referee_deadline_1week.html +++ b/scipost_django/templates/email/referees/remind_referee_deadline_1week.html @@ -6,7 +6,7 @@ <br><br> {{ invitation.submission.title }} <br>by {{ invitation.submission.author_list }}<br> - (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). + (see https://{{ domain }}{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> <p> Thank you in advance, diff --git a/scipost_django/templates/email/referees/remind_referee_deadline_1week.json b/scipost_django/templates/email/referees/remind_referee_deadline_1week.json index ef9f2ddf76c80829246050ea0dfec1e3c308b61d..39b239d654f80308987399894f7ea204b41eb514 100644 --- a/scipost_django/templates/email/referees/remind_referee_deadline_1week.json +++ b/scipost_django/templates/email/referees/remind_referee_deadline_1week.json @@ -1,11 +1,11 @@ { "subject": "SciPost: refereeing deadline approaching", "recipient_list": [ - "jscaux@scipost.org" + "jscaux@" ], "bcc": [ - "edadmin@scipost.org" + "edadmin@" ], "from_name": "SciPost Refereeing", - "from_email": "refereeing@scipost.org" + "from_email": "refereeing@" } diff --git a/scipost_django/templates/email/registration_invitation.html b/scipost_django/templates/email/registration_invitation.html index 495a8385da7f9f4dd39c9748a3f1c96bf15ef769..25be94e6363634c10178eb4524a8c1221f338ee4 100644 --- a/scipost_django/templates/email/registration_invitation.html +++ b/scipost_django/templates/email/registration_invitation.html @@ -17,7 +17,7 @@ Dear {% if object.message_style == 'F' %}{{ object.get_title_display }} {{ objec {# Referee invite #} <p> We would hereby like to cordially invite you to become a Contributor on SciPost (this is required in order to deliver reports; our records show that you are not yet registered); - for your convenience, we have prepared a pre-filled <a href="https://scipost.org/invitation/{{ object.invitation_key }}">registration form</a> for you. + for your convenience, we have prepared a pre-filled <a href="https://{{ domain }}/invitation/{{ object.invitation_key }}">registration form</a> for you. After activation of your registration, you will be allowed to contribute, in particular by providing referee reports. </p> <p> @@ -25,7 +25,7 @@ Dear {% if object.message_style == 'F' %}{{ object.get_title_display }} {{ objec we would appreciate a quick accept/decline response from you, ideally within the next 2 days. </p> <p> - If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://scipost.org/submissions/decline_ref_invitation/{{ object.invitation_key }}"> clicking here</a>. + If you are <strong>not</strong> able to provide a Report, you can let us know by simply <a href="https://{{ domain }}/submissions/decline_ref_invitation/{{ object.invitation_key }}"> clicking here</a>. </p> <p> If you are able to provide a Report, you can confirm this after registering and logging in (you will automatically be prompted for a confirmation). @@ -74,7 +74,7 @@ Dear {% if object.message_style == 'F' %}{{ object.get_title_display }} {{ objec <br> <i>by {{ notification.submission.author_list }}</i> <br> - <a href="https://scipost.org/{{ notification.submission.get_absolute_url }}">View the submission's page</a> + <a href="https://{{ domain }}/{{ notification.submission.get_absolute_url }}">View the submission's page</a> </li> {% endfor %} </ul> @@ -91,18 +91,18 @@ Dear {% if object.message_style == 'F' %}{{ object.get_title_display }} {{ objec international scientific community. </p> <p> - The site is anchored at <a href="https://scipost.org">scipost.org</a>. + The site is anchored at <a href="https://{{ domain }}{% url 'scipost:index' %}">{{ domain }}</a>. Many further details about SciPost, its principles, ideals and implementation can be found at - the <a href="https://scipost.org/about">about</a> - and <a href="https://scipost.org/FAQ">FAQ</a> pages.</p> + the <a href="https://{{ domain }}{% url 'scipost:about' %}">about</a> + and <a href="https://{{ domain }}{% url 'scipost:FAQ' %}">FAQ</a> pages.</p> <p>As a professional academic, you can register at the - <a href="https://scipost.org/register">registration page</a>, + <a href="https://{{ domain }}{% url 'scipost:register' %}">registration page</a>, enabling you to contribute to the site's contents, for example by offering submissions, reports and comments. </p> <p> - For your convenience, a partly pre-filled <a href="https://scipost.org/invitation/{{ object.invitation_key }}">registration form</a> + For your convenience, a partly pre-filled <a href="https://{{ domain }}/invitation/{{ object.invitation_key }}">registration form</a> has been prepared for you (you can in any case still register at the - <a href="https://scipost.org/register">registration page</a>). + <a href="https://{{ domain }}{% url 'scipost:register' %}">registration page</a>). </p> <p> If you do develop sympathy for the initiative, besides participating in the @@ -156,18 +156,18 @@ Dear {% if object.message_style == 'F' %}{{ object.get_title_display }} {{ objec </p> <p> To help you in considering this, it would be best if you were to take - the time to look at the website itself, which is anchored at scipost.org. + the time to look at the website itself, which is anchored at {{ domain }}. Besides looking around the site, you can also personally register (to become a Contributor, without necessarily committing to membership of the Editorial College, this to be discussed separately) by visiting - the following <a href="https://scipost.org/invitation/{{ object.invitation_key }}"> + the following <a href="https://{{ domain }}/invitation/{{ object.invitation_key }}"> single-use link</a>, containing a partly pre-filled form for your convenience. </p> <p> Many details about the initiative - can then be found at scipost.org/about and at scipost.org/FAQ. + can then be found at {{ domain }}{% url 'scipost:about' %} and at {{ domain }}{% url 'scipost:FAQ' %}. Functioning of the College will proceed according to the by-laws set - out in scipost.org/EdCol_by-laws. + out in {{ domain }}{% url 'scipost:EdCol_by-laws' %}. </p> <p> Since the success of this initiative is dependent on the involvement of diff --git a/scipost_django/templates/email/registration_invitation.json b/scipost_django/templates/email/registration_invitation.json index aac60d198e6fadbaf1b1e59c849c89f90ce3da5c..486ba18f03259cb67d2868b939d267987f6e06de 100644 --- a/scipost_django/templates/email/registration_invitation.json +++ b/scipost_django/templates/email/registration_invitation.json @@ -4,8 +4,8 @@ "email" ], "bcc": [ - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Registration", - "from_email": "registration@scipost.org" + "from_email": "registration@" } diff --git a/scipost_django/templates/email/registration_invitation_reminder.json b/scipost_django/templates/email/registration_invitation_reminder.json index fcff6309d460ffcf6ec1b570e332fff61fb2d193..d04f7b7e02f454569bacd0413a6e429a8069999e 100644 --- a/scipost_django/templates/email/registration_invitation_reminder.json +++ b/scipost_django/templates/email/registration_invitation_reminder.json @@ -5,8 +5,8 @@ ], "bcc": [ "invited_by.email", - "admin@scipost.org" + "admin@" ], "from_name": "SciPost Registration", - "from_email": "registration@scipost.org" + "from_email": "registration@" } diff --git a/scipost_django/templates/email/signatory/thank_SPB_signature.html b/scipost_django/templates/email/signatory/thank_SPB_signature.html index 4ac17759d9709195aa031852561345c53b781969..f406ac41b599e78a73c2ff80fe6aa62abb89e51b 100644 --- a/scipost_django/templates/email/signatory/thank_SPB_signature.html +++ b/scipost_django/templates/email/signatory/thank_SPB_signature.html @@ -1,12 +1,13 @@ +{% load static %} <p>Many thanks for signing the petition!</p> <p>One quick and easy way to help us further is to get your colleagues to also sign. Please consider doing this, via word-of-mouth or email!</p> <p> One less quick but even more effective way to further help SciPost convince - your institution, library and/or funding agency to become Supporting Partners + your institution, library and/or funding agency to become Sponsors is to send a personalized email to one of their representatives; you can use our - <a href="mailto:?subject=Petition to support SciPost&body=[PLEASE FILL IN THE TO FIELD ABOVE (keeping partners@scipost.org in cc)]%0D%0A%0D%0ADear ...%0D%0A%0D%0A[PLEASE WRITE A PERSONALIZED MESSAGE]%0D%0A%0D%0AHere under, you will find basic information about SciPost and how you can support it.%0D%0A%0D%0ASincerely,%0D%0A[YOUR SIGNATURE]%0D%0A%0D%0A%0D%0A%0D%0ASciPost (https://scipost.org) is a top-quality next-generation Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://scipost.org/about and https://scipost.org/FAQ.%0D%0A%0D%0ASciPost follows a different funding model than most traditional publishers. It operates on an entirely not-for-profit basis, and charges neither subscription fees nor article processing charges; instead, its activities are financed through a cost-slashing consortial model.%0D%0A%0D%0ABy making a small financial commitment, the institutions and organizations that benefit from SciPost’s activities can become Supporting Partners. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the consortial funding scheme and how to join can be found at https://scipost.org/partners or by emailing partners@scipost.org.%0D%0A&cc=partners@scipost.org">template</a> as a start.</p> + <a href="mailto:?subject=Petition to support SciPost&body=[PLEASE FILL IN THE TO FIELD ABOVE (keeping sponsors@{{ domain }} in cc)]%0D%0A%0D%0ADear ...%0D%0A%0D%0A[PLEASE WRITE A PERSONALIZED MESSAGE]%0D%0A%0D%0AHere under, you will find basic information about SciPost and how you can support it.%0D%0A%0D%0ASincerely,%0D%0A[YOUR SIGNATURE]%0D%0A%0D%0A%0D%0A%0D%0ASciPost (https://{{ domain }}) is a top-quality next-generation Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://{{ domain }}{% url 'scipost:about' %} and https://{{ domain }}{% url 'scipost:FAQ' %}.%0D%0A%0D%0ASciPost follows a different funding model than most traditional publishers. It operates on an entirely not-for-profit basis, and charges neither subscription fees nor article processing charges; instead, its activities are financed through a cost-slashing consortial model.%0D%0A%0D%0ABy making a small financial commitment, the institutions and organizations that benefit from SciPost’s activities can become Sponsors. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the consortial funding scheme and how to join can be found at https://{{ domain }}{% url 'sponsors:sponsors' %} or by emailing sponsors@{{ domain }}.%0D%0A&cc=sponsors@{{ domain }}">template</a> as a start.</p> <p> - You can also point them towards details of our consortial funding scheme on our <a href="https://scipost.org/partners">Partners page</a>, and our <a href="https://scipost.org/static/scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf">one-page Prospectus</a> summarizing the scheme, which is expounded in detail in the draft <a href="https://scipost.org/static/scipost/SPB/SciPost_Supporting_Partner_Agreement.pdf">Partner Agreement</a>. + You can also point them towards details of our consortial funding scheme on our <a href="https://{{ domain }}{% url 'sponsors:sponsors' %}">Sponsors page</a>, and our <a href="https://{{ domain }}{% static 'scipost/SPB/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> summarizing the scheme, which is expounded in detail in the draft <a href="https://{{ domain }}{% static 'scipost/SPB/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement</a>. </p> <p> We are very grateful for your help. diff --git a/scipost_django/templates/email/signatory/thank_SPB_signature.json b/scipost_django/templates/email/signatory/thank_SPB_signature.json index 7f990c877060080463778079d8d6cc31e4b6add7..91f0fc1dab0aa35c2f4268e14b250ce80b9173f4 100644 --- a/scipost_django/templates/email/signatory/thank_SPB_signature.json +++ b/scipost_django/templates/email/signatory/thank_SPB_signature.json @@ -4,5 +4,5 @@ "signatory.user.email" ], "from_name": "SciPost petitions", - "from_email": "petitions@scipost.org" + "from_email": "petitions@" } diff --git a/scipost_django/templates/email/tests/test_mail_code_1.json b/scipost_django/templates/email/tests/test_mail_code_1.json index 43cae8f8bdafe878a5aed5b91b5b247732e05871..e3587c24dc78194ca60bcbe610be643d9a35721f 100644 --- a/scipost_django/templates/email/tests/test_mail_code_1.json +++ b/scipost_django/templates/email/tests/test_mail_code_1.json @@ -1,5 +1,5 @@ { "subject": "SciPost Test", - "recipient_list": ["test@scipost.org"], - "from_email": "admin@scipost.org" + "recipient_list": ["test@"], + "from_email": "admin@" } diff --git a/scipost_django/templates/email/tests/test_mail_code_fault_1.json b/scipost_django/templates/email/tests/test_mail_code_fault_1.json index 48ed00ad03592db18fc74d2b1dc7fbec47d8850b..32acadc18b4488a4ab2d54c60b7ca57f091af6bf 100644 --- a/scipost_django/templates/email/tests/test_mail_code_fault_1.json +++ b/scipost_django/templates/email/tests/test_mail_code_fault_1.json @@ -1,4 +1,4 @@ { "subject": "SciPost Test", - "from_email": "admin@scipost.org" + "from_email": "admin@" } diff --git a/scipost_django/templates/email/tests/test_mail_code_no_template_1.json b/scipost_django/templates/email/tests/test_mail_code_no_template_1.json index 43cae8f8bdafe878a5aed5b91b5b247732e05871..e3587c24dc78194ca60bcbe610be643d9a35721f 100644 --- a/scipost_django/templates/email/tests/test_mail_code_no_template_1.json +++ b/scipost_django/templates/email/tests/test_mail_code_no_template_1.json @@ -1,5 +1,5 @@ { "subject": "SciPost Test", - "recipient_list": ["test@scipost.org"], - "from_email": "admin@scipost.org" + "recipient_list": ["test@"], + "from_email": "admin@" } diff --git a/scipost_django/theses/forms.py b/scipost_django/theses/forms.py index 9939d0f4edd0b1f9fea6273f2f72602ddf0ee812..e5d93ed8a1110a5d338a4e09f4c1776700725cd2 100644 --- a/scipost_django/theses/forms.py +++ b/scipost_django/theses/forms.py @@ -3,6 +3,7 @@ __license__ = "AGPL v3" from django import forms +from django.contrib.sites.models import Site from django.core.mail import EmailMessage from django.template.loader import render_to_string @@ -96,13 +97,14 @@ class VetThesisLinkForm(BaseRequestThesisLinkForm): thesislink.delete() + domain = Site.objects.get_current().domain email = EmailMessage( subject_line, message_plain, - 'SciPost Theses <theses@scipost.org>', + f'SciPost Theses <theses@{domain}>', [thesislink.requested_by.user.email], - ['theses@scipost.org'], - reply_to=['theses@scipost.org'] + [f'theses@{domain}'], + reply_to=[f'theses@{domain}'] ).send(fail_silently=False) diff --git a/scipost_django/theses/urls.py b/scipost_django/theses/urls.py index 957ae942da90789f7b6fb73533b60ef8ed841dee..97dcd8a4b85e4ec0317f787ce2476eae8a63ff26 100644 --- a/scipost_django/theses/urls.py +++ b/scipost_django/theses/urls.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.conf.urls import include, url +from django.urls import include, path, re_path from django.views.generic import TemplateView from . import views @@ -11,10 +11,34 @@ app_name = 'theses' urlpatterns = [ # Thesis Links - url(r'^$', views.ThesisListView.as_view(), name='theses'), - url(r'^browse/(?P<nrweeksback>[0-9]{1,3})/$', views.ThesisListView.as_view(), name='browse'), - url(r'^(?P<thesislink_id>[0-9]+)/$', views.thesis_detail, name='thesis'), - url(r'^request_thesislink$', views.RequestThesisLink.as_view(), name='request_thesislink'), - url(r'^unvetted_thesislinks$', views.UnvettedThesisLinks.as_view(), name='unvetted_thesislinks'), - url(r'^vet_thesislink/(?P<pk>[0-9]+)/$', views.VetThesisLink.as_view(), name='vet_thesislink'), + path( + '', + views.ThesisListView.as_view(), + name='theses' + ), + re_path( + r'^browse/(?P<nrweeksback>[0-9]{1,3})/$', + views.ThesisListView.as_view(), + name='browse' + ), + path( + '<int:thesislink_id>/', + views.thesis_detail, + name='thesis' + ), + path( + 'request_thesislink', + views.RequestThesisLink.as_view(), + name='request_thesislink' + ), + path( + 'unvetted_thesislinks', + views.UnvettedThesisLinks.as_view(), + name='unvetted_thesislinks' + ), + path( + 'vet_thesislink/<int:pk>/', + views.VetThesisLink.as_view(), + name='vet_thesislink' + ), ] diff --git a/scipost_vue/components/Search.vue b/scipost_vue/components/Search.vue index da61bef8e4afeac86e77fb168625dc72522749db..c539a23f9e1a9d4897c6348ca3605620117271f8 100644 --- a/scipost_vue/components/Search.vue +++ b/scipost_vue/components/Search.vue @@ -212,8 +212,6 @@ export default { fetchAvailableTabs() initialQuery.value = JSON.parse(document.getElementById('json_q').textContent) }) - // Close search form in header in case it is open - onMounted(() => document.getElementById('header-search-close-btn').click()) return { availableTabs,