Page MenuHomec4science

new_base.html
No OneTemporary

File Metadata

Created
Tue, Jun 4, 07:16

new_base.html

{#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#}
{% extends "page.html" %}
{% from "_formhelpers.html" import render_field with context %}
{% block title %}{% endblock %}
{% block body %}
{% if not is_new %}
<div id="deletemodal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="deletemodal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 id="deletemodal_label">Delete community?</h3>
</div>
<div class="modal-body">
<div class="alert alert-danger"><h5>Warning</h5><ul><li>You will loose all connections to records currently attached to this community and you will not be able to recover them.</li><li>Any external repository harvesting your community collection will stop working.</li></ul></div>
</div>
<div class="modal-footer">
<form action="{{url_for('.delete', community_id=community.id)}}" method="POST">
{%- for field in deleteform %}{{ field }}{% endfor %}
<button class="btn btn-large" data-dismiss="modal" aria-hidden="true">No, thanks</button>
<button type="submit" href="{{ url_for('.delete', community_id=community.id) }}" class="btn btn-danger"><i class="icon-trash icon-white"></i> Yes, delete</button>
</form>
</div>
</div>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-12">
<h1>{% if is_new -%}
<i class="icon-plus"></i> {{ _("New community") }}
{%- else -%}
<i class="icon-edit"></i> {{ _("Edit community") }}
{%- endif %}</h1>
</div>
</div>
<div class="row">
<div id="file_container" class="col-md-8">
<form action="." method="POST" id="edit_form" class="form-horizontal" role="form">
<div class="panel-group">
{% if not is_new %}
<div class="panel panel-default">
<div class="panel-heading">
<span class="panel-toggle text-muted pull-right"></span>
<a class="panel-toggle" data-toggle="collapse" data-idx="0" href="#collapse0">Community URLs<b class="caret"></b></a>
</div>
<div id="collapse0" class="panel-body collapse in">
<div class="panel-inner">
<fieldset>
<div class="form-group">
<label class="control-label col-md-3"><i class="icon-share"></i>Collection URL:</label>
<div class="controls col-md-9"><a href="{{ community.community_url }}">{{config.CFG_SITE_URL}}{{ community.community_url }}</a>
<p class="text-muted field-desc"><small>Above address links directly to your community collection.</small></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3"><i class="icon-share"></i>Upload URL:</label>
<div class="controls col-md-9"><a href="{{ community.upload_url }}">{{config.CFG_SITE_URL}}{{ community.upload_url }}</a>
<p class="text-muted field-desc"><small>Above address will automatically ensure people who use it will have their record added to your community collection.</small></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3"><i class="icon-share"></i>Curation URL:</label>
<div class="controls col-md-9"><a href="{{ community.community_provisional_url }}">{{config.CFG_SITE_URL}}{{ community.community_provisional_url }}</a>
<p class="text-muted field-desc"><small>Above address links to your private curation URL. You will find all uploads pending your curation.</small></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3"><i class="icon-share"></i>Harvesting URL:</label>
<div class="controls col-md-9"><a href="{{ community.oai_url }}">{{config.CFG_SITE_URL}}{{ community.oai_url }}</a>
<p class="text-muted field-desc"><small>Above address links to a OAI-PMH feed, which can be used by other digital repositories to harvest this community collection.</small></p>
</div>
</div>
</fieldset>
</div>
</div>
</div>
{% endif %}
{%- for title, fieldnames, conf in form.field_sets %}
<div class="panel panel-default">
{%- if title %}
<div class="panel-heading">
<span class="panel-toggle text-muted pull-right">{{conf.state}}</span>
<a class="panel-toggle" data-toggle="collapse" data-idx="{{loop.index}}" href="#collapse{{loop.index}}">{{title}} <b class="caret"></b></a>
</div>
{%- endif %}
<div id="collapse{{loop.index}}" class="panel-body collapse{% if conf.classes %} {{conf.classes}}{% endif %}">
<div class="panel-inner">
{%- if conf.description %}
<p>{{ conf.description|urlize }}</p>
{%- endif %}
{% if not is_new %}
<fieldset>
<div class="form-group field-identifier">
<label class="control-label col-md-3" for="identifier">
<i class="icon-barcode"></i> Identifier
</label>
<div class="controls col-md-9">
<input class="form-control" type="text" disabled value="{{community.id}}">
<p class="text-muted help-block field-desc"><small>The identifier cannot be changed after creation of the community.</small></p>
</div>
</div>
</fieldset>
{% endif %}
<fieldset>
{%- for f in fieldnames %}
{% if f == '-' %}<hr />
{%- else %}
{%- set field = form.get_field_by_name(f) %}
{% if field %}
<div class="form-group field-{{ field.name }}{% if field.errors %} error{% endif %}">
<label class="control-label{{' required' if field.required else ''}} col-md-3" for="{{field.label.field_id}}">
{%- if field._icon_html or form.get_field_icon(f) %}
{% if form.get_field_icon(f) %}<i class="icon-{{ form.get_field_icon(f) }}"></i>{% else %}{{ field._icon_html|safe }}{% endif %}
{%- endif %}
{{ field.label.text }}
</label>
<div class="controls col-md-9">
{% if form.has_autocomplete(field) %}
<div id="{{f}}_values" class="col-md-5 tag-values"><ul class="unstyled">{% if f == "funding_source" %}{% for tag in field.get_tags() %}<li class="alert alert-info tag" data-tag-id="{{tag.grant_agreement_number}}"><button type="button" class="close" data-dismiss="alert">&times;</button>{{tag.label}}</li>{% endfor %}{% endif %}</ul></div>
{% endif %}
{%- if field.type == "Date" %}
{{ field(class_="form-control col-md-2 " + field.short_name, placeholder=form.get_field_placeholder(f)) }}
{%- else %}
{{ field(class_="form-control col-md-5 " + field.short_name, placeholder=form.get_field_placeholder(f)) }}
{%- endif %}
{% if field.description %}<p class="text-muted field-desc"><small>{{field.description|urlize}}</small></p>{% endif %}
{% if field.errors %}
<span class="alert alert-danger help-inline" id="error-{{ field.name }}">{% for error in field.errors %}{{ error }}{% if not loop.last %}<br />{% endif %}{% endfor %}</span>
{% else %}
<span class="alert alert-danger help-inline" id="error-{{ field.name }}" style="display:none;"></span>
{% endif %}
</div>
</div>
{%- endif %}
{%- endif %}
{%- endfor %}
</fieldset>
</div>
</div>
</div>
{%- endfor %}
</div>
<div class="well clearfix" style="margin-top: 10px;">
<button type="button" role="button" data-toggle="modal" class="btn btn-danger pull-left{% if is_new %} hide{% endif %}" data-target="#deletemodal"><i class="icon-trash icon-white"></i> Delete</button>
<span class="pull-right">
<span class="loader"><img src="{{ url_for('static', filename='img/ajax-loader.gif' ) }}" /></span>
<button type="submit" class="btn btn-primary edit-form-submit"><i class="icon-ok icon-white"></i> {% if is_new %}Create{% else %}Save{% endif %}</a>
</span>
</div>
</form>
</div>
<div class="col-md-4">
{% include "communities/mycommunities.html" %}
</div>
</div>
{% endblock %}
{% block javascript %}
<script type="text/javascript" src="/vendors/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
var CKEDITOR_BASEPATH = '/ckeditor/';
function init_ckeditor(selector, type) {
if(type=="simple"){
CKEDITOR.replace( selector, {
toolbar: [
['PasteText','PasteFromWord'],
['Bold','Italic','Strike','-','Subscript','Superscript',],
['NumberedList','BulletedList', 'Blockquote'],
['Undo','Redo','-','Find','Replace','-', 'RemoveFormat'],
['Mathjax', 'SpecialChar', 'ScientificChar'],
['Source'], ['Maximize'],
],
extraPlugins: 'scientificchar,mathjax,blockquote',
disableNativeSpellChecker: false,
removePlugins: 'elementspath',
removeButtons: ''
});
} else {
CKEDITOR.replace( selector, {
toolbar: [
['PasteText','PasteFromWord'],
['Bold','Italic','Strike','-','Subscript','Superscript',],
['NumberedList','BulletedList', 'Blockquote', 'Table', '-', 'Link', 'Anchor'],
['Undo','Redo','-','Find','Replace','-', 'RemoveFormat'],
['Mathjax', 'SpecialChar', 'ScientificChar'],
['Styles', 'Format'], ['Source'], ['Maximize'],
],
extraPlugins: 'scientificchar,mathjax,blockquote',
disableNativeSpellChecker: false,
removePlugins: 'elementspath',
removeButtons: ''
});
}
}
init_ckeditor("page", 'advanced');
init_ckeditor("description", 'simple');
</script>
{% endblock %}

Event Timeline