Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2020-101
2020-101
Commits
1fd5beac
Commit
1fd5beac
authored
Jul 02, 2020
by
SohanDanushka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Committing for project evaluation 1 (frontend view)
parent
b970e2c7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
349 additions
and
233 deletions
+349
-233
LecturerApp/templates/LecturerApp/index.html
LecturerApp/templates/LecturerApp/index.html
+12
-9
LecturerApp/templates/LecturerApp/lecVideo.html
LecturerApp/templates/LecturerApp/lecVideo.html
+260
-0
LecturerApp/templates/LecturerApp/template.html
LecturerApp/templates/LecturerApp/template.html
+50
-106
LecturerApp/templates/LecturerApp/video.html
LecturerApp/templates/LecturerApp/video.html
+0
-118
LecturerApp/urls.py
LecturerApp/urls.py
+1
-0
LecturerApp/views.py
LecturerApp/views.py
+26
-0
LecturerStatic/LecturerApp/videos/poses.mp4
LecturerStatic/LecturerApp/videos/poses.mp4
+0
-0
No files found.
LecturerApp/templates/LecturerApp/index.html
View file @
1fd5beac
...
...
@@ -36,6 +36,8 @@
$
(
'
.calc
'
).
click
(
function
()
{
let
video_name
=
$
(
this
).
attr
(
'
id
'
);
$
(
'
#loader
'
).
attr
(
'
hidden
'
,
false
);
// alert('hello');
$
(
'
#no_content_message
'
).
attr
(
'
hidden
'
,
true
);
...
...
@@ -60,6 +62,7 @@
function
assignPerct
(
percentages
)
{
$
(
'
#no_content_message
'
).
attr
(
'
hidden
'
,
true
);
$
(
'
#progress_bars
'
).
attr
(
'
hidden
'
,
false
);
$
(
'
#loader
'
).
attr
(
'
hidden
'
,
true
);
let
sitting
=
Math
.
round
(
percentages
.
sitting_perct
);
let
standing
=
Math
.
round
(
percentages
.
standing_perct
);
...
...
@@ -159,14 +162,14 @@
</a>
<div
id=
"collapsePages"
class=
"collapse"
aria-labelledby=
"headingPages"
data-parent=
"#accordionSidebar"
>
<div
class=
"bg-white py-2 collapse-inner rounded"
>
<h6
class=
"collapse-header"
>
Login Screens:
</h6
>
<a
class=
"collapse-item"
href=
"
login.html"
>
Login
</a>
<a
class=
"collapse-item"
href=
"
register.html"
>
Register
</a>
<a
class=
"collapse-item"
href=
"forgot-password.html"
>
Forgot Password
</a
>
<div
class=
"collapse-divider"
></div
>
<h6
class=
"collapse-header"
>
Other Pages:
</h6
>
<a
class=
"collapse-item"
href=
"404.html"
>
404 Page
</a
>
<a
class=
"collapse-item"
href=
"blank.html"
>
Blank Page
</a
>
<!-- <h6 class="collapse-header">Login Screens:</h6>--
>
<a
class=
"collapse-item"
href=
"
index.html"
>
Dashboard
</a>
<a
class=
"collapse-item"
href=
"
/lecture-video"
>
Video Page
</a>
<!-- <a class="collapse-item" href="forgot-password.html">Forgot Password</a>--
>
<!-- <div class="collapse-divider"></div>--
>
<!-- <h6 class="collapse-header">Other Pages:</h6>--
>
<!-- <a class="collapse-item" href="404.html">404 Page</a>--
>
<!-- <a class="collapse-item" href="blank.html">Blank Page</a>--
>
</div>
</div>
</li>
...
...
@@ -681,7 +684,7 @@
</div>
<!--loader -->
<div
class=
"text-center"
id=
"loader"
>
<div
class=
"text-center"
id=
"loader"
hidden
>
<!-- <img src="{% static 'LectureApp/images/ajax-loader.gif' %}" alt="">-->
<img
src=
"{% static 'LecturerApp/images/ajax-loader.gif' %}"
alt=
""
>
...
...
LecturerApp/templates/LecturerApp/lecVideo.html
0 → 100644
View file @
1fd5beac
This diff is collapsed.
Click to expand it.
LecturerApp/templates/LecturerApp/template.html
View file @
1fd5beac
...
...
@@ -10,10 +10,10 @@
<title>
Hello World
</title>
{% load static %}
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity=
"sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin=
"anonymous"
>
<link
rel=
"stylesheet"
href=
"{% static '
First
App/css/sb-admin-2.min.css' %}"
>
<link
rel=
"stylesheet"
href=
"{% static '
Lecturer
App/css/sb-admin-2.min.css' %}"
>
<link
href=
"https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"{% static '
First
App/css/all.min.css' %}"
>
<link
rel=
"stylesheet"
href=
"{% static '
Lecturer
App/css/all.min.css' %}"
>
</head>
{% endblock %}
...
...
@@ -23,7 +23,7 @@
{% block 'javascript' %}
{% load static %}
<script
type=
"text/javascript"
src=
"{% static '
First
App/vendor/jquery/jquery.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static '
Lecturer
App/vendor/jquery/jquery.js' %}"
></script>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
// $('#test').click(function () {
...
...
@@ -38,113 +38,57 @@
<!-- Sidebar -->
<ul
class=
"navbar-nav bg-gradient-primary sidebar sidebar-dark accordion"
id=
"accordionSidebar"
>
<!-- Sidebar - Brand -->
<a
class=
"sidebar-brand d-flex align-items-center justify-content-center"
href=
"index.html"
>
<div
class=
"sidebar-brand-icon rotate-n-15"
>
<i
class=
"fas fa-laugh-wink"
></i>
</div>
<div
class=
"sidebar-brand-text mx-3"
>
SB Admin
<sup>
2
</sup></div>
</a>
<!-- Sidebar - Brand -->
<a
class=
"sidebar-brand d-flex align-items-center justify-content-center"
href=
"index.html"
>
<div
class=
"sidebar-brand-icon rotate-n-15"
>
<i
class=
"fas fa-laugh-wink"
></i>
</div>
<div
class=
"sidebar-brand-text mx-3"
>
SB Admin
<sup>
2
</sup></div>
</a>
<!-- Divider -->
<hr
class=
"sidebar-divider my-0"
>
<!-- Divider -->
<hr
class=
"sidebar-divider my-0"
>
<!-- Nav Item - Dashboard -->
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
href=
"index.html
"
>
<i
class=
"fas fa-fw fa-tachometer-alt"
></i>
<span>
Dashboard
</span></a>
</li>
<!-- Nav Item - Dashboard -->
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
href=
"/
"
>
<i
class=
"fas fa-fw fa-tachometer-alt"
></i>
<span>
Dashboard
</span></a>
</li>
<!-- Divider -->
<hr
class=
"sidebar-divider"
>
<!-- Heading -->
<div
class=
"sidebar-heading"
>
Interface
</div>
<!-- Nav Item - Pages Collapse Menu -->
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapseTwo"
aria-expanded=
"true"
aria-controls=
"collapseTwo"
>
<i
class=
"fas fa-fw fa-cog"
></i>
<span>
Components
</span>
</a>
<div
id=
"collapseTwo"
class=
"collapse"
aria-labelledby=
"headingTwo"
data-parent=
"#accordionSidebar"
>
<div
class=
"bg-white py-2 collapse-inner rounded"
>
<h6
class=
"collapse-header"
>
Custom Components:
</h6>
<a
class=
"collapse-item"
href=
"buttons.html"
>
Buttons
</a>
<a
class=
"collapse-item"
href=
"cards.html"
>
Cards
</a>
</div>
</div>
</li>
<!-- Divider -->
<hr
class=
"sidebar-divider"
>
<!-- Heading -->
<div
class=
"sidebar-heading"
>
<!-- Nav Item - Utilities Collapse Menu -->
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapseUtilities"
aria-expanded=
"true"
aria-controls=
"collapseUtilities"
>
<i
class=
"fas fa-fw fa-wrench"
></i>
<span>
Utilities
</span>
</a>
<div
id=
"collapseUtilities"
class=
"collapse"
aria-labelledby=
"headingUtilities"
data-parent=
"#accordionSidebar"
>
<div
class=
"bg-white py-2 collapse-inner rounded"
>
<h6
class=
"collapse-header"
>
Custom Utilities:
</h6>
<a
class=
"collapse-item"
href=
"utilities-color.html"
>
Colors
</a>
<a
class=
"collapse-item"
href=
"utilities-border.html"
>
Borders
</a>
<a
class=
"collapse-item"
href=
"utilities-animation.html"
>
Animations
</a>
<a
class=
"collapse-item"
href=
"utilities-other.html"
>
Other
</a>
</div>
</div>
</li>
<!-- Divider -->
<hr
class=
"sidebar-divider"
>
<!-- Nav Item - Pages Collapse Menu -->
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapsePages"
aria-expanded=
"true"
aria-controls=
"collapsePages"
>
<i
class=
"fas fa-fw fa-folder"
></i>
<span>
Pages
</span>
</a>
<div
id=
"collapsePages"
class=
"collapse"
aria-labelledby=
"headingPages"
data-parent=
"#accordionSidebar"
>
<div
class=
"bg-white py-2 collapse-inner rounded"
>
<a
class=
"collapse-item"
href=
"/"
>
Dashboard
</a>
<a
class=
"collapse-item"
href=
"/lecture-video"
>
Video Page
</a>
</div>
</div>
</li>
<!-- Heading -->
<div
class=
"sidebar-heading"
>
Addons
</div>
<!-- Nav Item - Pages Collapse Menu -->
<li
class=
"nav-item"
>
<a
class=
"nav-link collapsed"
href=
"#"
data-toggle=
"collapse"
data-target=
"#collapsePages"
aria-expanded=
"true"
aria-controls=
"collapsePages"
>
<i
class=
"fas fa-fw fa-folder"
></i>
<span>
Pages
</span>
</a>
<div
id=
"collapsePages"
class=
"collapse"
aria-labelledby=
"headingPages"
data-parent=
"#accordionSidebar"
>
<div
class=
"bg-white py-2 collapse-inner rounded"
>
<h6
class=
"collapse-header"
>
Login Screens:
</h6>
<a
class=
"collapse-item"
href=
"/login"
>
Login
</a>
<a
class=
"collapse-item"
href=
"/register"
>
Register
</a>
<a
class=
"collapse-item"
href=
"/forgot-password"
>
Forgot Password
</a>
<div
class=
"collapse-divider"
></div>
<h6
class=
"collapse-header"
>
Other Pages:
</h6>
<a
class=
"collapse-item"
href=
"/404"
>
404 Page
</a>
<a
class=
"collapse-item"
href=
"/blank"
>
Blank Page
</a>
</div>
<!-- Divider -->
<hr
class=
"sidebar-divider d-none d-md-block"
>
<!-- Sidebar Toggler (Sidebar) -->
<div
class=
"text-center d-none d-md-inline"
>
<button
class=
"rounded-circle border-0"
id=
"sidebarToggle"
></button>
</div>
</li>
<!-- Nav Item - Charts -->
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"charts.html"
>
<i
class=
"fas fa-fw fa-chart-area"
></i>
<span>
Charts
</span></a>
</li>
<!-- Nav Item - Tables -->
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"tables.html"
>
<i
class=
"fas fa-fw fa-table"
></i>
<span>
Tables
</span></a>
</li>
<!-- Divider -->
<hr
class=
"sidebar-divider d-none d-md-block"
>
<!-- Sidebar Toggler (Sidebar) -->
<div
class=
"text-center d-none d-md-inline"
>
<button
class=
"rounded-circle border-0"
id=
"sidebarToggle"
></button>
</div>
</ul>
<!-- End of Sidebar -->
...
...
@@ -387,21 +331,21 @@
<script
src=
"https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity=
"sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity=
"sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin=
"anonymous"
></script>
<script
src=
"{% static '
First
App/vendor/jquery/jquery.js' %}"
></script>
<script
src=
"{% static '
First
App/vendor/bootstrap/js/bootstrap.bundle.min.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/vendor/jquery/jquery.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/vendor/bootstrap/js/bootstrap.bundle.min.js' %}"
></script>
<!-- Core plugin JavaScript-->
<script
src=
"{% static '
First
App/vendor/jquery-easing/jquery.easing.min.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/vendor/jquery-easing/jquery.easing.min.js' %}"
></script>
<!-- Custom scripts for all pages-->
<script
src=
"{% static '
First
App/js/sb-admin-2.min.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/js/sb-admin-2.min.js' %}"
></script>
<!-- Page level plugins -->
<script
src=
"{% static '
First
App/vendor/chart.js/Chart.min.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/vendor/chart.js/Chart.min.js' %}"
></script>
<!-- Page level custom scripts -->
<script
src=
"{% static '
First
App/js/demo/chart-area-demo.js' %}"
></script>
<script
src=
"{% static '
First
App/js/demo/chart-pie-demo.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/js/demo/chart-area-demo.js' %}"
></script>
<script
src=
"{% static '
Lecturer
App/js/demo/chart-pie-demo.js' %}"
></script>
{% endblock %}
</body>
...
...
LecturerApp/templates/LecturerApp/video.html
deleted
100644 → 0
View file @
b970e2c7
{% extends 'LecturerApp/template.html' %}
<!DOCTYPE html>
<html
lang=
"en"
>
<body
id=
"page-top"
>
<!-- Page Wrapper -->
<div
id=
"wrapper"
>
<!-- Sidebar -->
<!-- Content Wrapper -->
<div
id=
"content-wrapper"
class=
"d-flex flex-column"
>
<!-- Main Content -->
<div
id=
"content"
>
<!-- Begin Page Content -->
{% block 'container-fluid' %}
<div
class=
"container-fluid"
>
{% load static %}
<!-- Page Heading -->
<div
class=
"d-sm-flex align-items-center justify-content-between mb-4"
>
<h1
class=
"h3 mb-0 text-gray-800"
>
{{video_name}}
</h1>
<a
href=
"#"
class=
"d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"
><i
class=
"fas fa-download fa-sm text-white-50"
></i>
Generate Report
</a>
</div>
<!-- <!– Content Row –>-->
<div
class=
"row"
>
<!-- Earnings (Monthly) Card Example -->
<div
class=
"col-xl-12 col-md-6 mb-4"
>
<div
class=
"card border-left-primary shadow h-100 py-2"
>
<div
class=
"card-body"
>
<div
class=
"row"
>
<div
class=
"col-3"
>
<video
width=
"500"
height=
"300"
controls
>
<source
src=
"{% static '' %}FirstApp/videos/{{video_name}}"
type=
"video/mp4"
>
Your browser does not support the video tag.
</video>
</div>
<div
class=
"col-3"
></div>
<!--progress bars-->
<div
class=
"col-6"
>
<h4
class=
"small font-weight-bold"
>
Anger
<span
class=
"float-right"
>
{{meta.angry_perct}}%
</span></h4>
<div
class=
"progress mb-4"
>
<div
class=
"progress-bar bg-danger"
role=
"progressbar"
style=
"width: 20%"
aria-valuenow=
"20"
aria-valuemin=
"0"
aria-valuemax=
"100"
></div>
</div>
<h4
class=
"small font-weight-bold"
>
Happy
<span
class=
"float-right"
>
{{meta.happy_perct}}%
</span></h4>
<div
class=
"progress mb-4"
>
<div
class=
"progress-bar bg-warning"
role=
"progressbar"
style=
"width: 40%"
aria-valuenow=
"40"
aria-valuemin=
"0"
aria-valuemax=
"100"
></div>
</div>
<h4
class=
"small font-weight-bold"
>
Sadness
<span
class=
"float-right"
>
{{meta.sad_perct}}%
</span></h4>
<div
class=
"progress mb-4"
>
<div
class=
"progress-bar"
role=
"progressbar"
style=
"width: 60%"
aria-valuenow=
"60"
aria-valuemin=
"0"
aria-valuemax=
"100"
></div>
</div>
<h4
class=
"small font-weight-bold"
>
Surprise
<span
class=
"float-right"
>
{{meta.surprise_perct}}%
</span></h4>
<div
class=
"progress mb-4"
>
<div
class=
"progress-bar bg-info"
role=
"progressbar"
style=
"width: 80%"
aria-valuenow=
"80"
aria-valuemin=
"0"
aria-valuemax=
"100"
></div>
</div>
<h4
class=
"small font-weight-bold"
>
Neutral
<span
class=
"float-right"
>
{{meta.neutral_perct}}%
</span></h4>
<div
class=
"progress"
>
<div
class=
"progress-bar bg-success"
role=
"progressbar"
style=
"width: 100%"
aria-valuenow=
"100"
aria-valuemin=
"0"
aria-valuemax=
"100"
></div>
</div>
<div
class=
"form-control"
>
<button
type=
"button"
id=
"test"
data-target=
"#gif-body"
data-toggle=
"modal"
>
Test
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
<!-- End of container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
</div>
{% block 'modal' %}
<div
class=
"modal fade"
id=
"gif-body"
role=
"dialog"
aria-labelledby=
"gif-body"
>
<div
class=
"modal-dialog modal-lg"
style=
"max-width: 1600px; max-height: 800px"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h2
class=
"modal-title"
>
Processing....
</h2>
<button
class=
"close"
type=
"button"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body text-center"
>
<img
src=
"{% static 'FirstApp/images/ajax-loader.gif' %}"
width=
"200"
height=
"500"
alt=
"This is a GIF"
>
<h5>
This might take few seconds...
</h5>
</div>
</div>
</div>
</div>
{% endblock %}
</body>
</html>
\ No newline at end of file
LecturerApp/urls.py
View file @
1fd5beac
...
...
@@ -23,6 +23,7 @@ urlpatterns = [
path
(
'template'
,
views
.
template
),
path
(
'base'
,
views
.
base
),
path
(
'child'
,
views
.
child
),
path
(
'lecture-video'
,
views
.
lecVideo
),
# path('Video', views.hello)
# API to retrieve activity recognition
...
...
LecturerApp/views.py
View file @
1fd5beac
...
...
@@ -99,3 +99,29 @@ def base(request):
def
child
(
request
):
return
render
(
request
,
'LecturerApp/child.html'
,
{
'template_name'
:
'LecturerApp/base.html'
})
def
lecVideo
(
request
):
video
=
"poses.mp4"
obj
=
{
'Message'
:
'Student and Lecturer Performance Enhancement System'
}
folder
=
os
.
path
.
join
(
BASE_DIR
,
os
.
path
.
join
(
'LecturerStatic
\\
LecturerApp
\\
videos'
))
videoPaths
=
[
os
.
path
.
join
(
folder
,
file
)
for
file
in
os
.
listdir
(
folder
)]
videos
=
[]
durations
=
[]
for
videoPath
in
videoPaths
:
video
=
tVideo
()
cap
=
cv2
.
VideoCapture
(
videoPath
)
fps
=
cap
.
get
(
cv2
.
CAP_PROP_FPS
)
# OpenCV2 version 2 used "CV_CAP_PROP_FPS"
frame_count
=
int
(
cap
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
duration
=
int
(
frame_count
/
fps
)
durations
.
append
(
duration
)
videoName
=
os
.
path
.
basename
(
videoPath
)
# videoName = videos.append(os.path.basename(videoPath))
durationObj
=
datetime
.
timedelta
(
seconds
=
duration
)
video
.
path
=
videoPath
video
.
name
=
videoName
video
.
duration
=
str
(
durationObj
)
videos
.
append
(
video
)
print
(
'Video Name: '
,
video
.
name
)
context
=
{
'object'
:
obj
,
'Videos'
:
videos
,
'durations'
:
durations
,
'template_name'
:
'LecturerApp/template.html'
,
'video_name'
:
video
}
return
render
(
request
,
'LecturerApp/lecVideo.html'
,
context
)
LecturerStatic/LecturerApp/videos/
Sit to Stand
.mp4
→
LecturerStatic/LecturerApp/videos/
poses
.mp4
View file @
1fd5beac
File moved
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