Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions install/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"group": {
"name": "plugin:eprints"
},
"setting": {
"description": "Enable eprints.",
"is_translatable": false,
"name": "eprints_enabled",
"pretty_name": "Enable eprints",
"type": "boolean"
},
"value": {
"default": ""
}
}
]
2 changes: 1 addition & 1 deletion logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def import_articles_to_journal(request):

for article in json_content:

section, created = models.Section.objects.language('en').get_or_create(
section, created = models.Section.objects.get_or_create(
journal=request.journal,
name=capfirst(article.get('type'))
)
Expand Down
32 changes: 21 additions & 11 deletions plugin_settings.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
from utils import models, plugins
from utils.install import update_settings

PLUGIN_NAME = 'eprints'
DESCRIPTION = 'Imports Eprints articles.'
AUTHOR = 'Andy Byers'
VERSION = '1.1'
SHORT_NAME = 'eprints'
MANAGER_URL = 'eprints_index'
JANEWAY_VERSION = "1.3.6"
JANEWAY_VERSION = "1.3.10"

from utils import models

class EprintsPlugin(plugins.Plugin):
plugin_name = PLUGIN_NAME
display_name = PLUGIN_NAME
description = DESCRIPTION
author = AUTHOR
short_name = SHORT_NAME

def install():
new_plugin, created = models.Plugin.objects.get_or_create(name=SHORT_NAME, version=VERSION, enabled=True)
manager_url = MANAGER_URL

version = VERSION
janeway_version = "1.4.0"

if created:
print('Plugin {0} installed.'.format(PLUGIN_NAME))
else:
print('Plugin {0} is already installed.'.format(PLUGIN_NAME))
is_workflow_plugin = False

models.PluginSetting.objects.get_or_create(name='eprints_enabled', plugin=new_plugin, types='boolean',
pretty_name='Enable eprints', description='Enable eprints',
is_translatable=False)

def install():
EprintsPlugin.install()
update_settings(
file_path='plugins/eprints/install/settings.json',
)


def hook_registry():
Expand Down