diff --git a/config.scss b/config.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/journals/templates/journals/_publication_details.html b/journals/templates/journals/_publication_details.html index 03e1a66d1a285e4c84b6b181a2a11cd19ed31fc0..55adae3bbd06788e40af6ef16624ff944519265e 100644 --- a/journals/templates/journals/_publication_details.html +++ b/journals/templates/journals/_publication_details.html @@ -1,5 +1,3 @@ -{% load render_bundle from webpack_loader %} - <div class="row"> <div class="col-12"> <h2 class="pb-1 text-blue">{{publication.title}}</h2> @@ -31,7 +29,7 @@ </div> -<div class="modal" id="bibtextmodal" tabindex="-1" role="dialog" aria-hidden="true"> +<div class="modal" id="bibtextmodal" tabindex="-1" role="dialog" aria-hidden="true" aria-labelledby="bibtextmodal"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-body"> @@ -49,5 +47,3 @@ </div> </div> </div> - -{% render_bundle 'modal' 'js' %} diff --git a/scipost/static/scipost/assets/config/preconfig.scss b/scipost/static/scipost/assets/config/preconfig.scss index 39a77066ff241bbc146e9e7b52b6e204e32ff0cb..e41116fc88bfbdfd871cfa9383ce3ecb98d1a94c 100644 --- a/scipost/static/scipost/assets/config/preconfig.scss +++ b/scipost/static/scipost/assets/config/preconfig.scss @@ -36,6 +36,7 @@ $green: #6ebb6e; $cyan: $scipost-lightblue; $yellow: $scipost-orange; $gray-600: #ccc; +$text-muted: #636c72; // Others, now as default // $red: $red; // $gray-100: $gray-100; diff --git a/scipost/static/scipost/assets/js/modal.js b/scipost/static/scipost/assets/js/modal.js deleted file mode 100644 index cdf325ec39455b2bffa1cf60ff4c30a5759ef91b..0000000000000000000000000000000000000000 --- a/scipost/static/scipost/assets/js/modal.js +++ /dev/null @@ -1,6 +0,0 @@ -require('bootstrap-loader'); - -jQuery('[data-toggle="modal"]').on('click', function(){ - var target = $(this).attr('data-target'); - $(target).modal('show'); -}); diff --git a/scipost/static/scipost/assets/js/scripts.js b/scipost/static/scipost/assets/js/scripts.js index ff2b6d6312ad34227951b20ec566e1ba7841ace8..6dfe09de3b42b5601b25d5bc9dba53bae26f456f 100644 --- a/scipost/static/scipost/assets/js/scripts.js +++ b/scipost/static/scipost/assets/js/scripts.js @@ -1,13 +1,42 @@ +import tooltip from './tooltip.js'; + function hide_all_alerts() { $(".alert").fadeOut(300); } +var getUrlParameter = function getUrlParameter(sParam) { + var sPageURL = decodeURIComponent(window.location.search.substring(1)), + sURLVariables = sPageURL.split('&'), + sParameterName, + i; + + for (i = 0; i < sURLVariables.length; i++) { + sParameterName = sURLVariables[i].split('='); + + if (sParameterName[0] === sParam) { + return sParameterName[1] === undefined ? true : sParameterName[1]; + } + } +}; + $(function(){ - // Remove all alerts in screen automatically after 10sec. - setTimeout(function() {hide_all_alerts()}, 10000); + // Remove all alerts in screen automatically after 15sec. + setTimeout(function() {hide_all_alerts()}, 15000); // Start general toggle $('[data-toggle="toggle"]').on('click', function() { $($(this).attr('data-target')).toggle(); }); + + // Show right tab if url contains `tab` GET request + var tab = getUrlParameter('tab') + if (tab) { + $('a[href="#' + tab + '"][data-toggle="tab"]').tab('show'); + } + + // Change `tab` GET parameter for page-reload + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + var tab_name = e.target.hash.substring(1) + window.history.replaceState({}, null, '?tab=' + tab_name); + }); }); diff --git a/scipost/static/scipost/assets/js/tooltip.js b/scipost/static/scipost/assets/js/tooltip.js index eaba2651c063e2e54a6be9787186e46b0d61c249..1542867e52fa2936c8a818e9fa08b33a293ed78c 100644 --- a/scipost/static/scipost/assets/js/tooltip.js +++ b/scipost/static/scipost/assets/js/tooltip.js @@ -1,5 +1,5 @@ -require('bootstrap-loader'); - jQuery('[data-toggle="tooltip"]').tooltip({ animation: false, + fallbackPlacement: 'clockwise', + placement: 'auto' }); diff --git a/scipost/templates/scipost/about.html b/scipost/templates/scipost/about.html index eebe1181be5753a28268a1b63b6488f6f280ab0d..0b9e87cdcfbc52898db555f0abaa26f980c42149 100644 --- a/scipost/templates/scipost/about.html +++ b/scipost/templates/scipost/about.html @@ -1,5 +1,5 @@ {% extends 'scipost/base.html' %} -{% load render_bundle from webpack_loader %} + {% block pagetitle %}: About{% endblock pagetitle %} {% load staticfiles %} @@ -185,7 +185,6 @@ {% endblock content %} {% block footer_script %} -{{block.super}} - {% render_bundle 'tooltip' 'js' %} + {{block.super}} <script src="{% static 'scipost/about.js' %}"></script> {% endblock %} diff --git a/submissions/templates/partials/submissions/admin/editorial_admin_summary.html b/submissions/templates/partials/submissions/admin/editorial_admin_summary.html index 5d8c754470bb3573e32c6558ef502908143b8117..2429f5cc7208e226770ba7dd419ca6ab483c9f1c 100644 --- a/submissions/templates/partials/submissions/admin/editorial_admin_summary.html +++ b/submissions/templates/partials/submissions/admin/editorial_admin_summary.html @@ -1,7 +1,6 @@ {% load guardian_tags %} {% load scipost_extras %} {% load submissions_extras %} -{% load render_bundle from webpack_loader %} <h5 class="pb-0">{{submission.get_subject_area_display}}</h5> @@ -143,7 +142,3 @@ <div id="eventslist"> {% include 'submissions/submission_event_list.html' with events=submission.events.for_eic %} </div> - -{% block footer_script %} - {% render_bundle 'tooltip' 'js' %} -{% endblock %} diff --git a/submissions/templates/partials/submissions/admin/submission_tooltip.html b/submissions/templates/partials/submissions/admin/submission_tooltip.html index 21149b9984934c660ebcb527c134125dad71bfa2..c2968b9a79145bbd96ea69ada144e497ee8f85a3 100644 --- a/submissions/templates/partials/submissions/admin/submission_tooltip.html +++ b/submissions/templates/partials/submissions/admin/submission_tooltip.html @@ -1,4 +1,4 @@ -<span class="circle-clickable no-break" data-toggle="tooltip" data-html="true" data-placement='right' +<span class="circle-clickable no-break" data-toggle="tooltip" data-html="true" title=" {{submission.arxiv_identifier_w_vn_nr}}<hr>Status: {{submission.get_status_display}}<br>Latest activity: {{submission.latest_activity}} ">?</span> diff --git a/submissions/templates/submissions/admin/editorial_admin.html b/submissions/templates/submissions/admin/editorial_admin.html index 2ce345e547cf2f4c783fecbefc9c35b75a00af86..b4bb315cb883119da6bead8ec95cce00e582a507 100644 --- a/submissions/templates/submissions/admin/editorial_admin.html +++ b/submissions/templates/submissions/admin/editorial_admin.html @@ -7,6 +7,7 @@ <span class="breadcrumb-item">Editorial Administration</span> {% endblock %} + {% block content %} <div class="row"> <div class="col-md-7"> diff --git a/webpack.config.js b/webpack.config.js index f24fa865cf54659b7fd00170862292d3787274df..54f4a619ad056e5ab3e515ec862394c1aedff8f5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,8 +15,6 @@ module.exports = { homepage: [ "./scipost/static/scipost/assets/js/newsticker.js", ], - tooltip: "./scipost/static/scipost/assets/js/tooltip.js", - modal: "./scipost/static/scipost/assets/js/modal.js", }, output: { path: path_bundles, @@ -29,7 +27,7 @@ module.exports = { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: "style-loader", - use: "css-loader" + use: "css-loader", }) }, { @@ -43,7 +41,7 @@ module.exports = { test: /\.scss$/, loader: ExtractTextPlugin.extract({ fallback: "style-loader", - use: "css-loader!sass-loader", + use: "css-loader!sass-loader" }) } ] @@ -53,22 +51,22 @@ module.exports = { $: "jquery", jQuery: "jquery", "window.jQuery": "jquery", - Tether: "tether", - "window.Tether": "tether", - Alert: "exports-loader?Alert!bootstrap/js/dist/alert", - Collapse: "exports-loader?Collapse!bootstrap/js/dist/collapse", Util: "exports-loader?Util!bootstrap/js/dist/util", Popper: ['popper.js', 'default'], }), new BundleTracker({ filename: './webpack-stats.json' }), - new ExtractTextPlugin('css/[name]-[hash].css'), + new ExtractTextPlugin({ + filename: 'css/[name]-[hash].css', + }), new CleanWebpackPlugin(['css', 'js'], { root: path_bundles, - verbose: true, dry: false, exclude: [] - }) + }), + new webpack.optimize.UglifyJsPlugin(), + new webpack.optimize.OccurrenceOrderPlugin(), + new webpack.optimize.AggressiveMergingPlugin() ], }