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) 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) %>

-
- <%= format_changeset_comments changeset %> -
+
<%= format_changeset_comments changeset %>
<% 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 %>
- <% if User.current.logged? || !Setting.login_required? %> -
- <%= format_changeset_comments @changeset %> -
+
<%= format_changeset_comments @changeset %>
<% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %> <%= render :partial => 'related_issues' %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index ba0924a..00cbe94 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,3 +1,5 @@ +<% if User.current.logged? %> +

<%= l(:label_home) %>

@@ -24,3 +26,149 @@ <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :key => User.current.rss_key, :format => 'atom'}, :title => "#{Setting.app_title}: #{l(:label_activity)}") %> <% end %> + +<% else %> + +
<%= text_field_tag 'forcetop', nil, :style => 'display: none;' %> + + +
+
+

SuitePro

+

<%= l(:welcome_suitepro) %>

+ +
+ <%= l(:welcome_discover) %> +
+ + +
+
+
+

A SIMPLE WAY TO GET WORK DONE  ;)

+

<%= raw l(:welcome_suitepro_is_redmine, :suitepro => 'SuitePro', :redmine => 'Redmine') %>

+
+
    +
  • Lorem
  • +
  • Ipsum
  • +
  • Dolor
  • +
+
+
+ + +
+
+
<%= image_tag '/themes/circlepro/images/pic01.jpg' %>
+

<%= raw l(:welcome_spotlight_1_title) %>

+

<%= l(:welcome_spotlight_1_text) %>

+
+
+
+
<%= image_tag '/themes/circlepro/images/pic02.jpg' %>
+

<%= raw l(:welcome_spotlight_2_title) %>

+

<%= l(:welcome_spotlight_2_text) %>

+
+
+
+
<%= image_tag '/themes/circlepro/images/pic03.jpg' %>
+

<%= raw l(:welcome_spotlight_3_title) %>

+

<%= l(:welcome_spotlight_3_text) %>

+
+
+
+ + +
+
+
+

<%= l(:welcome_other_features) %>

+
+
    +
  • +

    <%= l(:welcome_feature_1_title) %>

    +

    <%= l(:welcome_feature_1_text) %>

    +
  • +
  • +

    <%= l(:welcome_feature_2_title) %>

    +

    <%= l(:welcome_feature_2_text) %>

    +
  • +
  • +

    <%= l(:welcome_feature_3_title) %>

    +

    <%= l(:welcome_feature_3_text) %>

    +
  • +
  • +

    <%= l(:welcome_feature_4_title) %>

    +

    <%= l(:welcome_feature_4_text) %>

    +
  • +
  • +

    <%= l(:welcome_feature_5_title) %>

    +

    <%= l(:welcome_feature_5_text) %>

    +
  • +
  • +

    <%= l(:welcome_feature_6_title) %>

    +

    <%= l(:welcome_feature_6_text) %>

    +
  • +
+
+
+ + +
+
+ <%= 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 %> +
+
+
+ + +
+
+
+

<%= l(:welcome_any_questions) %>

+

<%= l(:welcome_please_contact) %>

+
+ +
+
+ +
+ + + + + + + +<% end %> diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index 7e14716..b0f8503 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -31,7 +31,7 @@ <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> <%= '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff', :id => @page.title, :project_id => @page.project, - :version => @content.version) + ')'.html_safe if @content.previous %> - + :version => @content.version) + ')'.html_safe if @content.previous %> - <%= link_to((l(:label_next) + " \xc2\xbb"), :action => 'show', :id => @page.title, :project_id => @page.project, :version => @content.next.version) + " - " if @content.next %> @@ -46,12 +46,13 @@ <%= render(:partial => "wiki/content", :locals => {:content => @content}) %> -