Skip to content
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

refresh admin-panel #603

Merged
merged 9 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/views/web/admin/careers/_item_step_fields.html.slim
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.nested-fields.mb-3
.row
.col-md-1
= link_to_remove_association f, class: 'btn btn-xs btn-warning' do
= t('.remove_field')
.col-md-7
= f.association :career_step, collection: @steps, hint: t('.step')
.col-md-2
= f.input :order, hint: t('.order')
.col-md-3
- if f.object.career_step
= link_to edit_admin_career_step_path(@career, f.object.career_step), class: 'btn btn-outline-primary me-1', title: t('.edit') do
span.bi.bi-gear-fill
= link_to_remove_association f, class: 'btn btn-xs btn-warning', title: t('.remove_field') do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше наверное красным? но хз

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

наверное вроде как по ярче смотрится
image

span.bi.bi-trash3-fill
2 changes: 2 additions & 0 deletions app/views/web/admin/careers/_menu.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ul.nav.nav-tabs.mb-4
= menu_item t('.list'), admin_careers_path
= menu_item t('.new'), new_admin_career_path
- if career
= menu_item career.name, edit_admin_career_path(career)
9 changes: 7 additions & 2 deletions app/views/web/admin/careers/_steps.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ table.table
tr
th = han('career/step', 'name')
th = han('career/step', 'created_at')
th = t('.action')
th = t('actions')
tbody
- steps.each do |step|
tr
td = link_to step.name, admin_career_step_path(career, step), class: 'text-decoration-none'
td = l step.created_at, format: :long
td = link_to t('.edit'), edit_admin_career_step_path(career, step), class: 'btn btn-primary'
td
.btn-group[role='group' aria-label="#{t('action_buttons')}"]
= link_to admin_career_step_path(career, step), class: 'btn btn-outline-primary btn-sm', title: t('.show_step') do
span.bi.bi-eye-fill
= link_to edit_admin_career_step_path(career, step), class: 'btn btn-outline-primary btn-sm', title: t('.edit') do
span.bi.bi-gear-fill
14 changes: 10 additions & 4 deletions app/views/web/admin/careers/_users.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
h3.my-4.me-3 = t('.users_career')

= link_to t('.add_user'), new_admin_career_member_path(@career), class: 'btn btn-primary'
= link_to new_admin_career_member_path(@career), class: 'btn btn-primary' do
span.bi.bi-lightning-charge.me-2
= t('.add_user')
table.table
thead
tr
Expand All @@ -9,7 +11,7 @@ table.table
th = han('career/member', 'created_at')
th = han('career/member', 'finished_at')
th = han('career/member', 'state')
th = t('.action')
th = t('actions')
tbody
- users.each do |user|
tr
Expand All @@ -19,5 +21,9 @@ table.table
td = show_date_if(user.career_members.last.finished_at, :long)
td = user.career_members.last.aasm(:state).human_state
td
- if user.career_members.last.may_archive?
= link_to t('.archive'), archive_admin_career_member_path(career, user.career_members.last), method: :patch, data: { confirm: t('.question') }, class: 'btn btn-primary'
.btn-group[role='group' aria-label="#{t('action_buttons')}"]
= link_to user_path(user), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-eye-fill
- if user.career_members.last.may_archive?
= link_to archive_admin_career_member_path(career, user.career_members.last), method: :patch, data: { confirm: t('.question') }, class: 'btn btn-outline-danger btn-sm', title: t('.archive') do
span.bi.bi.bi-trash3
2 changes: 2 additions & 0 deletions app/views/web/admin/careers/edit.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
- content_for :header do
= t('career')

= render 'menu', career: @career

= simple_form_for @career, as: :career, url: admin_career_path(@career), wrapper: 'horizontal_form' do |f|
p-0.pt-3.mb-5.hexlet-dashboard-courses
ul.nav.nav-tabs.justify-content-center[role='tablist']
Expand Down
14 changes: 8 additions & 6 deletions app/views/web/admin/careers/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
- content_for :header do
= t('career')

= render 'menu'
= render 'menu', career: nil

table.table
thead
tr
th = sort_link(@q, 'name')
th = sort_link(@q, 'slug')
th = sort_link(@q, 'created_at')
th = t('.action')
th = t('actions')
tbody
- @careers.each do |career|
tr
td = link_to career.name, admin_career_path(career), class: 'no decorete'
td = career.slug
td = l career.created_at, format: :long
td = link_to t('.edit'), edit_admin_career_path(career), class: 'btn btn-primary btn-sm'
td
.btn-group[role='group' aria-label="#{t('action_buttons')}"]
= link_to admin_career_path(career), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-eye-fill
= link_to edit_admin_career_path(career), class: 'btn btn-outline-primary btn-sm', title: t('.edit') do
span.bi.bi-gear-fill
2 changes: 1 addition & 1 deletion app/views/web/admin/careers/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- content_for :header do
= t('career')

= render 'menu'
= render 'menu', career: nil

= simple_form_for @career, as: :career, url: admin_careers_path, wrapper: 'horizontal_form' do |f|
= render 'form', f:
Expand Down
12 changes: 5 additions & 7 deletions app/views/web/admin/careers/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
- content_for :header do
= t('.career_path')

.row.mb-3
.col-sm-3
b = han('career', 'name')
.col-sm-9
= @career.name
= t('.career_track', name: @career.name)
.coll
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это что за класс такой?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да хз, удалить наверное забыл

= link_to edit_admin_career_path(@career), class: 'btn btn-primary mb-2' do
span.bi.bi-gear.me-2
= t('.edit')

.row.mb-3
.col-sm-3
Expand Down
7 changes: 4 additions & 3 deletions app/views/web/admin/home/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
- content_for :header do
= t('.admins')

table.table
thead
tr
th = sort_link(@q, 'name')
th = sort_link(@q, 'state')
th = sort_link(@q, 'email')
th = sort_link(@q, 'created_at')
th = t('actions')
tbody
- @admins.each do |admin|
tr
td = link_to admin, user_path(admin)
td = admin.aasm(:state).human_state
td = admin.email
td = l admin.created_at, format: :short
td
= link_to user_path(admin), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-eye-fill
17 changes: 12 additions & 5 deletions app/views/web/admin/resumes/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ table.table
th = sort_link(@q, 'user')
th = sort_link(@q, 'email')
th = sort_link(@q, 'created_at')
th = t('.action')
th = t('actions')
tbody
- @resumes.each do |resume|
tr
Expand All @@ -27,9 +27,16 @@ table.table
td = resume.user.email
td = l resume.created_at, format: :short
td
- if resume.may_restore?
= link_to t('.restore'), restore_admin_resume_path(resume), method: :patch, class: 'btn btn-success btn-sm'
- elsif resume.may_archive?
= link_to t('.archive'), archive_admin_resume_path(resume), method: :patch, class: 'btn btn-danger btn-sm'
.btn-group[role='group' aria-label="#{t('action_buttons')}"]
= link_to resume_path(resume), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-eye-fill
= link_to edit_admin_resume_path(resume), class: 'btn btn-outline-primary btn-sm', title: t('.edit') do
span.bi.bi-gear-fill
- if resume.may_restore?
= link_to restore_admin_resume_path(resume), method: :patch, class: 'btn btn-outline-success btn-sm', data: { confirm: t('.confirm_restore') }, title: t('.restore') do
span.bi.bi-arrow-counterclockwise
- elsif resume.may_archive?
= link_to archive_admin_resume_path(resume), method: :patch, class: 'btn btn-outline-danger btn-sm', data: { confirm: t('.confirm_archive') }, title: t('.archive') do
span.bi.bi-trash3

= paginate @resumes
7 changes: 7 additions & 0 deletions app/views/web/admin/users/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ table.table
th = sort_link(@q, 'role')
th = sort_link(@q, 'state')
th = sort_link(@q, 'created_at')
th = t('actions')
tbody
- @users.each do |user|
tr
Expand All @@ -18,5 +19,11 @@ table.table
td = user.role_text
td = user.aasm(:state).human_state
td = l user.created_at, format: :short
td
.btn-group[role='group' aria-label="#{t('action_buttons')}"]
= link_to user_path(user), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-eye-fill
= link_to edit_admin_user_path(user), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-gear-fill

