Refactor courses
This commit is contained in:
@@ -2,29 +2,29 @@
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => "course_full_name"} Nome completo
|
||||
%dd= text_field 'course', 'full_name'
|
||||
%label{:for => "course_full_name"}= Course.human_attribute_name(:full_name)
|
||||
%dd= text_field 'course', 'full_name'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_short_name"} Nome abreviado
|
||||
%label{:for => "course_short_name"}= Course.human_attribute_name(:short_name)
|
||||
%dd= text_field 'course', 'short_name'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_code"} Código
|
||||
%label{:for => "course_code"}= Course.human_attribute_name(:code)
|
||||
%dd= text_field 'course', 'code'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_grade"} Semestre
|
||||
%label{:for => "course_grade"}= Course.human_attribute_name(:grade)
|
||||
%dd= text_field 'course', 'grade'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_period"} Data
|
||||
%label{:for => "course_period"}= Course.human_attribute_name(:period)
|
||||
%dd= text_field 'course', 'period'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_hidden"} Ocultar
|
||||
%label{:for => "course_hidden"}= Course.human_attribute_name(:hidden)
|
||||
%dd= check_box 'course', 'hidden'
|
||||
|
||||
%dt
|
||||
%label{:for => "course_description"} Descrição
|
||||
%label{:for => "course_description"}= Course.human_attribute_name(:description)
|
||||
%dd= preserve(text_area('course', 'description', :cols => 60, :rows => 10))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Editar disciplina
|
||||
%h1.title= t(:edit_course)
|
||||
|
||||
%p
|
||||
= form_tag course_path(@course.id), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar', :accesskey => 'e'
|
||||
= submit_tag t(:edit), :accesskey => 'e'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.cmd
|
||||
= action_icon('add', 'Cadastrar nova disciplina', new_course_url, :accesskey => '+') if admin?
|
||||
= action_icon('add', 'Cadastrar nova disciplina', new_course_url, accesskey: '+') if admin?
|
||||
|
||||
%h4.title= App.title
|
||||
%h1.title= "Disciplinas #{@period}"
|
||||
@@ -8,6 +8,7 @@
|
||||
%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
|
||||
@@ -17,7 +18,7 @@
|
||||
= action_icon('subtract', 'Desmatricular-se', unenroll_course_url(course))
|
||||
= link_to h(course.full_name), course_url(course)
|
||||
|
||||
-# cache(courses_path) do
|
||||
-# cache(courses_path) do
|
||||
- old_grade = 0
|
||||
- for course in @courses
|
||||
- if course.grade != old_grade
|
||||
@@ -32,5 +33,5 @@
|
||||
|
||||
%h3
|
||||
Outros Semestres
|
||||
%li= link_to "2008.2", :period => '2008.2'
|
||||
%li= link_to "2008.1", :period => '2008.1'
|
||||
%li= link_to "2008.2", period: '2008.2'
|
||||
%li= link_to "2008.1", period: '2008.1'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Adicionar disciplina
|
||||
%h1.title= t(:new_course)
|
||||
|
||||
= form_tag courses_url, :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Cadastrar", :accesskey => 'e'
|
||||
= submit_tag t(:create), :accesskey => 'e'
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
.cmd
|
||||
- if admin?
|
||||
= action_icon 'edit', 'Editar disciplina', edit_course_url, :accesskey => 'e'
|
||||
= action_icon 'edit', t(:edit_course), edit_course_url, :accesskey => 'e'
|
||||
=# action_icon 'trash', 'Excluir disciplina', course_url, :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
-# cache(course_path(@course.id)) do
|
||||
|
||||
%h4.title Disciplina
|
||||
%h4.title= t(:course).capitalize
|
||||
%h1.title= h(@course.full_name)
|
||||
|
||||
%p= @course.description.format_wiki
|
||||
@@ -31,32 +29,31 @@
|
||||
|
||||
.box
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar página wiki', new_course_wiki_instance_url(@course)
|
||||
= action_icon 'add', t(:create_wiki_page), new_course_wiki_instance_url(@course)
|
||||
|
||||
%h3 Páginas Wiki
|
||||
%h3= t(:wiki_pages)
|
||||
%ul.wiki
|
||||
- @course.wiki_pages.find_front_page.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_instance_url(@course.to_param, wiki.id) unless wiki.first?
|
||||
=action_icon 'arrow2_s', 'Mover para baixo', move_down_course_wiki_instance_url(@course.to_param, wiki.id) unless wiki.last?
|
||||
=action_icon 'arrow2_n', t(:move_up), move_up_course_wiki_instance_url(@course.to_param, wiki.id) unless wiki.first?
|
||||
=action_icon 'arrow2_s', t(:move_down), move_down_course_wiki_instance_url(@course.to_param, wiki.id) unless wiki.last?
|
||||
- if wiki.last?
|
||||
%span{:style => 'margin-right: 14px'}
|
||||
=link_to h(wiki.title), course_wiki_instance_url(@course.to_param, wiki.id)
|
||||
- if @course.wiki_pages.empty?
|
||||
%li.no_itens Nenhuma página wiki
|
||||
%li.no_itens= t(:no_wiki_pages)
|
||||
- else
|
||||
%li.show_all= link_to "Ver todas as páginas wiki", course_wiki_url(@course)
|
||||
%li.show_all= link_to t(:see_all_wiki_pages), course_wiki_url(@course)
|
||||
|
||||
.box
|
||||
.cmd= action_icon 'add', 'Adicionar anexo', new_course_attachment_url(@course)
|
||||
.cmd= action_icon 'add', t(:create_attachment), new_course_attachment_url(@course)
|
||||
|
||||
%h3 Repositório de Arquivos
|
||||
%h3= t(:repository)
|
||||
.repositorio
|
||||
= nested_attachments_to_html(attachments_to_nested_hash(@course.attachments.find_front_page))
|
||||
- if @course.attachments.empty?
|
||||
%ul.wiki
|
||||
%li.no_itens Nenhum arquivo
|
||||
%li.no_itens= t(:no_attachments)
|
||||
- else
|
||||
%li.show_all= link_to "Ver todos os arquivos", course_attachments_url(@course)
|
||||
|
||||
%li.show_all= link_to t(:see_all_attachments), course_attachments_url(@course)
|
||||
|
||||
Reference in New Issue
Block a user