Skip to content

Commit

Permalink
Made changes to styles.css and edit.php
Browse files Browse the repository at this point in the history
Make the edit modal look like the view modal
  • Loading branch information
Not-Brundle committed Nov 27, 2024
1 parent 6028a3f commit 979c228
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
32 changes: 20 additions & 12 deletions server/moodle/mod/homework/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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: " .
Expand All @@ -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>
Expand Down Expand Up @@ -171,7 +177,9 @@ class="material"
]
); ?>
</div>
</div>
<?php endforeach; ?>

<?php
/**
*
Expand Down
8 changes: 8 additions & 0 deletions server/moodle/mod/homework/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,12 @@
.material-container > *:first-child {
font-size: 20px;
font-weight: bold;
}

.homework-action-buttons button {
margin-right: 10px;
}

.homework-action-buttons button:last-child {
margin-right: 0;
}

0 comments on commit 979c228

Please sign in to comment.