-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from cul-it/develop
Pre-release merge for v0.2
- Loading branch information
Showing
9 changed files
with
68 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,11 +49,11 @@ Add it to your ``requirements.txt`` file. For the time being, we'll | |
distribute directly from GitHub. To use a specific version, for example, you | ||
would write: | ||
|
||
``-e git://github.com/cul-it/arxiv-base-ui[email protected]#egg=arxiv-base-ui`` | ||
``-e git://github.com/cul-it/[email protected]#egg=arxiv-base`` | ||
|
||
Or if this repo is private, and you want to install a specific commit: | ||
|
||
``-e git+ssh://[email protected]/cul-it/arxiv-base-ui.git@d9af6c670afdf6f0fda6d92f7b110dcd60514f4a#egg=arxiv-base-ui`` | ||
``-e git+ssh://[email protected]/cul-it/arxiv-base.git@d9af6c670afdf6f0fda6d92f7b110dcd60514f4a#egg=arxiv-base`` | ||
|
||
See the [pip documentation](https://pip.pypa.io/en/latest/reference/pip_install/#git) | ||
for details. | ||
|
@@ -64,23 +64,23 @@ templates and static files available to you. For example, in your | |
|
||
```python | ||
from flask import Flask | ||
from baseui import BaseUI | ||
from arxiv.base import Base | ||
from someapp import routes | ||
|
||
|
||
def create_web_app() -> Flask: | ||
app = Flask('someapp') | ||
app.config.from_pyfile('config.py') | ||
|
||
BaseUI(app) # Registers the base UI blueprint. | ||
Base(app) # Registers the base/UI blueprint. | ||
app.register_blueprint(routes.blueprint) # Your blueprint. | ||
return app | ||
``` | ||
|
||
You can now extend base templates, e.g.: | ||
|
||
```html | ||
{%- extends "baseui/base.html" %} | ||
{%- extends "base/base.html" %} | ||
|
||
{% block content %} | ||
Hello world! | ||
|
@@ -90,17 +90,17 @@ Hello world! | |
And use static files in your templates, e.g.: | ||
|
||
``` | ||
{{ url_for('baseui.static', filename='images/CUL-reduced-white-SMALL.svg') }} | ||
{{ url_for('base.static', filename='images/CUL-reduced-white-SMALL.svg') }} | ||
``` | ||
|
||
## Editing and compiling sass | ||
|
||
The file arxivstyle.css should never be edited directly. It is compiled from arxivstyle.sass with this command from project directory root: | ||
```sass baseui/static/sass/arxivstyle.sass:baseui/static/css/arxivstyle.css``` | ||
```sass base/static/sass/arxivstyle.sass:base/static/css/arxivstyle.css``` | ||
|
||
or you can use the ``--watch`` option to autocompile on any changed file: | ||
|
||
```sass --watch baseui/static/sass/arxivstyle.sass:baseui/static/css/arxivstyle.css``` | ||
```sass --watch base/static/sass/arxivstyle.sass:baseui/static/css/arxivstyle.css``` | ||
|
||
Bulma source files are included in the ``static/sass`` directory so that variables can be overridden directly during compile. The ``arxivstyle.sass`` file has been written to do this; do not edit it. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Provides application for development purposes.""" | ||
|
||
from base.factory import create_web_app | ||
from arxiv.base.factory import create_web_app | ||
|
||
app = create_web_app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,27 @@ | |
import os | ||
|
||
SERVER_NAME = None | ||
|
||
ARXIV_TWITTER_URL = os.environ.get('ARXIV_TWITTER_URL', | ||
'https://twitter.com/arxiv') | ||
ARXIV_SEARCH_BOX_URL = os.environ.get('SEARCH_BOX_URL', '/search') | ||
ARXIV_SEARCH_ADVANCED_URL = os.environ.get('ARXIV_SEARCH_ADVANCED_URL', | ||
'/search/advanced') | ||
ARXIV_ACCOUNT_URL = os.environ.get('ACCOUNT_URL', '/user') | ||
ARXIV_LOGIN_URL = os.environ.get('LOGIN_URL', '/user/login') | ||
ARXIV_LOGOUT_URL = os.environ.get('LOGOUT_URL', '/user/logout') | ||
ARXIV_HOME_URL = os.environ.get('ARXIV_HOME_URL', 'https://arxiv.org') | ||
ARXIV_HELP_URL = os.environ.get('ARXIV_HELP_URL', '/help') | ||
ARXIV_CONTACT_URL = os.environ.get('ARXIV_CONTACT_URL', '/help/contact') | ||
ARXIV_BLOG_URL = os.environ.get('ARXIV_BLOG_URL', | ||
"https://blogs.cornell.edu/arxiv/") | ||
ARXIV_WIKI_URL = os.environ.get( | ||
'ARXIV_WIKI_URL', | ||
"https://confluence.cornell.edu/display/arxivpub/arXiv+Public+Wiki" | ||
) | ||
ARXIV_ACCESSIBILITY_URL = os.environ.get( | ||
'ARXIV_ACCESSIBILITY_URL', | ||
"mailto:[email protected]" | ||
) | ||
ARXIV_LIBRARY_URL = os.environ.get('ARXIV_LIBRARY_URL', | ||
'https://library.cornell.edu') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<div class="columns" role="navigation" aria-label="Secondary"> | ||
<div class="column"> | ||
<ul class="nav-spaced"> | ||
<li><a href="/help/contact">Contact</a></li> | ||
<li><a href="https://twitter.com/arxiv">Find us on Twitter</a></li> | ||
<li><a href="{{ config_url('contact') }}">Contact</a></li> | ||
<li><a href="{{ config_url('twitter') }}">Find us on Twitter</a></li> | ||
</ul> | ||
</div> | ||
<div class="column"> | ||
<ul class="nav-spaced"> | ||
<li><a href="https://blogs.cornell.edu/arxiv/">Blog - the latest news</a></li> | ||
<li><a href="https://confluence.cornell.edu/display/arxivpub/arXiv+Public+Wiki">Wiki - project documentation</a></li> | ||
<li><a href="{{ config_url('blog') }}">Blog - the latest news</a></li> | ||
<li><a href="{{ config_url('wiki') }}">Wiki - project documentation</a></li> | ||
</ul> | ||
</div> | ||
<div class="column"> | ||
<ul class="nav-spaced"> | ||
<li><a href="mailto:web-accessibility@cornell.edu">Web Accessibility Help</a></li> | ||
<li><a href="/help">Help with using arXiv</a></li> | ||
<li><a href="{{ config_url('accessibility') }}">Web Accessibility Help</a></li> | ||
<li><a href="{{ config_url('help') }}">Help with using arXiv</a></li> | ||
</ul> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<!-- contains Cornell logo and sponsor statement --> | ||
<div class="attribution level is-marginless" role="banner"> | ||
<div class="level-left"> | ||
<a class="level-item" href="https://library.cornell.edu"><img src="{{ url_for('base.static', filename='images/CUL-reduced-white-SMALL.svg') }}" alt="Cornell University Library" width="300" aria-label="logo" /></a> | ||
<a class="level-item" href="{{ config_url('library') }}"><img src="{{ url_for('base.static', filename='images/CUL-reduced-white-SMALL.svg') }}" alt="Cornell University Library" width="300" aria-label="logo" /></a> | ||
</div> | ||
<div class="level-right"><p class="sponsors level-item">We gratefully acknowledge support from<br /> the Simons Foundation and member institutions</p></div> | ||
</div> | ||
<!-- contains arXiv identity and search bar --> | ||
<div class="identity level is-marginless"> | ||
<div class="level-left"> | ||
<h1 class="level-item"><a href="" aria-label="arxiv-logo">arXiv.org</a></h1> | ||
<h1 class="level-item"><a href="{{ config_url('home') }}" aria-label="arxiv-logo">arXiv.org</a></h1> | ||
</div> | ||
{{ macros.compactsearch('level-right') }} | ||
{{ macros.compactsearch(config_url, 'level-right') }} | ||
</div> <!-- closes identity --> | ||
<div class="user-tools box is-pulled-right" role="navigation" aria-label="User menu"><a href="">Login</a> | <a href="">My Account</a> | <a href="">Logout</a></div> | ||
<div class="user-tools box is-pulled-right" role="navigation" aria-label="User menu"><a href="{{ config_url('login') }}">Login</a> | <a href="{{ config_url('account') }}">My Account</a> | <a href="{{ config_url('logout') }}">Logout</a></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ jsonschema==2.6.0 | |
mypy==0.560 | ||
pylint==1.8.2 | ||
coverage==4.4.2 | ||
coveralls==1.2.0 |