Show the current and next issues/publications, and display links
to more specific administrative pages.
Parameters:
journal_name - the journal to be administrated
ln - language
with_editor_rights - True if can edit configuration. Read-only mode otherwise
"""
ifjournal_nameisNone:
try:
journal_name=guess_journal_name(ln)
exceptInvenioWebJournalNoJournalOnServerError,e:
returne.user_box()
ifnotcan_read_xml_config(journal_name):
return'<span style="color:#f00">Configuration could not be read. Please check that %s/webjournal/%s/%s-config.xml exists and can be read by the server.</span><br/>'%(CFG_ETCDIR,journal_name,journal_name)
Go to the <a href="%(CFG_SITE_URL)s/journal/%(name)s">%(name)s journal</a> to
see the result.</span>'''%{'CFG_SITE_URL':CFG_SITE_URL,
'name':journal_name,
'recid':recid}
elifresult==1:
msg='''<span style="color:#f00"><a href="%(CFG_SITE_URL)s/record/%(recid)s">record %(recid)s</a> is already featured. Choose another one or remove it first.</span>'''% \
{'CFG_SITE_URL':CFG_SITE_URL,
'recid':recid}
else:
msg='''<span style="color:#f00">Record could not be featured. Check file permission.</span>'''
<legend>Remove featured record</legend><span style="color:#f00">Are you sure you want to remove <a href="%(CFG_SITE_URL)s/record/%(recid)s">record %(recid)s</a> from the list of featured record?
Add a new journal or configure the settings of an existing journal.
Parameters:
journal_name - the journal to configure, or name of the new journal
xml_config - the xml configuration of the journal (string)
action - One of ['edit', 'editDone', 'add', 'addDone']
ln - language
"""
msg=None
ifaction=='edit':
# Read existing config
ifjournal_nameisnotNone:
ifnotcan_read_xml_config(journal_name):
return'<span style="color:#f00">Configuration could not be read. Please check that %s/webjournal/%s/%s-config.xml exists and can be read by the server.</span><br/>'%(CFG_ETCDIR,journal_name,journal_name)
return'<span style="color:#f00">You must specify a journal name</span>'
ifactionin['editDone','addDone']:
# Save config
ifaction=='addDone':
res=add_journal(journal_name,xml_config)
ifres==-1:
msg='<span style="color:#f00">A journal with that name already exists. Please choose another name.</span>'
action='add'
elifres==-2:
msg='<span style="color:#f00">Configuration could not be written (no permission). Please manually copy your config to %s/webjournal/%s/%s-config.xml</span><br/>'%(CFG_ETCDIR,journal_name,journal_name)
action='edit'
elifres==-4:
msg='<span style="color:#f00">Cache file could not be written (no permission). Please manually create directory %s/webjournal/%s/ and make it writable for your Apache user</span><br/>'%(CFG_CACHEDIR,journal_name)