diff --git a/django/website/hid/templates/hid/item.html b/django/website/hid/templates/hid/item.html new file mode 100644 index 0000000000000000000000000000000000000000..550f99d42968275974625618e4b293a3f96ee7c3 --- /dev/null +++ b/django/website/hid/templates/hid/item.html @@ -0,0 +1,85 @@ +{% extends "base_side.html" %} +{% load i18n %} +{% load bootstrap3 %} +{% load render_table from django_tables2 %} + +{% block maincontent %} +<h1 class="page-header"><span class="fa fa-pencil fa-fw"></span>{% trans "View & Edit: " %}<span class="item-type">{% trans "Question" %}</span></h1> + <div class='row'> + <div class="col-lg-12"> + <form id="single-item-form" role="form"> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="col-lg-12"> + <ul class="list-unstyled item-meta-dates clearfix col-lg-8"> + <li class="item-added-date"><span class="fa fa-calendar fa-fw"></span><span class="item-meta-label">{% trans "Added: " %}</span> + 15 jul 2015 + </li> + <li class="item-updated-date"><span class="fa fa-calendar fa-fw"></span><span class="item-meta-label">{% trans "Updated: " %}</span> + 18 jul 2015 + </li> + <li class="item-reported-date"><span class="fa fa-calendar fa-fw"></span><span class="item-meta-label">{% trans "Reported: " %}</span> + 10 jul 2015 + </li> + </ul> + <div class="col-lg-4 pull-right"> + <div class="form-group btn-group pull-right"> + {% bootstrap_button "Cancel" button_type="submit" value="Cancel" button_class="btn btn-sm" %} + {% bootstrap_button "Update" button_type="submit" value="update" button_class="btn btn-sm btn-success" %} + </div> + </div> + <div class="col-lg-12"></div> + <div class="col-lg-12 item-body"> + <div class="form-group well"> + <label><span class="fa fa-question-circle fa-fw"></span> {% trans "Question" %}</label> + <textarea class="form-control" placeholder="{% trans "Add the content of the question here" %}" rows="3">I have been told that very soon Liberia will be declar ebolo free, now i want to know if there is any ebola case.</textarea> + </div> + <div class="col-xs-12 form-group input-group "> + <span class="input-group-addon"><span class="fa fa-tags fa-fw"></span> {% trans "Tags" %}</span> + <input type="text" class="form-control" placeholder="add tags, seperated, by comma" aria-describedby="basic-addon1"> + </div> + </div> + </div> + <div class="col-lg-12 item-dropdowns"> + <div class="col-xs-6 form-group input-group pull-left"> + <label class="col-xs-4 control-label"><span class="fa fa-sitemap fa-fw"></span> {% trans "Category" %}</label> + <div class="col-xs-8 pull-right selectContainer"> + <select name="language" class="form-control"> + <option value="null">{% trans "Select Category" %}</option> + <option value="ebola-origins">{% trans "Ebola ~ Origins" %}</option> + <option value="ebola-measures">{% trans "Ebola ~ Measures" %}</option> + <option value="ebola-updates">{% trans "Ebola ~ Updates" %}</option> + </select> + </div> + </div> + <div class="col-xs-6 form-group input-group "> + <label class="col-xs-4 control-label"><span class="fa fa-globe fa-fw"></span> Region</label> + <div class="col-xs-8 selectContainer"> + <select name="language" class="form-control"> + <option value="null">{% trans "Select region..." %}</option> + <option value="region1">{% trans "Region One" %}</option> + <option value="region2">{% trans "Region Two" %}</option> + <option value="region3">{% trans "Region Three" %}</option> + </select> + </div> + </div> + <div class="col-lg-4"> + <div class="form-group btn-group"> + {% bootstrap_button "Delete" button_type="submit" value="delete" button_class="btn btn-danger btn-sm" %} + </div> + </div> + <div class="col-lg-8"> + <div class="form-group btn-group pull-right"> + {% bootstrap_button "Cancel" button_type="submit" value="Cancel" button_class="btn btn-sm" %} + {% bootstrap_button "Update" button_type="submit" value="update" button_class="btn btn-sm btn-success" %} + </div> + </div> + </div> + </div> + </div> + </form> + </div> +</div> + + +{% endblock maincontent %} \ No newline at end of file diff --git a/django/website/hid/urls.py b/django/website/hid/urls.py index bf7f17ee88c2fd52a30ebc4f2ccac2d5ae84300f..97c6b717e82d98dfae15965804c9c36a815721de 100644 --- a/django/website/hid/urls.py +++ b/django/website/hid/urls.py @@ -4,7 +4,7 @@ from django.contrib.auth.decorators import login_required from dashboard.views import DashboardView from .views import ( - UploadSpreadsheetView, ListSources, ViewItems, process_items + UploadSpreadsheetView, ListSources, ViewItems, ViewSingleItem, process_items ) urlpatterns = patterns('', @@ -13,5 +13,6 @@ urlpatterns = patterns('', url(r'^sources/$', login_required(ListSources.as_view()), name='sources'), url(r'^view/process/$', login_required(process_items), name="data-view-process"), url(r'^view/$', login_required(ViewItems.as_view()), name="data-view"), + url(r'^view/(?P<id>\d+)$', login_required(ViewSingleItem.as_view())), url(r'^$', login_required(DashboardView.as_view()), name='dashboard'), ) diff --git a/django/website/hid/views.py b/django/website/hid/views.py index 664afa178155769021a3e8ad2291d260a39cab2d..4124a2320c0efc0d9f8b0976f4da279d2a3d0a03 100644 --- a/django/website/hid/views.py +++ b/django/website/hid/views.py @@ -102,6 +102,12 @@ class ViewItems(SingleTableView): context['upload_form'] = UploadForm(initial={'source': 'geopoll'}) return context +class ViewSingleItem(TemplateView): + template_name = "hid/item.html" + + def get_context_data(self, **kwargs): + ctx = super(ViewSingleItem, self).get_context_data(**kwargs) or {} + return ctx def get_deleted(params): return [int(x) for x in params.getlist("delete", [])] diff --git a/django/website/media/less/view-edit.less b/django/website/media/less/view-edit.less index a255a1943875f441f858cfbb741360a91e99c4b9..4dd2c9fddacb9582ee6a28f70f9a8a1249610d5e 100644 --- a/django/website/media/less/view-edit.less +++ b/django/website/media/less/view-edit.less @@ -124,3 +124,26 @@ form.header-upload-form { top: 10px; right: 150px; } + +//Item view page + +.item-type { + color: @brand-primary +} + +.item-meta-dates { + padding-top:@padding-large-vertical; + font-size:13px; + color:@gray; +} + +.input-group .control-label { + padding:10px; +} + +.item-meta-dates > li { + display:inline-block; + margin-right:10px; +} + +