Skip to content

Instantly share code, notes, and snippets.

View amardesi's full-sized avatar

Andy Mardesich amardesi

View GitHub Profile
@amardesi
amardesi / _datacite_geoLoc.html
Created February 20, 2016 16:04
_datacite_geoLoc.html
{% load layout_extras %}
{% load i18n %}
<script type="text/javascript">
$(function() {
$('#geoloc_set .form-container').formset({
prefix: '{{ form.geoloc_set.prefix }}',
deleteCssClass: 'button__minus',
deleteText: '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
addCssClass: 'button__plus',
addText: '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
@amardesi
amardesi / _datacite_xml.html
Created February 20, 2016 16:01
_datacite_xml.html
{% load layout_extras %}
{% load i18n %}
<script type="text/javascript" src="/static/javascripts/jquery.formset.js"></script>
{{ form.nonrepeating_form.non_field_errors }}
{% include "create/_datacite_inlinetext.html" with field=form.nonrepeating_form.target %}
{% include "create/_datacite_geoLoc.html" %}
{% comment %} include "create/_datacite_description.html" {% endcomment %}
{% comment %} include "create/_datacite_creator.html" {% endcomment %}
@amardesi
amardesi / advanced_describe.html
Created February 20, 2016 15:55
advanced_describe.html
{% load layout_extras %}
{% load metadata_tags %}
{% load i18n %}
<input name="original_profile" id="original_profile" type="hidden" value="{{current_profile.name}}"/>
<div class="fieldset-stacked__embedded-select">
<span id="create__fieldset7" class="fieldset-inline__legend-number-4">{% trans "Describe the identified object using the" %}</span>
<label for="current_profile" class="fcontrol__text-label-hidden">{% trans "Profile" %}</label>
<select name="current_profile" id="current_profile" class="fcontrol__select">
{% for prof in profile_names %}
@amardesi
amardesi / ui_create.py
Created February 20, 2016 15:53
ui_create.py
import ui_common as uic
from django.shortcuts import redirect
import django.contrib.messages
import metadata
import ezid
import form_objects
import logging
import urllib
import re
import datacite_xml
@amardesi
amardesi / form_objects.py
Created February 20, 2016 15:50
form_objects.py
from django import forms
from django.forms import BaseFormSet, formset_factory
import django.core.validators
import util
import idmap
import userauth
import re
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
@amardesi
amardesi / Description.md
Last active February 22, 2016 20:36
django-dynamic-formset