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 3 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
10 changes: 7 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,13 @@
.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-sm-1
= 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
- if f.object.career_step
.col-sm-1
= 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
Copy link
Contributor

Choose a reason for hiding this comment

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

если посчитать - стало 11 колонок, а не 12
предлагаю сделать
col-md-7 (или 8)
col-md-2
col-md-3 и в этот md 3 (или 2) положить обе кнопки

8 changes: 6 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,14 @@ 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
= link_to admin_career_step_path(career, step), class: 'btn btn-outline-primary btn-sm me-1' do
span.bi.bi-eye-fill
= link_to edit_admin_career_step_path(career, step), class: 'btn btn-outline-primary btn-sm me-1', title: t('.edit') do
Copy link
Contributor

Choose a reason for hiding this comment

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

тут me-1 зачем?
по красоте можно попробовать сделать через https://getbootstrap.com/docs/5.3/components/button-group
но это вкусовщина

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
image
попробовал через групу кнопок

span.bi.bi-gear-fill
11 changes: 8 additions & 3 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,8 @@ table.table
td = show_date_if(user.career_members.last.finished_at, :long)
td = user.career_members.last.aasm(:state).human_state
td
= link_to user_path(user), class: 'btn btn-outline-primary btn-sm me-1' do
span.bi.bi-eye-fill
- 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'
= link_to archive_admin_career_member_path(career, user.career_members.last), method: :patch, data: { confirm: t('.question') }, class: 'btn btn-outline-primary btn-sm', title: t('.archive') do
span.bi.bi-file-earmark-zip
11 changes: 6 additions & 5 deletions app/views/web/admin/careers/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
- content_for :header do
= t('career')

= render 'menu'

table.table
Expand All @@ -9,11 +6,15 @@ table.table
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
= link_to admin_career_path(career), class: 'btn btn-outline-primary btn-sm me-1' 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
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' do
span.bi.bi-eye-fill
Copy link
Contributor

Choose a reason for hiding this comment

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

давай тоже маленькими

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'
.text-center
Copy link
Contributor

Choose a reason for hiding this comment

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

какая-то несогласованность, нигде этого нет, а тут есть

= link_to resume_path(resume), class: 'btn btn-outline-primary btn-sm me-1' do
span.bi.bi-eye-fill
= link_to edit_admin_resume_path(resume), class: 'btn btn-outline-primary btn-sm me-1', 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-primary btn-sm', data: { confirm: t('confirm') }, title: t('.restore') do
span.bi.bi-activity
- elsif resume.may_archive?
= link_to archive_admin_resume_path(resume), method: :patch, class: 'btn btn-outline-primary btn-sm', data: { confirm: t('confirm') }, title: t('.archive') do
span.bi.bi-file-earmark-zip
Copy link
Contributor

Choose a reason for hiding this comment

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

опасные кнопки, а цвета у них одинаковые
дестрой - сделай красной
опубликование - зеленой

и я бы confirm cделал попонятнее, типа согласны архивировать\заархивировать

Copy link
Contributor

Choose a reason for hiding this comment

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

иконка непонятная, давай поищем получше, для удаления можно корзину взять
для восстановления что-то типа значка разоврота
ну и спросил бы девченок, понято ли им


= paginate @resumes
6 changes: 6 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,10 @@ table.table
td = user.role_text
td = user.aasm(:state).human_state
td = l user.created_at, format: :short
td
= link_to user_path(user), class: 'btn btn-outline-primary btn-sm me-2' 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
6 changes: 6 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,10 @@ table.table
/ td = user.role
td = l vacancy.created_at, format: :long
td = show_date_if(vacancy.published_at, :long)
td
= link_to vacancy_path(vacancy), class: 'btn btn-outline-primary btn-sm me-1' 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
17 changes: 8 additions & 9 deletions config/locales/admin/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ en:
admin:
resumes:
index:
action: Action
archive: Archive
restore: Publish
edit: Edit CV
archive: Archive CV
restore: Publish CV
edit:
header: Resume editing
vacancies:
Expand All @@ -17,6 +17,7 @@ en:
edit:
header: Job editing
index:
edit: Editing Job
no_date: no date
export: Export jobs to csv
users:
Expand All @@ -29,18 +30,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,15 +57,13 @@ en:
form:
cancel: Cancel
steps:
action: Action
edit: Edit
add_new_step: Add new step
steps_career: Career track steps
show:
step: Step %{step_name}
users:
users_career: Students
action: Action
archive: Archive
question: You are sure?
add_user: Add student
Expand All @@ -85,7 +85,6 @@ en:
list: List
new: New
index:
action: Action
edit: Edit
show:
step: Career track step
22 changes: 9 additions & 13 deletions config/locales/admin/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ ru:
admin:
resumes:
index:
action: Действие
archive: В архив
restore: Опубликовать
edit: Редактировать резюме
archive: Убрать в архив
restore: Опубликовать резюме
edit:
header: Редактирование резюме
vacancies:
Expand All @@ -17,30 +17,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,15 +54,13 @@ ru:
form:
cancel: Отменить
steps:
action: Действие
edit: Редактировать
add_new_step: Добавить новый шаг
steps_career: Шаги карьерного трека
show:
step: Шаг %{step_name}
users:
users_career: Студенты
action: Действие
archive: Архивировать
question: Вы уверенны?
add_user: Добавить студента
Expand All @@ -85,7 +82,6 @@ ru:
list: Список
new: Новый
index:
action: Действие
edit: Редактировать
show:
step: Шаг карьерного трека
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
en:
actions: Actions
application_name: Hexlet CV
in_the_city: "in the city %{city_name}"
months_nominative_case:
Expand Down
1 change: 1 addition & 0 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ru:
actions: Действия
career: Карьерный трек
steps: Шаг карьерного трека
months_nominative_case:
Expand Down