Skip to content

Commit

Permalink
Migrates admin job pages to Bootstrap 5 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
matyikriszta committed Apr 13, 2022
1 parent cda8ad1 commit dbf86eb
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 120 deletions.
14 changes: 0 additions & 14 deletions app/assets/stylesheets/foundation_and_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1389,17 +1389,3 @@ blockquote em {
height: 105px;
visibility: hidden;
}

.label.status {
@include label(
$text-size: 13px,
$bg: $codebar-blue
);
}

.label.admin.status.pending {
@include label(
$text-size: 13px,
$bg: $alert-color
);
}
10 changes: 5 additions & 5 deletions app/views/admin/jobs/_job.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%tr
%td
= link_to job.title, admin_job_path(job.id)
= link_to job.title, admin_job_path(job.id), class: 'border-0'
%td
= job.company
%td
Expand All @@ -9,11 +9,11 @@
= l(job.created_at, format: :date)
%td
- if job.published? && job.expired?
%span.label.admin.status.expired= t('job.admin.status.expired')
%span.badge.bg-danger= t('job.admin.status.expired')
- else
%span.label.admin.status{ class: job.status }= t("job.admin.status.#{job.status}")
%span.badge.bg-info{ class: job.status }= t("job.admin.status.#{job.status}")
%td
- if job.pending?
= link_to 'Review', admin_job_path(job.id)
= link_to 'Review', admin_job_path(job.id), class: 'border-0'
- if job.published?
= link_to 'Unpublish', admin_job_unpublish_path(job.id)
= link_to 'Unpublish', admin_job_unpublish_path(job.id), class: 'border-0'
24 changes: 0 additions & 24 deletions app/views/admin/jobs/all.html.haml

This file was deleted.

33 changes: 16 additions & 17 deletions app/views/admin/jobs/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
.job.mb4
.stripe
.row
.large-12.columns
%br
%ul.breadcrumbs
%li=link_to t('admin.dashboard.title'), admin_root_path
%li.current
%span= t('admin.jobs.title')
.container-fluid.pt-3
.row.mb-4
.col
%nav{'aria-label': 'breadcrumb'}
%ol.breadcrumb.ml-0
%li.breadcrumb-item= link_to t('admin.dashboard.title'), admin_root_path, class: 'border-0'
%li.breadcrumb-item.active= t('admin.jobs.title')

- if @jobs.any?
.row
%table.large-12.columns
- if @jobs.any?
.row.mb-4
.col
%table.table
%thead
%tr
%th Title
Expand All @@ -22,8 +21,8 @@
%tbody
- @jobs.each do |job|
= render partial: 'admin/jobs/job', locals: { job: job }
.row
.medium-6.columns.text-left
= page_entries_info(@jobs, model: 'job')
.medium-6.columns.text-right
= will_paginate(@jobs)
.row.mb-4
.col-6
= page_entries_info(@jobs, model: 'job')
.col-6.text-right
= will_paginate(@jobs)
121 changes: 61 additions & 60 deletions app/views/admin/jobs/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
.job.mb4
.stripe
.row
.large-12.columns
%br
%ul.breadcrumbs
%li=link_to t('admin.dashboard.title'), admin_root_path
%li=link_to t('admin.jobs.title'), admin_jobs_path
%li.current
%span= @job.title
.row
.large-12.columns
- if !@job.published? && @job.expired?
.panel
.row
.large-12.columns
=t('admin.jobs.messages.cannot_approve')
- elsif !@job.published?
.panel
.row
.large-12.columns
%h4
%strong Before approving this job make sure
%ul.no-bullet
%li
%input#work_details{ type: 'checkbox' }
%label{ for: 'work_details' } The post details the work that will have to be undertaken
%li
%input#roles{ type: 'checkbox' }
%label{ for: 'roles' } It's suitable for people looking for Internships and Junior roles that will enable them to build up their career
%li
%input#reliable_source{ type: 'checkbox' }
%label{ for: 'reliable_source' } It was posted by someone you know or a reliable source
%li
%input#payment{ type: 'checkbox' }
%label{ for: 'payment' } Payment confirmation was posted in Slack
%li
%input#to-the-point{ type: 'checkbox' }
%label{ for: 'to-the-point' } The post is short and to the point
.container-fluid.pt-3
.row.mb-4
.col
%nav{'aria-label': 'breadcrumb'}
%ol.breadcrumb.ml-0
%li.breadcrumb-item= link_to t('admin.dashboard.title'), admin_root_path, class: 'border-0'
%li.breadcrumb-item= link_to t('admin.jobs.title'), admin_jobs_path, class: 'border-0'
%li.breadcrumb-item.active= @job.title

