diff --git a/invenio/base/bundles.py b/invenio/base/bundles.py index 5654ef1c7..3804e33ff 100644 --- a/invenio/base/bundles.py +++ b/invenio/base/bundles.py @@ -1,195 +1,198 @@ # -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """Base bundles. .. py:data:: invenio Invenio JavaScript scripts .. py:data:: styles Stylesheets such as Twitter Bootstrap, Font-Awesome, Invenio, ... .. py:data:: jquery JavaScript libraries such as jQuery, Type Ahead, Bootstrap, Hogan, ... .. note:: ``bootstrap.js`` provides ``$.fn.button`` which will be overwritten by jQueryUI button when loaded globally. Use require.js to load only the jQueryUI modules of your needs. .. code-block:: javascript require(['jquery', 'ui/accordion'], function($) { $(function(){ $('#accordion').accordion() }) }) .. py:data:: lessjs LessCSS JavaScript library that is used in debug mode to render the less stylesheets .. py:data:: requirejs Require.js JavaScript library used in debug mode to load asynchronously the Javascript modules (defined using AMD). .. py:data:: almondjs Require.js JavaScript library used in production mode. It cannot load asynchronously the module that must be bundles using ``r.js``. """ import mimetypes from invenio.ext.assets import Bundle mimetypes.add_type("text/css", ".less") invenio = Bundle( "js/invenio.js", output="invenio.js", filters="requirejs", weight=90 ) styles = Bundle( "vendors/jquery-tokeninput/styles/token-input.css", "vendors/jquery-tokeninput/styles/token-input-facebook.css", "vendors/typeahead.js-bootstrap3.less/typeahead.css", "less/base.less", + "less/user-menu.less", + "less/sticky-footer.less", + "less/footer.less", output="invenio.css", depends=[ "less/base.less", "less/base/**/*.less" ], filters="less,cleancss", weight=50, bower={ "bootstrap": "3.2.0", "font-awesome": "4.1.0", "typeahead.js-bootstrap3.less": "0.2.3", } ) # FIXME #if config.CFG_WEBSTYLE_TEMPLATE_SKIN != "default": # styles.contents.append("css/" + config.CFG_WEBSTYLE_TEMPLATE_SKIN + ".css") jquery = Bundle( "vendors/jquery/dist/jquery.js", "vendors/jquery.jeditable/index.js", "vendors/jquery-tokeninput/src/jquery.tokeninput.js", "vendors/jquery.caret/dist/jquery.caret-1.5.2.js", "vendors/typeahead.js/dist/typeahead.bundle.js", "vendors/hogan/web/builds/3.0.2/hogan-3.0.2.js", "vendors/bootstrap/dist/js/bootstrap.js", "js/bootstrap-select.js", "js/translate.js", "js/init.js", output="jquery.js", filters="requirejs", weight=10, bower={ # The dependencies marked as *orphan* are not part of any bundles # and loaded manually using the script tag. Usually from legacy pages. "flot": "latest", # orphan "jquery": "~1.11", "jquery.caret": "https://github.com/acdvorak/jquery.caret.git", "jquery-form": "latest", # orphan "jquery.hotkeys": "https://github.com/jeresig/" # orphan "jquery.hotkeys.git", "jquery.jeditable": "http://invenio-software.org/download/jquery/" "v1.5/js/jquery.jeditable.mini.js", "jquery-migrate": "latest", # orphan "jquery-multifile": "svn+http://jquery-multifile-plugin.googlecode.com" "/svn/", # orphan "jquery-tablesorter": "http://invenio-software.org/download/jquery/" "jquery.tablesorter.20111208.zip", # orphan "jquery-tokeninput": "latest", "jquery.treeview": "latest", # orphan, to be replaced by jqTree "json2": "latest", # orphan "hogan": "~3", "MathJax": "~2.4", # orphan "swfobject": "latest", # orphan "typeahead.js": "latest", "uploadify": "latest" # orphan #"bootstrap": "*", is set by invenio.css already. } ) # TO BE REMOVED AND LOADED INDIVIDUALLY. jqueryui = Bundle( "js/jquery-ui.js", filters="requirejs", output="jquery-ui.js", weight="11" ) # less.js is only used when the following configuration is set: # # - ASSETS_DEBUG is True # - LESS_RUN_IN_DEBUG is False # lessjs = Bundle( "vendors/less/dist/less-1.7.0.js", output="less.js", filters="uglifyjs", weight=0, bower={ "less": "latest" } ) # require.js is only used when: # # - ASSETS_DEBUG is True # - REQUIREJS_RUN_IN_DEBUG is not False requirejs = Bundle( "vendors/requirejs/require.js", "js/settings.js", output="require.js", filters="uglifyjs", weight=0, bower={ "requirejs": "latest", "requirejs-hogan-plugin": "latest" } ) # almond.js is only used when: # # - ASSETS_DEBUG is False # - or REQUIREJS_RUN_IN_DEBUG is True almondjs = Bundle( "vendors/almond/almond.js", "js/settings.js", output="almond.js", filters="uglifyjs", weight=0, bower={ "almond": "latest" } ) diff --git a/invenio/base/static/less/base.less b/invenio/base/static/less/base.less index 8fca767fa..3d22be508 100644 --- a/invenio/base/static/less/base.less +++ b/invenio/base/static/less/base.less @@ -1,188 +1,93 @@ /** * -*- mode: text; coding: utf-8; -*- * * This file is part of Invenio. * Copyright (C) 2014 CERN. * Invenio is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * Invenio is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Invenio; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ @charset "utf-8"; @import "../vendors/bootstrap/less/bootstrap.less"; @import "../vendors/font-awesome/less/font-awesome.less"; // Setting the path to fonts files. @icon-font-path: "/vendors/bootstrap/fonts/"; @fa-font-path: "/vendors/font-awesome/fonts"; //@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.1.0/fonts"; -body { - padding-top: 70px; -} - -#footer a, #footer a:hover { - color: #666; -} -#footer, #footer p { - font-size: 11px; - color: #333; -} - -#footer .langs { - text-align: right; -} +@footer-height: 150px; h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: bold; } -/* Lastly, apply responsive CSS fixes as necessary */ -@media (max-width: @screen-sm-min) { - #footer { - margin-left: -20px; - margin-right: -20px; - padding-left: 20px; - padding-right: 20px; - } -} - .navbar-brand img { height: 20px; opacity: 0.6; } .navbar-brand:hover img { opacity: 0.95; } /* to display icon inline with text at a button */ .btn-inline-icon-hide-sm span { display: inline !important; /* to overwrite bootstrap's important */ } @media (max-width: @screen-md-min) { .btn-inline-icon-hide-sm span { display: none !important; /* to overwrite important above*/ } } /* to make inline sub-forms fields stick together */ .right-not-rounded { border-bottom-right-radius: 0px; border-top-right-radius: 0px; } .left-not-rounded { border-bottom-left-radius: 0px; border-top-left-radius: 0px; } .no-padding { padding: 0px; } /* END */ legend [class*="icon-"] { vertical-align: baseline; } a.label, a.label:hover, .label a, .label a:hover { color: white;} .htmlbrief .media-heading { font-weight: 200; } .icon.muted { opacity: 0.6; } .list-group-item.active a { color: #ffffff; background-color: #3276B1; } .list-group-item.active { background-color: #3276B1; } .panel-bot-margin { margin-bottom: 10px; } -/* ------------------------ Stick footer ----------------------- */ -/* Reference: http://getbootstrap.com/examples/sticky-footer/sticky-footer.css */ -html, -body { - height: 100%; - /* The html and body elements cannot have any padding or margin. */ -} - -/* Wrapper for page content to push down footer */ -#wrap { - min-height: 100%; - height: auto; - /* Negative indent footer by its height */ - margin: 0 auto -150px; - /* Pad bottom by footer height */ - padding: 0 0 150px; -} - -/* Set the fixed height of the footer here */ -#footer { - height: 150px; -} - -/* Special class on .container surrounding .navbar, used for positioning it into place. */ - -.navbar-wrapper { - position:absolute; - top: 0; - left: 0; - right: 0; - z-index: 20; - margin-top: 20px; - .container { - padding-left:0; - padding-right: 0; - } - .navbar { - padding-left: 15px; - padding-right: 15px; - } -} - -.navbar-content { - width: 300px; - padding: 15px; - padding-bottom: 0; - - &:before, &:after { - display: table; - content: ""; - line-height: 0; - } -} - -.navbar-nav.navbar-right:last-child { - margin-right: 15px !important; -} - -.navbar-footer { - background-color:#DDD; -} - -.navbar-footer-content { - padding:15px; -} - -.dropdown-menu { - padding: 0px; - overflow: hidden; -} diff --git a/invenio/base/static/less/footer.less b/invenio/base/static/less/footer.less new file mode 100644 index 000000000..631de0709 --- /dev/null +++ b/invenio/base/static/less/footer.less @@ -0,0 +1,45 @@ +/** + * -*- mode: text; coding: utf-8; -*- + * + * This file is part of Invenio. + * Copyright (C) 2014 CERN. + + * Invenio is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Invenio is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Invenio; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +@import (reference) "base.less"; + +#footer a, #footer a:hover { + color: @text-muted; +} + +#footer, #footer p { + font-size: @font-size-small; + color: @text-muted; +} + +#footer .langs { + text-align: right; +} + +/* Lastly, apply responsive CSS fixes as necessary */ +@media (max-width: @screen-sm-min) { + #footer { + margin-left: -@line-height-computed; + margin-right: -@line-height-computed; + padding-left: @line-height-computed; + padding-right: @line-height-computed; + } +} diff --git a/invenio/base/static/less/sticky-footer.less b/invenio/base/static/less/sticky-footer.less new file mode 100644 index 000000000..a20d1f46e --- /dev/null +++ b/invenio/base/static/less/sticky-footer.less @@ -0,0 +1,46 @@ +/** + * -*- mode: text; coding: utf-8; -*- + * + * This file is part of Invenio. + * Copyright (C) 2014 CERN. + + * Invenio is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Invenio is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Invenio; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +@import (reference) "base.less"; + +/* +----------------------- Stick footer ----------------------- */ +/* Reference: http://getbootstrap.com/examples/sticky-footer/sticky-footer.css */ +html, +body { + height: 100%; + /* The html and body elements cannot have any padding or margin. */ +} + +/* Wrapper for page content to push down footer */ +#wrap { + min-height: 100%; + height: auto; + /* Negative indent footer by its height */ + margin: 0 auto -@footer-height; + /* Pad bottom by footer height */ + padding: 0 0 @footer-height; +} + +/* Set the fixed height of the footer here */ +#footer { + height: @footer-height; +} diff --git a/invenio/base/static/less/user-menu.less b/invenio/base/static/less/user-menu.less new file mode 100644 index 000000000..c9f042a3f --- /dev/null +++ b/invenio/base/static/less/user-menu.less @@ -0,0 +1,61 @@ +/** + * -*- mode: text; coding: utf-8; -*- + * + * This file is part of Invenio. + * Copyright (C) 2014 CERN. + + * Invenio is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Invenio is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Invenio; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +@import (reference) "base.less"; + +/* Special class on .container surrounding .navbar, used for positioning it into place. */ + +.navbar-wrapper { + position:absolute; + top: @line-height-computed; + left: @line-height-computed; + right: @line-height-computed; + z-index: 20; + margin-top: @line-height-computed; + .container { + padding-left: @padding-large-horizontal; + padding-right: @padding-large-horizontal; + } + .navbar { + padding-left: @line-height-computed; + padding-right: @line-height-computed; + } +} + +.navbar-content { + width: @modal-sm; + padding: @padding-large-horizontal; + padding-bottom: @padding-xs-vertical; + .clearfix; +} + +.navbar-nav.navbar-right:last-child { + margin-right: @line-height-computed !important; +} + +.navbar-footer { + background-color:@navbar-default-toggle-hover-bg; +} + +.dropdown-menu { + padding: @padding-xs-vertical; + overflow: hidden; +} diff --git a/invenio/base/templates/header_base.html b/invenio/base/templates/header_base.html index 89b5f3a0b..dec50875a 100644 --- a/invenio/base/templates/header_base.html +++ b/invenio/base/templates/header_base.html @@ -1,113 +1,113 @@ {# ## This file is part of Invenio. ## Copyright (C) 2012, 2013, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #} {# ## This file contains header part of main page template. ## ## Usage: ## {% include 'header.html' %} #} -