Formatting
This commit is contained in:
@@ -107,8 +107,10 @@ body {
|
|||||||
|
|
||||||
}
|
}
|
||||||
#wrapper {
|
#wrapper {
|
||||||
background-color: #f4f4f4;
|
|
||||||
box-shadow: 2px 2px 2px rgba(0,0,0,0.1);
|
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 {
|
.wrapper2 {
|
||||||
// background-image: url(<%= App.base_path %>/assets/bg_body.png);
|
// background-image: url(<%= App.base_path %>/assets/bg_body.png);
|
||||||
@@ -647,8 +649,14 @@ background-position: 0px 12px;
|
|||||||
}
|
}
|
||||||
.pagination {
|
.pagination {
|
||||||
margin: 18px 0px;
|
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 {
|
.fieldWithErrors input, .fieldWithErrors textarea {
|
||||||
border: 2px solid #c00;
|
border: 2px solid #c00;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,44 +20,46 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
class LogController < ApplicationController
|
class LogController < ApplicationController
|
||||||
|
before_filter :require_login, only: [:undo]
|
||||||
|
before_filter :find_course, only: [:index]
|
||||||
|
|
||||||
before_filter :require_login, :only => [ :undo ]
|
def index
|
||||||
|
if @course
|
||||||
|
@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")
|
||||||
|
end
|
||||||
|
|
||||||
def index
|
respond_to do |format|
|
||||||
if @course
|
format.html
|
||||||
@log_entries = @course.log_entries.paginate(:page => params[:page], :per_page => 30, :order => "created_at desc")
|
format.rss { response.content_type = Mime::RSS }
|
||||||
else
|
format.xml { render xml: @log_entries }
|
||||||
@log_entries = LogEntry.paginate(:page => params[:page], :per_page => 30,
|
end
|
||||||
:conditions => [ "course_id not in (select id from courses where hidden = ?)", true],
|
end
|
||||||
:order => "created_at desc")
|
|
||||||
end
|
|
||||||
|
|
||||||
respond_to do |format|
|
def undo
|
||||||
format.html
|
@log_entry = LogEntry.find(params[:id])
|
||||||
format.rss { response.content_type = Mime::RSS }
|
@log_entry.undo!(@current_user)
|
||||||
format.xml { render :xml => @log_entries }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def undo
|
respond_to do |format|
|
||||||
@log_entry = LogEntry.find(params[:id])
|
format.html do
|
||||||
@log_entry.undo!(@current_user)
|
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
|
||||||
|
|
||||||
respond_to do |format|
|
protected
|
||||||
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)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
def find_course
|
||||||
def find_course
|
if params[:course_id]
|
||||||
unless params[:course_id].nil?
|
@course = Course.from_param(params[:course_id])
|
||||||
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?
|
end
|
||||||
@course = Course.find(params[:course_id])
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ class WikiPage < ActiveRecord::Base
|
|||||||
validates_format_of :title, with: /^[^0-9]/
|
validates_format_of :title, with: /^[^0-9]/
|
||||||
validate :check_wiki_syntax
|
validate :check_wiki_syntax
|
||||||
|
|
||||||
|
|
||||||
before_validation :set_canonical_title
|
before_validation :set_canonical_title
|
||||||
before_save :set_position
|
before_save :set_position
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
.right
|
.right
|
||||||
= action_icon('subtract', 'Desmatricular-se', unenroll_course_url(course))
|
= action_icon('subtract', 'Desmatricular-se', unenroll_course_url(course))
|
||||||
= link_to h(course.full_name), course_url(course)
|
= link_to h(course.full_name), course_url(course)
|
||||||
- else
|
- else
|
||||||
- @courses = Course.visible.where(period: @period)
|
- @courses = Course.visible.where(period: @period)
|
||||||
|
|
||||||
-# cache(courses_path) do
|
-# cache(courses_path) do
|
||||||
- old_grade = 0
|
- old_grade = 0
|
||||||
|
|||||||
@@ -34,3 +34,7 @@ h1, h2, h3, h4, h5, th {
|
|||||||
.specialDay {
|
.specialDay {
|
||||||
color: <%= color[1] %>;
|
color: <%= color[1] %>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pagination a:hover {
|
||||||
|
border: 1px solid <%= color[1] %> !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
%th Data
|
%th Data
|
||||||
%th Usuário
|
%th Usuário
|
||||||
%th Descrição
|
%th Descrição
|
||||||
- @wiki_page.versions.reverse.each do |entry|
|
- @wiki_page.versions.order("version desc").each do |entry|
|
||||||
%tr
|
%tr
|
||||||
%td.narrow
|
%td.narrow
|
||||||
%input{:type => "radio", :name => "to", :value => entry.version, :onclick => "history_to(#{entry.version})"}
|
%input{:type => "radio", :name => "to", :value => entry.version, :onclick => "history_to(#{entry.version})"}
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ WikiUFC::Application.routes.draw do
|
|||||||
|
|
||||||
# Log
|
# Log
|
||||||
with_options controller: 'log' 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/:id/undo', action: 'undo', format: 'html', as: 'undo_course_log'
|
||||||
log.match 'courses/:course_id/log.:format', action: 'index', as: 'formatted_course_log'
|
log.match 'courses/:course_id/log.:format', action: 'index', as: 'formatted_course_log'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user