Initial import
This commit is contained in:
22
app/views/courses/_form.html.haml
Normal file
22
app/views/courses/_form.html.haml
Normal file
@@ -0,0 +1,22 @@
|
||||
= error_messages_for 'course'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => "course_full_name"} Nome completo
|
||||
%dd= text_field 'course', 'full_name'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_short_name"} Nome abreviado
|
||||
%dd= text_field 'course', 'short_name'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_code"} Código
|
||||
%dd= text_field 'course', 'code'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_period"} Semestre
|
||||
%dd= text_field 'course', 'period'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_description"} Descrição
|
||||
%dd= preserve(text_area('course', 'description', :cols => 60, :rows => 10))
|
||||
3
app/views/courses/_left_panel.html.haml
Normal file
3
app/views/courses/_left_panel.html.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
- cache(:controller => 'courses', :action => 'show', :id => @course, :part => 'left') do
|
||||
= render 'widgets/menu_disciplina'
|
||||
= render 'widgets/menu_user'
|
||||
3
app/views/courses/_right_panel.html.haml
Normal file
3
app/views/courses/_right_panel.html.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
- cache(:controller => 'courses', :action => 'show', :id => @course, :part => 'right') do
|
||||
= render 'widgets/calendario'
|
||||
= render 'widgets/news'
|
||||
7
app/views/courses/edit.html.haml
Normal file
7
app/views/courses/edit.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Editar disciplina
|
||||
|
||||
%p
|
||||
- form_tag course_path(@course.id), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
29
app/views/courses/index.html.haml
Normal file
29
app/views/courses/index.html.haml
Normal file
@@ -0,0 +1,29 @@
|
||||
.cmd
|
||||
= action_icon('add', 'Cadastrar nova disciplina', new_course_url) if admin?
|
||||
|
||||
- cache do
|
||||
%h4.title= App.title
|
||||
%h1.title Disciplinas
|
||||
|
||||
.box
|
||||
%ul
|
||||
- if logged_in?
|
||||
- unless @current_user.courses.empty?
|
||||
%h3 Disciplinas matriculadas
|
||||
- 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)
|
||||
|
||||
- old_period = 0
|
||||
- for course in @courses
|
||||
- if course.period != old_period
|
||||
%h3= (course.period == 99 ? "Optativas" : "Semestre #{course.period}")
|
||||
- old_period = course.period
|
||||
|
||||
%li{highlight(course.id)}
|
||||
.right
|
||||
= action_icon('add', 'Matricular-se', enroll_course_url(course))
|
||||
= link_to h(course.full_name), course_url(course)
|
||||
|
||||
6
app/views/courses/new.html.haml
Normal file
6
app/views/courses/new.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Adicionar disciplina
|
||||
|
||||
- form_tag course_url(@course.id), :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Cadastrar"
|
||||
40
app/views/courses/show.html.haml
Normal file
40
app/views/courses/show.html.haml
Normal file
@@ -0,0 +1,40 @@
|
||||
.cmd
|
||||
- if admin?
|
||||
= action_icon 'edit', 'Editar disciplina', edit_course_url
|
||||
/= action_icon 'trash', 'Excluir disciplina', course_url, :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
- cache do
|
||||
|
||||
%h4.title Disciplina
|
||||
%h1.title= h(@course.full_name)
|
||||
|
||||
%p= wiki @course.description
|
||||
|
||||
.box
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar página wiki', new_course_wiki_url(@course)
|
||||
|
||||
%h3 Páginas Wiki
|
||||
%ul.wiki
|
||||
- @course.wiki_pages.each do |wiki|
|
||||
%li{highlight(wiki.id)}
|
||||
.cmd{:style => 'margin-bottom: -27px; margin-top: -9px;'}
|
||||
=action_icon 'arrow2_n', 'Mover para cima', move_up_course_wiki_url(@course, wiki) unless wiki.first?
|
||||
=action_icon 'arrow2_s', 'Mover para baixo', move_down_course_wiki_url(@course, wiki) unless wiki.last?
|
||||
- if wiki.last?
|
||||
%span{:style => 'margin-right: 14px'}
|
||||
=link_to h(wiki.title), course_wiki_url(@course, wiki)
|
||||
- if @course.wiki_pages.empty?
|
||||
%li.no_itens Nenhuma página wiki
|
||||
|
||||
.box
|
||||
.cmd= action_icon 'add', 'Adicionar anexo', new_course_attachment_url(@course)
|
||||
|
||||
%h3 Repositório de Arquivos
|
||||
.repositorio
|
||||
%ul.wiki
|
||||
- @course.attachments.each do |att|
|
||||
%li{:class => mime_class(att.content_type)}
|
||||
= link_to h(att.file_name), course_attachment_url(@course, att)
|
||||
- if @course.attachments.empty?
|
||||
%li.no_itens Nenhum arquivo
|
||||
Reference in New Issue
Block a user