Commit 0290186c authored by Santiago Ramos's avatar Santiago Ramos
Browse files

Mostramos ayuda definida

parent 713ec2a2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ module ApplicationHelper
    otros[:name] ||= "#{objeto}[#{atributo}]"
    if clase == "editor_rico"
      #include_tiny_mce_if_needed
      cadena = "<div class=\"elemento\">".html_safe + rotulo +"<br/>".html_safe + text_area( objeto, atributo , {:disabled => otros[:disabled], :class => "tinymce mceEditor", :type => "d", :name => otros[:name]})
      cadena = "<div class=\"elemento\">".html_safe + rotulo +"<br/>".html_safe + text_area( objeto, atributo , {:disabled => otros[:disabled], :class => "tinymce mceEditor", :type => "d", :name => otros[:name], value: otros[:value]})
      cadena += tinymce_assets
      cadena += tinymce :uploadimage_hint => (@proyecto ? @proyecto.id : 'tinymce_upload'), :language => session[:idioma_seleccionado]
    else
+13 −5
Original line number Diff line number Diff line
@@ -35,15 +35,23 @@
    <% lang_box_style = (lang == I18n.locale.to_s) ? '' : 'display:none;' %>
    <div id="lang_box_<%= lang %>" style="<%= lang_box_style %>">
      <div class="linea">
        <%= texto _("Título de ayuda %{lang}")%{lang: lang.upcase}, "ayuda_idioma[#{lang}]", "titulo", "", {value: @ayuda_idioma[lang].titulo} %>
        <%= texto _("Título") + " (#{lang.upcase})", "ayuda_idioma[#{lang}]", "titulo", "2", {value: @ayuda_idioma[lang].titulo} %>
        <%= texto _("URL") + " (#{lang.upcase})", "ayuda_idioma[#{lang}]", "url", "2", {value: @ayuda_idioma[lang].url} %>
      </div>
      <div class="linea">
        <%= texto _("URL de ayuda %{lang}")%{lang: lang.upcase}, "ayuda_idioma[#{lang}]", "url", "", {value: @ayuda_idioma[lang].url} %>
      </div>
      <div class="linea">
        <%= texto_area _("Texto de ayuda %{lang}")%{lang: lang.upcase}, "ayuda_idioma[#{lang}]", "body", "", {value: @ayuda_idioma[lang].body} %>
        <%= texto_area _("Texto de ayuda") + " (#{lang.upcase})", "ayuda_idioma[#{lang}]", "body", "", {value: @ayuda_idioma[lang].body} %>
      </div>
    </div>
  <% end %>
  <div class="linea">
    <br><br><br>
  </div>
<%= formulario_final %>
<!-- Final formulario -->
<!-- Hasta que no resolvamos el cambio a jquery, no podemos invocar el modal resize to content tras la carga de tinymce y tenemos que hacer esto -->
<div class="linea">
  <br><br><br>
</div>
<div class="linea">
  <br><br><br><br>
</div>
+23 −20
Original line number Diff line number Diff line
@@ -9,13 +9,15 @@ def texto_ayuda ruta
  ruta[:lang] = session[:idioma_seleccionado]
  ayuda = Ayuda.search(ruta)
  puts "------> Texto ayuda para (#{ruta}) "
  if ayuda
    puts "        " + ayuda.inspect
  else
    puts "        NO existe ayuda particular"
  end
  #puts "------------------------> Buscando seccion: " + (params[:seccion] || "nil") + " controlador: " + (params[:controller] || "nil") + " accion: " + (params[:action]||"nil")
  texto = Array.new
  if ayuda
    logger.info "------> Existe ayuda particular para '#{ruta}'"
    texto.push( "<h4>#{ayuda.titulo}</h4>" )
    texto.push( ayuda.body )
    texto.push( "<a href='" + ayuda.url + "' target='_blank'>"+ _("Más info...") + "</a>" ) unless ayuda.url.blank?
  else
    logger.info "------> No existe ayuda particular para '#{ruta}'. Usando ayuda vieja."
    textos_ayuda = case session[:idioma_seleccionado]
      when "pt" then TEXTOS_AYUDA_PT
      when "en" then TEXTOS_AYUDA_EN
@@ -35,6 +37,7 @@ def texto_ayuda ruta
        end
      end
    end
  end
  #puts "--------------> " + texto.inspect
  return texto
end