Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 2 #65

Open
wants to merge 983 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
983 commits
Select commit Hold shift + click to select a range
aea71b8
contact us popover added
Aug 28, 2012
da548fe
Sampark - C_ removed
varshaan Aug 28, 2012
36f9d94
search for sampark page
srmanikandasriram Aug 28, 2012
ddde000
contacts modal bug fixed
Aug 28, 2012
6a379fc
minor modal changes
Aug 28, 2012
7a5859d
bullet points for downloads added
srmanikandasriram Aug 28, 2012
9e5fbe2
sampark home page editted
srmanikandasriram Aug 28, 2012
63aa210
minor changes
webopsShaastra Aug 28, 2012
a4798c8
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Aug 28, 2012
6719ac4
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Aug 28, 2012
37e793e
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Aug 28, 2012
36a7719
Added google analytics.
BademiChetan Aug 29, 2012
f0fbd05
Merge branch 'events' of https://github.com/ShaastraWebops/Shaastra-2…
BademiChetan Aug 29, 2012
5e8b84c
scroll hospi
vsvrp-1995 Aug 30, 2012
67535e1
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
vsvrp-1995 Aug 30, 2012
c2c7ebc
hospi scroll
vsvrp-1995 Aug 30, 2012
0f77bf4
hospi scroll
vsvrp-1995 Aug 30, 2012
5e25bdf
hospi scroll
vsvrp-1995 Aug 30, 2012
fb9b11c
sampark scroll removed
srmanikandasriram Aug 30, 2012
9612b51
hospi is now a hash of the main site
srmanikandasriram Aug 30, 2012
352c4c9
scroll hospi
vsvrp-1995 Aug 30, 2012
665398a
modal moved to base.html
Aug 31, 2012
b6c3dde
minor change
Aug 31, 2012
4392184
minor alignment changes in modal
Aug 31, 2012
02662f4
fb app changes
webopsShaastra Aug 31, 2012
9dd5791
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Aug 31, 2012
d5a8c5a
sampark anchor tag corrected
Aug 31, 2012
636531c
spons logo fix
srmanikandasriram Sep 1, 2012
921943e
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
srmanikandasriram Sep 1, 2012
b511f46
minor bug removed
Sep 4, 2012
4e13a9d
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Sep 4, 2012
8fd4ecc
minor changes
webopsShaastra Sep 4, 2012
2573f24
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 4, 2012
eca122b
shaastra updates div added
Sep 8, 2012
cccbc44
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 8, 2012
923d4cc
updates text changed
Sep 9, 2012
58996fa
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 9, 2012
5a31610
marquee help text added for sampark events
Sep 10, 2012
aa080d7
sampark help text made simpler
Sep 10, 2012
58a0a5b
minor changes
webopsShaastra Sep 10, 2012
9976c2a
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 10, 2012
840af12
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 10, 2012
24a3370
site admin contact added
yashmurty Sep 15, 2012
92b0f76
minor changes
webopsShaastra Sep 16, 2012
9fed72a
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 16, 2012
21e2a14
updated sampark ticker on main site
srmanikandasriram Sep 18, 2012
5c3325c
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 18, 2012
5db8a41
Event Registration (Issue #62): Update models.
anantgirdhar Sep 19, 2012
e337f2d
Event Registration: Minor change.
anantgirdhar Sep 19, 2012
3c42ffc
Add Shaastra registration tab on home page.
anantgirdhar Sep 19, 2012
723817b
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 19, 2012
46e8ffa
register icon rectified
Sep 20, 2012
32f1a79
marquee added in the front page
Sep 20, 2012
0461d6e
scroll register
vsvrp-1995 Sep 20, 2012
3004e1c
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
vsvrp-1995 Sep 20, 2012
4be0566
register new college changed to a button
Sep 20, 2012
292e33f
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Sep 20, 2012
ab13bf7
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 21, 2012
e87d401
register page sroll problems resolved
Sep 22, 2012
a3cffff
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 22, 2012
1fb7519
minor changes
webopsShaastra Sep 22, 2012
e70d624
minor changes
webopsShaastra Sep 22, 2012
2cd32b9
Event Registration: Add registration models.
anantgirdhar Sep 24, 2012
3d4a277
Event registration: Add necessary URLs for registration.
anantgirdhar Sep 25, 2012
cadff3f
Event registration: Add and modify models.
anantgirdhar Sep 25, 2012
3c743bd
Event registration: Add views for singular event registration.
anantgirdhar Sep 25, 2012
4f507b0
Event registration: Add views for teams (kulted from last year).
anantgirdhar Sep 25, 2012
c4007bf
Event registration: Add templates for teams (kulted from last year).
anantgirdhar Sep 25, 2012
f45b38b
Event registration: Modify views for registration.
anantgirdhar Sep 25, 2012
8600bc5
Event registration: Add templates for singular event registrations.
anantgirdhar Sep 25, 2012
dacf05d
Event registration: Correct spelling error.
anantgirdhar Sep 26, 2012
2a2ef48
Event registration: Correct error.
anantgirdhar Sep 26, 2012
4eb0dbf
Event registration: Remove constraint in Team for testing.
anantgirdhar Sep 26, 2012
a6c1f89
Event registration: EventTeamRegistrations seems obsolete. Remove.
anantgirdhar Sep 26, 2012
56dbb10
pune sampark changed to kerala sampark
Sep 26, 2012
46dbf6a
Event registration: Change order of URLs.
anantgirdhar Sep 26, 2012
403b9eb
Did nothing.
anantgirdhar Sep 26, 2012
0adc76f
Event registration: Fix errors in views.
anantgirdhar Sep 26, 2012
655b153
Event registration: Add template to tell user that team regn is requi…
anantgirdhar Sep 26, 2012
8f07287
Event registration: Fix errors in templates.
anantgirdhar Sep 26, 2012
462a27c
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 26, 2012
833aa72
sampark kerela details added
vsvrp-1995 Sep 27, 2012
0c2046a
testing js
Sep 28, 2012
6ab14ef
restoring back
Sep 28, 2012
85e535d
minor changes
webopsShaastra Sep 29, 2012
cb7df9f
minor changes
webopsShaastra Sep 29, 2012
9f11731
Event registration: Add singular event registration cancelation funct…
anantgirdhar Sep 29, 2012
793c3ec
Event registration: Modify team deregistration message.
anantgirdhar Sep 29, 2012
30edbbb
Event registration: Fix bug.
anantgirdhar Sep 29, 2012
ac3aed5
Event registration: Add some constraints and checks on teams.
anantgirdhar Sep 29, 2012
1ab9c28
Event registration: Fix bug.
anantgirdhar Sep 29, 2012
eb13d18
Event registration: Allow user to see his name in team_home.html.
anantgirdhar Sep 29, 2012
59f2395
Event registration: Show registrations open in announcments.
anantgirdhar Sep 29, 2012
5adc443
small bug removed
Sep 30, 2012
2a8c357
login icon added
Sep 30, 2012
4b839f5
minor changes
webopsShaastra Sep 30, 2012
f352fcd
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Sep 30, 2012
3328012
Update added to home
varshaan Oct 1, 2012
4a82669
Try: Add chosen select to college registration.
anantgirdhar Oct 1, 2012
66f49b3
Revert. Chosen widget did not work.
anantgirdhar Oct 1, 2012
12efdcd
Try: Add chosen select to college registration.
anantgirdhar Oct 1, 2012
56a75eb
events link hard-coded
vsvrp-1995 Oct 1, 2012
8c14a6a
Change password help text.
anantgirdhar Oct 1, 2012
9a19d4e
announcements on main page
srmanikandasriram Oct 1, 2012
e2b12fc
announcements in min site in marquee
srmanikandasriram Oct 1, 2012
5fe4cdb
minor changes
Oct 1, 2012
982e187
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 1, 2012
fb99f2d
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
vsvrp-1995 Oct 1, 2012
ac894ab
Try: Fix college regn multiple error problem.
anantgirdhar Oct 1, 2012
d7c6717
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Oct 1, 2012
6d9c2c4
Revert. College regn multiple message fix did not work.
anantgirdhar Oct 1, 2012
2f80745
marquee text changed
Oct 1, 2012
d2a6570
home page video changed
Oct 1, 2012
42a538d
twitter link changed
Oct 1, 2012
cbdd1d0
scroll error removed
Oct 1, 2012
3bf59ef
minor bug removed
Oct 1, 2012
5355b9e
events link
vsvrp-1995 Oct 2, 2012
d9f0abe
events link
vsvrp-1995 Oct 2, 2012
802c183
minor bug removed
Oct 2, 2012
bcb067b
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Oct 2, 2012
be4f129
hardcoded link removed
Oct 2, 2012
80d1723
Register Hospi added + Shaastra id created
varshaan Oct 2, 2012
093d701
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
varshaan Oct 2, 2012
c49075a
Added Associated Events category
varshaan Oct 3, 2012
7e5ccdb
footer tab added
Oct 3, 2012
fe29fac
Hospi mistakes
vsvrp-1995 Oct 3, 2012
e513e7f
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
vsvrp-1995 Oct 3, 2012
d4b36ef
hospi mistake
vsvrp-1995 Oct 3, 2012
fcf98d2
transparent background over content added
Oct 4, 2012
ea38d2b
co-cas phone no removed
Oct 5, 2012
46d6d52
Frontend Hospi
yashmurty Oct 6, 2012
8d2fac3
Hospi Frontend
yashmurty Oct 6, 2012
ac5ea57
Hospi Frontend
yashmurty Oct 6, 2012
311795c
fb unhandled exception resolved
srmanikandasriram Oct 7, 2012
d9a3598
Shorten name for IT/IS branch (it exceeds 50 character model limit).
anantgirdhar Oct 7, 2012
4ab3665
Tell users to check spam if regn mail not received.
anantgirdhar Oct 7, 2012
965fb8b
hash handler changed
srmanikandasriram Oct 8, 2012
587af58
hash handler changed
srmanikandasriram Oct 8, 2012
d8561f8
hash changed for sampark
srmanikandasriram Oct 8, 2012
3d75c43
adding scroll to tabtext
Oct 8, 2012
c534434
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Oct 8, 2012
bc7f54d
testing scrollpane
Oct 8, 2012
4bb9cee
testing scrollpane on tabtext
Oct 8, 2012
53ac396
adding scrollpane
Oct 8, 2012
feec76f
testing scrollpane
Oct 8, 2012
792dc41
testing scrollpane
Oct 8, 2012
a9ea813
removing the changes
Oct 8, 2012
579c99d
scroll added
srmanikandasriram Oct 8, 2012
2e2caa9
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
srmanikandasriram Oct 8, 2012
e9ce30c
scroll completed
srmanikandasriram Oct 9, 2012
8926390
scroll finally working, update ur style.css
Oct 9, 2012
bb1d5b2
Change study branch IC/IS name to information technology and sciences…
anantgirdhar Oct 9, 2012
edd6a38
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
anantgirdhar Oct 9, 2012
38c8183
Merge EventRegn into events: Event registration.
anantgirdhar Oct 11, 2012
09eff70
Resolve EventRegn merge error.
anantgirdhar Oct 11, 2012
7a43ff3
Contacts Update
yashmurty Oct 11, 2012
c7076b1
hospi footer tab added
Oct 11, 2012
bec0d47
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Oct 11, 2012
ba209c4
added internship line in email
varshaan Oct 12, 2012
9657b0e
Merge error fixed
webopsShaastra Oct 12, 2012
6829f27
easing plugin added
Oct 13, 2012
bc3f263
minor changes
webopsShaastra Oct 13, 2012
f04b20b
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 13, 2012
f87fcd4
minor changes
Oct 13, 2012
1ed0f7c
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 13, 2012
f0995d9
minor bug removed
Oct 13, 2012
0d5d3a4
minor eroors corrected
Oct 13, 2012
6035e20
minor changes
webopsShaastra Oct 13, 2012
5579e91
merge head removed
webopsShaastra Oct 13, 2012
cef28e7
added hashes for tab names
srmanikandasriram Oct 13, 2012
af4bf30
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
srmanikandasriram Oct 13, 2012
2aa0e98
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 13, 2012
a195e35
minor changes in sampark home
srmanikandasriram Oct 13, 2012
3c804d0
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 13, 2012
962ac6c
Hospi and Register issues corrected
webopsShaastra Oct 13, 2012
8cf325c
lightbox added for hospi images
Oct 15, 2012
dd2dc68
ticker changed
webopsShaastra Oct 15, 2012
57f5d15
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 15, 2012
39114b3
soln for hash fragments cross links issue
srmanikandasriram Oct 18, 2012
83c610d
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 18, 2012
462491a
mod for hash fragments
srmanikandasriram Oct 18, 2012
d95f028
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 18, 2012
26c0c5c
style block placed ahead
Oct 19, 2012
368766e
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
Oct 19, 2012
279a9d5
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 19, 2012
4f2e7ed
register page css corrected
webopsShaastra Oct 19, 2012
e46a37d
Changed want_hospi to want_accomodation
varshaan Oct 19, 2012
7099051
Help-Text changed
varshaan Oct 19, 2012
cd11075
add event issue solved
srmanikandasriram Oct 20, 2012
b3e51a6
adding events
srmanikandasriram Oct 20, 2012
579de78
adding events
srmanikandasriram Oct 20, 2012
19f64ed
TDP Submissions
varshaan Oct 22, 2012
f6f463b
added tdp files
varshaan Oct 22, 2012
f370484
sampark home content changed
srmanikandasriram Oct 22, 2012
0b92a95
Modifications in TDP
varshaan Oct 22, 2012
67efaff
added field in event models
varshaan Oct 22, 2012
1396688
minor errors corrected
Oct 22, 2012
a5e0ae5
css added
Oct 23, 2012
676c1f5
sampark home text modified
srmanikandasriram Oct 23, 2012
ccd16f0
fb app restructure
srmanikandasriram Oct 24, 2012
14f5dfe
fb app events hashed
srmanikandasriram Oct 24, 2012
ad1239b
fb app sampark.html added
srmanikandasriram Oct 24, 2012
a2dcc95
spons images
srmanikandasriram Oct 24, 2012
7a59603
spons div
vsvrp-1995 Oct 24, 2012
f089626
spons div
webopsShaastra Oct 24, 2012
51459d6
spons div
webopsShaastra Oct 24, 2012
6fccc47
spons slide removed
vsvrp-1995 Oct 24, 2012
9a80ba5
spons slide removed
webopsShaastra Oct 24, 2012
69be352
spons tab
srmanikandasriram Oct 24, 2012
0b90627
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
srmanikandasriram Oct 24, 2012
0c9c91c
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 24, 2012
eb5ceaa
css added
Oct 24, 2012
27156fd
new tdp template
Oct 24, 2012
6cb7d57
minor changes
Oct 24, 2012
5d6560d
spons images
srmanikandasriram Oct 24, 2012
e18e99d
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 24, 2012
cbc0d30
frontend enhancement
Oct 24, 2012
3a1b5db
commented some uneccessary code
Oct 24, 2012
23d4e1b
Merge error fixed
varshaan Oct 25, 2012
5f07d28
Merge branch 'tdpsubmissions' of github.com:ShaastraWebops/Shaastra-2…
varshaan Oct 25, 2012
c650fd1
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
varshaan Oct 25, 2012
b980b59
spons images
srmanikandasriram Oct 25, 2012
6add352
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
srmanikandasriram Oct 25, 2012
971f292
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 25, 2012
7bb4b86
minor changes
webopsShaastra Oct 25, 2012
c0e39ab
spons footer hidden
srmanikandasriram Oct 25, 2012
09f851b
TDP Submission Multiple times enabled.
varshaan Oct 25, 2012
73f9967
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
varshaan Oct 25, 2012
2d3a543
Team TDP Submission tested and corrected
varshaan Oct 25, 2012
ffca4fd
spons images index number changed
srmanikandasriram Oct 26, 2012
80a9c42
updated spons
vsvrp-1995 Oct 26, 2012
8d40e98
scroll updated divs
vsvrp-1995 Oct 26, 2012
1736763
spons button
vsvrp-1995 Oct 26, 2012
b4c5881
spons button
vsvrp-1995 Oct 26, 2012
d9407b2
spons button
webopsShaastra Oct 26, 2012
9a7c02c
spons page
webopsShaastra Oct 26, 2012
e3d50c2
Registeration Front End
yashmurty Oct 26, 2012
a010b13
Merge branch 'events' of github.com:ShaastraWebops/Shaastra-2013-Webs…
yashmurty Oct 26, 2012
a60c886
Merge branch 'events' of http://github.com/ShaastraWebops/Shaastra-20…
webopsShaastra Oct 26, 2012
d350d7a
spons closed for now
vsvrp-1995 Oct 26, 2012
3d3588f
spons closed for now
webopsShaastra Oct 26, 2012
675170b
TDP Upload url corrected
webopsShaastra Oct 27, 2012
2fd167e
spons images modified
srmanikandasriram Oct 27, 2012
809ff3f
hash fragments ajax crawling
srmanikandasriram Oct 27, 2012
12ab3ad
hash fragments ajax crawling minor changed
srmanikandasriram Oct 27, 2012
ae46138
minor changes
srmanikandasriram Oct 27, 2012
1c2f669
hash changes for sampark
srmanikandasriram Oct 27, 2012
5dde860
minor changes
srmanikandasriram Oct 27, 2012
791e770
sampark hash
webopsShaastra Oct 27, 2012
a349929
Marquee updated for sampark
mdrhazy Oct 28, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
*.pyc
local_settings.py
*~
*.sw*
*.sw*
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
6th June, 12
Basic Tabs done.
Please take care of the different settings that need for dajax to run.
Dont use 'shaastra' as your project folder's name. Dajax was not accepting hyphens for some reason. My folder's name is 'shaastra'.
If you have a different name please change 'Dajaxice.shaastra.events.<some_func>' to 'Dajaxice.<your_project_folder>.events.<some_func>' in all the templates.
Dont forget to add AUTH_PROFILE_MODULE = 'events.UserProfile' to your local settings.

9th June, 12
Tab files added. they have add, delete functionality.
sending file uses ajax. rest can be done by dajax.
Renaming files has to be done.

15th June, 12 Renaming of files done

16th June, Chosen-JQuery plugin implemented in the form for adding events. 'Tags' for events can now be added in a more presentable way.

25th June, Coords can now add questionnares. He/She can choose to add an mcq or a subjective. After adding an mcq, he/she can add choices for it. editing/deleting of options/questions can be done.
As suggested by Suraj, I have made some changes so that you dont need to name your project folder as 'shaastra'. I have added some lines to global_settings.py and added a file called context_processors.py. So in templates just use {{pro_dir}} instead of 'shaastra' now, and your folder name will get rendered there. Just add the following line as it is in your TEMPLATE_CONTEXT_PROCESSORS - "events.context_processors.project_dir_name".
Shaastra 2013 Events
91 changes: 64 additions & 27 deletions admin/ajax.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#The variable Summary refers to the div where a table consisting group name and its cores is displayed
#The variable space refers to the div where different forms like add/edit group/core are displayed
#!/usr/bin/python
# -*- coding: utf-8 -*-
# The variable Summary refers to the div where a table consisting group name and its cores is displayed
# The variable space refers to the div where different forms like add/edit group/core are displayed

from dajaxice.decorators import dajaxice_register
from django.utils import simplejson
Expand All @@ -9,95 +11,130 @@
from django.contrib.auth.models import Group, User
from users.models import UserProfile


@dajaxice_register
def add_edit_group(request,form="",id=0):
def add_edit_group(request, form='', id=0):
"""
This function calls the AddGroupForm from forms.py
If a new group is being created, a blank form is displayed and the super user can fill in necessary details.
If an existing group's details is being edited, the same form is displayed populated with current group details for all fields

"""

dajax = Dajax()
if id:
group_form = AddGroupForm(form, instance=Group.objects.get(id=id))
group_form = AddGroupForm(form,
instance=Group.objects.get(id=id))
else:
group_form = AddGroupForm(form)
if group_form.is_valid():
group_form.save()
dajax.script("updateSummary();")
dajax.script('updateSummary();')
return dajax.json()


@dajaxice_register
def updateSummary(request):
"""
This function updates the table in summary div whenever a new group/core is added or when an existing group/core is edited or deleted

"""

dajax = Dajax()
dajax.assign("#summary",'innerHTML',"<table border='1'><thead><tr><th>S.No</th><th>Group Name</th><th>Cores</th></tr></thead><tbody id='groups'>")
groups=Group.objects.order_by('id').all()[1:]
dajax.assign('#summary', 'innerHTML',
"<table border='1' class='table table-striped table-bordered table-condensed'><thead><tr><th>S.No</th><th>Group Name</th><th>Cores</th></tr></thead><tbody id='groups'>"
)
groups = Group.objects.order_by('id').all()
for g in groups:
dajax.append("#groups",'innerHTML',"<tr><td>"+str(g.id-1)+"</td><td class='grps' id="+g.name+"><a href="+'#editgroup/'+str(g.id)+'/'+">"+g.name+"</a></td><td id="+str(g.id)+"></td></tr>")
cores=User.objects.filter(groups__name=g.name)
dajax.append('#groups', 'innerHTML', '<tr><td>' + str(g.id)
+ "</td><td class='grps' id=" + g.name
+ "><a class='tablelinks' href=" + '#editgroup/'
+ str(g.id) + '/' + '>' + g.name
+ '</a></td><td id=' + str(g.id) + '></td></tr>')
cores = User.objects.filter(groups__name=g.name)
for c in cores:
if c.get_profile().is_core:
dajax.append("#"+str(g.id),'innerHTML',"<li class='cores' id="+str(c.username)+"><a href="+'#editcore/'+str(c.id)+'/'+">"+str(c)+"</a>")
dajax.assign(".bbq-item","innerHTML","<i>Space for displaying forms</i>");
dajax.append('#' + str(g.id), 'innerHTML',
"<li class='cores' id=" + str(c.username)
+ "><a class='tablelinks' href="
+ '#editcore/' + str(c.id) + '/' + '>'
+ str(c) + '</a>')
dajax.script("window.location.hash=''")
return dajax.json()


@dajaxice_register
def del_group(request,id):
def del_group(request, id):
"""
This function is called when the super user wants to delete a group

"""

dajax = Dajax()
group=Group.objects.get(id=id)
group = Group.objects.get(id=id)
group.delete()
dajax.script("updateSummary();")
dajax.script('updateSummary();')
return dajax.json()


@dajaxice_register
def add_edit_core(request,form="",id=0):
def add_edit_core(request, form='', id=0):
"""
This function calls the AddCoreForm from forms.py
If a new core is being created, a blank form is displayed and the super user can fill in necessary details.
If an existing core's details is being edited, the same form is displayed populated with current core details for all fields

"""

dajax = Dajax()
if id:

# groups field is a Many-to-Many field and requires a list of values

grps = []
grps.append(form['groups'])
form['groups'] = grps
core_form = AddCoreForm(form, instance=User.objects.get(id=id))
if core_form.is_valid():
core_form.save()
dajax.script("updateSummary();")
dajax.script('updateSummary();')
else:
template = loader.get_template('ajax/admin/editcore.html')
html=template.render(RequestContext(request,locals()))
dajax.assign(".bbq-item",'innerHTML',html)
html = template.render(RequestContext(request, locals()))
dajax.assign('.bbq-item', 'innerHTML', html)
else:

# groups field is a Many-to-Many field and requires a list of values

grps = []
grps.append(form['groups'])
form['groups'] = grps
core_form = AddCoreForm(form)
if core_form.is_valid():
core=core_form.save()
core.set_password("default")
core = core_form.save()
core.set_password('default')
core.save()
core_profile = UserProfile( user=core, is_core=True)
core_profile = UserProfile(user=core, is_core=True)
core_profile.save()
dajax.script("updateSummary();")
dajax.script('updateSummary();')
else:
form['groups'] = grps[0]
template = loader.get_template('ajax/admin/addcore.html')
html=template.render(RequestContext(request,locals()))
dajax.assign(".bbq-item",'innerHTML',html)
html = template.render(RequestContext(request, locals()))
dajax.assign('.bbq-item', 'innerHTML', html)
dajax.script("$('.chzn-select').chosen();")
return dajax.json()


@dajaxice_register
def del_core(request,id):
def del_core(request, id):
"""
This function is called when the super user wants to delete a core

"""

dajax = Dajax()
core=User.objects.get(id=id)
core = User.objects.get(id=id)
core.delete()
dajax.script("updateSummary();")
dajax.script('updateSummary();')
return dajax.json()
19 changes: 16 additions & 3 deletions admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import Group, User
from users.models import UserProfile
from chosen import widgets as chosenwidgets


class AddGroupForm(forms.ModelForm):

"""
This form is used to add/edit groups

"""

class Meta:

model = Group
fields=('name',)
fields = ('name', )


class AddCoreForm(forms.ModelForm):

"""
This form is used to add/edit cores

"""

class Meta:

model = User
fields=('groups','username','email')
# widgets={'password':forms.widgets.HiddenInput,}
fields = ('groups', 'username', 'email')
widgets = {'groups': chosenwidgets.ChosenSelect}


2 changes: 2 additions & 0 deletions admin/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import Group
from django.contrib.auth.models import User
Expand Down
7 changes: 7 additions & 0 deletions admin/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Expand All @@ -9,8 +12,12 @@


class SimpleTest(TestCase):

def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""

self.assertEqual(1 + 1, 2)


9 changes: 6 additions & 3 deletions admin/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

from django.conf import settings
from django.conf.urls.defaults import *
from admin.views import *

urlpatterns = patterns('',
urlpatterns = patterns(
'',
url(r'^addgroup/', addgroup, name='addgroup'),
url(r'^editgroup/(?P<id>\d+)', editgroup, name='editgroup'),
url(r'^addcore/', addcore, name='addcore'),
url(r'^editcore/(?P<id>\d+)', editcore, name='editcore'),
url(r'^$', home, name = 'home'),
)
url(r'^$', home, name='home'),
)
50 changes: 34 additions & 16 deletions admin/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
Expand All @@ -6,52 +8,68 @@
from admin.forms import *
from django.contrib.auth.models import Group


@login_required(login_url=settings.SITE_URL + 'user/login/')
def home(request):
"""
This is the home page view of the superuser
"""
if request.user.is_superuser is False :

if request.user.is_superuser is False:
return HttpResponseRedirect(settings.SITE_URL)
return render_to_response('admin/home.html', locals(), context_instance = RequestContext(request))
return render_to_response('admin/home.html', locals(),
context_instance=RequestContext(request))


@login_required(login_url=settings.SITE_URL + 'user/login/')
def addgroup(request):
"""
This is the home page view of the superuser
"""
if request.user.is_superuser is False :

if request.user.is_superuser is False:
return HttpResponseRedirect(settings.SITE_URL)
group_form=AddGroupForm()
return render_to_response('ajax/admin/addgroup.html', locals(), context_instance = RequestContext(request))
group_form = AddGroupForm()
return render_to_response('ajax/admin/addgroup.html', locals(),
context_instance=RequestContext(request))


@login_required(login_url=settings.SITE_URL + 'user/login/')
def editgroup(request,id=0):
def editgroup(request, id=0):
"""
This is the home page view of the superuser
"""
if request.user.is_superuser is False :

if request.user.is_superuser is False:
return HttpResponseRedirect(settings.SITE_URL)
group_form=AddGroupForm(instance=Group.objects.get(id=id))
return render_to_response('ajax/admin/editgroup.html', locals(), context_instance = RequestContext(request))
group_form = AddGroupForm(instance=Group.objects.get(id=id))
return render_to_response('ajax/admin/editgroup.html', locals(),
context_instance=RequestContext(request))


@login_required(login_url=settings.SITE_URL + 'user/login/')
def addcore(request):
"""
This is the home page view of the superuser
"""
if request.user.is_superuser is False :

if request.user.is_superuser is False:
return HttpResponseRedirect(settings.SITE_URL)
core_form=AddCoreForm()
return render_to_response('ajax/admin/addcore.html', locals(), context_instance = RequestContext(request))
core_form = AddCoreForm()
return render_to_response('ajax/admin/addcore.html', locals(),
context_instance=RequestContext(request))


@login_required(login_url=settings.SITE_URL + 'user/login/')
def editcore(request,id=0):
def editcore(request, id=0):
"""
This is the home page view of the superuser
"""
if request.user.is_superuser is False :

if request.user.is_superuser is False:
return HttpResponseRedirect(settings.SITE_URL)
core_form=AddCoreForm(instance=User.objects.get(id=id))
return render_to_response('ajax/admin/editcore.html', locals(), context_instance = RequestContext(request))
core_form = AddCoreForm(instance=User.objects.get(id=id),
initial={'groups': User.objects.get(id=id).groups.get_query_set()[0]})
return render_to_response('ajax/admin/editcore.html', locals(),
context_instance=RequestContext(request))

Empty file added coord/__init__.py
Empty file.
Loading