.large-12.columns
%p
- if @job.expired?
=t('admin.jobs.info.request_changes_html', name: @job&.created_by&.full_name,
email: mail_to(@job.created_by.email, @job.created_by.email,
subject: "Regarding job listing #{@job.title}"))
- elsif @job.published?
= t('admin.jobs.info.approved_by', name: @job&.approved_by&.full_name,
date: @job.published_on)
.row
.col-12
- if !@job.published? && @job.expired?
.card.mb-2
.card-body
= t('admin.jobs.messages.cannot_approve')
- elsif !@job.published?
.card.mb-2
.card-header
%h6.mb-0 Before approving this job make sure
.card-body
%ul.list-unstyled.ml-0.mb-0
%li.form-check.mb-3
%input.form-check-input.mt-1#work_details{ type: 'checkbox' }
%label.form-check-label{ for: 'work_details' }
The post details the work that will have to be undertaken
%li.form-check.mb-3
%input.form-check-input.mt-1#roles{ type: 'checkbox' }
%label.form-check-label{ for: 'roles' }
It's suitable for people looking for Internships and Junior roles that will enable them to build up their career
%li.form-check.mb-3
%input.form-check-input.mt-1#reliable_source{ type: 'checkbox' }
%label.form-check-label{ for: 'reliable_source' }
It was posted by someone you know or a reliable source
%li.form-check.mb-3
%input.form-check-input.mt-1#payment{ type: 'checkbox' }
%label.form-check-label{ for: 'payment' }
Payment confirmation was posted in Slack
%li.form-check
%input.form-check-input.mt-1#to-the-point{ type: 'checkbox' }
%label.form-check-label{ for: 'to-the-point' }
The post is short and to the point

- else
=t('admin.jobs.info.request_changes_html', name: @job&.created_by&.full_name,
email: mail_to(@job.created_by.email, @job.created_by.email,
subject: "Regarding job listing #{@job.title}"))
%br
%br
=link_to 'Approve', admin_job_approve_path(@job.id),
class: 'button',
'data-confirm': t('admin.jobs.messages.confirm_approval')
%h2 Preview
%hr
.col-12.mb-4
- if @job.expired?
%P= t('admin.jobs.info.request_changes_html', name: @job&.created_by&.full_name,
email: mail_to(@job.created_by.email, @job.created_by.email,
subject: "Regarding job listing #{@job.title}"))
- elsif @job.published?
%P= t('admin.jobs.info.approved_by', name: @job&.approved_by&.full_name,
date: @job.published_on)

= render partial: 'jobs/show', locals: { admin: true, preview: false }
- else
%p= t('admin.jobs.info.request_changes_html', name: @job&.created_by&.full_name,
email: mail_to(@job.created_by.email, @job.created_by.email,
subject: "Regarding job listing #{@job.title}"))

= link_to 'Approve', admin_job_approve_path(@job.id),
class: 'btn btn-primary',
'data-confirm': t('admin.jobs.messages.confirm_approval')

.col-12.mb-2
%h2 Preview

= render partial: 'jobs/show', locals: { admin: true, preview: false }

0 comments on commit dbf86eb

Please sign in to comment.