diff --git a/pacApp/__pycache__/urls.cpython-37.pyc b/pacApp/__pycache__/urls.cpython-37.pyc index 3361a57..381e924 100644 Binary files a/pacApp/__pycache__/urls.cpython-37.pyc and b/pacApp/__pycache__/urls.cpython-37.pyc differ diff --git a/pacApp/__pycache__/views.cpython-37.pyc b/pacApp/__pycache__/views.cpython-37.pyc index 532c1e3..51e64d3 100644 Binary files a/pacApp/__pycache__/views.cpython-37.pyc and b/pacApp/__pycache__/views.cpython-37.pyc differ diff --git a/pacApp/static/pacApp/assets/css/schedule.css b/pacApp/static/pacApp/assets/css/schedule.css index 6a9fbc5..25ec9cc 100755 --- a/pacApp/static/pacApp/assets/css/schedule.css +++ b/pacApp/static/pacApp/assets/css/schedule.css @@ -1,3 +1,8 @@ +table { + border-collapse:collapse; +} + + input[type="radio"], { -webkit-appearance: radio; cursor: pointer; @@ -27,21 +32,22 @@ input[type="radio"]#group:checked ~ .reveal-if-activeGroup { overflow: visible; } -th tr{ +th { text-align:left; - } .studio { - padding:6px 12px; + padding-left:20px; + padding-right:0px; } + /* Style the tab */ .tab { overflow: hidden; border: 1px solid #ccc; background-color: #f1f1f1; - padding: 6px 12px; + padding: 6px 12px; width:100%; position:relative; } @@ -71,10 +77,10 @@ th tr{ /* Style the tab content */ .tabcontent { display: none; - padding: 6px 12px; border: 1px solid #ccc; border-top: none; width: 100%; + overflow:hidden; } diff --git a/pacApp/static/pacApp/assets/css/table.css b/pacApp/static/pacApp/assets/css/table.css index a287600..128f86c 100755 --- a/pacApp/static/pacApp/assets/css/table.css +++ b/pacApp/static/pacApp/assets/css/table.css @@ -25,12 +25,6 @@ table { border-collapse: collapse; } -th, td { - font-weight: unset; - padding-right: 10px; - text-align:left; -} - .column100 { width: 130px; } diff --git a/pacApp/static/pacApp/assets/js/schedule.js b/pacApp/static/pacApp/assets/js/schedule.js index b44bf56..bac37dd 100755 --- a/pacApp/static/pacApp/assets/js/schedule.js +++ b/pacApp/static/pacApp/assets/js/schedule.js @@ -22,6 +22,7 @@ function openDay(tab, id) { // Show the current tab, and add an "active" class to the button that opened the tab document.getElementById(tab).style.display = "block"; document.getElementById(id).className += " active"; + var weekdays= {'sun':0,'mon':1,'tue':2,'wed':3,'thu':4,'fri':5,'sat':6}; var date = $('#'+id).data('date').split('-'); console.log(date) var reformatted = date[1] + '/' + date[2] + '/' + date[0].substring(2,4); @@ -194,7 +195,7 @@ function handleresponse(response) } -function setupWeek() +function setupWeek(type) // date = yyyy-mm-dd { // in prepation for the today tab - if it is on the current day, has this feature @@ -204,18 +205,36 @@ function setupWeek() groups = 'None' } console.log(groups); - + + var active = document.getElementsByClassName('active')[0].id[1]; + console.log(active); + var curr = $('#curr').val(); + console.log(curr); let url = 'update'; - request = $.ajax( + if (type == 'week') { + request = $.ajax( { type: "GET", url: url, data: {'newdate': curr, 'selectgroups': groups}, + success: handleresponse, + } + ); + } + else if (type == 'group') { + request = $.ajax( + { + type: "GET", + url: url, + data: {'newdate': curr, + 'selectgroups': groups, + 'groupday': active}, success: handleresponse, } ); + } } function setGroups() { @@ -231,6 +250,7 @@ function setGroups() { } + // sendbook gathers all the stuff necessary to make a booking function sendbook(id) { // checks whether or not there are selected groups diff --git a/pacApp/templates/pacApp/schedule.html b/pacApp/templates/pacApp/schedule.html index 111d9cb..9322054 100644 --- a/pacApp/templates/pacApp/schedule.html +++ b/pacApp/templates/pacApp/schedule.html @@ -5,6 +5,7 @@ + @@ -14,9 +15,6 @@ th, td { cursor: pointer; } - table { - border-collapse: collapse; - } {% endif %} @@ -51,7 +49,7 @@

Booking Schedule

{% include 'templates/pacApp/tableElements/daystab.html' %} {% include 'templates/pacApp/tableElements/table.html' %} - {% include 'templates/pacApp/tableElements/groupSelection.html' %} + {% include 'templates/pacApp/tableElements/groupSelection.html'%}
@@ -75,7 +73,7 @@

Booking Schedule

$('#headerschedule').css('display','none'); } else { - $('#scheduletable').css('margin', '20px'); + /* $('#scheduletable').css('margin', '20px'); */ $('#booking').css('display','none'); } // very initial set up of the document, we use today's date to set up active tab diff --git a/pacApp/templates/pacApp/tableElements/friday.html b/pacApp/templates/pacApp/tableElements/friday.html index bb9bf44..234b1fc 100755 --- a/pacApp/templates/pacApp/tableElements/friday.html +++ b/pacApp/templates/pacApp/tableElements/friday.html @@ -114,3 +114,4 @@ + \ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/groupSelection.html b/pacApp/templates/pacApp/tableElements/groupSelection.html index 373c0a7..ecb82f0 100644 --- a/pacApp/templates/pacApp/tableElements/groupSelection.html +++ b/pacApp/templates/pacApp/tableElements/groupSelection.html @@ -1,12 +1,12 @@ -
- +
+ - + - + - + - +
\ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/monday.html b/pacApp/templates/pacApp/tableElements/monday.html index ef32c52..89df62f 100755 --- a/pacApp/templates/pacApp/tableElements/monday.html +++ b/pacApp/templates/pacApp/tableElements/monday.html @@ -110,3 +110,4 @@
+ \ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/saturday.html b/pacApp/templates/pacApp/tableElements/saturday.html index ed3b15c..680ed47 100755 --- a/pacApp/templates/pacApp/tableElements/saturday.html +++ b/pacApp/templates/pacApp/tableElements/saturday.html @@ -108,3 +108,4 @@ + \ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/table.html b/pacApp/templates/pacApp/tableElements/table.html index fcc79f8..2ee70c4 100644 --- a/pacApp/templates/pacApp/tableElements/table.html +++ b/pacApp/templates/pacApp/tableElements/table.html @@ -29,7 +29,7 @@ - + @@ -45,6 +45,7 @@
{% include 'templates/pacApp/tableElements/saturday.html'%}
+ \ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/thursday.html b/pacApp/templates/pacApp/tableElements/thursday.html index fbfa42a..2f2f3d3 100755 --- a/pacApp/templates/pacApp/tableElements/thursday.html +++ b/pacApp/templates/pacApp/tableElements/thursday.html @@ -110,3 +110,4 @@ + \ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/tuesday.html b/pacApp/templates/pacApp/tableElements/tuesday.html index 6bda9bc..d7d74e6 100755 --- a/pacApp/templates/pacApp/tableElements/tuesday.html +++ b/pacApp/templates/pacApp/tableElements/tuesday.html @@ -110,3 +110,4 @@ + \ No newline at end of file diff --git a/pacApp/templates/pacApp/tableElements/wednesday.html b/pacApp/templates/pacApp/tableElements/wednesday.html index b17a1ba..8def0e3 100755 --- a/pacApp/templates/pacApp/tableElements/wednesday.html +++ b/pacApp/templates/pacApp/tableElements/wednesday.html @@ -111,3 +111,4 @@ + diff --git a/pacApp/views.py b/pacApp/views.py index b95208d..a6d0c20 100755 --- a/pacApp/views.py +++ b/pacApp/views.py @@ -27,10 +27,14 @@ def error_500(request): return render(request,'templates/pacApp/404.html', data) def createContext(startdate, endweek, newdate, groups, getGroups): + actualdate = date.today() + currday = 'None' week = {} for i in range(7): # week.append((startdate + timedelta(days=i)).strftime('%Y-%m-%d-%w')) week[(startdate + timedelta(days=i)).strftime('%w')] = (startdate + timedelta(days=i)).strftime('%Y-%m-%d') + if (startdate + timedelta(days=i)).strftime('%Y-%m-%d') == actualdate.strftime('%Y-%m-%d'): + currday = actualdate.strftime('%w') # print(week) studioList = {'bloomberg':0, 'dillondance':1, 'dillonmar':2, 'dillonmpr': 3, 'murphy': 4, 'ns':5,'nswarmup': 6, 'nstheatre': 7, 'whitman': 8, 'wilcox': 9} @@ -54,6 +58,7 @@ def createContext(startdate, endweek, newdate, groups, getGroups): 'Whitman': Booking.objects.filter(studio_id=8).filter(booking_date__range=[startdate, endweek]), 'Wilcox': Booking.objects.filter(studio_id=9).filter(booking_date__range=[startdate, endweek]), 'newdate': newdate, 'formatdate': formatdate, 'weekday': int(startdate.strftime('%w')), 'sun': week['0'], + 'currday':currday, 'mon': week['1'], 'tue': week['2'], 'wed': week['3'], 'thu': week['4'], 'fri': week['5'], 'sat': week['6']} if getGroups == True: @@ -137,6 +142,7 @@ def update(request:HttpResponse): request.GET.get('endtime'), request.GET.get('day')) retdate = request.GET.get('newdate').split('-') startdate = datetime.date(int(retdate[0]),int(retdate[1]),int(retdate[2])) + print(startdate) endweek = startdate + timedelta(days=6) newdate = request.GET.get('newdate') print(newdate) @@ -151,10 +157,18 @@ def update(request:HttpResponse): context = createContext(startdate, endweek, newdate, groups, getGroups) if weekday != None: context['weekday'] = weekday + groupday = request.GET.get('groupday'); + print(weekday) + print('groupday is') + print(groupday) + if weekday == None and groupday != None: + context['weekday'] = groupday context['editable'] = True + return render(request, "templates/pacApp/tableElements/table.html", context) + def insert_space_item(request: HttpResponse): return redirect('/schedule') diff --git a/pacProject/__pycache__/settings.cpython-37.pyc b/pacProject/__pycache__/settings.cpython-37.pyc index 5eedbc2..ec287a9 100644 Binary files a/pacProject/__pycache__/settings.cpython-37.pyc and b/pacProject/__pycache__/settings.cpython-37.pyc differ diff --git a/pacProject/settings.py b/pacProject/settings.py index 11885e3..a58cdeb 100755 --- a/pacProject/settings.py +++ b/pacProject/settings.py @@ -24,8 +24,8 @@ SECRET_KEY = '59c!&ax&$m&aoy#!&((_l741@@-s6(86f4g8qxu1w!4^v!65d9' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False -#DEBUG = True +#DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['pac-schedule.herokuapp.com/']