Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1200 from okfn/1200-datastore-read-only
Datapusher Core Extension
- Loading branch information
Showing
43 changed files
with
880 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.datapusher-status-link:hover { | ||
text-decoration: none; | ||
} | ||
|
||
.datapusher-status { | ||
&.status-unknown { | ||
color: #bbb; | ||
} | ||
&.status-pending { | ||
color: #FFCC00; | ||
} | ||
&.status-error { | ||
color: red; | ||
} | ||
&.status-complete { | ||
color: #009900; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
{% extends 'package/edit_base.html' %} | ||
|
||
{% block subtitle %}{{ _('Edit') }} - {{ h.dataset_display_name(pkg) }}{% endblock %} | ||
|
||
{% block primary_content_inner %} | ||
{% block form %}{{ c.form | safe }}{% endblock %} | ||
{% block form %}{{ c.form | safe }}{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{% extends "package/resource_edit_base.html" %} | ||
|
||
{% block subtitle %}{{ h.dataset_display_name(pkg) }} - {{ h.resource_display_name(res) }}{% endblock %} | ||
|
||
{% block primary_content_inner %} | ||
|
||
{% set action = h.url_for(controller='ckanext.datapusher.plugin:ResourceDataController', action='resource_data', id=pkg.name, resource_id=res.id) %} | ||
{% set show_table = true %} | ||
|
||
<form method="post" action="{{ action }}" > | ||
<button class="btn btn-primary" name="save" type="submit"> | ||
<i class="icon-cloud-upload"></i> {{ _('Upload Data') }} | ||
</button> | ||
</form> | ||
|
||
{% if status.error and status.error.message %} | ||
{% set show_table = false %} | ||
<div class="alert alert-error"> | ||
<strong>{{ _('Upload error:') }}</strong> {{ status.error.message }} | ||
</div> | ||
{% elif status.task_info and status.task_info.error %} | ||
{% set show_table = false %} | ||
<div class="alert alert-error"> | ||
<strong>{{ _('Error:') }}</strong> {{ status.task_info.error }} | ||
</div> | ||
{% endif %} | ||
|
||
<table class="table table-bordered"> | ||
<colgroup> | ||
<col width="150"> | ||
<col> | ||
</colgroup> | ||
<tr> | ||
<th>{{ _('Status') }}</th> | ||
<td>{{ status.status.capitalize() if status.status else _('Not Uploaded Yet') }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ _('Last updated') }}</th> | ||
<td>{{ h.time_ago_from_timestamp(status.last_updated) if status.status else _('Never') }}</td> | ||
</tr> | ||
</table> | ||
|
||
{% if status.status and status.task_info and show_table %} | ||
<h3>{{ _('Upload Log') }}</h3> | ||
<ul class="activity"> | ||
{% for item in status.task_info.logs %} | ||
{% set icon = 'ok' if item.level == 'INFO' else 'exclamation' %} | ||
{% set class = ' failure' if icon == 'exclamation' else ' success' %} | ||
{% set popover_content = 'test' %} | ||
<li class="item no-avatar{{ class }}"> | ||
<i class="icon icon-{{ icon }}"></i> | ||
<p> | ||
{{ item.message | urlize }}<br> | ||
<span class="date"> | ||
{{ h.time_ago_from_timestamp(item.timestamp) }} | ||
<a href="#" data-target="popover" data-content="<dl>{% for key, value in item.iteritems() %}<dt>{{ key }}</dt><dd>{{ value }}</dd>{% endfor %}</dl>" data-html="true">more info</a> | ||
</span> | ||
</p> | ||
</li> | ||
{% endfor %} | ||
<li class="item no-avatar"> | ||
<i class="icon icon-info"></i> | ||
<p class="muted">{{ _('End of log') }}</p> | ||
</li> | ||
</ul> | ||
{% endif %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
{% extends "package/resource_edit_base.html" %} | ||
|
||
{% set res = c.resource %} | ||
|
||
{% block subtitle %}{{ _('Edit') }} - {{ h.resource_display_name(res) }} - {{ h.dataset_display_name(pkg) }}{% endblock %} | ||
|
||
{% block form %} | ||
{{ h.snippet('package/snippets/resource_edit_form.html', data=data, errors=errors, error_summary=error_summary, pkg_name=pkg.name, form_action=c.form_action, allow_upload=g.ofs_impl and logged_in) }} | ||
{% snippet 'package/snippets/resource_edit_form.html', data=data, errors=errors, error_summary=error_summary, pkg_name=pkg.name, form_action=c.form_action, allow_upload=g.ofs_impl and logged_in %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<section class="module module-narrow module-shallow"> | ||
<h2 class="module-heading"><i class="icon-info-sign"></i> {{ _('What\'s a resource?') }}</h2> | ||
<div class="module-content"> | ||
<p>{{ _('A resource can be any file or link to a file containing useful data.') }}</p> | ||
</div> | ||
</section> |
Oops, something went wrong.