forked from Antiarchitect/taurus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Teaching plans viewing UI for supervisor and dept_heads
- Loading branch information
Showing
9 changed files
with
153 additions
and
5 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
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
4 changes: 3 additions & 1 deletion
4
...r/reference/teaching_plans/show.html.haml → ...tion/groups/teaching_plans/show.html.haml
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
53 changes: 53 additions & 0 deletions
53
app/views/application/specialities/teaching_plans/show.html.haml
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,53 @@ | ||
%h1 Учебный план специальности #{@speciality.code} «#{@speciality.name}» | ||
|
||
%p Группы: #{@speciality.groups.map{|g| g.name}.join(", ")} | ||
|
||
- conditions = {:speciality_id => @speciality.id} | ||
|
||
- if @teaching_plans.empty? | ||
%p Для данной специальности учебный план ещё не загружен. | ||
|
||
- else | ||
%table.teaching_plan.infotable.fullwidth-table | ||
%thead | ||
%tr | ||
%th{:rowspan => 3} Дисциплина | ||
- @courses.each do |course| | ||
%th{:colspan => 8} Курс #{course} | ||
%th{:rowspan => 3} Всего | ||
%tr | ||
- @courses.each do |course| | ||
%th{:colspan => 4} Семестр 1 | ||
%th{:colspan => 4} Семестр 2 | ||
%tr | ||
- (@courses.count*2).times do |course| | ||
- ["Лек", "Прт", "Лаб"].each do |typename| | ||
%th #{typename} | ||
%th{:rowspan => 3} Экз | ||
%tfoot | ||
%tr | ||
%th Всего | ||
- @courses.each do |course| | ||
- (1..2).each do |semester| | ||
- conditions.merge!({:course => course, :semester => semester}) | ||
- plans = TeachingPlan.all(:conditions => conditions) | ||
%th #{plans.sum{|p| p.lections or 0 } if plans.any?} | ||
%th #{plans.sum{|p| p.practics or 0} if plans.any?} | ||
%th #{plans.sum{|p| p.lab_works or 0} if plans.any?} | ||
%th | ||
%th | ||
%tbody | ||
- @disciplines.each do |discipline| | ||
%tr | ||
%th= discipline.name | ||
- plans = [] | ||
- @courses.each do |course| | ||
- (1..2).each do |semester| | ||
- conditions.merge!({:discipline_id => discipline.id, :course => course, :semester => semester}) | ||
- plan = TeachingPlan.first(:conditions => conditions) | ||
- plans << plan if plan | ||
%td #{plan.lections if plan} | ||
%td #{plan.practics if plan} | ||
%td #{plan.lab_works if plan} | ||
%td #{(plan.exam ? "Экз" : "Зач") if plan} | ||
%th= plans.sum{|p| (p.lections or 0) + (p.practics or 0) + (p.lab_works or 0)} if plans.any? |
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,44 @@ | ||
%h1 Специальность #{@speciality.code} «#{@speciality.name}» | ||
|
||
%p Учебный план на #{TAURUS_CONFIG["semester"]["current"]["title"]} семестр. | ||
|
||
%table.teaching_plan.infotable.fullwidth-table | ||
%thead | ||
%tr | ||
%th{:rowspan => 2} Дисциплина | ||
%th{:rowspan => 2} Часов в неделю | ||
- @courses.each do |course| | ||
%th{:colspan => 3} #{course} | ||
%th{:rowspan => 2} Экзамен/зачёт | ||
%tr | ||
- 3.times do | ||
%th Лекции | ||
%th Практики | ||
%th Лаб. работы | ||
%tfoot | ||
%tr | ||
%th Всего | ||
%th.numeric-cell= @charge_cards.map{|cc| cc.hours_per_week}.sum | ||
- [[1, :lections], [2, :practics], [3, :lab_works]].each do |type| | ||
- plan = @teaching_plans.map{|tp| tp[type[1]]}.compact.sum | ||
- card = @charge_cards.select{|cc| cc.lesson_type_id == type[0]}.map{|cc| cc.try(:hours_quantity)}.sum | ||
- err = (plan - card).abs unless plan.zero? or card.zero? or (plan - card).abs.zero? | ||
%th.numeric-cell= plan unless plan.zero? | ||
%th.numeric-cell= card | ||
%th.numeric-cell.error-cell= err | ||
%th | ||
%tbody | ||
- @disciplines.each do |discipline| | ||
%tr | ||
%th= discipline.name | ||
- cards = @charge_cards.select{|cc| cc.discipline_id == discipline.id} | ||
- plan = @teaching_plans.select{|tp| tp.discipline_id == discipline.id}.first | ||
%td.numeric-cell= cards.map{|cc| cc.hours_per_week}.sum | ||
- [[1, :lections], [2, :practics], [3, :lab_works]].each do |type| | ||
- val = plan[type[1]] if plan | ||
- card = cards.select{|cc| cc.lesson_type_id == type[0]}.first.try(:hours_quantity) | ||
- err = (val - card).abs if val and card and not (val - card).abs.zero? | ||
%td.numeric-cell= val | ||
%td.numeric-cell= card | ||
%td.numeric-cell.error-cell= err | ||
%td #{(plan.exam ? "Экзамен" : "Зачёт") if plan} |
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