You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
.cmd
|
|
= action_icon('add', 'Cadastrar nova disciplina', new_course_url, accesskey: '+') if admin?
|
|
|
|
%h4.title= App.title
|
|
%h1.title= "Disciplinas #{@period}"
|
|
|
|
.box
|
|
%ul
|
|
- if logged_in?
|
|
- if params[:period].nil?
|
|
- @courses = @current_user.courses_not_enrolled(@period)
|
|
%h3 Disciplinas Matriculadas
|
|
- if @current_user.courses.empty?
|
|
%li.no_itens Nenhuma disciplina matriculada
|
|
- for course in @current_user.courses
|
|
%li{highlight(course.id)}
|
|
.right
|
|
= action_icon('subtract', 'Desmatricular-se', unenroll_course_url(course))
|
|
= link_to h(course.full_name), course_url(course)
|
|
- else
|
|
- @courses = Course.visible.where(period: @period)
|
|
|
|
-# cache(courses_path) do
|
|
- old_grade = 0
|
|
- for course in @courses
|
|
- if course.grade != old_grade
|
|
%h3= (course.grade == 99 ? "Optativas" : "Semestre #{course.grade}")
|
|
- old_grade = course.grade
|
|
|
|
%li{highlight(course.id)}
|
|
- if course.period == App.current_period
|
|
.right
|
|
= action_icon('add', 'Matricular-se', enroll_course_url(course))
|
|
= link_to h(course.full_name), course_url(course)
|
|
|
|
%h3
|
|
Outros Semestres
|
|
- for period in Course.pluck_periods
|
|
%li= link_to period.to_s, period: period
|