Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 3 files changed
  • 0 comments
  • 1 contributor
24 search/templates/home.html
@@ -43,14 +43,19 @@
43 43 var newEl = $("#template_" + val).clone();
44 44 newEl.removeAttr("id").addClass("searchParam");
45 45 var newElWrapper = $("<div>").addClass("searchParamContainer");
46   - var isToggleElt = $("#template_istoggle").clone();
47   - isToggleElt.removeAttr("id");
48   - isToggleElt.show();
49   - isToggleElt.appendTo(newElWrapper);
  46 + if (newEl.hasClass('no-choice')) {
  47 + var hiddenInput = newEl.find('input[type=hidden]');
  48 + hiddenInput.attr('name', $(this).attr('name') + "_" + newEl.attr("name"));
  49 + } else {
  50 + var isToggleElt = $("#template_istoggle").clone();
  51 + isToggleElt.removeAttr("id");
  52 + isToggleElt.show();
  53 + isToggleElt.appendTo(newElWrapper);
  54 + isToggleElt.attr("name", newEl.attr("name") + "_" + isToggleElt.attr("name"));
  55 + newEl.attr("name", $(this).attr("name") + "_" + newEl.attr("name"));
  56 + }
50 57 newEl.appendTo(newElWrapper);
51   - newEl.attr("name", $(this).attr("name") + "_" + newEl.attr("name"));
52 58 newEl.show();
53   - isToggleElt.attr("name", newEl.attr("name") + "_" + isToggleElt.attr("name"));
54 59 newElWrapper.appendTo(that);
55 60 if( newEl[0].tagName == "SELECT" ) {
56 61 if( newEl.data("filtertype") == "state" ) {
@@ -283,6 +288,13 @@
283 288 {% endfor %}
284 289 </select>
285 290
  291 + <div id="template_student"
  292 + name="student"
  293 + class="no-choice">
  294 + <label style="margin-left: 0.5em">Searching for students</label>
  295 + <input type="hidden" name="student" value="yes" />
  296 + </div>
  297 +
286 298 <select id="template_language"
287 299 name="language"
288 300 multiple="multiple">
5 search/views.py
@@ -258,6 +258,10 @@ def make_donated_times_query(users, query_data, values, search_on, extra_data={}
258 258 'query': "fields__value",
259 259 'extra': {"fields__name": "engagement_level"},
260 260 },
  261 + 'student': {
  262 + 'query': "fields__value",
  263 + 'extra': {"fields__name": "student"},
  264 + },
261 265 'language': {
262 266 'query': "lang__id",
263 267 },
@@ -435,6 +439,7 @@ def home(request):
435 439 ('skills', "Skills"),
436 440 ('engagement_level', "Engagement Level"),
437 441 ('language', "Preferred Language"),
  442 + ('student', "Student"),
438 443 ('created_before', "Created Before"),
439 444 ('created_after', "Created After"),
440 445 ),
4 templates/base.html
@@ -276,7 +276,9 @@
276 276 if ($('.subnav').hasClass('subnav-fixed')) return;
277 277 // Remember top position
278 278 var offset = $('.subnav').offset()
279   - $('.subnav').attr('data-top', offset.top);
  279 + if (offset) {
  280 + $('.subnav').attr('data-top', offset.top);
  281 + }
280 282 }
281 283
282 284 if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop())

No commit comments for this range

Something went wrong with that request. Please try again.