Added templatetags for use in the GHOP module.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Fri, 28 Aug 2009 13:17:32 +0200
changeset 2830 5caf0d342696
parent 2829 ebc8976cd8f6
child 2831 a7ed56911653
Added templatetags for use in the GHOP module. Reviewed by: to-be-reviewed
app/soc/templates/modules/ghop/templatetags/_as_filter_multiselect.html
app/soc/templates/modules/ghop/templatetags/_as_ghop_task_comments.html
app/soc/templates/modules/ghop/templatetags/_as_ghop_task_ws.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/templates/modules/ghop/templatetags/_as_filter_multiselect.html	Fri Aug 28 13:17:32 2009 +0200
@@ -0,0 +1,36 @@
+{% comment %}
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+
+<script type="text/javascript">
+$(document).ready( function() {
+	$('#id_{{ field_label }}').multiSelect({
+	  selectAll: false,
+	  noneSelected: 'Any',
+	  oneOrMoreSelected: '*'
+	});
+});
+</script>
+
+<div class="column">
+ <div class="top"><strong>{{ field_label }}:</strong></div>
+ <div class="bottom">
+  <select id="id_{{ field_label }}" name="{{ field_label }}" 
+      multiple="multiple">
+   {% for value in field_value %}
+   <option value="{{ value }}">{{ value }}</option>
+   {% endfor %}
+  </select>
+ </div>
+</div>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/templates/modules/ghop/templatetags/_as_ghop_task_comments.html	Fri Aug 28 13:17:32 2009 +0200
@@ -0,0 +1,59 @@
+{% comment %}
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+
+<script type="text/javascript">
+$(document).ready(function(){
+  $('.spc{{ comment_id }}').hide();
+  $('.ghoptaskcomment #c{{ comment_id }}').hover(
+    function() {
+      $('.spc{{ comment_id }}').show();
+    },
+    function() {
+      $('.spc{{ comment_id }}').hide();
+    });
+});
+</script>
+
+<div class="ghoptaskcomment">
+ <div class="title" id="c{{ comment_id }}">
+  On {{ comment.created_on|date:"jS F Y H:i" }},
+  by
+  {% if comment.created_by %} 
+    {{ comment.created_by.name }}:
+  {% else %}
+    {{ site_name }} Automatic Updater:
+  {% endif %}
+  <span class="spc{{ comment_id }}">
+   <a title="Permalink to this Comment" href="#c{{ comment_id }}">¶</a>
+  </span>
+ </div>
+ <div class="box-inner">
+  <p>
+   {% if comment.content %}
+     {{ comment.content|safe }}</p>
+   {% else %}
+   (No Comment was entered for this change.)
+   {% endif %}
+ </div>
+ {% if comment.changes %}
+  <div class="changes">
+   <div class="box-inner">
+    <b>Changes:</b>
+    {{ comment.changes|join:"; " }} 
+   </div>
+  </div>
+ {% endif %}
+</div>
+<hr />
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/templates/modules/ghop/templatetags/_as_ghop_task_ws.html	Fri Aug 28 13:17:32 2009 +0200
@@ -0,0 +1,54 @@
+{% comment %}
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+
+<script type="text/javascript">
+$(document).ready(function(){
+  $('.spws{{ ws_id }}').hide();
+  $('.ghoptaskcomment #ws{{ ws_id }}').hover(
+    function() {
+      $('.spws{{ ws_id }}').show();
+    },
+    function() {
+      $('.spws{{ ws_id }}').hide();
+    });
+});
+</script>
+
+<div class="ghoptaskcomment">
+ <div class="title" id="ws{{ ws_id }}">
+  On {{ ws.submitted_on|date:"jS F Y H:i" }},
+  by {{ ws.user.name }}:
+  <span class="spws{{ ws_id }}">
+   <a title="Permalink to this Work Submission" href="#ws{{ ws_id }}">¶</a>
+  </span>
+ </div>
+ <div class="box-inner">
+  <p>
+   {% if ws.information %}
+     {{ ws.information|safe }}</p>
+   {% else %}
+   (No additional information was entered with this work submission.)
+   {% endif %}
+ </div>
+ {% if ws.url_to_work %}
+  <div class="changes">
+   <div class="box-inner">
+    <b>Link to Work Submitted:</b>
+    <a href='{{ ws.url_to_work|safe }}'>{{ ws.url_to_work|safe }}</a> 
+   </div>
+  </div>
+ {% endif %}
+</div>
+<hr />
+