Initial import
This commit is contained in:
10
app/views/attachments/_form.html.haml
Normal file
10
app/views/attachments/_form.html.haml
Normal file
@@ -0,0 +1,10 @@
|
||||
= error_messages_for 'attachment'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => 'attachment_file'} Arquivo
|
||||
%dd= file_field 'attachment', 'file'
|
||||
|
||||
%dt
|
||||
%label{:for => "attachment_description"} Descrição
|
||||
%dd= preserve(text_area 'attachment', 'description')
|
||||
7
app/views/attachments/edit.html.haml
Normal file
7
app/views/attachments/edit.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Modificar arquivo
|
||||
|
||||
%p
|
||||
- form_for :attachment, @attachment, :url => course_attachment_url, :html => { :method => 'put', :multipart => 'true' } do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
7
app/views/attachments/new.html.haml
Normal file
7
app/views/attachments/new.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Adicionar arquivo
|
||||
|
||||
%p
|
||||
- form_for :attachment, @attachment, :url => course_attachments_url, :html => { :method => 'post', :multipart => 'true' } do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Criar"
|
||||
20
app/views/attachments/show.html.haml
Normal file
20
app/views/attachments/show.html.haml
Normal file
@@ -0,0 +1,20 @@
|
||||
.cmd
|
||||
= action_icon 'edit', 'Editar', edit_course_attachment_url
|
||||
= action_icon 'trash', 'Excluir', course_attachment_url, :confirm => 'Tem certeza que deseja excluir o arquivo?', :method => :delete
|
||||
|
||||
%h4.title= h(@attachment.course.full_name)
|
||||
%h1.title Repositório
|
||||
|
||||
%p
|
||||
%dl
|
||||
%dt Arquivo
|
||||
%dd= link_to h(@attachment.file_name), download_course_attachment_url
|
||||
|
||||
%dt Descrição
|
||||
%dd= h(@attachment.description)
|
||||
|
||||
%dt Tipo de Arquivo
|
||||
%dd= h(@attachment.content_type)
|
||||
|
||||
%dt Tamanho
|
||||
%dd= number_to_human_size @attachment.size
|
||||
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
|
||||
19
app/views/events/_form.html.haml
Normal file
19
app/views/events/_form.html.haml
Normal file
@@ -0,0 +1,19 @@
|
||||
= error_messages_for 'event'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => "event_title"} Título
|
||||
%dd= text_field 'event', 'title'
|
||||
|
||||
%dt
|
||||
%label{:for => "event_date"} Data
|
||||
%dd= date_select 'event', 'date', :order => [:day, :month, :year]
|
||||
|
||||
%dt
|
||||
%label{:for => "event_time"} Horário
|
||||
%dd= time_select 'event', 'time'
|
||||
|
||||
%dt
|
||||
%label{:for => "event_description"} Descrição
|
||||
%dd= preserve(text_area('event', 'description', :rows => 6))
|
||||
|
||||
7
app/views/events/edit.html.haml
Normal file
7
app/views/events/edit.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Editar evento
|
||||
|
||||
%p
|
||||
- form_tag course_event_url(@course, @event), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
39
app/views/events/index.html.haml
Normal file
39
app/views/events/index.html.haml
Normal file
@@ -0,0 +1,39 @@
|
||||
- cache do
|
||||
|
||||
- last_event = nil
|
||||
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar evento', new_course_event_url
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Calendário
|
||||
|
||||
.box.div_calendario
|
||||
|
||||
- @events.each do |event|
|
||||
- if last_event != event.date
|
||||
= "</ul></div>" if last_event
|
||||
.date= event.date.strftime("%d de %B")
|
||||
= "<div><ul>"
|
||||
|
||||
%li[event]
|
||||
.time= event.time.strftime("%H:%M")
|
||||
= link_to h(event.title), course_event_url(@course, event)
|
||||
|
||||
%div.description{:style => (event.id == params[:id].to_i ? '' : 'display: none')}
|
||||
%div.cmd{:style => "height: 27px; margin-top: -27px;"}
|
||||
= action_icon 'edit', 'Editar', edit_course_event_url(@course, event)
|
||||
= action_icon 'trash', 'Excluir', course_event_url(@course, event), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
= h(event.description)
|
||||
= "Sem descrição" if event.description.empty?
|
||||
|
||||
- last_event = event.date
|
||||
|
||||
= "</ul></div>" if !@events.empty?
|
||||
|
||||
- if @events.empty?
|
||||
.box
|
||||
%ul
|
||||
%li.grey Nenhum evento
|
||||
|
||||
%br
|
||||
7
app/views/events/new.html.haml
Normal file
7
app/views/events/new.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= @course.full_name
|
||||
%h1.title Adicionar evento
|
||||
|
||||
%p
|
||||
- form_tag course_event_url(@course, @event), :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Adicionar"
|
||||
2
app/views/events/show.html.haml
Normal file
2
app/views/events/show.html.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
- @events = @course.events
|
||||
= render 'events/index'
|
||||
15
app/views/layouts/attachments.html.haml
Normal file
15
app/views/layouts/attachments.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)}"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Arquivos", course_url(@course))
|
||||
- if @attachment.id
|
||||
= "›" + link_to(truncate(h(@attachment.file_name)), course_attachment_url)
|
||||
- @title = @title + " - #{truncate(h(@attachment.file_name))}"
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @right_panel = render 'courses/_right_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
47
app/views/layouts/base.html.haml
Normal file
47
app/views/layouts/base.html.haml
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
!!! XML
|
||||
!!!
|
||||
%html
|
||||
%head
|
||||
%title= @title || App.title
|
||||
%meta{'name' => 'robots', :content => 'noindex,nofollow'}
|
||||
%meta{'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8'}
|
||||
%link{'href' => "/stylesheets/wiki.css", 'rel' => 'Stylesheet', 'type' => %'text/css'}
|
||||
%link#css_color{'href' => "/stylesheets/themes/color.#@color.css", 'rel' => 'Stylesheet', 'type' => %'text/css'}
|
||||
= javascript_include_merged :base
|
||||
|
||||
%body{'onload' => 'javascript: startup()'}
|
||||
#wrapper
|
||||
#header
|
||||
%h1= "<strong>Wiki</strong> UFC"
|
||||
|
||||
#header_menu
|
||||
%ul
|
||||
- if logged_in?
|
||||
%li.grey= "Logged in as {u}"[:logged_in_as, h(@current_user.display_name)]
|
||||
%li.last= link_to 'Logout', logout_path
|
||||
- else
|
||||
%li= link_to 'Cadastrar', signup_path
|
||||
%li.last= link_to 'Login', login_path
|
||||
|
||||
#strip
|
||||
|
||||
#location
|
||||
= flash_div
|
||||
= @location
|
||||
|
||||
#site
|
||||
%div
|
||||
- if @right_panel.nil?
|
||||
.float_panel_left= @left_panel
|
||||
#innerwrapper_2column
|
||||
.content= @content
|
||||
- else
|
||||
.float_panel_left= @left_panel
|
||||
.float_panel_right= @right_panel
|
||||
#innerwrapper_3column
|
||||
.content= @content
|
||||
%br{'style' => 'clear:both'}
|
||||
|
||||
#footer
|
||||
|
||||
20
app/views/layouts/courses.html.haml
Normal file
20
app/views/layouts/courses.html.haml
Normal file
@@ -0,0 +1,20 @@
|
||||
- @title = "#{App.title}"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›";
|
||||
= link_to("Disciplinas", courses_url)
|
||||
- if @course and @course.id
|
||||
= "› " + link_to(h(@course.full_name), course_url)
|
||||
- @title = @title + " - #{h(@course.full_name)}"
|
||||
- else
|
||||
- @title = @title + " - Disciplinas"
|
||||
|
||||
- if @course and @course.id
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @right_panel = render 'courses/_right_panel'
|
||||
- else
|
||||
- @left_panel = render('widgets/menu_navigation') + render('widgets/menu_user')
|
||||
- end
|
||||
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
12
app/views/layouts/events.html.haml
Normal file
12
app/views/layouts/events.html.haml
Normal file
@@ -0,0 +1,12 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)} - Calendário"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Calendário", course_events_url)
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @right_panel = render 'courses/_right_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
11
app/views/layouts/log.html.haml
Normal file
11
app/views/layouts/log.html.haml
Normal file
@@ -0,0 +1,11 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)} - Mudanças recentes"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Log", course_log_url(@course))
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
12
app/views/layouts/news.html.haml
Normal file
12
app/views/layouts/news.html.haml
Normal file
@@ -0,0 +1,12 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)} - Notícias"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Noticias", course_news_index_url(@course))
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @right_panel = render 'courses/_right_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
12
app/views/layouts/users.html.haml
Normal file
12
app/views/layouts/users.html.haml
Normal file
@@ -0,0 +1,12 @@
|
||||
- @title = App.title
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›";
|
||||
= link_to("Usuários", users_path)
|
||||
- if @user and @user.id
|
||||
= "› " + link_to(h(@user.name), user_url(@user))
|
||||
- @title = @title + " - #{h(@user.display_name)}"
|
||||
|
||||
- @left_panel = render('widgets/menu_navigation') + render('widgets/menu_user')
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
14
app/views/layouts/wiki.html.haml
Normal file
14
app/views/layouts/wiki.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)}"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Wiki", course_url(@course))
|
||||
- if @wiki_page.title
|
||||
= "›" + link_to(h(@wiki_page.title), course_wiki_url(@course, @wiki_page))
|
||||
- @title = @title + " - #{h(@wiki_page.title)}"
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
6
app/views/log/_attachment_log_entry.html.haml
Normal file
6
app/views/log/_attachment_log_entry.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
= "Anexo " + link_to(h(entry.attachment.file_name), course_attachment_url(@course, entry.attachment))
|
||||
|
||||
= "criado " if entry.kind_of?(AttachmentCreateLogEntry)
|
||||
= "editado " if entry.kind_of?(AttachmentEditLogEntry)
|
||||
= "excluído " if entry.kind_of?(AttachmentDeleteLogEntry)
|
||||
= "restaurado " if entry.kind_of?(AttachmentRestoreLogEntry)
|
||||
6
app/views/log/_event_log_entry.html.haml
Normal file
6
app/views/log/_event_log_entry.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
= "Evento " + link_to(h(entry.event.title), course_event_url(@course, entry.event))
|
||||
|
||||
= "criado " if entry.kind_of?(EventCreateLogEntry)
|
||||
= "editado " if entry.kind_of?(EventEditLogEntry)
|
||||
= "excluído " if entry.kind_of?(EventDeleteLogEntry)
|
||||
= "restaurado " if entry.kind_of?(EventRestoreLogEntry)
|
||||
6
app/views/log/_news_log_entry.html.haml
Normal file
6
app/views/log/_news_log_entry.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
= "Notícia " + link_to(h(entry.news.title), course_news_url(@course, entry.news))
|
||||
|
||||
= "criada " if entry.kind_of?(NewsCreateLogEntry)
|
||||
= "editada " if entry.kind_of?(NewsEditLogEntry)
|
||||
= "excluída " if entry.kind_of?(NewsDeleteLogEntry)
|
||||
= "restaurada " if entry.kind_of?(NewsRestoreLogEntry)
|
||||
13
app/views/log/_wiki_log_entry.html.haml
Normal file
13
app/views/log/_wiki_log_entry.html.haml
Normal file
@@ -0,0 +1,13 @@
|
||||
= "Página " + link_to(h(entry.wiki_page.versions.last.title), course_wiki_url(@course, entry.wiki_page.id, :version => entry.wiki_page.version))
|
||||
|
||||
= "criada " if entry.kind_of?(WikiCreateLogEntry)
|
||||
= "editada " if entry.kind_of?(WikiEditLogEntry)
|
||||
= "excluída " if entry.kind_of?(WikiDeleteLogEntry)
|
||||
= "restaurada " if entry.kind_of?(WikiRestoreLogEntry)
|
||||
|
||||
- if entry.kind_of?(WikiEditLogEntry)
|
||||
- if entry.wiki_page.description and !entry.wiki_page.description.empty?
|
||||
= "(<i>#{h(entry.wiki_page.description)}</i>)"
|
||||
= "(" + link_to("diff", diff_course_wiki_url(@course, entry.wiki_page.id, :from => entry.wiki_page.version - 1, :to => entry.wiki_page.version)) + ")"
|
||||
= "(" + link_to("edit", edit_course_wiki_url(@course, entry.wiki_page.id, :description => "Revertendo para versão #{entry.wiki_page.version}", :version => entry.wiki_page.version)) + ")"
|
||||
= "(" + link_to("undo", edit_course_wiki_url(@course, entry.wiki_page.id, :description => "Revertendo para versão #{entry.wiki_page.version-1}", :version => entry.wiki_page.version - 1)) + ")"
|
||||
18
app/views/log/index.html.haml
Normal file
18
app/views/log/index.html.haml
Normal file
@@ -0,0 +1,18 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Mudanças recentes
|
||||
|
||||
%table.log
|
||||
%tr
|
||||
%th Data
|
||||
%th Usuário
|
||||
%th Descrição
|
||||
- @log_entries.each do |entry|
|
||||
%tr
|
||||
%td= entry.created_at.strftime("%d/%m/%y %H:%M:%S")
|
||||
%td= link_to truncate(h(entry.user.display_name), 20), user_path(entry.user)
|
||||
%td
|
||||
= render(:partial => 'log/attachment_log_entry', :locals => { :entry => entry }) if entry.kind_of?(AttachmentLogEntry)
|
||||
= render(:partial => 'log/event_log_entry', :locals => { :entry => entry }) if entry.kind_of?(EventLogEntry)
|
||||
= render(:partial => 'log/news_log_entry', :locals => { :entry => entry }) if entry.kind_of?(NewsLogEntry)
|
||||
= render(:partial => 'log/wiki_log_entry', :locals => { :entry => entry }) if entry.kind_of?(WikiLogEntry)
|
||||
= "(" + link_to("undo", undo_course_log_url(@course, entry)) + ")" if entry.reversible?
|
||||
10
app/views/news/_form.html.haml
Normal file
10
app/views/news/_form.html.haml
Normal file
@@ -0,0 +1,10 @@
|
||||
= error_messages_for 'news'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => "news_title"} Título
|
||||
%dd= text_field 'news', 'title'
|
||||
|
||||
%dt
|
||||
%label{:for => "news_body"} Descrição
|
||||
%dd= preserve(text_area('news', 'body'))
|
||||
7
app/views/news/edit.html.haml
Normal file
7
app/views/news/edit.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Editar noticia
|
||||
|
||||
%p
|
||||
- form_tag course_news_url(@course, @news), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
28
app/views/news/index.html.haml
Normal file
28
app/views/news/index.html.haml
Normal file
@@ -0,0 +1,28 @@
|
||||
- cache do
|
||||
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar', new_course_news_url
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Notícias
|
||||
|
||||
= auto_discovery_link_tag :rss, formatted_course_news_index_url(@course, :rss)
|
||||
|
||||
.news
|
||||
- @course.news.each do |n|
|
||||
.line{:class => 'new', :id => "news_#{n.id}"}
|
||||
.cmd{:style => (n.id == params[:id].to_i ? '' : 'display: none')}
|
||||
= action_icon 'edit', 'Editar', edit_course_news_url(@course, n)
|
||||
= action_icon 'trash', 'Excluir', course_news_url(@course, n), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
.left= n.timestamp.strftime("%d de %B")
|
||||
%h4
|
||||
= link_to h(n.title), course_news_url(@course, n)
|
||||
|
||||
%p{:style => (n.id == params[:id].to_i ? '' : 'display: none')}
|
||||
= h(n.body)
|
||||
|
||||
- if @course.news.empty?
|
||||
.box
|
||||
%ul
|
||||
%li.grey Nenhuma notícia
|
||||
18
app/views/news/index.rss.builder
Normal file
18
app/views/news/index.rss.builder
Normal file
@@ -0,0 +1,18 @@
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.rss(:version=>"2.0") do
|
||||
xml.channel do
|
||||
xml.title("#{App.title} - #{@course.full_name} - " + "News"[].titleize)
|
||||
xml.link(course_news_index_url(@course))
|
||||
xml.language(App.language)
|
||||
xml.description("{course} news"[:news_about, @course.full_name])
|
||||
for news_item in @news
|
||||
xml.item do
|
||||
xml.title(news_item.title)
|
||||
xml.description(news_item.body)
|
||||
xml.pubDate(news_item.timestamp.rfc2822)
|
||||
xml.link(course_news_url(@course, news_item))
|
||||
xml.guid(course_news_url(@course, news_item))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
6
app/views/news/new.html.haml
Normal file
6
app/views/news/new.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%h4.title= @course.full_name
|
||||
%h1.title Adicionar evento
|
||||
|
||||
- form_tag course_news_url(@course, @news), :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Enviar"
|
||||
1
app/views/news/show.html.haml
Normal file
1
app/views/news/show.html.haml
Normal file
@@ -0,0 +1 @@
|
||||
= render 'news/index'
|
||||
9
app/views/notifications/forgot_password.html.erb
Normal file
9
app/views/notifications/forgot_password.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
_____________
|
||||
|
||||
|
||||
Seu nome de usuário é <%= h(@login) %>. E seu novo password é <%= h(@pass) %>.
|
||||
Faça o seu Login e mude para algo mais fácil de ser memorizado.
|
||||
|
||||
|
||||
Wiki Ufc
|
||||
-------------
|
||||
38
app/views/stylesheets/color.css.erb
Normal file
38
app/views/stylesheets/color.css.erb
Normal file
@@ -0,0 +1,38 @@
|
||||
<% color = App.color_schemes[@color] || App.color_schemes[App.default_color] %>
|
||||
|
||||
a {
|
||||
color: <%= color[1] %>;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
border-bottom: 1px dotted <%= color[1] %>;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, th {
|
||||
color: <%= color[2] %>;
|
||||
}
|
||||
|
||||
#header {
|
||||
background-color: <%= color[0] %>;
|
||||
}
|
||||
|
||||
#header_menu {
|
||||
background-color: <%= color[0] %>;
|
||||
}
|
||||
|
||||
#header_menu ul li {
|
||||
border-right: 1px solid <%= color[0] %>;
|
||||
}
|
||||
|
||||
#strip {
|
||||
background-color: <%= color[0] %>;
|
||||
}
|
||||
|
||||
#footer {
|
||||
background-color: <%= color[3] %>;
|
||||
border-top: 5px solid <%= color[3] %>;
|
||||
}
|
||||
|
||||
.icon img:hover {
|
||||
background-color: <%= color[1] %>;
|
||||
}
|
||||
18
app/views/user/change_password.html.erb
Normal file
18
app/views/user/change_password.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h3 class="title">Alterar senha</h3>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action => 'change_password' do %>
|
||||
|
||||
<label for="user_password">Nova senha</label><br/>
|
||||
<%= password_field "user", "password", :size => 20, :value=>"" %><br/>
|
||||
|
||||
<label for="user_password_confirmation">Confirme nova senha</label><br/>
|
||||
<%= password_field "user", "password_confirmation", :size => 20, :value=>"" %><br/>
|
||||
<br/>
|
||||
<%= submit_tag "Enviar" %>
|
||||
|
||||
<% end %>
|
||||
</o>
|
||||
54
app/views/user/edit.html.erb
Normal file
54
app/views/user/edit.html.erb
Normal file
@@ -0,0 +1,54 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Editar Preferências</h1>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action => 'update', :id => @user do %>
|
||||
|
||||
<label for="user_name">Nome</label><br/>
|
||||
<%= text_field "user", "name", :size => 20 %><br/>
|
||||
|
||||
<label for="user_email">Email</label><br/>
|
||||
<%= text_field "user", "email", :size => 20 %><br/><br/>
|
||||
|
||||
|
||||
<label for="user_password">Senha</label><br/>
|
||||
<%= password_field "user", "password", {:value => "", :size => 20, :id => 'password'} %><br/>
|
||||
|
||||
<label for="user_password_confirmation">Confirmação de Senha</label><br/>
|
||||
<%= password_field "user", "password_confirmation", {:value => "", :size => 20} %><br/>
|
||||
|
||||
<div id="passmeter"> </div><br/>
|
||||
|
||||
<label for="user_pref_color">Cor de Preferência:</label><br />
|
||||
<%= select_tag("user[pref_color]", options_for_select( {
|
||||
"Preto" => 0,
|
||||
"Verde (Claro)" => 1,
|
||||
"Azul (Claro)" => 2,
|
||||
"Lilás" => 3,
|
||||
"Vermelho/Cinza" => 4,
|
||||
"Verde-limão" => 5,
|
||||
"Azul (Padrão)" => 6,
|
||||
"Vermelho" => 7,
|
||||
"Azul/Laranja" => 8,
|
||||
"Verde/Vermelho" => 9,
|
||||
"Pink" => 10,
|
||||
"Roxo" => 11,
|
||||
"Vinho" => 12,
|
||||
}.sort)) %><br/><br/>
|
||||
|
||||
<label for="user_courses">Disciplinas matriculadas:</label><br/>
|
||||
<% Course.find(:all).each do |course| %>
|
||||
<%= check_box_tag("user[course_ids][]", course.id, @user.courses.include?(course)) %>
|
||||
<%= h(course.full_name) %><br/>
|
||||
<% end %>
|
||||
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<%= submit_tag "Editar" %>
|
||||
|
||||
<% end %><br/><br/>
|
||||
</p>
|
||||
|
||||
15
app/views/user/forgot_password.html.erb
Normal file
15
app/views/user/forgot_password.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Recuperar senha</h1>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action=>'forgot_password' do %>
|
||||
|
||||
Email<br/>
|
||||
<%= text_field "user","email" %><br/><br/>
|
||||
|
||||
<%= submit_tag 'Enviar nova senha' %>
|
||||
|
||||
<% end %>
|
||||
</p>
|
||||
21
app/views/user/login.html.erb
Normal file
21
app/views/user/login.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Login</h1>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action=> "login" do %>
|
||||
|
||||
<label for="user_login">Login:</label><br/>
|
||||
<%= text_field "user", "login", :size => 20 %><br/>
|
||||
|
||||
<label for="user_password">Senha:</label><br/>
|
||||
<%= password_field "user", "password", :size => 20 %><br/>
|
||||
|
||||
<%= submit_tag "Login" %><br /><br />
|
||||
|
||||
<%= link_to 'Criar conta', :action => 'signup' %> |
|
||||
<%= link_to 'Recuperar senha', :action => 'forgot_password' %>
|
||||
|
||||
<% end %>
|
||||
</p>
|
||||
13
app/views/user/rss.xml.builder
Normal file
13
app/views/user/rss.xml.builder
Normal file
@@ -0,0 +1,13 @@
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.instruct! :rss, :version=>"2.0"
|
||||
xml.channel{
|
||||
for course in @courses
|
||||
for event in course.events
|
||||
xml.item do
|
||||
xml.title("[" + course.short_name + "] " + event.title)
|
||||
xml.pubDate(Time.parse(event.date.to_s).rfc822)
|
||||
xml.description(event.description)
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
84
app/views/user/show.html.erb
Normal file
84
app/views/user/show.html.erb
Normal file
@@ -0,0 +1,84 @@
|
||||
<% last_event = nil %>
|
||||
|
||||
<div class="cmd">
|
||||
<%= link_to 'preferências', :action => 'edit'%>
|
||||
</div>
|
||||
|
||||
<h4 class="title">Página Pessoal</h4>
|
||||
<h1 class="title">Bem vindo, <%= h(@user.name) %></h1>
|
||||
|
||||
<!-- Noticias -->
|
||||
<div class="box news">
|
||||
<h3>Notícias</h3>
|
||||
<% @news_messages.each do |n| %>
|
||||
<div class="line">
|
||||
<h4 class="left"><%= n.timestamp.strftime("%d de %B") %></h4>
|
||||
<h4><%= link_to h(n.course.full_name) , course_news_url(n.course, n) %> ›
|
||||
<a href="#" id="new_<%=n.id%>"><%= h(n.title) %></a></h4>
|
||||
|
||||
<p id="new_desc_<%= n.id %>" style="display:none">
|
||||
<%= h(n.body) %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<% @news_messages.each do |n| %>
|
||||
events['#new_<%= n.id %>:click'] = function(el, e) {
|
||||
Effect.toggle($('new_desc_<%= n.id %>'), 'blind');
|
||||
Event.stop(e);
|
||||
};
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
<!-- Calendario -->
|
||||
<div class="box div_calendario">
|
||||
<div class="cmd">
|
||||
<%= link_to 'rss', :action => 'rss', :login => h(@user.login)%>
|
||||
<%= link_to 'icalendar', :controller => 'events', :action => 'icalendar'%>
|
||||
</div>
|
||||
<h3>Calendário</h3>
|
||||
|
||||
<% @events.each do |event| %>
|
||||
<% if last_event != event.date %>
|
||||
<% if last_event %></ul></div><% end %>
|
||||
<div class="date"><%= event.date.strftime("%d de %B") %></div>
|
||||
<div><ul>
|
||||
<% end %>
|
||||
<li>
|
||||
<div class="time"><%= event.time.strftime("%H:%M") %></div>
|
||||
<%= link_to h(event.course.full_name), course_event_url(event.course, event) %> ›
|
||||
<a href="#" id="event_<%= event.id %>"><%= h(event.title) %></a>
|
||||
|
||||
<div id="desc_<%= event.id %>" class="description" style="display:none">
|
||||
<%= h(event.description) %>
|
||||
<%= "Sem descrição" if event.description.length == 0 %>
|
||||
</div>
|
||||
</li>
|
||||
<% last_event = event.date %>
|
||||
<% end %>
|
||||
<%= "</ul></div>" if !@events.empty? %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<% @events.each do |event| %>
|
||||
events['#event_<%= event.id %>:click'] = function(el, e) {
|
||||
Effect.toggle($('desc_<%= event.id %>'), 'blind');
|
||||
Event.stop(e);
|
||||
};
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Disciplinas Matriculadas -->
|
||||
<div class="box">
|
||||
<h3>Disciplinas Matriculadas</h3>
|
||||
<ul class="wiki">
|
||||
<% @user.courses.each do |course| %>
|
||||
<li><%= link_to h(course.full_name), course_url(course) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h4><%#= link_to 'Descadastrar usuário', :action => 'destroy'%></h4>
|
||||
58
app/views/user/signup.html.erb
Normal file
58
app/views/user/signup.html.erb
Normal file
@@ -0,0 +1,58 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Criar conta</h1>
|
||||
|
||||
<p>
|
||||
<% form_tag :action=> "signup" do %>
|
||||
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<label for="user_name">Nome</label><br/>
|
||||
<%= text_field "user", "name", :size => 20 %><br/>
|
||||
|
||||
<label for="user_email">Email</label><br/>
|
||||
<%= text_field "user", "email", :size => 20 %><br/><br/>
|
||||
|
||||
<label for="user_login">Login</label><br/>
|
||||
<%= text_field "user", "login", :size => 20 %><br/>
|
||||
|
||||
<label for="user_password">Senha</label><br/>
|
||||
<%= password_field "user", "password", {:value => "", :size => 20, :id => 'password'} %><br/>
|
||||
|
||||
<label for="user_password_confirmation">Confirmação de Senha</label><br/>
|
||||
<%= password_field "user", "password_confirmation", {:value => "", :size => 20} %><br/>
|
||||
|
||||
<div id="passmeter"> </div><br />
|
||||
|
||||
<label for="user_pref_color">Cor de Preferência:</label>
|
||||
<%= select_tag("user[pref_color]", options_for_select( {
|
||||
"Preto" => 0,
|
||||
"Verde (Claro)" => 1,
|
||||
"Azul (Claro)" => 2,
|
||||
"Lilás" => 3,
|
||||
"Vermelho/Cinza" => 4,
|
||||
"Verde-limão" => 5,
|
||||
"Azul (Padrão)" => 6,
|
||||
"Vermelho" => 7,
|
||||
"Azul/Laranja" => 8,
|
||||
"Verde/Vermelho" => 9,
|
||||
"Pink" => 10,
|
||||
"Roxo" => 11,
|
||||
"Vinho" => 12,
|
||||
}.sort)) %><br/><br/><br/>
|
||||
|
||||
<label for="user_courses">Disciplinas matriculadas:</label><br/>
|
||||
<% @courses.each do |course| %>
|
||||
<%= check_box_tag("user[course_ids][]", course.id, @user.courses.include?(course)) %>
|
||||
<%= h(course.full_name) %><br/>
|
||||
<% end %>
|
||||
|
||||
<% if @courses.empty? %>
|
||||
Nenhuma disciplina cadastrada<br/>
|
||||
<% end %>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<%= submit_tag "Enviar" %>
|
||||
|
||||
<% end %>
|
||||
</p>
|
||||
18
app/views/users/_form_profile.html.haml
Normal file
18
app/views/users/_form_profile.html.haml
Normal file
@@ -0,0 +1,18 @@
|
||||
= error_messages_for 'user'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => 'user_display_name'} Nome de Exibição
|
||||
%dd= text_field('user', 'display_name')
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_name'} Nome completo
|
||||
%dd= text_field('user', 'name')
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_description'} Descrição
|
||||
%dd= text_area('user', 'description', { :rows => 10 })
|
||||
|
||||
- if admin?
|
||||
%dt= check_box_tag('user[admin]', 1, @user.admin?) + " Administrador"
|
||||
|
||||
37
app/views/users/_form_settings.html.haml
Normal file
37
app/views/users/_form_settings.html.haml
Normal file
@@ -0,0 +1,37 @@
|
||||
= javascript_include_tag 'color'
|
||||
= error_messages_for 'user'
|
||||
|
||||
%dl
|
||||
- if defined?(signup) and signup
|
||||
%dt
|
||||
%label{:for => 'user_login'} Login
|
||||
%dd= text_field('user', 'login')
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_name'} Nome completo
|
||||
%dd= text_field('user', 'name')
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_display_name'} Nome de exibição
|
||||
%dd= text_field('user', 'display_name')
|
||||
|
||||
%dt
|
||||
%laber{:for => 'user_email'} Email
|
||||
%dd= text_field('user', 'email')
|
||||
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_password'} Senha
|
||||
%dd= password_field('user', 'password', {:value => '', :id => 'password'})
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_password_confirmation'} Confirmação de Senha
|
||||
%dd= password_field('user', 'password_confirmation', {:value => ''})
|
||||
|
||||
#passmeter
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_color_pref'} Esquema de cores
|
||||
= render :partial => 'widgets/color', :collection => App.color_schemes
|
||||
%br.clear
|
||||
|
||||
35
app/views/users/_form_signup.html.haml
Normal file
35
app/views/users/_form_signup.html.haml
Normal file
@@ -0,0 +1,35 @@
|
||||
= javascript_include_tag 'color'
|
||||
= error_messages_for 'user'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => 'user_login'} Login
|
||||
%dd= text_field('user', 'login')
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_name'} Nome Completo
|
||||
%dd= text_field('user', 'name')
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_display_name'} Nome de exibição (apelido)
|
||||
%dd= text_field('user', 'display_name')
|
||||
|
||||
%dt
|
||||
%laber{:for => 'user_email'} Email
|
||||
%dd= text_field('user', 'email')
|
||||
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_password'} Senha
|
||||
%dd= password_field('user', 'password', {:value => '', :id => 'password'})
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_password_confirmation'} Confirmação de Senha
|
||||
%dd= password_field('user', 'password_confirmation', {:value => ''})
|
||||
|
||||
#passmeter
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_color_pref'} Esquema de cores
|
||||
= render :partial => 'widgets/color', :collection => App.color_schemes
|
||||
%br.clear
|
||||
1
app/views/users/_user.html.haml
Normal file
1
app/views/users/_user.html.haml
Normal file
@@ -0,0 +1 @@
|
||||
%li= link_to h(user.name), user_path(user)
|
||||
49
app/views/users/dashboard.html.erb
Normal file
49
app/views/users/dashboard.html.erb
Normal file
@@ -0,0 +1,49 @@
|
||||
<% last_event = nil %>
|
||||
|
||||
<h4 class="title">Dashboard</h4>
|
||||
<h1 class="title">Bem vindo, <%= h(@current_user.display_name) %></h1>
|
||||
|
||||
<!-- Noticias -->
|
||||
<div class="news box">
|
||||
<h3>Notícias recentes</h3>
|
||||
<% @news.each do |n| %>
|
||||
<div class="line">
|
||||
<h4 class="left"><%= n.timestamp.strftime("%d de %B") %></h4>
|
||||
<h4><%= link_to h(n.course.full_name) , course_url(n.course) %> ›
|
||||
<%= link_to h(n.title), course_news_url(n.course, n) %></h4>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!-- Calendario -->
|
||||
<div class="box div_calendario">
|
||||
<h3>Próximos eventos</h3>
|
||||
|
||||
<% @events.each do |event| %>
|
||||
<% if last_event != event.date %>
|
||||
<% if last_event %></ul></div><% end %>
|
||||
<div class="date"><%= event.date.strftime("%d de %B") %></div>
|
||||
<div><ul>
|
||||
<% end %>
|
||||
<li>
|
||||
<div class="time"><%= event.time.strftime("%H:%M") %></div>
|
||||
<%= link_to h(event.course.full_name), course_url(event.course) %> ›
|
||||
<%= link_to h(event.title), course_event_url(event.course, event) %>
|
||||
</li>
|
||||
<% last_event = event.date %>
|
||||
<% end %>
|
||||
<%= "</ul></div>" if !@events.empty? %>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Disciplinas Matriculadas -->
|
||||
<div class="box">
|
||||
<h3>Disciplinas Matriculadas</h3>
|
||||
<ul class="wiki">
|
||||
<% @current_user.courses.each do |course| %>
|
||||
<li><%= link_to h(course.full_name), course_url(course) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h4><%#= link_to 'Descadastrar usuário', :action => 'destroy'%></h4>
|
||||
13
app/views/users/edit.html.haml
Normal file
13
app/views/users/edit.html.haml
Normal file
@@ -0,0 +1,13 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
%h4.title Usuários
|
||||
%h1.title Editar perfil
|
||||
|
||||
%p
|
||||
- form_tag user_path(@user.id), :method => 'put' do
|
||||
= render :partial => 'form_profile'
|
||||
= submit_tag 'Editar'
|
||||
%button#show_preview{:type => "button"}
|
||||
Visualizar
|
||||
= image_tag "loading.gif", :class => "spinner_button", :id => "spinner_preview", :style => "display: none"
|
||||
#wiki_preview{:style => "display: none"}
|
||||
7
app/views/users/index.html.haml
Normal file
7
app/views/users/index.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
- cache do
|
||||
%h4.title= App.title
|
||||
%h1.title Usuários
|
||||
|
||||
.box
|
||||
%ul
|
||||
= render :partial => @users
|
||||
25
app/views/users/login.html.haml
Normal file
25
app/views/users/login.html.haml
Normal file
@@ -0,0 +1,25 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Login
|
||||
|
||||
%p
|
||||
= error_messages_for :user
|
||||
|
||||
- form_tag login_path do
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => 'user_login'} Login
|
||||
%dd= text_field "user", "login"
|
||||
|
||||
%dt
|
||||
%label{:for => 'user_password'} Senha
|
||||
%dd= password_field "user", "password"
|
||||
|
||||
%dt
|
||||
= check_box_tag('remember_me', 1)
|
||||
%label{:for => 'remember_me'} Lembrar de mim neste computador
|
||||
|
||||
= submit_tag 'Login'
|
||||
|
||||
%br
|
||||
= link_to 'Criar nova conta', signup_path
|
||||
=# link_ro 'Recuperar senha', recover_password_path
|
||||
7
app/views/users/settings.html.haml
Normal file
7
app/views/users/settings.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title Usuários
|
||||
%h1.title Editar configurações
|
||||
|
||||
%p
|
||||
- form_tag settings_url do
|
||||
= render :partial => 'form_settings'
|
||||
= submit_tag 'Editar'
|
||||
14
app/views/users/show.html.haml
Normal file
14
app/views/users/show.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
- cache do
|
||||
#users
|
||||
.cmd
|
||||
= action_icon('edit', 'Editar perfil', edit_user_url) if admin? or @current_user == @user
|
||||
/= action_icon 'trash', 'Excluir usuário', user_url, :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
.card
|
||||
%img.avatar{:src => gravatar_url_for(@user.email)}
|
||||
%h1.title= h(@user.display_name)
|
||||
%p= h(@user.name)
|
||||
%p= "Membro desde {c}"[:member_since, @user.created_at.strftime("%d de %B de %Y")]
|
||||
%p= "Última visita há {c}"[:last_seen, distance_of_time_in_words(Time.now, @user.last_seen)]
|
||||
|
||||
= wiki @user.description if !@user.description.blank?
|
||||
7
app/views/users/signup.html.haml
Normal file
7
app/views/users/signup.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Nova conta
|
||||
|
||||
%p
|
||||
- form_tag signup_path do
|
||||
= render :partial => 'form_settings', :locals => { :signup => true }
|
||||
= submit_tag 'Criar'
|
||||
4
app/views/widgets/_color.html.haml
Normal file
4
app/views/widgets/_color.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
.color_theme
|
||||
= radio_button('user', 'pref_color', App.color_schemes.index(color), :class => 'color_radio')
|
||||
- color.each do |c|
|
||||
.color_box{:style => "background-color: #{c}"}
|
||||
100
app/views/widgets/calendario.html.erb
Normal file
100
app/views/widgets/calendario.html.erb
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
<% if not @ajax %>
|
||||
<!-- Calendario -->
|
||||
<div class="menu">
|
||||
<%= image_tag "loading.gif", :id => "spinner_calendar",
|
||||
:class => "spinner", :style => "display:none" %>
|
||||
<div class="cmd">
|
||||
<%= action_icon 'add', 'Adicionar evento', new_course_event_url(@course) %>
|
||||
</div>
|
||||
<h1>Calendário</h1>
|
||||
<div id="calendar">
|
||||
<% end -%>
|
||||
<%=
|
||||
@year ||= Time.now.year
|
||||
@month ||= Time.now.month
|
||||
@events ||= @course.events
|
||||
|
||||
calendar({:year => @year, :month => @month, :table_class => 'calendario',
|
||||
:abbrev => (0..1) }) do |d|
|
||||
|
||||
cell_text = d.mday
|
||||
cell_attrs = {:class => 'day'}
|
||||
@events.each do |e|
|
||||
if e.date == d
|
||||
cell_attrs[:onclick] = "show_events('#{d.to_s}')"
|
||||
cell_attrs[:class] = 'specialDay'
|
||||
cell_text = link_to d.mday, "#"
|
||||
end
|
||||
end
|
||||
[cell_text, cell_attrs]
|
||||
end
|
||||
%>
|
||||
<% if not @ajax -%>
|
||||
</div>
|
||||
<div class="widget_events">
|
||||
<ul>
|
||||
<% @events.each do |e| -%>
|
||||
<li style="display: none" class="event_item events_<%=e.date.to_s%>">
|
||||
<%= link_to e.date.strftime("%d de %B"), course_event_url(@course, e) %>.
|
||||
<%= h(e.title) %>. <%= h(e.description) %>
|
||||
</li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<% if not @ajax -%>
|
||||
<script type="text/javascript">
|
||||
calendar_year = <%= @year %>;
|
||||
calendar_month = <%= @month %>;
|
||||
|
||||
events['#calendar_next:click'] = function(element, e) {
|
||||
if(++calendar_month > 12) {
|
||||
calendar_month = 1;
|
||||
calendar_year++;
|
||||
}
|
||||
|
||||
<% if @course %>
|
||||
url = '/widgets/calendar/<%= @course.id %>/' + calendar_year + '/' + calendar_month;
|
||||
<% end %>
|
||||
|
||||
spinner_start('calendar');
|
||||
new Ajax.Updater('calendar', url, {
|
||||
onComplete: function() {
|
||||
spinner_stop('calendar');
|
||||
}
|
||||
});
|
||||
Event.stop(e);
|
||||
};
|
||||
|
||||
events['#calendar_prev:click'] = function(element, e) {
|
||||
if(--calendar_month < 1) {
|
||||
calendar_month = 12;
|
||||
calendar_year--;
|
||||
}
|
||||
|
||||
<% if @course %>
|
||||
url = '/widgets/calendar/<%= @course.id %>/' + calendar_year + '/' + calendar_month;
|
||||
<% end %>
|
||||
|
||||
spinner_start('calendar');
|
||||
new Ajax.Updater('calendar', url, {
|
||||
onComplete: function() {
|
||||
spinner_stop('calendar');
|
||||
}
|
||||
});
|
||||
|
||||
Event.stop(e);
|
||||
};
|
||||
|
||||
function show_events(e) {
|
||||
$$('.event_item').each(function(x) {
|
||||
if(x.match('.events_' + e)) x.show();
|
||||
else x.hide();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<% end -%>
|
||||
|
||||
10
app/views/widgets/menu_disciplina.html.erb
Normal file
10
app/views/widgets/menu_disciplina.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- Menu Disciplina -->
|
||||
<div class="menu">
|
||||
<h1>Disciplina</h1>
|
||||
<ul>
|
||||
<li><%= link_to "Visão Geral", course_url(@course) %></li>
|
||||
<li><%= link_to "Noticias", course_news_index_url(@course) %></li>
|
||||
<li><%= link_to "Calendário", course_events_url(@course) %></li>
|
||||
<li><%= link_to "Mudanças recentes", course_log_url(@course) %></li>
|
||||
</ul>
|
||||
</div>
|
||||
5
app/views/widgets/menu_navigation.html.haml
Normal file
5
app/views/widgets/menu_navigation.html.haml
Normal file
@@ -0,0 +1,5 @@
|
||||
.menu
|
||||
%h1= App.title
|
||||
%ul
|
||||
%li= link_to "Courses"[].titleize, courses_url
|
||||
%li= link_to "Users"[].titleize, users_url
|
||||
7
app/views/widgets/menu_user.html.haml
Normal file
7
app/views/widgets/menu_user.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
- if session[:user_id]
|
||||
.menu
|
||||
%h1= "User"[].titleize
|
||||
%ul
|
||||
/%li= link_to "Dashboard"[].titleize, dashboard_path
|
||||
%li= link_to("User profile"[].titleize, user_url(session[:user_id]))
|
||||
%li= link_to("Edit settings"[].titleize, settings_url)
|
||||
22
app/views/widgets/news.html.erb
Normal file
22
app/views/widgets/news.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<!-- Mural -->
|
||||
<div class="menu">
|
||||
<div class="cmd">
|
||||
<%= action_icon 'add', 'Adicionar notícia', new_course_news_url(@course) %>
|
||||
</div>
|
||||
<h1>Noticias</h1>
|
||||
<ul class="widget_news">
|
||||
<% @course.news[0..3].each do |msg| %>
|
||||
<li>
|
||||
<h4><%= tz(msg.timestamp).strftime("%d/%m") %></h4>
|
||||
<%= link_to msg.title, course_news_url(@course, msg) %>.
|
||||
<%= truncate(msg.body, 80) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @course.news.size > 4 %>
|
||||
<li><%= link_to("Ver todas as notícias", course_news_index_url(@course)) %></li>
|
||||
<% end %>
|
||||
<% if @course.news.empty? %>
|
||||
<li class="no_itens">Nenhuma notícia</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
44
app/views/widgets/shoutbox.html.erb
Normal file
44
app/views/widgets/shoutbox.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<% receiver = @user ? @user : @course %>
|
||||
<!-- Shoutbox -->
|
||||
<div class="menu">
|
||||
<h1>Shoutbox</h1>
|
||||
<div id="shoutbox">
|
||||
<ul id="shoutbox_messages">
|
||||
<li>Carregando...</li>
|
||||
</ul>
|
||||
<% if session[:user] %>
|
||||
<% form_tag(
|
||||
{:controller => 'message', :action => 'create'}, {:id => 'shoutbox_form' }) do %>
|
||||
<div>
|
||||
<%= text_area :message, :body %>
|
||||
<%= hidden_field :message, :message_type, :value => (@user ? Message::USER_SHOUTBOX_MESSAGE : Message::SHOUTBOX_MESSAGE) %>
|
||||
<%= hidden_field :message, :receiver_id, :value => receiver.id %>
|
||||
<%= submit_tag 'Enviar', :id => 'shoutbox_send' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i>Para enviar mensagens, é preciso fazer <%= link_to 'login', :controller => 'user', :action => 'login' %>.</i>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var updater = new Ajax.PeriodicalUpdater('shoutbox_messages',
|
||||
'<%= url_for :controller => 'message', :action => 'show_shoutbox' + (@user?'_user':''), :id => receiver.id %>',
|
||||
{ method: 'get', frequency: 10, decay: 1.5}
|
||||
);
|
||||
|
||||
events['#shoutbox_send:click'] = function(button, e) {
|
||||
Event.stop(e);
|
||||
button.disabled = true;
|
||||
$('shoutbox_form').request({
|
||||
method: 'post',
|
||||
onSuccess: function(t) {
|
||||
button.disabled = false;
|
||||
updater.stop();
|
||||
updater.start();
|
||||
$('shoutbox_form').reset();
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
15
app/views/wiki/_form.html.haml
Normal file
15
app/views/wiki/_form.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
= error_messages_for 'wiki_page'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => 'wiki_page_title'} Título
|
||||
%dd= text_field 'wiki_page', 'title'
|
||||
|
||||
%dt
|
||||
%label{:for =>'wiki_page_content'} Conteúdo
|
||||
%dd= preserve(text_area('wiki_page', 'content'))
|
||||
|
||||
- unless @wiki_page.new_record?
|
||||
%dt
|
||||
%label{:for => 'wiki_page_description'} Descrição das alterações
|
||||
%dd= text_field('wiki_page', 'description', { :size => '80' })
|
||||
6
app/views/wiki/_history.html.haml
Normal file
6
app/views/wiki/_history.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
= action_icon('undo', "Reverter", edit_course_wiki_url(@course, @wiki_page, :description => "Revertendo para versão #{page.version}", :version => page.version)) + " "
|
||||
= link_to page.updated_at.strftime("%d/%m/%y %H:%M:%S"), course_wiki_url(@course, @wiki_page, :version => page.version)
|
||||
= "por #{link_to h(page.user.display_name), user_path(page.user)}" if page.respond_to?(:user) and !page.user.nil?
|
||||
|
||||
- if page.description and !page.description.empty?
|
||||
= "(<i>#{h(page.description)}</i>)"
|
||||
11
app/views/wiki/diff.html.haml
Normal file
11
app/views/wiki/diff.html.haml
Normal file
@@ -0,0 +1,11 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= h(@wiki_page.title)
|
||||
|
||||
%p
|
||||
Comparando versões:
|
||||
%ul
|
||||
%li= render :partial => 'wiki/history', :locals => { :page => @to }
|
||||
%li= render :partial => 'wiki/history', :locals => { :page => @from }
|
||||
|
||||
= link_to "Comparar outras versões", versions_course_wiki_url(@course, @wiki_page, :from => @from.version, :to => @to.version)
|
||||
= format_diff h(@diff)
|
||||
14
app/views/wiki/edit.html.haml
Normal file
14
app/views/wiki/edit.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= "Editar #{h(@wiki_page.title)}"
|
||||
|
||||
%p
|
||||
- form_tag course_wiki_url(@course, @wiki_page.id), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Salvar'
|
||||
%button#show_preview{:type => "button"}
|
||||
Visualizar
|
||||
= image_tag "loading.gif", :class => "spinner_button", :id => "spinner_preview", :style => "display: none"
|
||||
#wiki_preview{:style => "display: none"}
|
||||
|
||||
13
app/views/wiki/new.html.haml
Normal file
13
app/views/wiki/new.html.haml
Normal file
@@ -0,0 +1,13 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Adicionar página wiki
|
||||
|
||||
%p
|
||||
- form_tag course_wiki_url(@course, @wiki_page.id) do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Criar"
|
||||
%button#show_preview{:type => "button"}
|
||||
Visualizar
|
||||
= image_tag "loading.gif", :class => "spinner_button", :id => "spinner_preview", :style => "display: none"
|
||||
#wiki_preview{:style => "display: none"}
|
||||
16
app/views/wiki/show.html.haml
Normal file
16
app/views/wiki/show.html.haml
Normal file
@@ -0,0 +1,16 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
.cmd
|
||||
= action_icon 'edit', 'Editar', edit_course_wiki_url
|
||||
= action_icon 'undo', 'Historico', versions_course_wiki_url
|
||||
= action_icon 'trash', 'Excluir página wiki', course_wiki_url, :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
- cache(:action => 'show', :short_name => h(@course.short_name), :title => h(@wiki_page.title) ) do
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= h(@wiki_page.title)
|
||||
#wiki_text
|
||||
= @wiki_page.to_html
|
||||
|
||||
%script{:language => 'javascript'}
|
||||
== enumerate_headers();
|
||||
34
app/views/wiki/versions.html.haml
Normal file
34
app/views/wiki/versions.html.haml
Normal file
@@ -0,0 +1,34 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= "Histórico de #{h(@wiki_page.title)}"
|
||||
%br
|
||||
|
||||
= javascript_include_tag "history"
|
||||
|
||||
%script{:language => 'javascript'}
|
||||
== radios_to = #{h(@history_to)};
|
||||
== radios_from = #{h(@history_from)};
|
||||
|
||||
- form_tag diff_course_wiki_url(@course, @wiki_page), :method => :get do
|
||||
%button{:type => "submit"}= "Comparar as versões selecionadas"
|
||||
%table.log
|
||||
%tr
|
||||
%th.narrow
|
||||
%th.narrow
|
||||
%th Data
|
||||
%th Usuário
|
||||
%th Descrição
|
||||
- @wiki_page.versions.reverse.each do |entry|
|
||||
%tr
|
||||
%td.narrow
|
||||
%input{:type => "radio", :name => "from", :value => entry.version, :onclick => "history_from(#{entry.version})"}
|
||||
%td.narrow
|
||||
%input{:type => "radio", :name => "to", :value => entry.version, :onclick => %"history_to(#{entry.version})"}
|
||||
%td= link_to(entry.updated_at.strftime("%d/%m/%y %H:%M:%S"), course_wiki_url(@course, @wiki_page, :version => entry.version))
|
||||
%td= link_to truncate(h(entry.user.display_name), 20), user_path(entry.user)
|
||||
%td
|
||||
= entry.description
|
||||
- if (entry.version > @wiki_page.versions.minimum(:version))
|
||||
= "(" + link_to("diff", diff_course_wiki_url(@course, @wiki_page, :from => entry.version - 1, :to => entry.version)) + ")"
|
||||
= "(" + link_to("edit", edit_course_wiki_url(@course, @wiki_page, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")"
|
||||
|
||||
/= will_paginate @versions
|
||||
15
app/views/wiki/versions.xml.builder
Normal file
15
app/views/wiki/versions.xml.builder
Normal file
@@ -0,0 +1,15 @@
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.versions do
|
||||
xml.count @wiki_page.versions.count
|
||||
xml.offset @offset
|
||||
@wiki_page.versions[(@offset.to_i)..(@offset.to_i+30)].reverse.each do |version|
|
||||
xml.version do
|
||||
xml.created_at version.created_at
|
||||
xml.updated_at version.updated_at
|
||||
xml.description version.description
|
||||
xml.title version.title
|
||||
xml.user_id version.user_id
|
||||
xml.version version.version
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user