Permalink
Browse files

Merge branch 'master' of github.com:catalpainternational/HarukaSMS

  • Loading branch information...
2 parents 9a41354 + 0afa09c commit 33fa5d5d50221191463575dca4b56cbc1c928b91 @nicolasH nicolasH committed Dec 5, 2011
View
141 haruka_theme/static/haruka_theme/css/custom.css
@@ -412,5 +412,146 @@ tr.row_section td {
#contact_list {
height: 530px;
+
+}
+
+/*-----------------DIV REPLACEMENTS POLLING -------------------*/
+
+
+#div_id_default_response_luo {
+
+ visibility:hidden;
+ height:0px;
+
+}
+
+#div_id_question_luo {
+ visibility:hidden;
+ height:0px;
+}
+
+
+#div_id_contacts {
+ visibility:hidden;
+ height:0px;
+
+}
+
+#newForm {
+ width:600px;
+ margin-left:20px;
+ height: 605px;
+ margin-top:0px;
+ background-color: #F5F5F5;
+ border: 1px solid rgba(0, 0, 0, 0.05);
+ border-radius: 4px 4px 4px 4px;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset;
+ margin-bottom: 20px;
+ min-height: 20px;
+ padding: 19px;
+}
+.uniForm .ctrlHolder {
+ border-bottom: 0px solid #DFDFDF;
+ padding: 7px;
+}
+
+.uniForm .focused {
+ background-color: #DDF4FB;
+ border-color: #C6EDF9;
+}
+
+#div_id_default_response {
+ position:relative;
+ top:-66px;
+}
+
+#div_id_start_immediately {
+ position:relative;
+ top:-125px;
+
+}
+
+#div_id_groups {
+ position:relative;
+ top:0px;
+ top:-138px;
+
+}
+
+#div_id_name {
+ position:relative;
+ top:-14px;
+}
+
+#div_id_question {
+ position:relative;
+ top:-10px;
+}
+
+.uniForm fieldset {
+ height: 605px;
+}
+
+.uniForm textarea, .uniForm .blockLabels textarea {
+ height: 2em;
+ width: 53%;
+
+ }
+
+/*-----------------DIV REPLACEMENTS DATA COLLECTION -------------------*/
+
+
+#div_id_keyword_prefix {
+ visibility:hidden;
+
+}
+
+#div_id_command_prefix {
+ visibility:hidden;
+
+}
+
+#div_id_separator {
+ visibility:hidden;
+}
+
+#id_description {
+ height: 2em;
+ width: 53%;
+}
+
+#div_id_restrict_to {
+ position:relative;
+ top:-910px;
+}
+
+#div_id_restrict_message {
+ position:relative;
+ top:-900px;
+}
+
+.form_fields_cell {
+ background-color: #ffffff;
+}
+
+.add_field_header {
+ color: white;
+ padding-bottom: 5px;
+ padding-left: 10px;
+ padding-top: 5px;
+ line-height: 18px;
+ padding: 10px 10px 9px;
+ text-align: left;
+}
+
+#new_field_box {
+ background-color: white;
+ border-bottom: none;
+ border-left: none;
+ border-right: none;
+ margin: 0;
+ width: 858px;
+ margin-left:20px;
+}
View
40 haruka_theme/templates/polls/category_edit.html
@@ -0,0 +1,40 @@
+<td class="category_name_col">
+ {% if not category %}
+ <div class="add_category_header">Add New Category</div>
+ {% endif %}
+ <script language="javascript">
+ $(document).ready(function() {
+ // highlight the save button when changes are detected
+ $("input,select").change(function() {
+ category_id = '{{ category.pk }}'
+ $("#save_" + category_id).addClass("positive");
+ });
+ });
+
+ </script>
+
+ {% if category %}
+
+ {% endif %} {{ form.name }} {{ form.name.errors}}</td>
+<td class="category_response_col">{{ form.response }} {{form.command.errors}}</td>
+<!--<td class="category_priority_col">{{ form.priority }} {{ form.priority.errors }}</td>-->
+<td class="category_color_col" {% if form.color %}style="background-color:#{{ form.color.value }}"{% endif %}>{{ form.color }} {{ form.color.errors }}</td>
+<td class="category_default_col">{{ form.default }} {{ form.default.errors }}</td>
+<td class="category_options_col">
+
+ {% if category %}
+ <a style="float:right;padding-top:7px;" href="javascript:void(0);"><img onclick="cancelCategory(this, '{% url poll.views.view_category poll.pk category.pk %}');" src="{{ MEDIA_URL }}rapidsms/icons/silk/decline.png" alt="" border="0"/></a>
+ <div>
+ <a class='btn success' onclick="saveCategory(this, '{% url poll.views.edit_category poll.pk category.pk %}');" href="javascript:void(0);" id="save_{{ category.pk }}">Save
+ </a>
+ </div>
+ {% else %}
+ <a href="javascript:void(0);"><img onclick="cancelAdd(this);" style="float:right;padding-top:6px;" src="{{ MEDIA_URL }}rapidsms/icons/silk/decline.png" alt="" border="0"/></a>
+ <div class="buttons">
+ <a onclick="addCategory(this);" href="javascript:void(0);" id="save_{{ category.pk }}" class="positive">
+ <img src="{{ MEDIA_URL }}rapidsms/icons/silk/add.png" alt=""/>Add
+ </a>
+ </div>
+ {% endif %}
+ </td>
+</form>
View
28 haruka_theme/templates/polls/category_view.html
@@ -0,0 +1,28 @@
+<td class="category_name_col">
+ {{ category.name }}
+</td>
+<td class="category_response_col">{{ category.response }}</td>
+<!--<td class="category_priority_col">{{ category.priority }}</td>-->
+<td class="category_color_col" {% if category.color %}style="background-color:#{{ category.color }}"{% endif %}>
+ &nbsp;
+</td>
+<td class="category_default_col">
+ {% if category.default %}
+ <img style="vertical-alignment:bottom;padding-top:7px" src="{{ MEDIA_URL }}rapidsms/icons/silk/accept.png" alt="This category is default"/>
+ {% else %}
+ &nbsp;
+ {% endif %}
+</td>
+<td class="category_options_col">
+ <a onclick="deleteCategory(this, '{% url poll.views.delete_category poll.pk category.pk %}');" class="negative" style="float:right">
+ <img style="vertical-alignment:bottom;padding-top:7px" src="{{ MEDIA_URL }}rapidsms/icons/silk/delete.png" alt=""/>
+ </a>
+ <div>
+ <a class="btn" onclick="editCategory(this, '{% url poll.views.edit_category poll.pk category.pk %}');" href="javascript:void(0);">Edit</a>
+ {% ifequal poll.type 't' %}
+<!-- <a href="{% url poll.views.view_rules poll.pk category.pk %}" id="save_{{ category.pk }}">
+ <img src="{{ MEDIA_URL }}poll/icons/silk/bullet_wrench.png" alt=""/>Rules ({{ category.rules.all.count }})
+ </a>-->
+ {% endifequal %}
+ </div>
+</td>
View
4 haruka_theme/templates/polls/poll_create.html
@@ -8,11 +8,11 @@
<form action="{% url poll.views.new_poll %}" method="post" class="uniForm" id="newForm">
<fieldset>
{{ form|as_uni_form }}
-<div style="float:left;margin-bottom:10px;margin-top:10px">
+<div style="float:left;margin-bottom:10px; margin-top:-120px; margin-left:154px;">
<a href="{% url polls %}" class="btn">
Cancel
</a>
- <a onclick="$('#newForm').submit();" href="javascript:void(0);" class="btn primary">
+ <a onclick="$('#newForm').submit();" href="javascript:void(0);" class="btn primary" style='margin-top:-120px'>
Create Poll
</a>
</div>
View
2 haruka_theme/templates/polls/poll_index.html
@@ -9,7 +9,7 @@
<a class="btn large primary" style="margin-bottom:30px;" href="{% url poll.views.new_poll %}"> Add New Poll </a>
-<table width="400px" class="condensed-table">
+<table class='condensed-table' style="width:878px; margin-left:20px;">
<thead>
<tr>
<th class="poll_name_col">Name</th>
View
6 haruka_theme/templates/polls/poll_view.html
@@ -89,15 +89,15 @@
<h4 style="margin-left:40px; margin-top:45px;">Polling Information</h4>
<div class="well" id="poll_header" style="width:858px; margin-left:20px;">
</div>
-
+<h4 style="margin-left:40px; margin-top:35px;">Response Type</h4>
<form action="">
{% csrf_token %}
-<table class="condensed-table" style="width:858px; margin-left:40px;">
+<table class="condensed-table" style="width:895px; margin-left:20px; margin-top:10px;">
<thead>
<tr>
<th class="category_name_col">Name</th>
<th class="category_response_col">Response Message</th>
-<th class="category_priority_col">Priority</th>
+<!--<th class="category_priority_col">Priority</th>-->
<th class="category_color_col">Color</th>
<th class="category_default_col">Default</th>
<th class="category_options_col"></th>
View
78 haruka_theme/templates/polls/response_table.html
@@ -0,0 +1,78 @@
+<script type="text/javascript">
+
+ function deleteResponse(link, delete_link) {
+ if (confirm("Are you sure you want to remove this response from the poll?")) {
+ $.post(delete_link, function(data) {
+ $(link).parents("tr").remove();
+ });
+ }
+ }
+
+ function cancelResponse(link, view_link) {
+ $(link).parents("tr").load(view_link);
+ }
+
+ function saveResponse(link, edit_link) {
+ form = $(link).parents(".form");
+ form_data = form.serializeArray();
+ $(link).parents("tr").load(edit_link, form_data);
+ }
+
+ function editResponse(link, edit_link) {
+ $(link).parents("tr").load(edit_link);
+ }
+
+</script>
+
+<h4 style='margin-left:40px; margin-top:45px'>Responses for:</h4>
+<div class="well" style="width:858px; margin-left:20px;">
+ <div class="name" style='margin-left:10px;'><h5>'{{ poll.question }}'</h5></div>
+ <div>
+ <a class='btn' style='margin-left:780px;'href="{% url poll.views.responses_as_csv poll.pk %}">Export
+ </a>
+ {% ifequal poll.type 'l' %}
+ <a href="{% url poll.views.apply_all poll.pk %}">
+ <img src="{{ MEDIA_URL }}poll/icons/silk/application_form_add.png" alt=""/>Register All
+ </a>
+ {% else %}
+ {% ifequal poll.type 'r' %}
+ <a href="{% url poll.views.apply_all poll.pk %}">
+ <img src="{{ MEDIA_URL }}poll/icons/silk/application_form_add.png" alt=""/>Register All
+ </a>
+ {% endifequal %}
+ {% endifequal %}
+ <br/>
+ </div>
+</div>
+<form class="form" action="" method="post">
+<table class="condensed-table" style='width:891px; margin-left:20px;'>
+ <thead>
+ <tr>
+ <th class="response_sender_col">Sender</th>
+ {% for column, colclass in columns %}
+ <th class="response_{{ colclass }}_col">{{ column }}</th>
+ {% endfor %}
+ <th class="response_options_col"></th>
+ </tr>
+ </thead>
+
+<tbody>
+{% if responses %}
+ {% for response in responses %}
+ <tr class="poll_table_row">
+ {% include row_template %}
+ </tr>
+ {% endfor %}
+{% else %}
+ <tr class="poll_table_row">
+ <td colspan="{{ columns|length }}">
+ <i>No responses for this poll.</i>
+ </td>
+ </tr>
+{% endif %}
+</tbody>
+</table>
+</form>
+<br/>
+</div>
+
View
25 haruka_theme/templates/xforms/form_create.html
@@ -0,0 +1,25 @@
+{% extends "xforms/layout.html" %}
+{% block title %}XForms{% endblock %}
+
+{% block content %}
+{% load forms %}
+
+<div id="form_header">
+<div><h4 style='margin-top:45px; margin-left:40px;'>Data Collection</h4></div>
+</div>
+
+<form action="/xforms/new/" method="post" class="uniForm" id="newForm">
+{% csrf_token %}
+{{ form|render_layout }}
+
+<div style="float:left;margin-bottom:10px;margin-top:10px">
+ <a class='btn' href="/xforms/">
+ Cancel
+ </a>
+ <a class='btn primary' onabortnclick="$('#newForm').submit();" href="javascript:void(0);">
+ Create Form
+ </a>
+</div>
+</form>
+
+{% endblock %}
View
14 haruka_theme/templates/xforms/form_details.html
@@ -0,0 +1,14 @@
+ <div class="buttons">
+ <a onclick="editFormDetails('{{xform.pk}}');" href="javascript:void(0);">
+ <img src="{{ MEDIA_URL }}rapidsms_xforms/icons/silk/pencil.png" alt=""/>
+ Edit
+ </a>
+ <a href="/xforms/odk/get/{{ xform.pk }}/">
+ <img src="{{ MEDIA_URL }}rapidsms_xforms/icons/silk/application_form.png" alt=""/>
+ XForm
+ </a>
+ </div>
+
+ <div class="name">{{xform.name}} <span class="keyword">({{xform.keyword}})</span></div>
+ <div class="description">{{xform.description}}</div>
+ <div class="response">Response: {{xform.response}}</div>
View
11 haruka_theme/templates/xforms/form_index.html
@@ -16,7 +16,7 @@
<a class='btn large primary' style="margin-bottom:30px;" href="/xforms/new/" style="float:left"> Add New Survey </a>
-<table width="100%" class="bordered-table zebra-striped">
+<table width="100%" class="condensed-table">
<thead>
<tr>
<th class="form_name_col">Name</th>
@@ -33,13 +33,12 @@
<td>
<a style="float:right;padding-top:7px;" href="javascript:void(0);" onclick="deleteForm('{{xform.pk}}','{{xform.name|addslashes}}');"><img border="0" src="{{ MEDIA_URL }}rapidsms/icons/silk/delete.png"/></a>
- <div class="buttons">
+ <div>
- <a href="/xforms/{{ xform.pk }}/submissions/">
- <img src="{{ MEDIA_URL }}rapidsms_xforms/icons/silk/database_table.png" alt=""/> Submissions ({{ xform.submissions.all.count }})
+ <a class='btn' href="/xforms/{{ xform.pk }}/submissions/">Submissions ({{ xform.submissions.all.count }})
</a>
- <a href="/xforms/{{ xform.pk }}/view/">
- <img src="{{ MEDIA_URL }}rapidsms_xforms/icons/silk/zoom.png" alt=""/> View
+ <a class='btn' href="/xforms/{{ xform.pk }}/view/">
+ View
</a>
</div>
</td>
View
8 haruka_theme/templates/xforms/form_view.html
@@ -1,5 +1,5 @@
{% extends "xforms/layout.html" %}
-{% block title %}XForms{% endblock %}
+{% block title %}Data Collection{% endblock %}
{% block content %}
@@ -129,12 +129,12 @@
});
</script>
-
-<div id="form_header">
+
+<div class="well" style="width:858px; margin-left:20px; margin-top: 45px;" id="form_header">
</div>
-<table width="100%" class="form_table">
+<table width="100%" class="condensed-table">
<thead>
<tr>
<th class="field_name_col">Caption</th>

0 comments on commit 33fa5d5

Please sign in to comment.