Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gong
gor
Commits
0290186c
Commit
0290186c
authored
6 years ago
by
Santiago Ramos
Browse files
Options
Downloads
Patches
Plain Diff
Mostramos ayuda definida
parent
713ec2a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/helpers/application_helper.rb
+1
-1
1 addition, 1 deletion
app/helpers/application_helper.rb
app/views/ayuda/_formulario.html.erb
+13
-5
13 additions, 5 deletions
app/views/ayuda/_formulario.html.erb
config/initializers/textos_ayuda.rb
+23
-20
23 additions, 20 deletions
config/initializers/textos_ayuda.rb
with
37 additions
and
26 deletions
app/helpers/application_helper.rb
+
1
−
1
View file @
0290186c
...
@@ -135,7 +135,7 @@ module ApplicationHelper
...
@@ -135,7 +135,7 @@ module ApplicationHelper
otros
[
:name
]
||=
"
#{
objeto
}
[
#{
atributo
}
]"
otros
[
:name
]
||=
"
#{
objeto
}
[
#{
atributo
}
]"
if
clase
==
"editor_rico"
if
clase
==
"editor_rico"
#include_tiny_mce_if_needed
#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_assets
cadena
+=
tinymce
:uploadimage_hint
=>
(
@proyecto
?
@proyecto
.
id
:
'tinymce_upload'
),
:language
=>
session
[
:idioma_seleccionado
]
cadena
+=
tinymce
:uploadimage_hint
=>
(
@proyecto
?
@proyecto
.
id
:
'tinymce_upload'
),
:language
=>
session
[
:idioma_seleccionado
]
else
else
...
...
This diff is collapsed.
Click to expand it.
app/views/ayuda/_formulario.html.erb
+
13
−
5
View file @
0290186c
...
@@ -35,15 +35,23 @@
...
@@ -35,15 +35,23 @@
<%
lang_box_style
=
(
lang
==
I18n
.
locale
.
to_s
)
?
''
:
'display:none;'
%>
<%
lang_box_style
=
(
lang
==
I18n
.
locale
.
to_s
)
?
''
:
'display:none;'
%>
<div
id=
"lang_box_
<%=
lang
%>
"
style=
"
<%=
lang_box_style
%>
"
>
<div
id=
"lang_box_
<%=
lang
%>
"
style=
"
<%=
lang_box_style
%>
"
>
<div
class=
"linea"
>
<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>
<div
class=
"linea"
>
<div
class=
"linea"
>
<%=
texto
_
(
"URL de ayuda %{lang}"
)
%
{
lang:
lang
.
upcase
},
"ayuda_idioma[
#{
lang
}
]"
,
"url"
,
""
,
{
value:
@ayuda_idioma
[
lang
].
url
}
%>
<%=
texto_area
_
(
"Texto de ayuda"
)
+
" (
#{
lang
.
upcase
}
)"
,
"ayuda_idioma[
#{
lang
}
]"
,
"body"
,
""
,
{
value:
@ayuda_idioma
[
lang
].
body
}
%>
</div>
<div
class=
"linea"
>
<%=
texto_area
_
(
"Texto de ayuda %{lang}"
)
%
{
lang:
lang
.
upcase
},
"ayuda_idioma[
#{
lang
}
]"
,
"body"
,
""
,
{
value:
@ayuda_idioma
[
lang
].
body
}
%>
</div>
</div>
</div>
</div>
<%
end
%>
<%
end
%>
<div
class=
"linea"
>
<br><br><br>
</div>
<%=
formulario_final
%>
<%=
formulario_final
%>
<!-- Final formulario -->
<!-- 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>
This diff is collapsed.
Click to expand it.
config/initializers/textos_ayuda.rb
+
23
−
20
View file @
0290186c
...
@@ -9,29 +9,32 @@ def texto_ayuda ruta
...
@@ -9,29 +9,32 @@ def texto_ayuda ruta
ruta
[
:lang
]
=
session
[
:idioma_seleccionado
]
ruta
[
:lang
]
=
session
[
:idioma_seleccionado
]
ayuda
=
Ayuda
.
search
(
ruta
)
ayuda
=
Ayuda
.
search
(
ruta
)
puts
"------> Texto ayuda para (
#{
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")
#puts "------------------------> Buscando seccion: " + (params[:seccion] || "nil") + " controlador: " + (params[:controller] || "nil") + " accion: " + (params[:action]||"nil")
texto
=
Array
.
new
texto
=
Array
.
new
textos_ayuda
=
case
session
[
:idioma_seleccionado
]
if
ayuda
when
"pt"
then
TEXTOS_AYUDA_PT
logger
.
info
"------> Existe ayuda particular para '
#{
ruta
}
'"
when
"en"
then
TEXTOS_AYUDA_EN
texto
.
push
(
"<h4>
#{
ayuda
.
titulo
}
</h4>"
)
else
TEXTOS_AYUDA
texto
.
push
(
ayuda
.
body
)
end
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
else
TEXTOS_AYUDA
end
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]]
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]]
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'info'
])
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'info'
]
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'info'
])
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'info'
]
texto
.
push
(
"<a href='"
+
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'url'
]
+
"' target='_blank'>"
+
_
(
"Más info..."
)
+
"</a>"
)
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'url'
]
texto
.
push
(
"<a href='"
+
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'url'
]
+
"' target='_blank'>"
+
_
(
"Más info..."
)
+
"</a>"
)
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'url'
]
if
ruta
[
:controller
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]]
if
ruta
[
:controller
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]]
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'info'
])
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'info'
]
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'info'
])
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'info'
]
texto
.
push
(
"<a href='"
+
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'url'
]
+
"' target='_blank'>"
+
_
(
"Más info..."
)
+
"</a>"
)
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'url'
]
texto
.
push
(
"<a href='"
+
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'url'
]
+
"' target='_blank'>"
+
_
(
"Más info..."
)
+
"</a>"
)
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'url'
]
if
ruta
[
:action
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]]
if
ruta
[
:action
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
]
&&
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]]
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'rotulo'
])
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'rotulo'
])
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'info'
])
texto
.
push
(
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'info'
])
texto
.
push
(
"<a href='"
+
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'url'
]
+
"' target='_blank'>"
+
_
(
"Más info..."
)
+
"</a>"
)
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'url'
]
texto
.
push
(
"<a href='"
+
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'url'
]
+
"' target='_blank'>"
+
_
(
"Más info..."
)
+
"</a>"
)
if
textos_ayuda
[
'secciones'
][
ruta
[
:section
]][
'controladores'
][
ruta
[
:controller
]][
'acciones'
][
ruta
[
:action
]][
'url'
]
end
end
end
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment