Atualizando para o Rails 2.3.2
This commit is contained in:
@@ -21,7 +21,7 @@ class ApplicationController < ActionController::Base
|
||||
include AuthenticationSystem
|
||||
|
||||
before_filter :startup
|
||||
around_filter :set_timezone
|
||||
before_filter :set_timezone
|
||||
|
||||
# Força o login para algumas áreas do sistema
|
||||
before_filter :require_login, :only => [ :edit, :new, :create, :update, :delete, :destroy, :download ]
|
||||
@@ -62,10 +62,8 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def set_timezone
|
||||
#TzTime.zone = session[:user].tz
|
||||
TzTime.zone = TZInfo::Timezone.get("America/Fortaleza")
|
||||
yield
|
||||
TzTime.reset!
|
||||
#Time.zone = session[:user].tz
|
||||
Time.zone = "America/Fortaleza"
|
||||
end
|
||||
|
||||
def startup
|
||||
@@ -89,7 +89,7 @@ class AttachmentsController < ApplicationController
|
||||
|
||||
def undelete
|
||||
@attachment = Attachment.find_with_deleted(params[:id])
|
||||
@attachment.update_attribute(:deleted_at, nil)
|
||||
@attachment.recover!
|
||||
flash[:notice] = 'Attachment restored'[]
|
||||
AttachmentRestoreLogEntry.create!(:target_id => @attachment.id, :user => @current_user, :course => @attachment.course)
|
||||
redirect_to course_attachment_url(@attachment.course, @attachment)
|
||||
|
||||
@@ -31,7 +31,6 @@ class CoursesController < ApplicationController
|
||||
@courses = Course.find(:all, :order => 'grade asc, full_name asc', :conditions => ['period = ?', @period])
|
||||
end
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xml { render :xml => @courses }
|
||||
@@ -54,7 +53,7 @@ class CoursesController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_path(@course) }
|
||||
format.xml { head :created, :location => formatted_course_url(@course, :xml) }
|
||||
format.xml { head :created, :location => course_url(@course, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class EventsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_event_path(@course, @event) }
|
||||
format.xml { head :created, :location => formatted_course_event_url(@course, @event, :xml) }
|
||||
format.xml { head :created, :location => course_event_url(@course, @event, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -61,7 +61,7 @@ class EventsController < ApplicationController
|
||||
|
||||
def update
|
||||
@event.attributes = params[:event]
|
||||
dirty = @event.dirty?
|
||||
dirty = @event.changed?
|
||||
@event.save!
|
||||
flash[:notice] = 'Event updated'[]
|
||||
|
||||
@@ -69,7 +69,7 @@ class EventsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_event_path(@course, @event) }
|
||||
format.xml { head :created, :location => formatted_course_event_url(@course, @event, :xml) }
|
||||
format.xml { head :created, :location => course_event_url(@course, @event, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -100,7 +100,7 @@ class EventsController < ApplicationController
|
||||
|
||||
def undelete
|
||||
@event = Event.find_with_deleted(params[:id])
|
||||
@event.restore!
|
||||
@event.recover!
|
||||
|
||||
flash[:notice] = "Event restored"[]
|
||||
EventRestoreLogEntry.create!(:target_id => @event.id, :user => @current_user, :course => @event.course, :version => @event.version)
|
||||
|
||||
@@ -53,8 +53,8 @@ class NewsController < ApplicationController
|
||||
NewsCreateLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @course, :version => @news.version)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_news_path(@course, @news) }
|
||||
format.xml { head :created, :location => formatted_course_news_url(@course, @news, :xml) }
|
||||
format.html { redirect_to course_news_instance_path(@course, @news) }
|
||||
format.xml { head :created, :location => course_news_instance_url(@course, @news, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -65,40 +65,40 @@ class NewsController < ApplicationController
|
||||
def update
|
||||
@news.attributes = params[:news]
|
||||
@news.timestamp = Time.now.utc
|
||||
dirty = @news.dirty?
|
||||
dirty = @news.changed?
|
||||
@news.save!
|
||||
flash[:notice] = 'News updated'[]
|
||||
|
||||
NewsEditLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @course, :version => @news.version) if dirty
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_news_path(@course, @news) }
|
||||
format.xml { head :created, :location => formatted_course_news_url(@course, @news, :xml) }
|
||||
format.html { redirect_to course_news_instance_path(@course, @news) }
|
||||
format.xml { head :created, :location => course_news_instance_url(@course, @news, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@news.destroy
|
||||
flash[:notice] = 'News removed'[]
|
||||
flash[:undo] = undelete_course_news_url(@course, @news)
|
||||
flash[:undo] = undelete_course_news_instance_url(@course, @news)
|
||||
|
||||
NewsDeleteLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @course, :version => @news.version)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_news_index_path(@course) }
|
||||
format.html { redirect_to course_news_path(@course) }
|
||||
format.xml { head :ok }
|
||||
end
|
||||
end
|
||||
|
||||
def undelete
|
||||
@news = News.find_with_deleted(params[:id])
|
||||
@news.restore!
|
||||
@news.recover!
|
||||
|
||||
flash[:notice] = "News restored"[]
|
||||
NewsRestoreLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @news.course, :version => @news.version)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_news_url(@news.course, @news) }
|
||||
format.html { redirect_to course_news_instance_url(@news.course, @news) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -113,6 +113,6 @@ class NewsController < ApplicationController
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment(course_path(@course.id, :part => :right))
|
||||
expire_fragment(course_news_index_path(@course.id))
|
||||
expire_fragment(course_news_path(@course.id))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,8 +49,8 @@ class WikiController < ApplicationController
|
||||
WikiCreateLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @course)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_wiki_path(@course, @wiki_page) }
|
||||
format.xml { head :created, :location => formatted_course_wiki_url(@course, @wiki_page, :xml) }
|
||||
format.html { redirect_to course_wiki_instance_url(@course, @wiki_page) }
|
||||
format.xml { head :created, :location => course_wiki_instance_url(@course, @wiki_page, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,7 +73,7 @@ class WikiController < ApplicationController
|
||||
@wiki_page.attributes = params[:wiki_page]
|
||||
@wiki_page.user_id = session[:user_id]
|
||||
@wiki_page.course_id = @course.id
|
||||
dirty = @wiki_page.dirty?
|
||||
dirty = @wiki_page.changed?
|
||||
@wiki_page.save!
|
||||
|
||||
WikiEditLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @course, :version => @wiki_page.version) if dirty
|
||||
@@ -81,15 +81,15 @@ class WikiController < ApplicationController
|
||||
flash[:notice] = "Wiki page updated"[]
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_wiki_path(@course, @wiki_page) }
|
||||
format.xml { head :created, :location => formatted_course_wiki_url(@course, @wiki_page, :xml) }
|
||||
format.html { redirect_to course_wiki_instance_url(@course, @wiki_page) }
|
||||
format.xml { head :created, :location => course_wiki_instance_url(@course, @wiki_page, :format => :xml) }
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@wiki_page.destroy
|
||||
flash[:notice] = "Wiki page removed"[]
|
||||
flash[:undo] = url_for(:course_id => @course, :id => @wiki_page.id, :action => 'undelete')
|
||||
flash[:undo] = undelete_course_wiki_instance_url(@course, @wiki_page.id)
|
||||
|
||||
WikiDeleteLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @course)
|
||||
|
||||
@@ -120,8 +120,9 @@ class WikiController < ApplicationController
|
||||
end
|
||||
|
||||
def diff
|
||||
@to = WikiPage.find_version(params[:id], params[:to])
|
||||
@from = WikiPage.find_version(params[:id], params[:from])
|
||||
@wiki_page = WikiPage.find(params[:id])
|
||||
@to = @wiki_page.versions.find_by_version(params[:to])
|
||||
@from = @wiki_page.versions.find_by_version(params[:from])
|
||||
@diff = WikiPage.diff(@from, @to)
|
||||
end
|
||||
|
||||
@@ -147,13 +148,13 @@ class WikiController < ApplicationController
|
||||
|
||||
def undelete
|
||||
@wiki_page = WikiPage.find_with_deleted(params[:id])
|
||||
@wiki_page.update_attribute(:deleted_at, nil)
|
||||
@wiki_page.recover!
|
||||
flash[:notice] = "Wiki page restored"[]
|
||||
|
||||
WikiRestoreLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @wiki_page.course)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to course_wiki_url(@wiki_page.course, @wiki_page) }
|
||||
format.html { redirect_to course_wiki_instance_url(@wiki_page.course, @wiki_page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -167,7 +168,7 @@ class WikiController < ApplicationController
|
||||
end
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment course_path(@course.id)
|
||||
expire_fragment course_wiki_path(@course.id, @wiki_page.id)
|
||||
expire_fragment course_url(@course.id)
|
||||
expire_fragment course_wiki_instance_url(@course.id, @wiki_page.id)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,9 @@ module ApplicationHelper
|
||||
|
||||
# Converte para o timezone local
|
||||
def tz(time_at)
|
||||
TzTime.zone.utc_to_local(time_at.utc)
|
||||
#FIXME
|
||||
#TzTime.zone.utc_to_local(time_at.utc)
|
||||
time_at
|
||||
end
|
||||
|
||||
FLASH_NAMES = [:notice, :warning, :message]
|
||||
@@ -59,6 +61,7 @@ module ApplicationHelper
|
||||
|
||||
def highlight(name)
|
||||
return {:class => 'highlight'} if (flash[:highlight] == name)
|
||||
return {}
|
||||
end
|
||||
|
||||
def spinner(name)
|
||||
@@ -84,4 +87,8 @@ module ApplicationHelper
|
||||
html_options.merge!({:class => 'icon', :alt => description, :title => description})
|
||||
link_to(image_tag("action/#{action_name}.gif", :title => description), options, html_options)
|
||||
end
|
||||
|
||||
def format_period(period)
|
||||
return "20#{period[0..1]}.#{period[2..2]}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,6 +58,6 @@ class Course < ActiveRecord::Base
|
||||
|
||||
def to_param
|
||||
return self.short_name if self.period == App.current_period
|
||||
return self.id
|
||||
return self.id.to_s
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ class Event < ActiveRecord::Base
|
||||
# Plugins
|
||||
acts_as_paranoid
|
||||
acts_as_versioned :if_changed => [ :title, :description, :time ]
|
||||
self.non_versioned_fields << 'deleted_at'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
belongs_to :course
|
||||
|
||||
@@ -19,7 +19,7 @@ class Message < ActiveRecord::Base
|
||||
# Plugins
|
||||
acts_as_paranoid
|
||||
acts_as_versioned :if_changed => [ :title, :body ]
|
||||
self.non_versioned_fields << 'deleted_at'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
belongs_to :user,
|
||||
|
||||
@@ -80,7 +80,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def to_param
|
||||
self.login.match(/^[-_a-z0-9]*$/i).nil? ? self.id : self.login
|
||||
self.login.match(/^[-_a-z0-9]*$/i).nil? ? self.id.to_s : self.login
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
@@ -23,7 +23,8 @@ class WikiPage < ActiveRecord::Base
|
||||
acts_as_paranoid
|
||||
acts_as_list :scope => 'course_id = #{course_id}'
|
||||
acts_as_versioned :if_changed => [ :content, :description, :title ]
|
||||
self.non_versioned_fields << 'position'
|
||||
self.non_versioned_columns << 'position'
|
||||
self.non_versioned_columns << 'deleted_at'
|
||||
|
||||
# Associacoes
|
||||
belongs_to :course
|
||||
@@ -34,7 +35,6 @@ class WikiPage < ActiveRecord::Base
|
||||
validates_uniqueness_of :title, :scope => :course_id
|
||||
validates_format_of :title, :with => /^[^0-9]/
|
||||
|
||||
|
||||
def validate
|
||||
begin
|
||||
to_html
|
||||
@@ -48,7 +48,7 @@ class WikiPage < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def to_param
|
||||
self.title.match(/^[-_a-z0-9]*$/i).nil? ? self.id : self.title
|
||||
self.title.match(/^[-_a-z0-9]*$/i).nil? ? self.id.to_id : self.title
|
||||
end
|
||||
|
||||
def WikiPage.diff(from, to)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
-# cache(course_path(@course.id, :part => :right)) do
|
||||
= render 'widgets/calendario'
|
||||
= render 'widgets/news'
|
||||
= render :file => 'widgets/calendario'
|
||||
= render :file => 'widgets/news'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%h4.title= App.title
|
||||
%h1.title Adicionar disciplina
|
||||
|
||||
- form_tag course_url(@course.id), :method => :post do
|
||||
- form_tag courses_url, :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Cadastrar"
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
|
||||
.box
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar página wiki', new_course_wiki_url(@course)
|
||||
= action_icon 'add', 'Adicionar página wiki', new_course_wiki_instance_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?
|
||||
=action_icon 'arrow2_n', 'Mover para cima', move_up_course_wiki_instance_url(@course, wiki) unless wiki.first?
|
||||
=action_icon 'arrow2_s', 'Mover para baixo', move_down_course_wiki_instance_url(@course, wiki) unless wiki.last?
|
||||
- if wiki.last?
|
||||
%span{:style => 'margin-right: 14px'}
|
||||
=link_to h(wiki.title), course_wiki_url(@course, wiki)
|
||||
=link_to h(wiki.title), course_wiki_instance_url(@course, wiki)
|
||||
- if @course.wiki_pages.empty?
|
||||
%li.no_itens Nenhuma página wiki
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
%h1.title Adicionar evento
|
||||
|
||||
%p
|
||||
- form_tag course_event_url(@course, @event), :method => :post do
|
||||
- form_tag course_events_url(@course), :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Adicionar"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
- @events = @course.events
|
||||
= render 'events/index'
|
||||
= render :file => 'events/index'
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
= "›" + 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'
|
||||
- @left_panel = render 'courses/left_panel'
|
||||
- @right_panel = render 'courses/right_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
- @title = @title + " - Disciplinas"
|
||||
|
||||
- if @course and @course.id
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @right_panel = render 'courses/_right_panel'
|
||||
- @left_panel = render 'courses/left_panel'
|
||||
- @right_panel = render 'courses/right_panel'
|
||||
- else
|
||||
- @left_panel = render('widgets/menu_navigation') + render('widgets/menu_user')
|
||||
- end
|
||||
- @left_panel = render('widgets/menu_navigation') + render('widgets/menu_user')
|
||||
|
||||
- @content = yield
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
= 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'
|
||||
- @left_panel = render 'courses/left_panel'
|
||||
- @right_panel = render 'courses/right_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Log", course_log_url(@course))
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @left_panel = render 'courses/left_panel'
|
||||
- @content = yield
|
||||
|
||||
- else
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
= link_to(App.title, index_url) + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Noticias", course_news_index_url(@course))
|
||||
= link_to("Noticias", course_news_url(@course))
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @left_panel = render 'courses/left_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
= 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))
|
||||
= "›" + link_to(h(@wiki_page.title), course_wiki_instance_url(@course, @wiki_page))
|
||||
- @title = @title + " - #{h(@wiki_page.title)}"
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @left_panel = render 'courses/left_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
= "Notícia " + link_to(h(entry.news.title), course_news_url(entry.course, entry.news, :version => entry.version))
|
||||
= "Notícia " + link_to(h(entry.news.title), course_news_instance_url(entry.course, entry.news, :version => entry.version))
|
||||
|
||||
= "criada " if entry.kind_of?(NewsCreateLogEntry)
|
||||
= "editada " if entry.kind_of?(NewsEditLogEntry)
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
- if entry.version
|
||||
= "Página " + link_to(h(entry.wiki_page.title), course_wiki_url(entry.course, entry.wiki_page.id, :version => entry.version))
|
||||
= "Página " + link_to(h(entry.wiki_page.title), course_wiki_instance_url(entry.course, entry.wiki_page.id, :version => entry.version))
|
||||
- else
|
||||
= "Página " + link_to(h(entry.wiki_page.title), course_wiki_url(entry.course, entry.wiki_page.id))
|
||||
= "Página " + link_to(h(entry.wiki_page.title), course_wiki_instance_url(entry.course, entry.wiki_page.id))
|
||||
|
||||
= "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)
|
||||
|
||||
- current_version = WikiPage.find_version(entry.wiki_page.id, entry.version)
|
||||
- previous_version = entry.wiki_page.previous_version(entry.version)
|
||||
- current_version = entry.wiki_page.versions.find_by_version(entry.version)
|
||||
- previous_version = current_version.previous
|
||||
|
||||
- if entry.kind_of?(WikiEditLogEntry)
|
||||
- if current_version.description and !current_version.description.empty?
|
||||
= "(<i>#{h(current_version.description)}</i>)"
|
||||
|
||||
- unless previous_version.nil?
|
||||
= "(" + link_to("diff", diff_course_wiki_url(entry.course, entry.wiki_page.id, :from => previous_version.version, :to => entry.version)) + ")"
|
||||
= "(" + link_to("diff", diff_course_wiki_instance_url(entry.course, entry.wiki_page.id, :from => previous_version.version, :to => entry.version)) + ")"
|
||||
|
||||
= "(" + link_to("edit", edit_course_wiki_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")"
|
||||
= "(" + link_to("edit", edit_course_wiki_instance_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")"
|
||||
|
||||
- unless previous_version.nil?
|
||||
= "(" + link_to("undo", edit_course_wiki_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{previous_version.version}", :version => previous_version.version)) + ")"
|
||||
= "(" + link_to("undo", edit_course_wiki_instance_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{previous_version.version}", :version => previous_version.version)) + ")"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
%h4.title= @course ? h(@course.full_name) : App.title
|
||||
%h1.title Mudanças recentes
|
||||
|
||||
- if @course
|
||||
= auto_discovery_link_tag :rss, formatted_course_log_url(@course, :rss)
|
||||
-# if @course
|
||||
=# auto_discovery_link_tag :rss, course_log_url(@course.id, :format => :rss)
|
||||
|
||||
.box
|
||||
%table
|
||||
@@ -15,7 +15,7 @@
|
||||
- @log_entries.each do |entry|
|
||||
%tr
|
||||
%td= tz(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= link_to truncate(h(entry.user.display_name), :length => 20), user_url(entry.user.id)
|
||||
- unless @course
|
||||
%td= link_to h(entry.course.short_name), course_url(entry.course)
|
||||
%td= render(:partial => 'log/log_entry', :locals => { :entry => entry })
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
%h1.title Editar noticia
|
||||
|
||||
%p
|
||||
- form_tag course_news_url(@course, @news), :method => :put do
|
||||
- form_tag course_news_instance_url(@course, @news), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
= javascript_include_tag 'news'
|
||||
|
||||
-# cache(course_news_index_path(@course.id)) do
|
||||
-# cache(course_news_path(@course.id)) do
|
||||
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar', new_course_news_url
|
||||
= action_icon 'add', 'Adicionar', new_course_news_instance_url
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Notícias
|
||||
|
||||
= auto_discovery_link_tag :rss, formatted_course_news_index_url(@course, :rss)
|
||||
= auto_discovery_link_tag :rss, course_news_url(@course, :format => :rss)
|
||||
|
||||
.box.div_news
|
||||
- if !@course.news.empty?
|
||||
@@ -21,11 +21,11 @@
|
||||
%td.top.aright{:width => '1%'}
|
||||
= n.timestamp.strftime("%d de %B")
|
||||
%td
|
||||
.title= link_to h(n.title), course_news_url(@course, n)
|
||||
.title= link_to h(n.title), course_news_instance_url(@course, n)
|
||||
.description{:style => (n.id == params[:id].to_i ? '' : 'display: none')}
|
||||
.cmd
|
||||
= action_icon 'edit', 'Editar', edit_course_news_url(@course, n, :version => n.version)
|
||||
= action_icon 'trash', 'Excluir', course_news_url(@course, n), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
= action_icon 'edit', 'Editar', edit_course_news_instance_url(@course, n, :version => n.version)
|
||||
= action_icon 'trash', 'Excluir', course_news_instance_url(@course, n), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
= formatted(n.body)
|
||||
= "Sem descrição" if n.body.empty?
|
||||
- else
|
||||
|
||||
@@ -2,7 +2,7 @@ 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.link(course_news_url(@course))
|
||||
xml.language(App.language)
|
||||
xml.description("{course} news"[:news_about, @course.full_name])
|
||||
for news_item in @news
|
||||
@@ -10,8 +10,8 @@ xml.rss(:version=>"2.0") do
|
||||
xml.title(news_item.title)
|
||||
xml.description(formatted(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))
|
||||
xml.link(course_news_instance_url(@course, news_item))
|
||||
xml.guid(course_news_instance_url(@course, news_item))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%h4.title= @course.full_name
|
||||
%h1.title Adicionar notícia
|
||||
|
||||
- form_tag course_news_url(@course, @news), :method => :post do
|
||||
- form_tag course_news_url, :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Enviar"
|
||||
|
||||
@@ -1 +1 @@
|
||||
= render 'news/index'
|
||||
= render :file => 'news/index'
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<% @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) %> ›
|
||||
<h4><%= link_to h(n.course.full_name) , course_news_instance_url(n.course, n) %> ›
|
||||
<a href="#" id="new_<%=n.id%>"><%= h(n.title) %></a></h4>
|
||||
|
||||
<p id="new_desc_<%= n.id %>" style="display:none">
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
%h4.title Dashboard
|
||||
%h1.title= "Bem vindo, #{h(@current_user.display_name)}"
|
||||
|
||||
= auto_discovery_link_tag :rss, formatted_dashboard_url(:secret => @current_user.secret, :format => 'rss')
|
||||
= auto_discovery_link_tag :rss, dashboard_url(:secret => @current_user.secret, :format => 'rss')
|
||||
|
||||
.dashboard
|
||||
.box
|
||||
.cmd
|
||||
=link_to "rss", formatted_dashboard_url(:secret => @current_user.secret, :format => 'rss')
|
||||
=link_to "rss", dashboard_url(:secret => @current_user.secret, :format => 'rss')
|
||||
- last_time = nil
|
||||
|
||||
%h3 Notícias Recentes
|
||||
@@ -20,13 +20,13 @@
|
||||
= 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))
|
||||
= link_to(h(n.title), course_news_instance_url(n.course, n))
|
||||
- unless n.body.empty?
|
||||
%p= truncate(h(n.body), 300)
|
||||
%p= truncate(h(n.body), :length => 300)
|
||||
|
||||
.box
|
||||
.cmd
|
||||
=link_to "ical", formatted_dashboard_url(:secret => @current_user.secret, :format => 'ics')
|
||||
=link_to "ical", dashboard_url(:secret => @current_user.secret, :format => 'ics')
|
||||
- last_time = nil
|
||||
|
||||
%h3 Próximos Eventos
|
||||
|
||||
@@ -10,8 +10,8 @@ xml.rss(:version=>"2.0") do
|
||||
xml.title(news_item.course.short_name + ": " + news_item.title)
|
||||
xml.description(formatted(news_item.body))
|
||||
xml.pubDate(news_item.timestamp.rfc2822)
|
||||
xml.link(course_news_url(news_item.course, news_item))
|
||||
xml.guid(course_news_url(news_item.course, news_item))
|
||||
xml.link(course_news_instance_url(news_item.course, news_item))
|
||||
xml.guid(course_news_instance_url(news_item.course, news_item))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<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 "Noticias", course_news_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>
|
||||
@@ -1,19 +1,19 @@
|
||||
<!-- Mural -->
|
||||
<div class="menu">
|
||||
<div class="cmd">
|
||||
<%= action_icon 'add', 'Adicionar notícia', new_course_news_url(@course) %>
|
||||
<%= action_icon 'add', 'Adicionar notícia', new_course_news_instance_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) %>
|
||||
<%= link_to msg.title, course_news_instance_url(@course, msg) %>.
|
||||
<%= truncate(msg.body, :length => 80) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @course.news.size > 4 %>
|
||||
<li><%= link_to("Ver todas as notícias", course_news_index_url(@course)) %></li>
|
||||
<li><%= link_to("Ver todas as notícias", course_news_url(@course)) %></li>
|
||||
<% end %>
|
||||
<% if @course.news.empty? %>
|
||||
<li class="no_itens">Nenhuma notícia</li>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
= action_icon('undo', "Reverter", edit_course_wiki_url(@course, @wiki_page, :description => "Revertendo para versão #{page.version}", :version => page.version)) + " "
|
||||
= link_to tz(page.updated_at).strftime("%d/%m/%y %H:%M:%S"), course_wiki_url(@course, @wiki_page, :version => page.version)
|
||||
= action_icon('undo', "Reverter", edit_course_wiki_instance_url(@course, @wiki_page, :description => "Revertendo para versão #{page.version}", :version => page.version)) + " "
|
||||
= link_to tz(page.updated_at).strftime("%d/%m/%y %H:%M:%S"), course_wiki_instance_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?
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
%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)
|
||||
= link_to "Comparar outras versões", versions_course_wiki_instance_url(@course, @wiki_page, :from => @from.version, :to => @to.version)
|
||||
= format_diff h(@diff)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
%h1.title= "Editar #{h(@wiki_page.title)}"
|
||||
|
||||
%p
|
||||
- form_tag course_wiki_url(@course, @wiki_page.id), :method => :put do
|
||||
- form_tag course_wiki_instance_url(@course, @wiki_page.id), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Salvar'
|
||||
%button#show_preview{:type => "button"}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
%h1.title Adicionar página wiki
|
||||
|
||||
%p
|
||||
- form_tag course_wiki_url(@course, @wiki_page.id) do
|
||||
- form_tag course_wiki_url(@course) do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Criar"
|
||||
%button#show_preview{:type => "button"}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
= 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
|
||||
= action_icon 'edit', 'Editar', edit_course_wiki_instance_url
|
||||
= action_icon 'undo', 'Historico', versions_course_wiki_instance_url
|
||||
= action_icon 'trash', 'Excluir página wiki', course_wiki_instance_url, :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= h(@wiki_page.title)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
== radios_to = #{h(@history_to)};
|
||||
== radios_from = #{h(@history_from)};
|
||||
|
||||
- form_tag diff_course_wiki_url(@course, @wiki_page), :method => :get do
|
||||
- form_tag diff_course_wiki_instance_url(@course, @wiki_page), :method => :get do
|
||||
%button{:type => "submit"}= "Comparar as versões selecionadas"
|
||||
.box
|
||||
%table
|
||||
@@ -24,12 +24,12 @@
|
||||
%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(tz(entry.updated_at).strftime("%d/%m/%y %H:%M:%S"), course_wiki_url(@course, @wiki_page, :version => entry.version))
|
||||
%td= link_to truncate(h(User.find_with_deleted(entry.user_id).display_name), 20), user_path(User.find_with_deleted(entry.user_id))
|
||||
%td= link_to(tz(entry.updated_at).strftime("%d/%m/%y %H:%M:%S"), course_wiki_instance_url(@course, @wiki_page, :version => entry.version))
|
||||
%td= link_to truncate(h(User.find_with_deleted(entry.user_id).display_name), :length => 20), user_path(User.find_with_deleted(entry.user_id))
|
||||
%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)) + ")"
|
||||
= "(" + link_to("diff", diff_course_wiki_instance_url(@course, @wiki_page, :from => entry.version - 1, :to => entry.version)) + ")"
|
||||
= "(" + link_to("edit", edit_course_wiki_instance_url(@course, @wiki_page, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")"
|
||||
|
||||
/= will_paginate @versions
|
||||
|
||||
Reference in New Issue
Block a user