Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
93473bd1
Commit
93473bd1
authored
Nov 24, 2014
by
Jason D Yeomans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved arround student detail to accounts app
parent
f37dd443
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
130 additions
and
45 deletions
+130
-45
roomlist/accounts/templates/detailStudent.html
roomlist/accounts/templates/detailStudent.html
+0
-0
roomlist/accounts/urls.py
roomlist/accounts/urls.py
+9
-0
roomlist/accounts/views.py
roomlist/accounts/views.py
+10
-1
roomlist/housing/migrations/0001_initial.py
roomlist/housing/migrations/0001_initial.py
+98
-0
roomlist/housing/templates/listBuildings.html
roomlist/housing/templates/listBuildings.html
+1
-1
roomlist/housing/urls.py
roomlist/housing/urls.py
+3
-9
roomlist/housing/views.py
roomlist/housing/views.py
+0
-5
roomlist/settings/settings.py
roomlist/settings/settings.py
+1
-0
roomlist/settings/urls.py
roomlist/settings/urls.py
+0
-4
roomlist/templates/layouts/buildings.html
roomlist/templates/layouts/buildings.html
+0
-22
roomlist/templates/login.html
roomlist/templates/login.html
+8
-3
No files found.
roomlist/
housing
/templates/detailStudent.html
→
roomlist/
accounts
/templates/detailStudent.html
View file @
93473bd1
File moved
roomlist/accounts/urls.py
View file @
93473bd1
from
django.conf.urls
import
patterns
,
include
,
url
from
django.conf.urls
import
patterns
,
include
,
url
from
accounts.views
import
DetailStudent
from
housing.models
import
Student
from
django.contrib
import
admin
from
django.contrib
import
admin
admin
.
autodiscover
()
admin
.
autodiscover
()
...
@@ -7,4 +9,11 @@ urlpatterns = patterns('',
...
@@ -7,4 +9,11 @@ urlpatterns = patterns('',
# login and logout
# login and logout
url
(
r
'^login/$'
,
'django.contrib.auth.views.login'
,
{
'template_name'
:
'login.html'
},
name
=
'login'
),
url
(
r
'^login/$'
,
'django.contrib.auth.views.login'
,
{
'template_name'
:
'login.html'
},
name
=
'login'
),
url
(
r
'^logout/$'
,
'django.contrib.auth.views.logout'
,
{
'template_name'
:
'index.html'
},
name
=
'logout'
),
url
(
r
'^logout/$'
,
'django.contrib.auth.views.logout'
,
{
'template_name'
:
'index.html'
},
name
=
'logout'
),
url
(
r
'^student/(?P<slug>[\w-]+)/$'
,
DetailStudent
.
as_view
(
model
=
Student
,
context_object_name
=
'student'
,
template_name
=
'detailStudent.html'
),
name
=
'detailStudent'
),
)
)
roomlist/accounts/views.py
View file @
93473bd1
from
django.shortcuts
import
render
from
django.shortcuts
import
render
# Create your views here.
from
django.views.generic
import
DetailView
,
ListView
,
CreateView
,
UpdateView
,
DeleteView
from
housing.models
import
Student
from
braces.views
import
LoginRequiredMixin
# details about the student
class
DetailStudent
(
LoginRequiredMixin
,
DetailView
):
model
=
Student
login_url
=
'/'
roomlist/housing/migrations/0001_initial.py
0 → 100644
View file @
93473bd1
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
models
,
migrations
import
autoslug.fields
import
django.utils.timezone
from
django.conf
import
settings
import
model_utils.fields
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Address'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'created'
,
model_utils
.
fields
.
AutoCreatedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'created'
,
editable
=
False
)),
(
'modified'
,
model_utils
.
fields
.
AutoLastModifiedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'modified'
,
editable
=
False
)),
(
'street'
,
models
.
CharField
(
max_length
=
100
)),
(
'zip_code'
,
models
.
IntegerField
(
max_length
=
5
)),
(
'state'
,
models
.
CharField
(
max_length
=
2
)),
],
options
=
{
'abstract'
:
False
,
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Building'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'created'
,
model_utils
.
fields
.
AutoCreatedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'created'
,
editable
=
False
)),
(
'modified'
,
model_utils
.
fields
.
AutoLastModifiedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'modified'
,
editable
=
False
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
)),
(
'neighbourhood'
,
models
.
CharField
(
default
=
b
'na'
,
max_length
=
100
,
choices
=
[(
b
'na'
,
b
'None'
),
(
b
'aq'
,
b
'Aquia'
),
(
b
'ra'
,
b
'Rappahannock'
),
(
b
'sh'
,
b
'Shenandoah'
)])),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
unique
=
True
,
editable
=
False
)),
(
'address'
,
models
.
ForeignKey
(
to
=
'housing.Address'
)),
],
options
=
{
'abstract'
:
False
,
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Class'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'created'
,
model_utils
.
fields
.
AutoCreatedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'created'
,
editable
=
False
)),
(
'modified'
,
model_utils
.
fields
.
AutoLastModifiedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'modified'
,
editable
=
False
)),
(
'year_int'
,
models
.
IntegerField
()),
(
'year_in_school'
,
models
.
CharField
(
default
=
b
'FR'
,
max_length
=
2
,
choices
=
[(
b
'FR'
,
b
'Freshman'
),
(
b
'SO'
,
b
'Sophomore'
),
(
b
'JR'
,
b
'Junior'
),
(
b
'SR'
,
b
'Senior'
)])),
],
options
=
{
'abstract'
:
False
,
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Room'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'created'
,
model_utils
.
fields
.
AutoCreatedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'created'
,
editable
=
False
)),
(
'modified'
,
model_utils
.
fields
.
AutoLastModifiedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'modified'
,
editable
=
False
)),
(
'number'
,
models
.
IntegerField
()),
(
'floor'
,
models
.
IntegerField
()),
(
'bedA'
,
models
.
CharField
(
max_length
=
80
)),
(
'bedB'
,
models
.
CharField
(
max_length
=
80
,
blank
=
True
)),
(
'bedC'
,
models
.
CharField
(
max_length
=
80
,
blank
=
True
)),
(
'bedD'
,
models
.
CharField
(
max_length
=
80
,
blank
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
unique
=
True
,
editable
=
False
)),
(
'building'
,
models
.
ForeignKey
(
to
=
'housing.Building'
)),
],
options
=
{
'abstract'
:
False
,
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Student'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'created'
,
model_utils
.
fields
.
AutoCreatedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'created'
,
editable
=
False
)),
(
'modified'
,
model_utils
.
fields
.
AutoLastModifiedField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'modified'
,
editable
=
False
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
unique
=
True
,
editable
=
False
)),
(
'room'
,
models
.
OneToOneField
(
to
=
'housing.Room'
)),
(
'user'
,
models
.
OneToOneField
(
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
'abstract'
:
False
,
},
bases
=
(
models
.
Model
,),
),
]
roomlist/housing/templates/listBuildings.html
View file @
93473bd1
...
@@ -16,7 +16,7 @@ GMU RoomList • Homepage
...
@@ -16,7 +16,7 @@ GMU RoomList • Homepage
<ul>
<ul>
{% for building in buildings %}
{% for building in buildings %}
<li>
<li>
<a
href=
"/
building
/{{ building.name }}"
>
{{ building.name }}
</a>
- {{ building.address }} {{ building.address.zip_code }}, {{ building.address.state}}
<a
href=
"/
housing/buildings
/{{ building.name }}"
>
{{ building.name }}
</a>
- {{ building.address }} {{ building.address.zip_code }}, {{ building.address.state}}
</li>
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
...
...
roomlist/housing/urls.py
View file @
93473bd1
from
django.conf.urls
import
patterns
,
include
,
url
from
django.conf.urls
import
patterns
,
include
,
url
from
housing.views
import
ListBuildings
,
DetailBuilding
,
ListRooms
,
DetailRoom
,
DetailStudent
from
housing.views
import
ListBuildings
,
DetailBuilding
,
ListRooms
,
DetailRoom
from
housing.models
import
Building
,
Room
,
Student
from
housing.models
import
Building
,
Room
,
Student
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
url
(
r
'^student/(?P<slug>[\w-]+)/$'
,
DetailStudent
.
as_view
(
model
=
Student
,
context_object_name
=
'student'
,
template_name
=
'detailStudent.html'
),
name
=
'detailStudent'
),
url
(
r
'^buildings/$'
,
url
(
r
'^buildings/$'
,
ListBuildings
.
as_view
(
ListBuildings
.
as_view
(
model
=
Building
,
model
=
Building
,
...
@@ -24,6 +17,7 @@ urlpatterns = patterns('',
...
@@ -24,6 +17,7 @@ urlpatterns = patterns('',
url
(
r
'^buildings/(?P<slug>[\w-]+)/$'
,
url
(
r
'^buildings/(?P<slug>[\w-]+)/$'
,
DetailBuilding
.
as_view
(
DetailBuilding
.
as_view
(
model
=
Building
,
model
=
Building
,
slug_field
=
'slug__iexact'
,
context_object_name
=
'building'
,
context_object_name
=
'building'
,
template_name
=
'detailBuilding.html'
),
template_name
=
'detailBuilding.html'
),
name
=
'detailBuilding'
),
name
=
'detailBuilding'
),
...
...
roomlist/housing/views.py
View file @
93473bd1
...
@@ -24,11 +24,6 @@ class DetailRoom(LoginRequiredMixin, ListView):
...
@@ -24,11 +24,6 @@ class DetailRoom(LoginRequiredMixin, ListView):
model
=
Room
model
=
Room
login_url
=
'/'
login_url
=
'/'
# details about the student
class
DetailStudent
(
LoginRequiredMixin
,
DetailView
):
model
=
Student
login_url
=
'/'
# update a student
# update a student
# update a room
# update a room
...
...
roomlist/settings/settings.py
View file @
93473bd1
...
@@ -15,6 +15,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
...
@@ -15,6 +15,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS
=
(
TEMPLATE_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
'templates'
),
os
.
path
.
join
(
BASE_DIR
,
'templates'
),
os
.
path
.
join
(
BASE_DIR
,
'housing/templates'
),
os
.
path
.
join
(
BASE_DIR
,
'housing/templates'
),
os
.
path
.
join
(
BASE_DIR
,
'accounts/templates'
),
)
)
STATICFILES_DIRS
=
(
STATICFILES_DIRS
=
(
...
...
roomlist/settings/urls.py
View file @
93473bd1
...
@@ -15,10 +15,6 @@ urlpatterns = patterns('',
...
@@ -15,10 +15,6 @@ urlpatterns = patterns('',
# url(r'^contact/$', TemplateView.as_view(template_name='contact.html'), name='contact'),
# url(r'^contact/$', TemplateView.as_view(template_name='contact.html'), name='contact'),
# url(r'^privacy/$', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
# url(r'^privacy/$', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
# logins
url
(
r
'^login/$'
,
'django.contrib.auth.views.login'
,
{
'template_name'
:
'login.html'
},
name
=
'login'
),
url
(
r
'logout/$'
,
'django.contrib.auth.views.logout'
,
{
'template_name'
:
'index.html'
},
name
=
'logout'
),
# app-level urls
# app-level urls
url
(
r
'^housing/'
,
include
(
'housing.urls'
)),
url
(
r
'^housing/'
,
include
(
'housing.urls'
)),
url
(
r
'^accounts/'
,
include
(
'accounts.urls'
)),
url
(
r
'^accounts/'
,
include
(
'accounts.urls'
)),
...
...
roomlist/templates/layouts/buildings.html
deleted
100644 → 0
View file @
f37dd443
{% extends 'layouts/base.html' %}
{% block title %}
GMU RoomList
•
Homepage
{% endblock %}
{% block content %}
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<h1><strong>
GMU
</strong>
ROOMLIST
</h1>
<p
class=
"lead"
>
List of buildings in database:
</p>
</div>
</div>
</div>
<div
class=
"row"
>
</div>
{% endblock %}
roomlist/templates/login.html
View file @
93473bd1
...
@@ -11,13 +11,18 @@
...
@@ -11,13 +11,18 @@
</div>
</div>
</div>
</div>
{% if form.errors %}
<p>
Your username and password didn't match. Please try again.
</p>
{% endif %}
<form
class=
"form-signin"
role=
"form"
action=
"/accounts/login/"
method=
"post"
>
<form
class=
"form-signin"
role=
"form"
action=
"/accounts/login/"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
<h2
class=
"form-signin-heading"
>
Please sign in
</h2>
<h2
class=
"form-signin-heading"
>
Please sign in
</h2>
<label
for=
"username"
class=
"sr-only"
>
Username
</label>
<label
for=
"username"
class=
"sr-only"
>
Username
</label>
<input
type=
"text"
id=
"inputUsername"
name=
"username"
class=
"form-control"
placeholder=
"Mason NetID"
required
autofocus
>
{{form.username}}
<label
for=
"inputPassword"
class=
"sr-only"
>
Password
</label>
<label
for=
"inputPassword"
class=
"sr-only"
>
Password
</label>
<input
type=
"password"
id=
"inputPassword"
name=
"password"
class=
"form-control"
placeholder=
"Password"
required
>
{{form.password}}
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
value=
"remember-me"
>
Remember me
<input
type=
"checkbox"
value=
"remember-me"
>
Remember me
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment