From c680c8e9e206ccbf1fa6493cc14948836944caad Mon Sep 17 00:00:00 2001
From: Genvictus <johannstarkmk42@gmail.com>
Date: Mon, 9 Oct 2023 11:32:42 +0700
Subject: [PATCH] rfc: fix pages

---
 src/app/controllers/Page/ComposePage.php | 17 ++++++++++++++---
 src/app/view/post.php                    | 20 +++++---------------
 src/app/view/submission.php              |  4 ++--
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/src/app/controllers/Page/ComposePage.php b/src/app/controllers/Page/ComposePage.php
index 87e96ba..689fe63 100644
--- a/src/app/controllers/Page/ComposePage.php
+++ b/src/app/controllers/Page/ComposePage.php
@@ -1,20 +1,31 @@
 <?php
 
 require_once SRC_ROOT_PATH . "/app/baseclasses/BaseController.php";
+require_once SRC_ROOT_PATH . "/app/controllers/Post/PostController.php";
+
 class ComposePage extends BaseController{
     protected static $instance;
 
-    public function __construct(){
-        parent::__construct(null);
+    public function __construct($srv){
+        parent::__construct($srv);
     }
 
     public static function getInstance(){
         if(!isset(self::$instance)){
-            self::$instance = new static();
+            self::$instance = new static(
+                PostController::getInstance()
+            );
         }
         return self::$instance;
     }
 
+    public function post($urlParams)
+    {
+        $srv->post();
+        require PAGE_PATH . "/submission.php";
+        exit();
+    }
+
     public function get($urlParams)
     {
         require PAGE_PATH . "/post.php";
diff --git a/src/app/view/post.php b/src/app/view/post.php
index e6dc185..852691f 100644
--- a/src/app/view/post.php
+++ b/src/app/view/post.php
@@ -11,9 +11,9 @@
 
 <body>
     <section id="overlay">
-        <img src="/public/assets/github_post_logo.jpg" alt="Github Logo" id="logo">
+        <img src="/public/assets/Logo.png" alt="Kicau Logo" id="logo">
         <hr>
-        <form action="submission.php" method="POST">
+        <form action="create" method="POST">
             <h1>Create a post!</h1>
             <section class="text-input">
                 <label for="textarea-input">Type in the box below:</label>
@@ -22,21 +22,11 @@
             </section>
             <br>
 
-            <section class="image">
-                <label for="image-input">Select an image file:</label>
-                <input type="file" id="image-input" name="image-input">
+            <section class="file">
+                <label for="file-input">Select a file:</label>
+                <input type="file" id="file-input" name="image-input">
             </section>
             <hr>
-            <section class="video">
-                <label for="video-input">Select a video file:</label>
-                <input type="file" id="video-input" name="video-input">
-            </section>
-            <hr>
-            <section class="audio">
-                <label for="audio-input">Select an audio file:</label>
-                <input type="file" id="audio-input" name="audio-input">
-            </section>
-            <br>
 
             <section class="submission">
                 <input type="submit" value="Post">
diff --git a/src/app/view/submission.php b/src/app/view/submission.php
index a5447c4..e576f7e 100644
--- a/src/app/view/submission.php
+++ b/src/app/view/submission.php
@@ -3,14 +3,14 @@
 
 <head>
     <meta charset="utf-8">
-    <link rel="stylesheet" type="text/css" href="public/css/post.css">
+    <link rel="stylesheet" type="text/css" href="/public/css/post.css">
     <link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
     <title>Post Review</title>
 </head>
 
 <body>
     <section id="overlay">
-        <img src="public/assets/github_post_logo.jpg" alt="Github Logo" id="logo">
+        <img src="/public/assets/github_post_logo.jpg" alt="Github Logo" id="logo">
         <hr>
         <h1>You have made a new post!</h1>
     </section>
-- 
GitLab