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
steps admin panel #610
steps admin panel #610
Conversation
065c6a3
to
b69a5dc
Compare
= link_to edit_admin_career_step_path(step), class: 'btn btn-outline-primary btn-sm me-1', title: t('.edit') do | ||
span.bi.bi-gear-fill | ||
= link_to admin_career_step_path(step), class: 'btn btn-outline-primary btn-sm', title: t('.show') do |
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.
порядок кнопок не тот, обычно
посмотреть \ редактировать \ удалить
@@ -0,0 +1,20 @@ | |||
= render 'menu' |
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.
а заголовка всё-таки не хватает
@@ -0,0 +1,3 @@ | |||
ul.nav.nav-tabs.mb-4 | |||
= menu_item t('.list'), admin_career_steps_path | |||
= menu_item t('.new'), new_admin_career_step_path |
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.
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.
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.
давай слово Шаг добавим в заголовок
в меню можно оставить "редактирование", у нас на Хекслете вроде так?
по выравниванию можно @richpeach-bot попросить глянуть одним глазом
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.
@usernaimandrey, я бы сохраняла для этих бейджей логику всей формы: лейбл слева в колонке, содержимое -- справа в колонке
- if @careers.any? | ||
= link_to '#attached', class: 'btn btn-primary' do | ||
span.bi.bi-eye.me-1 | ||
= t('.attached_careers') |
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.
ну ваще не в кассу огромная синяя кнопка
может в шапке (или под заголовком) расположить 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.
|
||
= render 'form', step: @step, url: admin_career_step_path(@step) | ||
|
||
= render 'careers', careers: @careers |
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.
внизу выглядит ОК,
но надо бы как-то отбить от основного контента (или вообще не показывать)
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.
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.
ждем исправления визуала и попросим Стаса проверить путь
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 t('.edit'), edit_admin_career_step_path(step), class: 'btn btn-primary' |
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.
наверное лучше target _blank
= link_to admin_career_path(career), class: 'btn btn-outline-primary btn-sm', title: t('.show') do | ||
span.bi.bi-eye-fill | ||
- else | ||
= render partial: 'web/shared/empty_list' |
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.
partial можно опустить
@amshkv Можно чекать) |
@@ -0,0 +1,20 @@ | |||
h4 = t('.attached') |
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.
такие вещи лучше делать без семантики
через .h4
класс или fs-4
- content_for :header do | ||
= t('.new_step') | ||
|
||
= render 'menu', step: nil |
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.
h3 = @step.name | ||
.bg-light.rounded.py-2.px-3 | ||
== markdown2html(@step.description) | ||
.my-1 | ||
h4 = t('.tasks') | ||
.bg-light.rounded.py-2.px-3 | ||
== markdown2html(@step.tasks_text) |
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.
давай уберем семантически заголовки на просто заголовки
@@ -1,6 +1,6 @@ | |||
h3.my-4.me-3 = t('.steps_career') | |||
|
|||
= link_to t('.add_new_step'), new_admin_career_step_path(career), class: 'btn btn-primary' | |||
/ = link_to t('.add_new_step'), new_admin_career_step_path(career), class: 'btn btn-primary' |
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.
это временно закомментили чтобы вернуть если что?
config/routes.rb
Outdated
@@ -96,9 +96,10 @@ | |||
end | |||
end | |||
resources :vacancies, only: %i[index edit update] | |||
resources :career_steps, only: %i[index new show create edit update] |
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.
А тут решили делать именно отдельным ресурсом, не вложенным на коллекции?
/careers/steps
/careers/steps/:id
...
Вроде всё же не предполагается что шаг может использоваться с какой-нибудь другой сущностью? Собственно и в моделях step - Career::Step
То есть step по сути это вложенный ресурс, но для всех треков.
@@ -11,14 +18,14 @@ def new | |||
|
|||
def edit | |||
@step = Career::Step.find(params[:id]) | |||
@careers = @step.careers |
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.
А в методе update если упало с ошибками валидации нам не нужно во вьюху передавать @careers
1aa1fc3
to
89ca9a1
Compare
Задачи: