Skip to content

Commit

Permalink
Merge pull request #48 from developmentseed/develop
Browse files Browse the repository at this point in the history
More bug fixing
  • Loading branch information
Scisco committed Dec 18, 2014
2 parents 043c76f + f3ba171 commit 6b56bdb
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 34 deletions.
25 changes: 14 additions & 11 deletions pillbox-engine/compare/adminx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@


class GenericAdmin(object):
def pillbox_image(self, instance):
if instance.pillbox.splimage:
return '<img height="90" src="%s" />' % instance.pillbox.splimage.url

def image_popup(self, image_obj):
if image_obj:
return '<a data-toggle="lightbox" data-remote="%s"><img height="90" src="%s" /></a>' % (image_obj.url,
image_obj.url)
else:
return ''

def pillbox_image(self, instance):
return self.image_popup(instance.pillbox.splimage)
pillbox_image.short_description = "Pillbox"
pillbox_image.allow_tags = True
pillbox_image.is_column = True

def spl_image(self, instance):
if instance.spl.splimage:
return '<img height="90" src="%s" />' % instance.spl.splimage.url
else:
return ''
return self.image_popup(instance.spl.splimage)
spl_image.short_description = "SPL"
spl_image.allow_tags = True
spl_image.is_column = True
Expand All @@ -27,13 +29,14 @@ def spl_image(self, instance):

list_display = ('spl_value', 'pillbox_value', 'verified', 'is_different', 'pillbox_image', 'spl_image', 'pillbox')

readonly_fields = ['spl', 'pillbox', 'spl_value']

fields = ['spl', 'pillbox', 'spl_value', 'pillbox_value', 'verified',
'is_different', 'reason']
readonly_fields = ['pillbox_image', 'spl_image', 'spl', 'pillbox', 'spl_value']

list_filter = ['verified', 'pillbox__new', 'pillbox__updated']

form_layout = ('spl_image', 'pillbox_image', 'spl_value',
'pillbox_value', 'verified', 'is_different',
'reason', 'spl', 'pillbox', )

list_per_page = 10

ordering = ['verified']
Expand Down
1 change: 1 addition & 0 deletions pillbox-engine/compare/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def update(pillbox, spl_pill, action='new'):
'medicine_name': 'medicine_name',
'part_medicine_name': 'part_medicine_name',
'dea_schedule_code': 'dea_schedule_code',
'dea_schedule_name': 'dea_schedule_name',
'spl_inactive_ing': 'spl_inactive_ing',
'spl_ingredients': 'spl_ingredients',
'splcolor': 'splcolor',
Expand Down
16 changes: 8 additions & 8 deletions pillbox-engine/pillbox/templatetags/pillbox_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ def pillbox_widgets():
'color': 'primary',
'action': '/pillbox/status/'
},
{
'icon': 'fa-sign-out',
'name': 'Export',
'text': 'Check Export Status',
'link': '#',
'color': 'red',
'action': '/pillbox/export_status/'
},
{
'icon': 'fa-arrows-h ',
'name': 'Add New',
Expand All @@ -48,6 +40,14 @@ def pillbox_widgets():
'link': '#',
'color': 'yellow',
'action': '/pillbox/transfer/compare'
},
{
'icon': 'fa-sign-out',
'name': 'Export',
'text': 'Check Export Status',
'link': '#',
'color': 'red',
'action': '/pillbox/export_status/'
}
]

Expand Down
2 changes: 1 addition & 1 deletion pillbox-engine/static/css/app.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* line 1, ../sass/app.scss */
.huge {
font-size: 40px;
font-size: 2em;
}

/* line 5, ../sass/app.scss */
Expand Down
2 changes: 1 addition & 1 deletion pillbox-engine/static/sass/app.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.huge {
font-size: 40px;
font-size: 2em;
}

.tab-pane {
Expand Down
6 changes: 6 additions & 0 deletions pillbox-engine/static/vendor/lightbox/ekko-lightbox.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pillbox-engine/static/vendor/lightbox/ekko-lightbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion pillbox-engine/templates/xadmin/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% load url from future %}{% load xadmin_tags %}{% load i18n %}<!DOCTYPE html>
{% load url from future %}{% load xadmin_tags %}{% load i18n %}
{% load staticfiles %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
Expand Down Expand Up @@ -35,5 +37,14 @@
{{ media.js }}
{% block extrabody %}{% endblock %}
{% view_block 'extrabody' %}

<script type="text/javascript" src="{% static 'vendor/lightbox/ekko-lightbox.min.js' %}"></script>
<script type="text/javascript">
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
event.preventDefault();
$(this).ekkoLightbox();
});
</script>

</body>
</html>
27 changes: 15 additions & 12 deletions pillbox-engine/templates/xadmin/views/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,41 @@
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
</div>
<div aria-labelledby="action-tab" id="action" class="tab-pane active fade in" role="tabpanel">

<div class="row">
<div class="col-lg-12">
<h2 class="page-header">SPL <small>updated: {% spl_sync_time %}</small></h2>
<h2 class="page-header">1. Download</h2>
</div>
</div>
<div class="row">
{% spl_widgets %}
{% download_widgets %}
{% size_widgets %}
<div class="col-lg-3 col-md-6">

</div>
</div>
<div id="spl-sync"></div>

<div class="row">
<div class="col-lg-12">
<h2 class="page-header">Pillbox <small>updated: {% pillbox_sync_time %}</small></h2>
<h2 class="page-header">2. Sync SPL <small>updated: {% spl_sync_time %}</small></h2>
</div>
</div>

<div class="row">
{% pillbox_widgets %}
{% spl_widgets %}
</div>
<div id="spl-sync"></div>

<div class="row">
<div class="col-lg-12">
<h2 class="page-header">Download</h2>
<h2 class="page-header">3. Process Pillbox <small>updated: {% pillbox_sync_time %}</small></h2>
</div>
</div>
<div class="row">
{% download_widgets %}
{% size_widgets %}
<div class="col-lg-3 col-md-6">

</div>
<div class="row">
{% pillbox_widgets %}
</div>


</div>
</div>
</div>
Expand Down

0 comments on commit 6b56bdb

Please sign in to comment.