-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
752 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
PLUGIN_NAME = 'Clockss Plugin' | ||
DESCRIPTION = 'CLOCKSS preservation plugin' | ||
AUTHOR = 'Andy Byers' | ||
VERSION = '1.0' | ||
SHORT_NAME = 'clockss' | ||
MANAGER_URL = None | ||
|
||
from utils import models | ||
|
||
|
||
def install(): | ||
new_plugin, created = models.Plugin.objects.get_or_create(name=SHORT_NAME, version=VERSION, enabled=True) | ||
|
||
if created: | ||
print('Plugin {0} installed.'.format(PLUGIN_NAME)) | ||
else: | ||
print('Plugin {0} is already installed.'.format(PLUGIN_NAME)) | ||
|
||
|
||
def hook_registry(): | ||
# On site load, the load function is run for each installed plugin to generate | ||
# a list of hooks. | ||
pass |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% load static from staticfiles %} | ||
|
||
<html> | ||
<head> | ||
<title>CLOCKSS Preservation - {{ current_year }}</title> | ||
<link href="{% static "dist/css/app.css" %}" rel="stylesheet"> | ||
{% if request.journal %}<link href="{% static "dist/css/journal" %}{{ request.journal.id }}_override.css" rel="stylesheet">{% endif %} | ||
</head> | ||
<body> | ||
<div class="row"> | ||
<div class="columns-12 large"> | ||
<h3>CLOCKSS Manifest - {{ current_year }}</h3> | ||
<h5>Archive of Issues - {{ current_year }}</h5> | ||
<ul>{% for issue in issues %} | ||
<li>{{ issue }}</li>{% endfor %} | ||
</ul> | ||
<h5>Archive of Articles - {{ current_year }}</h5> | ||
<ul>{% for article in articles %} | ||
<li>{{ article.title }}{% endfor %}</li></ul> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.conf.urls import url | ||
|
||
from plugins.clockss import views | ||
|
||
urlpatterns = [ | ||
url(r'^$', views.index, name='index'), | ||
] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from django.shortcuts import render, redirect, get_object_or_404 | ||
from django.core.urlresolvers import reverse | ||
from django.utils import timezone | ||
|
||
from journal import models | ||
from submission import models as submission_models | ||
|
||
|
||
def index(request): | ||
if not request.GET.get('year'): | ||
current_year = timezone.now().year | ||
else: | ||
current_year = request.GET.get('year') | ||
|
||
issues = models.Issue.objects.filter(date__year=current_year) | ||
articles = submission_models.Article.objects.filter(date_published__year=current_year) | ||
|
||
template = 'clockss/index.html' | ||
context = { | ||
'issues': issues, | ||
'articles': articles, | ||
'current_year': current_year, | ||
} | ||
|
||
return render(request, template, context) |