From 7750f183e7242c24ed883ad6ebc1c5640c5451e8 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 2 Dec 2020 20:03:09 +0100 Subject: [PATCH] =?UTF-8?q?Actualiza=20el=20c=C3=B3digo=20con=20personaliz?= =?UTF-8?q?aciones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Archivos que se modifican para personalizar su funcionamiento según los requerimientos de SuitePro. --- app/controllers/wiki_controller.rb | 4 +- app/helpers/search_helper.rb | 3 + app/views/account/login.html.erb | 11 +- app/views/issues/tabs/_changesets.html.erb | 4 +- app/views/layouts/base.html.erb | 77 ++++++++- app/views/repositories/_changeset.html.erb | 4 +- app/views/wiki/show.html.erb | 4 +- config/locales/en.yml | 8 + config/locales/es.yml | 30 ++-- .../app/views/welcome/index.html.slim | 161 +++++++++++++++--- plugins/additionals/config/locales/en.yml | 31 ++++ plugins/additionals/config/locales/es.yml | 55 ++++-- 12 files changed, 326 insertions(+), 66 deletions(-) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 423f94f..33fd849 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -44,6 +44,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 @@ -109,7 +111,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 5ba88a6..5fe4946 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 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/tabs/_changesets.html.erb b/app/views/issues/tabs/_changesets.html.erb index f869a5d..5a1d012 100644 --- a/app/views/issues/tabs/_changesets.html.erb +++ b/app/views/issues/tabs/_changesets.html.erb @@ -16,9 +16,7 @@ :rev => changeset.identifier) %>) <% end %>

-
- <%= format_changeset_comments changeset %> -
+
<%= format_changeset_comments changeset %>
<%= call_hook(:view_issues_history_changeset_bottom, { :changeset => changeset }) %> <% end %> diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 76e23cf..d896e59 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -2,22 +2,27 @@ - + <%= html_title %> - + <%= csrf_meta_tag %> <%= favicon %> -<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'tribute-3.7.3', 'application', 'responsive', :media => 'all' %> +<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'cookieconsent.min', 'tribute-3.7.3', '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 %>
@@ -60,20 +65,32 @@
+
+
+
<%= render_menu :account_menu -%>
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> +
- -
+ +
+ +<%= javascript_tag "$('#scrollup').click(function(){$('html,body').animate({scrollTop:0},600);return false;});" %> + + +
+ + + <%= call_hook :view_layouts_base_body_bottom %> + + + diff --git a/app/views/repositories/_changeset.html.erb b/app/views/repositories/_changeset.html.erb index 393e03e..9b18c02 100644 --- a/app/views/repositories/_changeset.html.erb +++ b/app/views/repositories/_changeset.html.erb @@ -33,9 +33,7 @@ -
- <%= 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/wiki/show.html.erb b/app/views/wiki/show.html.erb index a710496..1c90103 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -61,7 +61,8 @@ <%= render(:partial => "wiki/content", :locals => {:content => @content}) %> -