Add option to delete harvesting sources
This commit is contained in:
parent
58164e915d
commit
696a8dc058
|
@ -55,6 +55,10 @@ class Harvest(SingletonPlugin):
|
||||||
controller='ckanext.harvest.controllers.view:ViewController',
|
controller='ckanext.harvest.controllers.view:ViewController',
|
||||||
action='show')
|
action='show')
|
||||||
|
|
||||||
|
map.connect('harvest_show', '/harvest/:id/delete',
|
||||||
|
controller='ckanext.harvest.controllers.view:ViewController',
|
||||||
|
action='delete')
|
||||||
|
|
||||||
map.connect('harvest_create', '/harvest/:id/refresh',
|
map.connect('harvest_create', '/harvest/:id/refresh',
|
||||||
controller='ckanext.harvest.controllers.view:ViewController',
|
controller='ckanext.harvest.controllers.view:ViewController',
|
||||||
action='create_harvesting_job')
|
action='create_harvesting_job')
|
||||||
|
|
|
@ -84,6 +84,13 @@ class ViewController(BaseController):
|
||||||
|
|
||||||
return render('ckanext/harvest/show.html')
|
return render('ckanext/harvest/show.html')
|
||||||
|
|
||||||
|
def delete(self,id):
|
||||||
|
form_url = self.form_api_url + '/harvestsource/delete/%s' % id
|
||||||
|
r = self._do_request(form_url)
|
||||||
|
|
||||||
|
h.flash_success('Harvesting source deleted successfully')
|
||||||
|
redirect(h.url_for(controller='harvest', action='index', id=None))
|
||||||
|
|
||||||
def create_harvesting_job(self,id):
|
def create_harvesting_job(self,id):
|
||||||
form_url = self.api_url + '/harvestingjob'
|
form_url = self.api_url + '/harvestingjob'
|
||||||
data = {
|
data = {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<a id="new-harvest-source" href="harvest/create">Add a harvesting source</a>
|
<a id="new-harvest-source" href="harvest/create">Add a harvesting source</a>
|
||||||
<table id="harvest-sources">
|
<table id="harvest-sources">
|
||||||
<tr>
|
<tr>
|
||||||
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>URL</th>
|
<th>URL</th>
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
|
|
||||||
<tr py:for="source in c.sources">
|
<tr py:for="source in c.sources">
|
||||||
<td>${h.link_to('view', 'harvest/' + source.id)}</td>
|
<td>${h.link_to('view', 'harvest/' + source.id)}</td>
|
||||||
|
<td>${h.link_to('delete', 'harvest/' + source.id + '/delete')}</td>
|
||||||
<td>${h.link_to('refresh', 'harvest/' + source.id + '/refresh')}</td>
|
<td>${h.link_to('refresh', 'harvest/' + source.id + '/refresh')}</td>
|
||||||
<td>${source.url}</td>
|
<td>${source.url}</td>
|
||||||
<td>${source.status.last_harvest_status}</td>
|
<td>${source.status.last_harvest_status}</td>
|
||||||
|
|
Loading…
Reference in New Issue