Skip to content

Commit

Permalink
Improve course#edit navigation by adding a link to course#show
Browse files Browse the repository at this point in the history
  • Loading branch information
mpugach committed Mar 6, 2023
1 parent e0a4b25 commit 646d2b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/helpers/concerns/link_tos.rb
Expand Up @@ -29,6 +29,10 @@ def link_to_back(condition, path)
link_to_action(condition, path, 'primary', t('links.back'), 'arrow-left')
end

def link_to_show(condition, path)
link_to_action(condition, path, 'primary', t('links.show'), 'eye-open')
end

def link_to_destroy(condition, path)
link_to_action(
condition, path, 'danger', t('links.delete'), 'trash',
Expand Down
1 change: 1 addition & 0 deletions app/views/courses/edit.html.haml
Expand Up @@ -5,6 +5,7 @@
%h1.text-center= t('.title')

.col-xs-12.col-sm-6.col-sm-offset-3.vert-offset-top-1.text-right
= link_to_show policy(@course).show?, course_path(@course)
= link_to_new policy(Course).new?, new_course_path
= link_to_index policy(Course).index?, courses_path
= link_to_destroy_course(@course)
Expand Down
1 change: 1 addition & 0 deletions config/locales/general.ru.yml
Expand Up @@ -52,6 +52,7 @@ ru:
list: 'Список'
new: 'Создать'
statistics: 'Статистика'
show: 'Просмотр'
update: 'Сохранить'
withdraw: 'Отозвать заявление'
alerts:
Expand Down
1 change: 1 addition & 0 deletions config/locales/general.uk.yml
Expand Up @@ -52,6 +52,7 @@ uk:
list: 'Список'
new: 'Створити'
statistics: 'Статистика'
show: 'Перегляд'
update: 'Зберегти'
withdraw: 'Відкликати заяву'
alerts:
Expand Down

0 comments on commit 646d2b6

Please sign in to comment.