Skip to content

Commit

Permalink
Merge pull request #99 from arXiv/develop
Browse files Browse the repository at this point in the history
Pre-release merge for arXiv Browse v0.2.3
  • Loading branch information
mhl10 authored Jun 11, 2019
2 parents fd40ed0 + c2abc37 commit 943db58
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 141 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mysqlclient = "==1.4.1"
"mmh3" = "*"
aiohttp = "*"
flask = "==1.0.2"
arxiv-base = "==0.15.7"
arxiv-base = "==0.15.8.post1"
validators = "*"
mypy-extensions = "*"
flask-wtf = "*"
Expand Down
284 changes: 146 additions & 138 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion browse/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import dateutil.parser
from datetime import datetime, timedelta

APP_VERSION = '0.2.2'
APP_VERSION = '0.2.3'
"""The application version """

ON = 'yes'
Expand Down
2 changes: 2 additions & 0 deletions browse/controllers/stats_page/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def get_monthly_submissions_page() -> Response:
try:
num_submissions, historical_delta = \
get_monthly_submission_count()
num_this_month = get_document_count_by_yymm(current_dt.date)
num_submissions += num_this_month
except Exception as ex:
logger.warning(f'Error getting monthly submissions stats data: {ex}')
raise InternalServerError
Expand Down
13 changes: 13 additions & 0 deletions browse/routes/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from arxiv import status
from arxiv.base import logging
from arxiv.base.urls.clickthrough import is_hash_valid
from arxiv import taxonomy
from browse.controllers import abs_page, archive_page, home_page, list_page, \
prevnext, tb_page, stats_page
from browse.controllers.cookies import get_cookies_page, cookies_to_set
Expand Down Expand Up @@ -98,6 +99,18 @@ def abstract(arxiv_id: str) -> Response:
raise InternalServerError('Unexpected error')


@blueprint.route('category_taxonomy', methods=['GET'])
def category_taxonomy() -> Response:
"""Display the arXiv category taxonomy."""
response = {
'groups': taxonomy.definitions.GROUPS,
'archives': taxonomy.definitions.ARCHIVES_ACTIVE,
'categories': taxonomy.definitions.CATEGORIES_ACTIVE
}
return render_template('category_taxonomy.html', **response), \
status.HTTP_200_OK, None # type: ignore


@blueprint.route('tb/', defaults={'arxiv_id': ''}, methods=['GET'])
@blueprint.route('tb/<path:arxiv_id>', methods=['GET'])
def tb(arxiv_id: str) -> Response:
Expand Down
41 changes: 41 additions & 0 deletions browse/templates/category_taxonomy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{%- extends "base.html" -%}
{% block title %}Category Taxonomy{% endblock %}
{% block header_h1 %}<h1><a href="/">{{ config['BROWSE_SITE_LABEL'] }}</a> &gt; category taxonomy</h1>{% endblock %}
{# Disable login on this page for now, per classic #}
{% block login_link %}{% endblock %}

{%- block content %}
<h1>arXiv Category Taxonomy</h1>
<div id="guide" style="border-radius: 5px; border: 1px solid; width: 55%; padding-left: 5px">
<h2>Group Name</h2>
<ul>
<li>Archive Name (Archive ID) - omitted if group consists of a single archive with the same name as the group</li>
<ul>
<li><strong>Category Name (Category ID)</strong><br />Category description if available</li>
</ul>
</ul>
</div>

{%- for group_key, group_details in groups.items()|sort if not group_details.is_test -%}
<h2>{{ groups[group_key].name }}</h2>
<ul>
{%- for archive_key, archive_details in archives.items()|sort(attribute='1.name') if archives[archive_key].in_group == group_key %}
{%- set archive_url = url_for('browse.archive', archive=archive_key) if archive_key != 'cs' else 'https://arxiv.org/corr' -%}
{%- set archive_name = archives[archive_key].name -%}
{%- if not (loop.first and loop.last) -%}
<li>{{ archive_name }} ({{ archive_key }})</li>
{%- endif -%}
<ul>
{% for category_key, category_details in categories.items()|sort(attribute='1.name') if categories[category_key].in_archive == archive_key %}
<li><strong>{{ categories[category_key].name }} ({{ category_key }})</strong>
{%- if 'description' in categories[category_key] -%}
<br />{{ categories[category_key].description }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endfor -%}
</ul>
{%- endfor -%}

{% endblock content %}
1 change: 1 addition & 0 deletions browse/templates/home/news.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{#- News blurbs appear at the top of the home page. Generally there should be no more than four items. -#}
11 Jun 2019: <a href="https://arxiv.org/new/#june11_2019">Announcing a new category and category mergers</a><br/>
20 May 2019: <a href="http://bit.ly/arXivEngineer4">We are hiring: arXiv Service Reliability Engineer</a><br/>
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.2.2'
release = '0.2.3'


# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit 943db58

Please sign in to comment.