Suporte a enderecos relativos
This commit is contained in:
@@ -82,7 +82,7 @@ class UsersController < ApplicationController
|
||||
@user.save!
|
||||
@color = @user.pref_color
|
||||
flash[:message] = 'Settings updated'[]
|
||||
redirect_to '/'
|
||||
redirect_to index_path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -103,7 +103,7 @@ class UsersController < ApplicationController
|
||||
def logout
|
||||
destroy_session
|
||||
flash[:message] = 'You have logged out'[:logout_success]
|
||||
redirect_to '/'
|
||||
redirect_to index_path
|
||||
end
|
||||
|
||||
def dashboard
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)}"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to(App.title, index_url) + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Arquivos", course_url(@course))
|
||||
|
||||
@@ -6,8 +6,12 @@
|
||||
%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'}
|
||||
|
||||
%link{'href' => "#{App.base_path}/stylesheets/wiki.css", 'rel' => 'Stylesheet', 'type' => %'text/css'}
|
||||
%link#css_color{'href' => "#{App.base_path}/stylesheets/themes/color.#@color.css", 'rel' => 'Stylesheet', 'type' => %'text/css'}
|
||||
|
||||
%script{:type => 'text/javascript'}
|
||||
== BASE_PATH = "#{App.base_path}";
|
||||
= javascript_include_merged :base
|
||||
|
||||
%body{'onload' => 'javascript: startup()'}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = "#{App.title}"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›";
|
||||
= link_to(App.title, index_url) + "›";
|
||||
= link_to("Disciplinas", courses_url)
|
||||
- if @course and @course.id
|
||||
= "› " + link_to(h(@course.full_name), course_url)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)} - Calendário"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to(App.title, index_url) + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Calendário", course_events_url)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)} - Mudanças recentes"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to(App.title, index_url) + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Log", course_log_url(@course))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)} - Notícias"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= 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))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = App.title
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›";
|
||||
= link_to(App.title, index_url) + "›";
|
||||
= link_to("Usuários", users_path)
|
||||
- if @user and @user.id
|
||||
= "› " + link_to(h(@user.name), user_url(@user))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- @title = "#{App.title} - #{h(@course.full_name)}"
|
||||
- @location = capture do
|
||||
= link_to(App.title, "/") + "›"
|
||||
= link_to(App.title, index_url) + "›"
|
||||
= link_to("Disciplinas", courses_url) + "›"
|
||||
= link_to(h(@course.full_name), course_url(@course)) + "›"
|
||||
= link_to("Wiki", course_url(@course))
|
||||
|
||||
@@ -38,7 +38,7 @@ ul ul, ol ol {
|
||||
}
|
||||
|
||||
.content ul li {
|
||||
background-image: url(/images/bullet.gif);
|
||||
background-image: url(<%= App.base_path %>/images/bullet.gif);
|
||||
background-position: 0px 7px;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 15px;
|
||||
@@ -120,7 +120,7 @@ body {
|
||||
font-weight: normal;
|
||||
min-width: 780px;
|
||||
|
||||
background-image: url(/images/bg_body.png);
|
||||
background-image: url(<%= App.base_path %>/images/bg_body.png);
|
||||
background-repeat: repeat-x;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ body {
|
||||
}
|
||||
|
||||
#header {
|
||||
background-image: url(/images/header_bg.png);
|
||||
background-image: url(<%= App.base_path %>/images/header_bg.png);
|
||||
background-position: top;
|
||||
background-repeat: repeat-x;
|
||||
color: #eee;
|
||||
@@ -199,7 +199,7 @@ body {
|
||||
|
||||
#footer {
|
||||
display: none;
|
||||
background-image: url(/images/footer_bg.png);
|
||||
background-image: url(<%= App.base_path %>/images/footer_bg.png);
|
||||
background-position: top;
|
||||
background-repeat: repeat-x;
|
||||
margin: 0em;
|
||||
@@ -465,11 +465,11 @@ h4.title, h1.title {
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.repositorio .mime_plain_text { background-image: url(/images/tango/text-x-generic.png); }
|
||||
.repositorio .mime_presentation { background-image: url(/images/tango/x-office-presentation.png); }
|
||||
.repositorio .mime_document { background-image: url(/images/tango/x-office-document.png); }
|
||||
.repositorio .mime_binary { background-image: url(/images/tango/application-x-executable.png); }
|
||||
.repositorio .mime_zip { background-image: url(/images/tango/package-x-generic.png); }
|
||||
.repositorio .mime_plain_text { background-image: url(<%= App.base_path %>/images/tango/text-x-generic.png); }
|
||||
.repositorio .mime_presentation { background-image: url(<%= App.base_path %>/images/tango/x-office-presentation.png); }
|
||||
.repositorio .mime_document { background-image: url(<%= App.base_path %>/images/tango/x-office-document.png); }
|
||||
.repositorio .mime_binary { background-image: url(<%= App.base_path %>/images/tango/application-x-executable.png); }
|
||||
.repositorio .mime_zip { background-image: url(<%= App.base_path %>/images/tango/package-x-generic.png); }
|
||||
|
||||
.spinner {
|
||||
float: right;
|
||||
@@ -607,7 +607,7 @@ textarea {
|
||||
|
||||
|
||||
#wiki_preview {
|
||||
background-image: url(/images/rascunho.png);
|
||||
background-image: url(<%= App.base_path %>/images/rascunho.png);
|
||||
border: 2px solid #e4e4e4;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
@@ -662,7 +662,7 @@ textarea {
|
||||
border-top: 1px solid #bbb;
|
||||
}
|
||||
|
||||
xbody { background-image: url(/prototype/line.png); }
|
||||
xbody { background-image: url(<%= App.base_path %>/prototype/line.png); }
|
||||
xhtml * { background-color: transparent !important; }
|
||||
|
||||
.menu, .content, #location {
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
<% if @course %>
|
||||
url = '/widgets/calendar/<%= @course.id %>/' + calendar_year + '/' + calendar_month;
|
||||
url = BASE_PATH + '/widgets/calendar/<%= @course.id %>/' + calendar_year + '/' + calendar_month;
|
||||
<% end %>
|
||||
|
||||
spinner_start('calendar');
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
|
||||
<% if @course %>
|
||||
url = '/widgets/calendar/<%= @course.id %>/' + calendar_year + '/' + calendar_month;
|
||||
url = BASE_PATH + '/widgets/calendar/<%= @course.id %>/' + calendar_year + '/' + calendar_month;
|
||||
<% end %>
|
||||
|
||||
spinner_start('calendar');
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
%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("User profile"[].titleize, user_url(@current_user))
|
||||
%li= link_to("Edit settings"[].titleize, settings_url)
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
# Geral
|
||||
App.language = "pt-br"
|
||||
App.title = "Wiki UFC"
|
||||
App.base_path = ""
|
||||
|
||||
# Limites
|
||||
App.max_upload_file_size = 5.megabytes
|
||||
|
||||
# Forum
|
||||
App.forum_uri = "http://127.0.0.1:3001/"
|
||||
#App.forum_uri = "http://127.0.0.1:3001/"
|
||||
|
||||
# Tema
|
||||
App.default_color = 6
|
||||
App.default_avatar = "http://engsoft.isoron.org/images/avatar.png"
|
||||
App.default_avatar = "http://wikiufc.gelsol.org/images/avatar.png"
|
||||
App.color_schemes = [
|
||||
# Default
|
||||
[ "#000", "#069", "#455", "#455" ],
|
||||
|
||||
@@ -7,7 +7,6 @@ required_fields = %w(
|
||||
language
|
||||
max_upload_file_size
|
||||
default_color
|
||||
forum_uri
|
||||
)
|
||||
|
||||
# Carrega as configuracoes personalizadas
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require 'hpricot'
|
||||
require 'icalendar'
|
||||
require 'tzinfo'
|
||||
require 'assert_valid_xhtml'
|
||||
#require 'assert_valid_xhtml'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Carrega as classes Message e LogEntry. O lazy loading do Rails gera
|
||||
# problemas se voce definir varias classes por arquivos.
|
||||
require "app/models/message.rb"
|
||||
require "app/models/log_entry.rb"
|
||||
require "#{RAILS_ROOT}/app/models/message.rb"
|
||||
require "#{RAILS_ROOT}/app/models/log_entry.rb"
|
||||
|
||||
class String
|
||||
def is_numeric?
|
||||
|
||||
@@ -74,8 +74,9 @@ ActionController::Routing::Routes.draw do |map|
|
||||
map.dashboard '/dashboard', :controller => 'users', :action => 'dashboard'
|
||||
|
||||
# Stylesheets
|
||||
map.connect 'stylesheets/:action.:format', :controller => 'stylesheets'
|
||||
map.connect 'stylesheets/themes/:action.:color.:format', :controller => 'stylesheets'
|
||||
|
||||
# Front page
|
||||
map.connect '', :controller => 'courses', :action => 'index'
|
||||
map.index '', :controller => 'courses', :action => 'index'
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ RewriteEngine On
|
||||
RewriteRule ^$ index.html [QSA]
|
||||
RewriteRule ^([^.]+)$ $1.html [QSA]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
|
||||
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
||||
|
||||
# In case Rails experiences terminal errors
|
||||
# Instead of displaying this message you can supply a file here which will be rendered instead
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
events['.color_radio:click'] = function(element, e) {
|
||||
style = document.createElement('link');
|
||||
style.rel = 'Stylesheet';
|
||||
style.href = "/stylesheets/themes/color." + element.value + ".css";
|
||||
style.href = BASE_PATH + "/stylesheets/themes/color." + element.value + ".css";
|
||||
$$('head')[0].appendChild(style);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ events['#show_preview:click'] = function(element, e)
|
||||
{
|
||||
spinner_start("preview");
|
||||
|
||||
new Ajax.Updater('wiki_preview', '/services/preview', {
|
||||
new Ajax.Updater('wiki_preview', BASE_PATH + '/services/preview', {
|
||||
parameters: {
|
||||
text: $$('textarea')[0].value
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user