-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made changes to styles.css and edit.php
Make the edit modal look like the view modal
- Loading branch information
1 parent
6028a3f
commit 979c228
Showing
2 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,6 @@ | |
// Output the header - REQUIRED. | ||
echo $OUTPUT->header(); | ||
|
||
echo html_writer::tag('div', 'This is the homework edit page', ['class' => 'content']); | ||
|
||
$homeworkmaterials = $DB->get_records_sql( | ||
"SELECT hm.*, f.filename | ||
|
@@ -85,6 +84,9 @@ | |
* @copyright 2024, cs-24-sw-5-01 <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
echo '<div class="view-homework-container">'; | ||
|
||
foreach ($homeworkmaterials as $materials) : | ||
// Generate the preview URL for the file if it exists. | ||
if ($materials->file_id !== null) { | ||
|
@@ -104,16 +106,20 @@ | |
} | ||
?> | ||
|
||
<div | ||
class="material" | ||
style=" | ||
border: 1px solid #ccc; | ||
padding: 16px; | ||
border-radius: 8px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
background-color: #f9f9f9; | ||
" | ||
> | ||
<div class="material"> | ||
|
||
<?php if ($materials->startpage != null): | ||
echo '<i class="fa-solid fa-book"></i>'; | ||
elseif ($materials->link != null): | ||
echo '<i class="fa-solid fa-link"></i>'; | ||
elseif ($materials->starttime != null): | ||
echo '<i class="fa-solid fa-play"></i>'; | ||
elseif ($materials->file_id != null): | ||
echo '<i class="fa-solid fa-file"></i>'; | ||
endif; ?> | ||
|
||
<div class="material-container"> | ||
|
||
<p><?= htmlspecialchars($materials->description) ?></p> | ||
<?php if ($materials->startpage !== null && $materials->endpage !== null) : ?> | ||
<p><?= "Page: " . | ||
|
@@ -138,7 +144,7 @@ class="material" | |
<?php if ($materials->file_id !== null && isset($previewurl)) : ?> | ||
<?php if (strtolower(pathinfo($file->filename, PATHINFO_EXTENSION)) === 'mp4') : ?> | ||
<!-- Display the video inline if it's an mp4 file --> | ||
<video controls width="800" height="360"> | ||
<video controls width="640" height="360"> | ||
<source src="<?= $previewurl ?>" type="video/mp4"> | ||
Your browser does not support the video tag. | ||
</video> | ||
|
@@ -171,7 +177,9 @@ class="material" | |
] | ||
); ?> | ||
</div> | ||
</div> | ||
<?php endforeach; ?> | ||
|
||
<?php | ||
/** | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters