From 723a54d68dce91a3d59f97b3013d09bbd9db5855 Mon Sep 17 00:00:00 2001
From: Manuel Cillero
Date: Sat, 4 Jul 2020 00:02:11 +0200
Subject: [PATCH] Actualiza a Redmine 3.4.13 con adaptaciones
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Archivos del código base de Redmine que se modifican para personalizar
la composición de las páginas, el texto de bienvenida y la presentación
de algunos contenidos.
---
README.md | 4 +
app/controllers/wiki_controller.rb | 4 +-
app/helpers/search_helper.rb | 5 +-
app/views/account/login.html.erb | 11 +-
app/views/issues/_changesets.html.erb | 4 +-
app/views/layouts/base.html.erb | 70 ++++++++--
app/views/repositories/_changeset.html.erb | 4 +-
app/views/welcome/index.html.erb | 148 +++++++++++++++++++++
app/views/wiki/show.html.erb | 8 +-
config/locales/en.yml | 38 ++++++
config/locales/es.yml | 46 ++++++-
11 files changed, 311 insertions(+), 31 deletions(-)
diff --git a/README.md b/README.md
index a05439f..2c80be2 100644
--- a/README.md
+++ b/README.md
@@ -156,6 +156,10 @@ suitepro
| +-- /layouts/base.html.erb
| |
| +-- /repositories/_changeset.html.erb
+ | |
+ | +-- /welcome/index.html.erb
+ | |
+ | +-- /wiki/show.html.erb
|
+-- /config/locales/en.yml
| |
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index a28e2bd..134765e 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -42,6 +42,8 @@ class WikiController < ApplicationController
helper :watchers
include Redmine::Export::PDF
+ include ActionView::Helpers::SanitizeHelper
+
# List of pages, sorted alphabetically and by parent (hierarchy)
def index
load_pages_for_index
@@ -107,7 +109,7 @@ class WikiController < ApplicationController
send_data(export, :type => 'text/html', :filename => filename_for_content_disposition("#{@page.title}.html"))
return
elsif params[:format] == 'txt'
- send_data(@content.text, :type => 'text/plain', :filename => filename_for_content_disposition("#{@page.title}.txt"))
+ send_data(strip_tags(@content.text), :type => 'text/plain', :filename => filename_for_content_disposition("#{@page.title}.txt"))
return
end
end
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 8788711..5f8233c 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -18,11 +18,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module SearchHelper
+ include ActionView::Helpers::SanitizeHelper
+
def highlight_tokens(text, tokens)
return text unless text && tokens && !tokens.empty?
re_tokens = tokens.collect {|t| Regexp.escape(t)}
regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE
result = ''
+ text = strip_tags(text)
text.split(regexp).each_with_index do |words, i|
if result.length > 1200
# maximum length of the preview reached
@@ -63,7 +66,7 @@ module SearchHelper
:all_words => params[:all_words], :scope => params[:scope], t => 1)
end
(''.html_safe +
- links.map {|link| content_tag('li', link)}.join(' ').html_safe +
+ links.map {|link| content_tag('li', link)}.join(' ').html_safe +
'
'.html_safe) unless links.empty?
end
end
diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb
index 1440e32..3dd7240 100644
--- a/app/views/account/login.html.erb
+++ b/app/views/account/login.html.erb
@@ -1,27 +1,28 @@
<%= call_hook :view_account_login_top %>
+
<%= l(:label_login) %>
<%= form_tag(signin_path, onsubmit: 'return keepAnchorOnSignIn(this);') do %>
<%= back_url_hidden_field_tag %>
-
+
<%= text_field_tag 'username', params[:username], :tabindex => '1' %>
-
+
<%= password_field_tag 'password', nil, :tabindex => '2' %>
-
+
<% if Setting.openid? %>
<%= text_field_tag "openid_url", nil, :tabindex => '3' %>
<% end %>
-
+
<% if Setting.autologin? %>
<% end %>
-
+
<% end %>
diff --git a/app/views/issues/_changesets.html.erb b/app/views/issues/_changesets.html.erb
index 3bd775c..a407a90 100644
--- a/app/views/issues/_changesets.html.erb
+++ b/app/views/issues/_changesets.html.erb
@@ -13,8 +13,6 @@
<% end %>
<%= authoring(changeset.committed_on, changeset.author) %>
-
+
<% end %>
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index 48ba562..4024b09 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -2,28 +2,31 @@
-
+
<%= html_title %>
-
+
<%= csrf_meta_tag %>
<%= favicon %>
-<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %>
+<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'cookieconsent.min', 'application', 'responsive', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
+<% is_welcome = !User.current.logged? && current_page?(:controller => 'welcome', :action => 'index') %>
+<%= stylesheet_link_tag 'frontpage', :media => 'all' if is_welcome %>
+
<%= javascript_heads %>
+
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
-
+
<%= call_hook :view_layouts_base_body_top %>