-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Story 2 - Edit applicants #4
base: main
Are you sure you want to change the base?
Conversation
…on path on same page
…rm data. Points too non-existant 'EditApplicantController'
…dio buttons for binary options with prepopulated info from DB
…nPageController to use existing method
:root{ | ||
--white: #ffffff; | ||
--black: #000000; | ||
--light-grey: #dddddd; | ||
--dark-grey: #333333; | ||
--light-blue: #337ab7; | ||
--red: #FF0000; | ||
--io-pink: #FF3366; | ||
--io-purple: #743DFB; | ||
--io-purple-dark: #0F0028; | ||
--io-green: #5FFFB4; | ||
|
||
--small: 768px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good to see that you have added the variables, but then you don't use them 😔.
For example, you should replace every occurrence of #dddddd
in this file with var(--light-grey)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
public/css/style.css
Outdated
} | ||
|
||
.btn:hover { | ||
background-color: rgb(0, 248, 131.75); | ||
background-color: rgb(0, 248, 131.75); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the variable --io-green
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
public/css/style.css
Outdated
.admin .links { | ||
grid-template-columns: 1fr; | ||
} | ||
@media screen and (max-width: 768px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@media screen and (max-width: 768px) { | |
@media screen and (max-width: var(--small)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/Models/CohortsModel.php
Outdated
public function getDate (){ | ||
$query = $this->db->prepare("SELECT `id`, `date` FROM `cohorts`;"); | ||
$query->execute(); | ||
return $query->fetchAll(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns multiple dates so it should be getDates
or getCohortDates
.
But also why don't you juse use the getAll
to get a list of all of the cohorts and then access the date from those entities? That's what I meant by saying it looked like this had already been done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've done this now :)
@@ -42,6 +43,7 @@ | |||
<td><a href="/admin/applicants/<?= $applicant->getId() ?>"><?= $applicant->getName(); ?></a></td> | |||
<td><?php echo $applicant->getEmail(); ?></td> | |||
<td><?php echo $applicant->getFormattedApplicationDate(); ?></td> | |||
<td><a href="/admin/applicant/edit/<?= $applicant->getId() ?>" class="edit-button">EDIT</a></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really easy to make the button consistent with other buttons because there is already a CSS class...
<td><a href="/admin/applicant/edit/<?= $applicant->getId() ?>" class="edit-button">EDIT</a></td> | |
<td><a href="/admin/applicant/edit/<?= $applicant->getId() ?>" class="btn">EDIT</a></td> |
Don't reinvent the wheel.
public/css/style.css
Outdated
.edit-button { | ||
top: 50%; | ||
transform: translateY(-50%); | ||
padding: 6px; | ||
border: 1px solid #dddddd; | ||
border-radius: 10px; | ||
font-size: 14px; | ||
position: absolute; | ||
background-color: #61fed2; | ||
color: black; | ||
transition: all 0.1s linear; | ||
box-shadow: 0 0 0 0 rgb(0,0,0); | ||
} | ||
.edit-button:hover { | ||
background-color: #dddddd; | ||
} | ||
|
||
.archive-button { | ||
left: 50%; | ||
transform: translateY(-50%); | ||
padding: 6px; | ||
border: 1px solid #dddddd;; | ||
border-radius: 10px; | ||
font-size: 14px; | ||
position: absolute; | ||
background-color: #61fed2; | ||
color: black; | ||
transition: all 0.1s linear; | ||
box-shadow: 0 0 0 0 rgb(0,0,0); | ||
} | ||
.archive-button:hover { | ||
background-color: #dddddd; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these CSS classes, they're redundant / not part of this story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/Models/ApplicationModel.php
Outdated
WHERE `applicant_id` = :id"); | ||
$query->execute([ | ||
'id' => $details['id'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id
usages should be applicant ID to disambiguate for later readers whether you mean the applicant ID or the application ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
As an: Academy Admin
I want: To be able to edit applicants
So that: I can correct mistakes made when adding an applicant, or when an applicant changes their details
We have assigned this 8 story points.
Requirements:
Must display an ‘Edit’ button next to each applicant on the applicants page in the ‘Actions’ column
This should take you to a seperate edit page
Must be able to edit all applicant and application fields
All form fields should be pre-populated with the existing data for that applicant
If the applicant does not have a row in the applications table, do not display any of the application fields on the edit page
Should be redirected to the single applicant page for the edited applicant upon success
Must display appropriate validation messages (should be consistent with adding an applicant)