Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renovate the academic group list to show the actions as buttons and s…
…upport localization
- Loading branch information
Showing
8 changed files
with
98 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.table > thead > tr > th.text-middle, | ||
.table > tbody > tr > td.text-middle, | ||
.text-middle | ||
vertical-align: middle | ||
|
||
.table > thead > tr > th.text-top, | ||
.table > tbody > tr > td.text-top, | ||
.text-top | ||
vertical-align: top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,42 @@ | ||
- provide(:title, 'All Academic Groups') | ||
- provide(:title, t('.title')) | ||
|
||
%h1 Academic Groups | ||
.row | ||
.col-xs-12 | ||
%h1.text-center | ||
= t('.title') | ||
|
||
.row | ||
.col-xs-12 | ||
.table-responsive | ||
%table.table.table-condensed.table-striped | ||
%thead | ||
%tr | ||
%th.text-top=t('.table_title_name') | ||
%th.text-top.text-center=t('.table_title_established') | ||
%th.text-top.text-center=t('.table_title_graduated') | ||
%th.text-top=t('.table_title_description') | ||
%th.text-top.text-center=t('.table_title_students') | ||
|
||
- if @academic_groups.any? { |c| policy(c).tap { |p| break p.edit? || p.destroy? || p.statistics? } } | ||
%th.text-top.text-right=t('.table_title_actions') | ||
|
||
%tbody | ||
- @academic_groups.each do |academic_group| | ||
%tr{class: 'academic_group', id: academic_group.id} | ||
%td= link_to academic_group.title, academic_group | ||
%td.text-center= l(academic_group.establ_date) if academic_group.establ_date.present? | ||
%td.text-center= l(academic_group.graduated_at, format: :with_day) unless academic_group.active? | ||
%td= academic_group.group_description | ||
%td.text-center= academic_group.active_students.count | ||
|
||
- if policy(academic_group).tap { |p| break p.edit? || p.destroy? || p.statistics? } | ||
%td.col-xs-2.col-sm-4.col-md-3.text-right.text-middle | ||
= link_to_action policy(academic_group).statistics?, | ||
academic_group_statistics_path(academic_group), | ||
'info', | ||
t('links.statistics'), | ||
'stats' | ||
= link_to_edit policy(academic_group).edit?, | ||
edit_academic_group_path(academic_group) | ||
= link_to_destroy policy(academic_group).destroy?, academic_group | ||
|
||
.table-responsive | ||
%table.table.table-condensed.table-striped | ||
%thead | ||
%tr | ||
%th Name | ||
%th Established | ||
%th Graduated | ||
%th Description | ||
%th Students | ||
%th Statistics | ||
%tbody | ||
- @academic_groups.each do |academic_group| | ||
%tr{class: 'academic_group', id: academic_group.id} | ||
%td= link_to academic_group.title, academic_group | ||
%td= l(academic_group.establ_date) if academic_group.establ_date.present? | ||
%td= l(academic_group.graduated_at, format: :with_day) unless academic_group.active? | ||
%td= academic_group.group_description | ||
%td= academic_group.active_students.count | ||
%td= link_to 'view', academic_group_statistics_path(academic_group) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters