From 99d5e2fd6799c98e9214ec708414b493f286398f Mon Sep 17 00:00:00 2001 From: Alinson Santos Date: Tue, 4 Mar 2008 07:07:30 -0300 Subject: [PATCH] Esqueci alguns arquivos.. --- app/views/users/dashboard.html.haml | 51 +++++++++++++++++++++++++++++ db/migrate/029_event_time.rb | 8 +++++ public/javascripts/events.js | 4 +++ public/javascripts/news.js | 4 +++ 4 files changed, 67 insertions(+) create mode 100644 app/views/users/dashboard.html.haml create mode 100644 db/migrate/029_event_time.rb create mode 100644 public/javascripts/events.js create mode 100644 public/javascripts/news.js diff --git a/app/views/users/dashboard.html.haml b/app/views/users/dashboard.html.haml new file mode 100644 index 0000000..32fb33f --- /dev/null +++ b/app/views/users/dashboard.html.haml @@ -0,0 +1,51 @@ +%h4.title Dashboard +%h1.title= "Bem vindo, #{h(@current_user.display_name)}" + +.dashboard + .box + - last_time = nil + %h3 Notícias Recentes + + - if @events.empty? + %ul + %li.no_itens Nenhum notícia recente + + %table + - @news.each do |n| + %tr + %td.top.aright + = n.timestamp.strftime("%d de %B") + %td + = link_to(h(n.course.full_name), course_url(n.course)) + " ›" + = link_to(h(n.title), course_news_url(n.course, n)) + - unless n.body.empty? + %p= h(n.body) + + .box + - last_time = nil + %h3 Próximos Eventos + + - if @events.empty? + %ul + %li.no_itens Nenhum evento próximo + + %table + - @events.each do |n| + %tr + %td.aright.top + = n.time.strftime("%d de %B") #unless n.time == last_time + - last_time = n.time + %td.top + = n.time.strftime("%H:%M") + %td.top + = link_to(h(n.course.full_name), course_url(n.course)) + " ›" + = link_to(h(n.title), course_event_url(n.course, n)) + + .box + %h3 Disciplinas Matriculadas + %ul + - if @current_user.courses.empty? + %li.no_itens Nenhuma disciplina matriculada + + - @current_user.courses.each do |course| + %li= link_to(h(course.full_name), course_url(course)) diff --git a/db/migrate/029_event_time.rb b/db/migrate/029_event_time.rb new file mode 100644 index 0000000..216ffee --- /dev/null +++ b/db/migrate/029_event_time.rb @@ -0,0 +1,8 @@ +class EventTime < ActiveRecord::Migration + def self.up + change_column :events, :date, :date, :null => true + end + + def self.down + end +end diff --git a/public/javascripts/events.js b/public/javascripts/events.js new file mode 100644 index 0000000..b1a339d --- /dev/null +++ b/public/javascripts/events.js @@ -0,0 +1,4 @@ +events['.div_calendario .title a:click'] = function(element, e) { + Effect.toggle(element.up().next(), 'blind'); + Event.stop(e); +} diff --git a/public/javascripts/news.js b/public/javascripts/news.js new file mode 100644 index 0000000..f7c890d --- /dev/null +++ b/public/javascripts/news.js @@ -0,0 +1,4 @@ +events['.div_news .title a:click'] = function(element, e) { + Effect.toggle(element.up().next(), 'blind'); + Event.stop(e); +}