Summary Files Commits Branches @commit @diff @stats
path: root / src / views
diff options
context:
space:
mode:
Commit67bc860ea4b3db5033a42038ab86d0df955c9295 (patch)
Author
 Kamen Mladenov <kamen.d.mladenov@protonmail.com>
2021-04-03 15:48:16 +0300
Committer
 GitHub <noreply@github.com>
2021-04-03 15:48:16 +0300
Files32aa82966b75e3b5b896acef9fbe1b5cf69aadc7 /src/views
devrix-job-board-0.2.tar
devrix-job-board-0.2.tar.gz
devrix-job-board-0.2.zip
Parentf8c1df9a9a24be0ff3811dc33e00f92bf51465ab (diff)
Parent39fd52b1aaf2fde1236fdef21df65ba768f598ed (diff)
Merge pull request #2 from Syndamia/dev v0.2
Implemented template front-end
5 files changed, 107 insertions, 77 deletions
-rw-r--r--src/views/create-offer.php46
-rw-r--r--src/views/dashboard-login.php26
-rw-r--r--src/views/dashboard.php36
-rw-r--r--src/views/edit-offer.php53
-rw-r--r--src/views/landing.php23
diff --git a/src/views/create-offer.php b/src/views/create-offer.php
index 19f2186..42df1fc 100644
--- a/src/views/create-offer.php
+++ b/src/views/create-offer.php
@@ -1,22 +1,24 @@
-<form method="post">
- <label for="title">Job Title: </label>
- <input type="text" name="title">
- <br>
- <label for="description">Job Description: </label>
- <textarea type="text" name="description"></textarea>
- <br>
- <label for="company">Company: </label>
- <select name="company">
- <?php
- foreach(self::$companies as $company) {
- echo "<option value=\"{$company->id}\">{$company->name}</option>";
- }
- ?>
- </select>
- <br>
- <label for="salary">Salary: </label>
- <input type="number" name="salary" min="1" placeholder="1">
- <br>
- <input type="submit" value="Submit">
-</form>
-<a href="/">&lt; Back</a>
+<div class="job-card">
+ <form class="centered-form blocky-form-items" method="post">
+ <label for="title">Job Title</label>
+ <input type="text" name="title">
+
+ <label for="description">Job Description</label>
+ <textarea type="text" name="description"></textarea>
+
+ <label for="company">Company</label>
+ <select name="company">
+ <?php
+ foreach(self::$companies as $company) {
+ echo "<option value=\"{$company->id}\">{$company->name}</option>";
+ }
+ ?>
+ </select>
+
+ <label for="salary">Salary (lev/month)</label>
+ <input type="number" name="salary" min="300" placeholder="300">
+
+ <br>
+ <input type="submit" value="Submit">
+ </form>
+</div>
diff --git a/src/views/dashboard-login.php b/src/views/dashboard-login.php
index a4cefe7..d7bae5e 100644
--- a/src/views/dashboard-login.php
+++ b/src/views/dashboard-login.php
@@ -1,13 +1,13 @@
-<form method="post">
- <label for="username">Username: </label>
- <input type="text" name="username">
- <br>
- <label for="password">Password</label>
- <input type="password" name="password">
- <br>
- <input type="submit" value="Login">
-</form>
-<?php
- echo self::$message;
-?>
-<a href="/">&lt; Back</a>
+<div class="job-card">
+ <form class="centered-form blocky-form-items" method="post">
+ <label for="username">Username</label>
+ <input type="text" name="username">
+ <label for="password">Password</label>
+ <input type="password" name="password">
+ <br>
+ <?php
+ echo self::$message;
+ ?>
+ <input type="submit" value="Login">
+ </form>
+</div>
diff --git a/src/views/dashboard.php b/src/views/dashboard.php
index 06be539..fe7a021 100644
--- a/src/views/dashboard.php
+++ b/src/views/dashboard.php
@@ -1,17 +1,27 @@
+<ul class="jobs-listing">
<?php
foreach($jobs as $job) {
- echo "{$job->id} {$job->title} {$job->description} " . self::$companies[$job->companyId] . " {$job->salary}
- <form method=\"post\">
- <input type=\"hidden\" name=\"_method\" value=\"get\">
- <input type=\"hidden\" name=\"jobId\" value=\"{$job->id}\">
- <input type=\"submit\" value=\"Edit\">
- </form>
- <form method=\"post\">
- <input type=\"hidden\" name=\"_method\" value=\"delete\">
- <input type=\"hidden\" name=\"jobId\" value=\"{$job->id}\">
- <input type=\"submit\" value=\"Delete\">
- </form>
- <br>";
+ echo '<li class="job-card">
+ <div class="job-primary">
+ <h2 class="job-title"><a href="#">' . $job->title . '</a></h2>
+ <div class="job-meta">
+ <a class="meta-company" href="#">' . self::$companies[$job->companyId] . '</a>
+ <span class="meta-date">' . round($job->salary, 2) . ' lev/month</span>
+ </div>
+ </div>
+ <div class="job-edit">
+ <form method="post">
+ <input type="hidden" name="_method" value="get">
+ <input type="hidden" name="jobId" value="' . $job->id . '">
+ <input type="submit" value="Edit" class="anchor-btn">
+ </form>
+ <form method="post">
+ <input type="hidden" name="_method" value="delete">
+ <input type="hidden" name="jobId" value="' . $job->id . '">
+ <input type="submit" value="Delete" class="anchor-btn">
+ </form>
+ </div>
+ </li>';
}
?>
-<a href="/">&lt; Back</a>
+</ul>
diff --git a/src/views/edit-offer.php b/src/views/edit-offer.php
index a6d699e..992b08e 100644
--- a/src/views/edit-offer.php
+++ b/src/views/edit-offer.php
@@ -1,25 +1,28 @@
-<form method="post">
- <input type="hidden" name="id" value="<?php echo self::$job->id?>">
- <label for="title">Job Title: </label>
- <input type="text" name="title" value="<?php echo self::$job->title ?>">
- <br>
- <label for="description">Job Description: </label>
- <textarea type="text" name="description"><?php echo self::$job->description ?></textarea>
- <br>
- <label for="company">Company: </label>
- <select name="company" selected="<?php echo self::$job->companyId ?>">
- <?php
- foreach(self::$companies as $company) {
- echo "<option value=\"{$company->id}\"";
- echo (self::$job->companyId == $company->id ? "selected" : "") . ">{$company->name}</option>";
- }
- ?>
- </select>
- <br>
- <label for="salary">Salary: </label>
- <input type="number" name="salary" min="1" placeholder="1" value="<?php echo self::$job->salary ?>">
- <br>
- <input type="hidden" name="_method" value="put">
- <input type="submit" value="Update">
-</form>
-<a href="/Dashboard">&lt; Back to Dashboard</a>
+<div class="job-card">
+ <form class="centered-form blocky-form-items" method="post">
+ <input type="hidden" name="id" value="<?php echo self::$job->id?>">
+
+ <label for="title">Job Title</label>
+ <input type="text" name="title" value="<?php echo self::$job->title ?>">
+
+ <label for="description">Job Description</label>
+ <textarea type="text" name="description"><?php echo self::$job->description ?></textarea>
+
+ <label for="company">Company</label>
+ <select name="company" selected="<?php echo self::$job->companyId ?>">
+ <?php
+ foreach(self::$companies as $company) {
+ echo "<option value=\"{$company->id}\"";
+ echo (self::$job->companyId == $company->id ? "selected" : "") . ">{$company->name}</option>";
+ }
+ ?>
+ </select>
+
+ <label for="salary">Salary (lev/month)</label>
+ <input type="number" name="salary" min="1" placeholder="1" value="<?php echo self::$job->salary ?>">
+
+ <br>
+ <input type="hidden" name="_method" value="put">
+ <input type="submit" value="Update">
+ </form>
+</div>
diff --git a/src/views/landing.php b/src/views/landing.php
index 6124f90..514e5a7 100644
--- a/src/views/landing.php
+++ b/src/views/landing.php
@@ -1,8 +1,23 @@
+<ul class="jobs-listing">
<?php
foreach($jobs as $job) {
- echo "{$job->title} {$job->description} " . self::$companies[$job->companyId] . " {$job->salary}<br>";
+ echo '<li class="job-card">
+ <div class="job-primary">
+ <h2 class="job-title"><a href="#">' . $job->title . '</a></h2>
+ <div class="job-meta">
+ <a class="meta-company" href="#">' . self::$companies[$job->companyId] . '</a>
+ <span class="meta-date">' . round($job->salary, 2) . ' lev/month</span>
+ </div>
+ <div class="job-details">
+ '. $job->description . '
+ </div>
+ </div>
+ <div class="job-logo">
+ <div class="job-logo-box">
+ <img src="https://i.imgur.com/ZbILm3F.png" alt="">
+ </div>
+ </div>
+ </li>';
}
?>
-
-<a href="/CreateOffer">Create a new Job Offer</a>
-<a href="/Dashboard">Dashboard</a>
+</ul>