master
Alinson S. Xavier 10 years ago
parent d08274aa5c
commit fcb86dcf37

@ -107,8 +107,10 @@ body {
}
#wrapper {
background-color: #f4f4f4;
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
// background: linear-gradient(#e4e4e4, #f4f4f4 30%);
background-color: #f4f4f4;
border-top: 2px solid #ccc;
}
.wrapper2 {
// background-image: url(<%= App.base_path %>/assets/bg_body.png);
@ -647,8 +649,14 @@ background-position: 0px 12px;
}
.pagination {
margin: 18px 0px;
text-align: right;
text-align: center;
}
.pagination a, .pagination em, .pagination span {
border: 1px solid #eee;
padding: 2px 9px;
border-radius: 3px;
}
.fieldWithErrors input, .fieldWithErrors textarea {
border: 2px solid #c00;
}

@ -20,22 +20,24 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class LogController < ApplicationController
before_filter :require_login, :only => [ :undo ]
before_filter :require_login, only: [:undo]
before_filter :find_course, only: [:index]
def index
if @course
@log_entries = @course.log_entries.paginate(:page => params[:page], :per_page => 30, :order => "created_at desc")
@log_entries = @course.log_entries.paginate(page: params[:page],
per_page: 30,
order: "created_at desc")
else
@log_entries = LogEntry.paginate(:page => params[:page], :per_page => 30,
:conditions => [ "course_id not in (select id from courses where hidden = ?)", true],
:order => "created_at desc")
@log_entries = LogEntry.paginate(page: params[:page], per_page: 30,
conditions: ["course_id not in (select id from courses where hidden = ?)", true],
order: "created_at desc")
end
respond_to do |format|
format.html
format.rss { response.content_type = Mime::RSS }
format.xml { render :xml => @log_entries }
format.xml { render xml: @log_entries }
end
end
@ -45,19 +47,19 @@ class LogController < ApplicationController
respond_to do |format|
format.html do
redirect_to course_event_url(@log_entry.course, @log_entry.target_id) if @log_entry.kind_of?(EventDeleteLogEntry)
redirect_to course_attachment_url(@log_entry.course, @log_entry.target_id) if @log_entry.kind_of?(AttachmentDeleteLogEntry)
redirect_to course_news_instance_url(@log_entry.course, @log_entry.target_id) if @log_entry.kind_of?(NewsDeleteLogEntry)
redirect_to course_wiki_instance_url(@log_entry.course, @log_entry.target_id) if @log_entry.kind_of?(WikiDeleteLogEntry)
redirect_to course_event_url(@log_entry.course, @log_entry.target_id) if @log_entry.is_a?(EventDeleteLogEntry)
redirect_to course_attachment_url(@log_entry.course, @log_entry.target_id) if @log_entry.is_a?(AttachmentDeleteLogEntry)
redirect_to course_news_instance_url(@log_entry.course, @log_entry.target_id) if @log_entry.is_a?(NewsDeleteLogEntry)
redirect_to course_wiki_instance_url(@log_entry.course, @log_entry.target_id) if @log_entry.is_a?(WikiDeleteLogEntry)
end
end
end
protected
def find_course
unless params[:course_id].nil?
params[:course_id] = Course.find(:first, :conditions => ['short_name = ?', params[:course_id]], :order => 'period desc').id if !params[:course_id].is_numeric? and !Course.find_by_short_name(params[:course_id]).nil?
@course = Course.find(params[:course_id])
if params[:course_id]
@course = Course.from_param(params[:course_id])
end
end
end

@ -46,7 +46,6 @@ class WikiPage < ActiveRecord::Base
validates_format_of :title, with: /^[^0-9]/
validate :check_wiki_syntax
before_validation :set_canonical_title
before_save :set_position

@ -34,3 +34,7 @@ h1, h2, h3, h4, h5, th {
.specialDay {
color: <%= color[1] %>;
}
.pagination a:hover {
border: 1px solid <%= color[1] %> !important;
}

@ -18,7 +18,7 @@
%th Data
%th Usuário
%th Descrição
- @wiki_page.versions.reverse.each do |entry|
- @wiki_page.versions.order("version desc").each do |entry|
%tr
%td.narrow
%input{:type => "radio", :name => "to", :value => entry.version, :onclick => "history_to(#{entry.version})"}

@ -64,7 +64,9 @@ WikiUFC::Application.routes.draw do
# Log
with_options controller: 'log' do |log|
log.match 'courses/:course_id/log', action: 'index', format: 'html', as: 'course_log'
log.match 'courses/:course_id/log', action: 'index',
format: 'html',
as: 'course_log'
log.match 'courses/:course_id/log/:id/undo', action: 'undo', format: 'html', as: 'undo_course_log'
log.match 'courses/:course_id/log.:format', action: 'index', as: 'formatted_course_log'
end