add upload MARC link to work page
parent
8576a7fb7b
commit
1872180c22
|
@ -383,6 +383,9 @@
|
|||
{% for record in edition.MARCrecords.all %}
|
||||
Download {{record.link_target}} MARC record for this edition: (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&format=xml">XML</a>) (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&format=mrc">mrc</a>)<br />
|
||||
{% endfor %}
|
||||
{% if user.is_staff and edition.ebooks %}
|
||||
<a href="{% url MARCUngluify %}?edition={{ edition.id }}">Upload</a> a MARC record for this edition. <br />
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -2630,6 +2630,16 @@ class MARCUngluifyView(FormView):
|
|||
template_name = 'marcungluify.html'
|
||||
form_class = MARCUngluifyForm
|
||||
success_url = reverse_lazy('MARCUngluify')
|
||||
|
||||
# allow a get param to specify the edition
|
||||
def get_initial(self):
|
||||
if self.request.method == 'GET':
|
||||
edition = self.request.GET.get('edition',None)
|
||||
if models.Edition.objects.filter(id=edition).count():
|
||||
edition = models.Edition.objects.filter(id=edition)[0]
|
||||
if edition.ebooks.count():
|
||||
return {'edition':edition.id}
|
||||
return {}
|
||||
|
||||
def form_valid(self, form):
|
||||
edition = form.cleaned_data['edition']
|
||||
|
|
Loading…
Reference in New Issue