forked from I2P_Developers/i2p.www
Set up tag links for /papers
This commit is contained in:
@@ -3,7 +3,7 @@ from flask import render_template
|
||||
from i2p2www import ANONBIB_CFG, ANONBIB_FILE
|
||||
from i2p2www.anonbib import BibTeX, config
|
||||
|
||||
def papers_list(tag=None, choice=None):
|
||||
def papers_list(tag='', choice='date'):
|
||||
config.load(ANONBIB_CFG)
|
||||
rbib = BibTeX.parseFile(ANONBIB_FILE)
|
||||
if tag:
|
||||
@@ -31,11 +31,11 @@ def papers_list(tag=None, choice=None):
|
||||
rbib = BibTeX.splitSortedEntriesBy(rbib, 'year')
|
||||
|
||||
bib = {
|
||||
'title': 'Papers on I2P',
|
||||
'short_title': 'I2P Papers',
|
||||
'otherbibs': '',
|
||||
'sectiontypes': sectionType,
|
||||
'tags': config.ALL_TAGS,
|
||||
'tag_titles': config.TAG_TITLES,
|
||||
'tag_short_titles': config.TAG_SHORT_TITLES,
|
||||
'tag': tag,
|
||||
'sectiontypes': sectionType,
|
||||
'field': choice,
|
||||
}
|
||||
|
||||
|
@@ -145,13 +145,13 @@ OMIT_ENTRIES = ("proceedings", "journal")
|
||||
ALL_TAGS = ("selected", )
|
||||
|
||||
# Titles of page, by tag.
|
||||
TAG_TITLES = { "": "The Free Haven Anonymity Bibliography",
|
||||
"selected": "Free Haven's Selected Papers in Anonymity"
|
||||
TAG_TITLES = { "": "I2P Bibliography",
|
||||
"selected": "Selected I2P Papers"
|
||||
}
|
||||
|
||||
# As TAG_TITLES, but shorter.
|
||||
TAG_SHORT_TITLES = { "": "Anonymity Bibliography",
|
||||
"selected": "Selected Papers in Anonymity",
|
||||
TAG_SHORT_TITLES = { "": "I2P Bibliography",
|
||||
"selected": "Selected I2P Papers",
|
||||
}
|
||||
|
||||
# Directories where tag pages get generated.
|
||||
|
@@ -1,11 +1,26 @@
|
||||
{% extends "global/layout.html" %}
|
||||
{% block title %}{{ bib.title }}{% endblock %}
|
||||
{% block title %}{{ bib.tag_titles[bib.tag] }}{% endblock %}
|
||||
{% block headextra %}
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/pubs.css') }}" />
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<h1 align="center">{{ bib.short_title }}</h1>
|
||||
<p align="center">{{ bib.otherbibs }}</p>
|
||||
<h1 align="center">{{ bib.tag_short_titles[bib.tag] }}</h1>
|
||||
|
||||
<p align="center">
|
||||
{%- if bib.tag|length %}<a href='{% if bib.field != 'date' -%}
|
||||
{{ get_url('papers_list', choice=bib.field) }}
|
||||
{%- else %}{{ get_url('papers_list') }}{% endif %}'>
|
||||
{%- endif %}{{ bib.tag_titles[''] }}
|
||||
{%- if bib.tag|length %}</a>{% endif %}
|
||||
{%- for tag in bib.tags %} |
|
||||
{%- if tag != bib.tag %}<a href='{% if bib.field != 'date' -%}
|
||||
{{ get_url('papers_list', tag=tag, choice=bib.field) }}
|
||||
{%- else %}{{ get_url('papers_list', tag=tag) }}{% endif %}'>
|
||||
{%- endif %}{{ bib.tag_titles[tag] }}
|
||||
{%- if tag != bib.tag %}</a>{% endif %}
|
||||
{%- endfor -%}
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
{%- if bib.field != 'topic' %}{% if bib.tag -%}
|
||||
<a href='{{ get_url('papers_list', tag=bib.tag, choice='topic') }}'>
|
||||
|
Reference in New Issue
Block a user