Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
24 search/templates/home.html
@@ -43,14 +43,19 @@
var newEl = $("#template_" + val).clone();
newEl.removeAttr("id").addClass("searchParam");
var newElWrapper = $("<div>").addClass("searchParamContainer");
- var isToggleElt = $("#template_istoggle").clone();
- isToggleElt.removeAttr("id");
- isToggleElt.show();
- isToggleElt.appendTo(newElWrapper);
+ if (newEl.hasClass('no-choice')) {
+ var hiddenInput = newEl.find('input[type=hidden]');
+ hiddenInput.attr('name', $(this).attr('name') + "_" + newEl.attr("name"));
+ } else {
+ var isToggleElt = $("#template_istoggle").clone();
+ isToggleElt.removeAttr("id");
+ isToggleElt.show();
+ isToggleElt.appendTo(newElWrapper);
+ isToggleElt.attr("name", newEl.attr("name") + "_" + isToggleElt.attr("name"));
+ newEl.attr("name", $(this).attr("name") + "_" + newEl.attr("name"));
+ }
newEl.appendTo(newElWrapper);
- newEl.attr("name", $(this).attr("name") + "_" + newEl.attr("name"));
newEl.show();
- isToggleElt.attr("name", newEl.attr("name") + "_" + isToggleElt.attr("name"));
newElWrapper.appendTo(that);
if( newEl[0].tagName == "SELECT" ) {
if( newEl.data("filtertype") == "state" ) {
@@ -283,6 +288,13 @@
{% endfor %}
</select>
+ <div id="template_student"
+ name="student"
+ class="no-choice">
+ <label style="margin-left: 0.5em">Searching for students</label>
+ <input type="hidden" name="student" value="yes" />
+ </div>
+
<select id="template_language"
name="language"
multiple="multiple">
View
5 search/views.py
@@ -258,6 +258,10 @@ def make_donated_times_query(users, query_data, values, search_on, extra_data={}
'query': "fields__value",
'extra': {"fields__name": "engagement_level"},
},
+ 'student': {
+ 'query': "fields__value",
+ 'extra': {"fields__name": "student"},
+ },
'language': {
'query': "lang__id",
},
@@ -435,6 +439,7 @@ def home(request):
('skills', "Skills"),
('engagement_level', "Engagement Level"),
('language', "Preferred Language"),
+ ('student', "Student"),
('created_before', "Created Before"),
('created_after', "Created After"),
),
View
4 templates/base.html
@@ -276,7 +276,9 @@
if ($('.subnav').hasClass('subnav-fixed')) return;
// Remember top position
var offset = $('.subnav').offset()
- $('.subnav').attr('data-top', offset.top);
+ if (offset) {
+ $('.subnav').attr('data-top', offset.top);
+ }
}
if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop())

No commit comments for this range

Something went wrong with that request. Please try again.