Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_father when can i be on my own i have the hello world to see
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
father when can i be on my own i have the hello world to see
widget_father when can i be on my own i have the hello world to see
Commits
85d51030
Commit
85d51030
authored
May 23, 2022
by
Charles Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a new cbv to homepage for forms
parent
751bfbfe
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
3 deletions
+42
-3
homepage_index.css
homepage/static/homepage/homepage_index.css
+13
-0
widgetuser_form.css
homepage/static/homepage/widgetuser_form.css
+0
-0
index.html
homepage/templates/homepage/index.html
+1
-0
widgetuser_form.html
homepage/templates/homepage/widgetuser_form.html
+19
-0
views.py
homepage/views.py
+9
-3
No files found.
homepage/static/homepage/homepage_index.css
View file @
85d51030
...
@@ -21,3 +21,16 @@
...
@@ -21,3 +21,16 @@
background-position
:
-100%
0
;
background-position
:
-100%
0
;
color
:
white
;
color
:
white
;
}
}
.new-user-link
{
text-decoration
:
none
;
font-family
:
Oxygen
;
color
:
black
;
font-size
:
26px
;
padding
:
10px
;
width
:
fit-content
;
transition
:
0.2s
ease-in-out
;
}
.new-user-link
:hover
{
background-color
:
rgba
(
0
,
0
,
0
,
0.8
);
color
:
white
;
}
\ No newline at end of file
homepage/static/homepage/widgetuser_form.css
0 → 100644
View file @
85d51030
homepage/templates/homepage/index.html
View file @
85d51030
...
@@ -16,4 +16,5 @@ Welcome to Widget!
...
@@ -16,4 +16,5 @@ Welcome to Widget!
{% for user in all_widgetusers %}
{% for user in all_widgetusers %}
<a
class=
"details"
href=
"{{user.id}}/details"
>
{{forloop.counter}}. {{user.last_name}}, {{user.first_name}} {{user.middle_name}}
</a>
</br>
<a
class=
"details"
href=
"{{user.id}}/details"
>
{{forloop.counter}}. {{user.last_name}}, {{user.first_name}} {{user.middle_name}}
</a>
</br>
{% endfor %}
{% endfor %}
<a
class=
"new-user-link"
href=
"users/add"
>
Add Widget User
</a>
{% endblock %}
{% endblock %}
\ No newline at end of file
homepage/templates/homepage/widgetuser_form.html
0 → 100644
View file @
85d51030
<!-- homepage/widgetuser_form.html -->
{% extends 'base.html' %}
{% load static %}
{% block title %}Homepage{% endblock %}
{% block styles %}
<link
rel=
"stylesheet"
href=
"{% static 'homepage/widgetuser_form.css' %}"
>
{% endblock %}
{% block header %}
Add Widget User
{% endblock %}
{% block content %}
<p>
Student ID: {{object.id_num}}
</p>
<p>
Email: {{object.email}}
</p>
<p>
Department and Course: {{object.department.home_unit}}, {{object.department.dept_name}}
</p>
{% endblock %}
\ No newline at end of file
homepage/views.py
View file @
85d51030
from
tkinter
import
Widget
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views
import
View
from
django.views
import
View
from
django.views.generic.detail
import
DetailView
from
django.views.generic.detail
import
DetailView
from
.models
import
Department
,
WidgetUser
from
django.views.generic.edit
import
CreateView
from
.models
import
WidgetUser
# Homepage Index View
class
HomepageView
(
View
):
class
HomepageView
(
View
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
objects_set
=
{
objects_set
=
{
...
@@ -11,6 +13,10 @@ class HomepageView(View):
...
@@ -11,6 +13,10 @@ class HomepageView(View):
}
}
return
render
(
request
,
'homepage/index.html'
,
objects_set
)
return
render
(
request
,
'homepage/index.html'
,
objects_set
)
# WidgetUser Detail View
class
WidgetUserDetailView
(
DetailView
):
class
WidgetUserDetailView
(
DetailView
):
model
=
WidgetUser
model
=
WidgetUser
# WidgetUser Create View
class
WidgetUserCreateView
(
CreateView
):
model
=
WidgetUser
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