Ejemplo n.º 1
0
def index():
    language = session.get('lang', get_locale())
    news = controllers.get_latest_news_by_lang(language)

    tweets = controllers.get_collection_tweets()
    press_releases = controllers.get_press_releases({'language': language})

    urls = {
        'downloads': '{0}/w/accesses?collection={1}'.format(
            current_app.config['METRICS_URL'],
            current_app.config['OPAC_COLLECTION']),
        'references': '{0}/w/publication/size?collection={1}'.format(
            current_app.config['METRICS_URL'],
            current_app.config['OPAC_COLLECTION']),
        'other': '{0}/?collection={1}'.format(
            current_app.config['METRICS_URL'],
            current_app.config['OPAC_COLLECTION'])
    }

    context = {
        'news': news,
        'urls': urls,
        'tweets': tweets,
        'press_releases': press_releases,
        'journals': controllers.get_journals(query_filter="current", order_by="-last_issue.year")
    }

    return render_template("collection/index.html", **context)
Ejemplo n.º 2
0
def index():
    default_lang = current_app.config.get('BABEL_DEFAULT_LOCALE')
    language = session.get('lang', default_lang)

    news = controllers.get_latest_news_by_lang(language)

    tweets = controllers.get_collection_tweets()
    press_releases = controllers.get_press_releases({'language': language})

    urls = {
        'downloads': '{0}/w/accesses?collection={1}'.format(
                                current_app.config['OPAC_METRICS_URL'],
                                current_app.config['OPAC_COLLECTION']),
        'references': '{0}/w/publication/size?collection={1}'.format(
                                current_app.config['OPAC_METRICS_URL'],
                                current_app.config['OPAC_COLLECTION']),
        'other': '{0}/?collection={1}'.format(
                                current_app.config['OPAC_METRICS_URL'],
                                current_app.config['OPAC_COLLECTION'])
    }

    context = {
        'news': news,
        'urls': urls,
        'tweets': tweets,
        'press_releases': press_releases,
        'journals': controllers.get_journals()
    }

    return render_template("collection/index.html", **context)
Ejemplo n.º 3
0
def index():
    default_lang = current_app.config.get("BABEL_DEFAULT_LOCALE")
    language = session.get("lang", default_lang)

    news = controllers.get_latest_news_by_lang(language)
    analytics = controllers.get_collection_analytics()
    tweets = controllers.get_collection_tweets()
    press_releases = controllers.get_press_releases({"language": language})

    context = {"news": news, "analytics": analytics, "tweets": tweets, "press_releases": press_releases}

    return render_template("collection/index.html", **context)