= paginate @users
7 changes: 7 additions & 0 deletions app/views/web/admin/vacancies/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ table.table
th = sort_link(@q, 'company_name')
th = sort_link(@q, 'created_at')
th = sort_link(@q, 'published_at')
td = t('actions')
tbody
- @vacancies.each do |vacancy|
tr
Expand All @@ -25,5 +26,11 @@ table.table
/ td = user.role
td = l vacancy.created_at, format: :long
td = show_date_if(vacancy.published_at, :long)
td
.btn-group[role='group' aria-label="#{t('action_buttons')}"]
= link_to vacancy_path(vacancy), class: 'btn btn-outline-primary btn-sm' do
span.bi.bi-eye-fill
= link_to edit_admin_vacancy_path(vacancy), class: 'btn btn-outline-primary btn-sm', title: t('.edit') do
span.bi.bi-gear-fill

= paginate @vacancies
22 changes: 12 additions & 10 deletions config/locales/admin/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ en:
admin:
resumes:
index:
action: Action
archive: Archive
restore: Publish
edit: Edit CV
archive: Archive CV
restore: Publish CV
confirm_archive: Are you sure you want to archive your resume?
confirm_restore: Are you sure you want to post your resume?
edit:
header: Resume editing
vacancies:
Expand All @@ -17,6 +19,7 @@ en:
edit:
header: Job editing
index:
edit: Editing Job
no_date: no date
export: Export jobs to csv
users:
Expand All @@ -29,18 +32,19 @@ en:
item_step_fields:
step: step
order: step sequence number
remove_field: Delete
remove_field: Delete step
edit: Edit step
index:
action: Action
edit: Edit
edit:
career: Career track
items: Career track steps
steps: Steps
add_step: Add step
show:
edit: Edit
users_career: Students in career tracks
career_path: Career track
career_track: 'Career track: %{name}'
steps: Career track steps
new:
cancel: Cancel
Expand All @@ -55,17 +59,16 @@ en:
form:
cancel: Cancel
steps:
action: Action
edit: Edit
add_new_step: Add new step
steps_career: Career track steps
show_step: Show
show:
step: Step %{step_name}
users:
users_career: Students
action: Action
archive: Archive
question: You are sure?
question: Are you sure you want to remove the user from the career track?
add_user: Add student
no_date: Not finished
users:
Expand All @@ -85,7 +88,6 @@ en:
list: List
new: New
index:
action: Action
edit: Edit
show:
step: Career track step
27 changes: 13 additions & 14 deletions config/locales/admin/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ ru:
admin:
resumes:
index:
action: Действие
archive: В архив
restore: Опубликовать
edit: Редактировать резюме
archive: Убрать в архив
restore: Опубликовать резюме
confirm_archive: Вы уверенны что хотите отправить резюме в архив
confirm_restore: Вы уверенны что хотите опубликовать резюме
edit:
header: Редактирование резюме
vacancies:
Expand All @@ -17,30 +19,29 @@ ru:
edit:
header: Редактирование вакансии
index:
edit: Редактировать вакансию
no_date: нет даты
export: Экспортировать вакансии в csv
users:
edit:
header: Редактирование пользователя
home:
index:
admins: Администраторы
careers:
item_step_fields:
step: шаг
order: порядковый номер шага
remove_field: Удалить
remove_field: Удалить шаг
edit: Редактировать шаг
index:
action: Действие
edit: Редактировать
edit: Редактировать карьерный трек
edit:
career: Карьерный трек
items: Шаги карьерного трека
steps: Шаги
add_step: Добавить шаг
show:
edit: Редактировать
users_career: Студенты проходящие карьерный трек
career_path: Карьерный трек
career_track: 'Карьерный трек: %{name}'
steps: Шаги карьерного трека
new:
cancel: Отменить
Expand All @@ -55,17 +56,16 @@ ru:
form:
cancel: Отменить
steps:
action: Действие
edit: Редактировать
add_new_step: Добавить новый шаг
steps_career: Шаги карьерного трека
show_step: Посмотреть
show:
step: Шаг %{step_name}
users:
users_career: Студенты
action: Действие
archive: Архивировать
question: Вы уверенны?
question: Вы уверенны что хотите удалить пользователя из карьерного трека?
add_user: Добавить студента
no_date: Не завершен
users:
Expand All @@ -85,7 +85,6 @@ ru:
list: Список
new: Новый
index:
action: Действие
edit: Редактировать
show:
step: Шаг карьерного трека
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
en:
actions: Actions
application_name: Hexlet CV
in_the_city: "in the city %{city_name}"
action_buttons: Action button
months_nominative_case:
-
- January
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ru:
actions: Действия
career: Карьерный трек
steps: Шаг карьерного трека
action_buttons: Кнопки действий
months_nominative_case:
-
- Январь
Expand Down