Skip to content

Commit

Permalink
add bootstrap button classes to login button
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacdontjelindell committed Jun 18, 2013
1 parent 23f6127 commit 33d53d2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions controllers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

def user():
form = auth()


# this looks horrible but it seems to be the only way to add a CSS class to the submit button
form[0][-1][1][0]['_class'] = 'btn btn-small'

# parse the referring URL to see if we can prepopulate the course_id field in
# the registration form
Expand All @@ -17,16 +18,17 @@ def user():
url_parts = ref[1].split("/")
else:
url_parts = ref.split("/")
for i in range(len(url_parts)):
if "static" in url_parts[i]:
try:
course_id = url_parts[i+1]
form.vars.course_id = course_id
form.process()
break
except KeyError:
# I have no idea if this case of a malformed URL will ever happen
break

for i in range(len(url_parts)):
if "static" in url_parts[i]:
try:
course_id = url_parts[i+1]
form.vars.course_id = course_id
form.process()
break
except KeyError:
# I have no idea if this case of a malformed URL will ever happen
break
return dict(form=form)

def download(): return response.download(request,db)
Expand Down

0 comments on commit 33d53d2

Please sign in to comment.