From 0d86a40ecf0625f4e03d795dfdf76a652776d9ab Mon Sep 17 00:00:00 2001 From: Kaltar5679 Date: Thu, 25 Jun 2015 13:54:35 +0200 Subject: [PATCH] organization of haystack function --- src/django-haystack | 1 + src/pip-delete-this-directory.txt | 5 + telemeta/forms/haystack_form.py | 6 +- .../static/telemeta/css/advanceSearch.css | 43 +++++ telemeta/static/telemeta/css/search.js | 69 ++++++++ telemeta/static/telemeta/js/advanceSearch.js | 106 ++++++++++++ telemeta/static/telemeta/js/search.js | 69 ++++++++ .../{js => lib/jquery}/jquery-ui.min.js | 0 .../telemeta/{js => lib/jquery}/jquery.js | 0 .../{js => lib/tablesorter}/jquery-latest.js | 0 .../tablesorter}/jquery.tablesorter.min.js | 0 telemeta/templates/search/addplaylist.html | 49 +----- telemeta/templates/search/advanceSearch.html | 158 +----------------- .../search/mediacollection_listhaystack.html | 4 +- .../search/mediaitem_listhaystack.html | 4 +- telemeta/templates/search/search.html | 121 +------------- telemeta/templates/telemeta/lists.html | 6 +- 17 files changed, 314 insertions(+), 327 deletions(-) create mode 160000 src/django-haystack create mode 100644 src/pip-delete-this-directory.txt create mode 100644 telemeta/static/telemeta/css/advanceSearch.css create mode 100644 telemeta/static/telemeta/css/search.js create mode 100644 telemeta/static/telemeta/js/advanceSearch.js create mode 100644 telemeta/static/telemeta/js/search.js rename telemeta/static/telemeta/{js => lib/jquery}/jquery-ui.min.js (100%) rename telemeta/static/telemeta/{js => lib/jquery}/jquery.js (100%) rename telemeta/static/telemeta/{js => lib/tablesorter}/jquery-latest.js (100%) rename telemeta/static/telemeta/{js => lib/tablesorter}/jquery.tablesorter.min.js (100%) diff --git a/src/django-haystack b/src/django-haystack new file mode 160000 index 00000000..ebf1a5c9 --- /dev/null +++ b/src/django-haystack @@ -0,0 +1 @@ +Subproject commit ebf1a5c94a7e8af1329084cf0056de0014821723 diff --git a/src/pip-delete-this-directory.txt b/src/pip-delete-this-directory.txt new file mode 100644 index 00000000..c8883ea9 --- /dev/null +++ b/src/pip-delete-this-directory.txt @@ -0,0 +1,5 @@ +This file is placed here by pip to indicate the source was put +here by pip. + +Once this package is successfully installed this source code will be +deleted (unless you remove this file). diff --git a/telemeta/forms/haystack_form.py b/telemeta/forms/haystack_form.py index 4288d5c1..cee89cb4 100644 --- a/telemeta/forms/haystack_form.py +++ b/telemeta/forms/haystack_form.py @@ -35,7 +35,7 @@ class HayAdvanceForm(SearchForm): #begin create field #to replace de basic search form field - q = forms.CharField(required=False, label=('Title'), widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'search'})) + q = forms.CharField(required=False, label=('title'), widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'search'})) location = forms.CharField(required=False, label=('Location'), widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'search'})) @@ -189,9 +189,9 @@ class HayAdvanceForm(SearchForm): if self.cleaned_data['item_status']: if self.cleaned_data.get('item_status') == 'pub': - sqs = sqs = sqs.filter(item_status='Published') + sqs = sqs.filter(item_status='Published') if self.cleaned_data.get('item_status') == 'unpub': - sqs = sqs = sqs.filter(item_status='Unpublished') + sqs = sqs.filter(item_status='Unpublished') if self.cleaned_data['media_type']: if self.cleaned_data.get('media_type') != '1': diff --git a/telemeta/static/telemeta/css/advanceSearch.css b/telemeta/static/telemeta/css/advanceSearch.css new file mode 100644 index 00000000..2c69cdaa --- /dev/null +++ b/telemeta/static/telemeta/css/advanceSearch.css @@ -0,0 +1,43 @@ +.overflow{ + max-height:200px; +} + +.module ul, li { + border-radius: 0px 0px 0px 0px; +} + +.ui-selectmenu-button.ui-widget.ui-state-default{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} + +.ui-selectmenu-button.ui-widget.ui-state-hover{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} + +.ui-selectmenu-button.ui-widget.ui-state-focus{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} + +.ui-selectmenu-button.ui-widget.ui-state-default .ui-icon{ + background-image:url("images/ui-icons_ffffff_256x240.png"); +} + +.ui-menu-item{ + background-color:white; +} + +.ui-menu-item.ui-state-focus{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} diff --git a/telemeta/static/telemeta/css/search.js b/telemeta/static/telemeta/css/search.js new file mode 100644 index 00000000..8b2a5066 --- /dev/null +++ b/telemeta/static/telemeta/css/search.js @@ -0,0 +1,69 @@ +$(function() { + + function getPrevUrlParameter(sParam){ + var sPageURL = document.referrer.substring(1); + var sURLVariables = sPageURL.split('&'); + for (var i = 0; i < sURLVariables.length; i++) + { + var sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] == sParam) + { + return sParameterName[1]; + } + } + }; + + function getCurrUrlParameter(sParam){ + var sPageURL = window.location.search.substring(1); + var sURLVariables = sPageURL.split('&'); + for (var i = 0; i < sURLVariables.length; i++) + { + var sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] == sParam) + { + return sParameterName[1]; + } + } + }; + + var prev = getPrevUrlParameter("page"); + var curr = getCurrUrlParameter("page"); + if(prev - {% endblock %} {% block content %} @@ -104,8 +59,8 @@ {% endblock %} {% block extra_javascript %} - - + + - + + + - + + + - - - + + +