Permalink
Browse files

(For #12) Added basic ability to add/edit/view end *date* of an event

Swapped out "Date, Start Time, End Time" pattern for "Start Date/Time,
End Date/Time" on new, confirmation, edit and event view pages.
  • Loading branch information...
1 parent 336e3f9 commit c6a3cce95ea2c1afca0cc9038120daa09b6a56e2 @mikeharris100 mikeharris100 committed Dec 2, 2011
Showing with 21 additions and 19 deletions.
  1. +4 −4 main.py
  2. +2 −2 notices.py
  3. +2 −2 static/js/edit.js
  4. +1 −1 static/js/new.js
  5. +2 −2 templates/confirmation.html
  6. +4 −3 templates/edit.html
  7. +2 −2 templates/event.html
  8. +4 −3 templates/new.html
View
@@ -196,12 +196,12 @@ def post(self, id):
if access_rights.can_edit:
try:
start_time = datetime.strptime('%s %s:%s %s' % (
- self.request.get('date'),
+ self.request.get('start_date'),
self.request.get('start_time_hour'),
self.request.get('start_time_minute'),
self.request.get('start_time_ampm')), '%m/%d/%Y %I:%M %p')
end_time = datetime.strptime('%s %s:%s %s' % (
- self.request.get('date'),
+ self.request.get('end_date'),
self.request.get('end_time_hour'),
self.request.get('end_time_minute'),
self.request.get('end_time_ampm')), '%m/%d/%Y %I:%M %p')
@@ -459,12 +459,12 @@ def post(self):
user = users.get_current_user()
try:
start_time = datetime.strptime('%s %s:%s %s' % (
- self.request.get('date'),
+ self.request.get('start_date'),
self.request.get('start_time_hour'),
self.request.get('start_time_minute'),
self.request.get('start_time_ampm')), '%m/%d/%Y %I:%M %p')
end_time = datetime.strptime('%s %s:%s %s' % (
- self.request.get('date'),
+ self.request.get('end_date'),
self.request.get('end_time_hour'),
self.request.get('end_time_minute'),
self.request.get('end_time_ampm')), '%m/%d/%Y %I:%M %p')
View
@@ -119,8 +119,8 @@ def notify_new_event(event):
""" % (
event.name,
event.member.email(),
- event.start_time.strftime('%I:%M%p'),
- event.end_time.strftime('%I:%M%p'),
+ event.start_time.strftime('%l, %F %j %Y %I:%M%p'),
+ event.end_time.strftime('%l, %F %j %Y %I:%M%p'),
event.type,
event.estimated_size,
event.roomlist(),
View
@@ -1,6 +1,6 @@
$(function() {
- $("#datepicker").datepicker();
- $('#datepicker, #roomlist input, #start_time_hour, #start_time_minute, #start_time_ampm, #end_time_hour, #end_time_minute, #end_time_ampm').blur(checkDup);
+ $(".datepicker").datepicker();
+ $('.datepicker, #roomlist input, #start_time_hour, #start_time_minute, #start_time_ampm, #end_time_hour, #end_time_minute, #end_time_ampm').blur(checkDup);
});
function checkDup() {
View
@@ -1,5 +1,5 @@
$(function() {
- $("#datepicker").datepicker({minDate: 0});
+ $(".datepicker").datepicker({minDate: 0});
try {
var formvalues = $.cookie('formvalues');
@@ -12,8 +12,8 @@
<h3>{{event.name}}</h3>
-<div class='b-block'><div class='b-label'>Date:</div><div class='b-data'>{{event.start_time|date:"l, F j Y"}}</div></div>
-<div class='b-block'><div class='b-label'>Time:</div><div class='b-data'>{{event.start_time|date:"g:iA"|lower}} to {{event.end_time|date:"g:iA"|lower}}</div></div>
+<div class='b-block'><div class='b-label'>Start:</div><div class='b-data'>{{event.start_time|date:"l, F j Y"}} at {{event.start_time|date:"g:iA"|lower}}</div></div>
+<div class='b-block'><div class='b-label'>End:</div><div class='b-data'>{{event.end_time|date:"l, F j Y"}} at {{event.end_time|date:"g:iA"|lower}}</div></div>
<div class='b-block'><div class='b-label'>Rooms:</div><div class='b-data'>{{event.roomlist}}</div></div>
<div id="rules">{{rules}}</div>
View
@@ -13,8 +13,8 @@
<div class='b-label'>When:</div>
<table style="margin: 0px;" class='b-data'>
<tr>
- <td class="first"><label for="date">Date:</label>
- <input name="date" id="datepicker" value="{{event.start_time|american_date}}" readonly="readonly"/></td>
+ <td class="first"><label for="start_date">Start Date:</label>
+ <input name="start_date" class="datepicker" value="{{event.start_time|american_date}}" readonly="readonly"/></td>
<td><label for="start_time">Start Time:</label>
<select name="start_time_hour" id="start_time_hour">
{% for hour in hours %}
@@ -34,7 +34,8 @@
</td>
</tr>
<tr>
- <td> </td>
+ <td class="first"><label for="end_date">End Date:</label>
+ <input name="end_date" class="datepicker" value="{{event.end_time|american_date}}" readonly="readonly"/></td>
<td><label for="end_time">End Time:</label>
<select name="end_time_hour" id="end_time_hour">
{% for hour in hours %}
View
@@ -35,8 +35,8 @@
</p>{% endif %}{% endif %}
<div class='b-block'><div class='b-label'>Status:</div><div class='b-data'>{{event.status|title}}</div></div>
- <div class='b-block'><div class='b-label'>Date:</div><div class='b-data'>{{event.start_time|date:"l, F j Y"}}</div></div>
- <div class='b-block'><div class='b-label'>Time:</div><div class='b-data'>{{event.start_time|date:"g:iA"|lower}} to {{event.end_time|date:"g:iA"|lower}}</div></div>
+ <div class='b-block'><div class='b-label'>Start:</div><div class='b-data'>{{event.start_time|date:"l, F j Y"}} at {{event.start_time|date:"g:iA"|lower}}</div></div>
+ <div class='b-block'><div class='b-label'>End:</div><div class='b-data'>{{event.end_time|date:"l, F j Y"}} at {{event.end_time|date:"g:iA"|lower}}</div></div>
<div class='b-block'><div class='b-label'>Member:</div><div class='b-data'>{{event.member}}</div></div>
<div class='b-block'><div class='b-label'>Type:</div><div class='b-data'>{{event.type}}</div></div>
<div class='b-block'><div class='b-label'>Estimated size:</div><div class='b-data'>{{event.estimated_size}}</div></div>
View
@@ -18,8 +18,8 @@
<h4>When</h4>
<table style="margin: 0px;">
<tr>
- <td class="first"><label for="date">Date:</label>
- <input name="date" id="datepicker" readonly="readonly"/></td>
+ <td class="first"><label for="start_date">Start Date:</label>
+ <input name="start_date" class="datepicker" readonly="readonly"/></td>
<td><label for="start_time">Start Time:</label>
<select name="start_time_hour">
<option>1</option>
@@ -48,7 +48,8 @@
</td>
</tr>
<tr>
- <td> </td>
+ <td class="first"><label for="end_date">End Date:</label>
+ <input name="end_date" class="datepicker" readonly="readonly"/></td>
<td><label for="end_time">End Time:</label>
<select name="end_time_hour">
<option>1</option>

0 comments on commit c6a3cce

Please sign in to comment.