mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 23:56:22 +00:00
saltar de secciones con un dropdown
recomendación de la clinica de ux de iff
This commit is contained in:
parent
cf1c3b050c
commit
5b46075d9a
7 changed files with 21 additions and 17 deletions
|
@ -18,6 +18,7 @@
|
||||||
//= require bootstrap/util
|
//= require bootstrap/util
|
||||||
//= require bootstrap/alert
|
//= require bootstrap/alert
|
||||||
//= require bootstrap/tooltip
|
//= require bootstrap/tooltip
|
||||||
|
//= require bootstrap/dropdown
|
||||||
//= require bootstrap-markdown/js/bootstrap-markdown
|
//= require bootstrap-markdown/js/bootstrap-markdown
|
||||||
//= require markdown-it/dist/markdown-it
|
//= require markdown-it/dist/markdown-it
|
||||||
//= require select2/dist/js/select2
|
//= require select2/dist/js/select2
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
$(document).on('turbolinks:load', function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
$('.alert').alert();
|
$('.alert').alert();
|
||||||
$('[data-toggle="tooltip"]').tooltip({ placement: 'auto' });
|
$('[data-toggle="tooltip"]').tooltip({ placement: 'auto' });
|
||||||
|
$('.dropdown-toggle').dropdown();
|
||||||
});
|
});
|
||||||
|
|
|
@ -97,3 +97,7 @@ textarea.post-content {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inline {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
|
@ -26,28 +26,20 @@
|
||||||
= render 'layouts/help', help: t('help.i18n.index')
|
= render 'layouts/help', help: t('help.i18n.index')
|
||||||
|
|
||||||
|
|
||||||
.row
|
#top.row
|
||||||
.col-2
|
|
||||||
%ul.list-group
|
|
||||||
- @site.data.dig(@lang_from).each_pair do |section, content|
|
|
||||||
%li.list-group-item.align-items-center.justify-content-between.d-flex
|
|
||||||
-# https://github.com/turbolinks/turbolinks/issues/75
|
|
||||||
%a{href: "##{section}",
|
|
||||||
title: t('help.i18n.toc'),
|
|
||||||
data: { turbolinks: 'false', toggle: 'tooltip' }}= t("help.i18n.#{section}")
|
|
||||||
-# %span.badge.badge-secondary.badge-pill{data: { toggle: 'tooltip' },
|
|
||||||
title: t('help.i18n.count') }
|
|
||||||
- if content.is_a? String
|
|
||||||
= 1
|
|
||||||
- elsif content.is_a? Array
|
|
||||||
= content.count
|
|
||||||
- elsif content.is_a? Hash
|
|
||||||
= content.map(&:count).inject(&:+)
|
|
||||||
.col
|
.col
|
||||||
|
|
||||||
= form_tag site_i18n_path(@site), method: :post, class: 'form' do
|
= form_tag site_i18n_path(@site), method: :post, class: 'form' do
|
||||||
= hidden_field 'i18n', 'lang_to', value: @lang_to
|
= hidden_field 'i18n', 'lang_to', value: @lang_to
|
||||||
.form-group
|
.form-group
|
||||||
|
.dropdown.inline
|
||||||
|
%button.btn.btn-info.dropdown-toggle{type: 'button',
|
||||||
|
data: { toggle: 'dropdown' },
|
||||||
|
aria: { haspopup: 'true', expanded: 'false' }}
|
||||||
|
= t('i18n.jump')
|
||||||
|
.dropdown-menu{aria: { labelledby: t('i18n.jump') }}
|
||||||
|
- @site.data.dig(@lang_from).each_pair do |section, content|
|
||||||
|
%a.dropdown-item{href: "##{section}"}= t("help.i18n.#{section}")
|
||||||
= submit_tag t('i18n.save'), class: 'btn btn-success'
|
= submit_tag t('i18n.save'), class: 'btn btn-success'
|
||||||
|
|
||||||
= render 'i18n/recursive', data: @site.data.dig(@lang_from), superkeys: []
|
= render 'i18n/recursive', data: @site.data.dig(@lang_from), superkeys: []
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
- unless keys.first == previous_key
|
- unless keys.first == previous_key
|
||||||
%h2{id: keys.first}
|
%h2{id: keys.first}
|
||||||
= t("help.i18n.#{keys.first}")
|
= t("help.i18n.#{keys.first}")
|
||||||
|
%small
|
||||||
|
%a.float-md-right{href: '#top'}= t('help.i18n.top')
|
||||||
- if value.is_a? String
|
- if value.is_a? String
|
||||||
= render 'i18n/text_field', keys: keys, value: value
|
= render 'i18n/text_field', keys: keys, value: value
|
||||||
- elsif value.is_a? Hash
|
- elsif value.is_a? Hash
|
||||||
|
|
|
@ -9,6 +9,7 @@ en:
|
||||||
site. When you enter a new section, you will see the previous ones
|
site. When you enter a new section, you will see the previous ones
|
||||||
and also have a path for where you\'re standing."
|
and also have a path for where you\'re standing."
|
||||||
i18n:
|
i18n:
|
||||||
|
top: 'Back to top'
|
||||||
index: "Here you can edit your site's texts that don't belong to a
|
index: "Here you can edit your site's texts that don't belong to a
|
||||||
post, like its description, sections, buttons... If you change
|
post, like its description, sections, buttons... If you change
|
||||||
languages up there in the title to be the same, you can edit them.
|
languages up there in the title to be the same, you can edit them.
|
||||||
|
@ -118,6 +119,7 @@ en:
|
||||||
save: 'Save'
|
save: 'Save'
|
||||||
change: 'Change'
|
change: 'Change'
|
||||||
translate: 'Translate'
|
translate: 'Translate'
|
||||||
|
jump: 'Jump to section'
|
||||||
translating:
|
translating:
|
||||||
from: 'Translating from'
|
from: 'Translating from'
|
||||||
to: 'into'
|
to: 'into'
|
||||||
|
|
|
@ -9,6 +9,7 @@ es:
|
||||||
Cuando ingreses a una sección, podrás volver a las secciones
|
Cuando ingreses a una sección, podrás volver a las secciones
|
||||||
anteriores y además tener una ruta de donde estás parada.'
|
anteriores y además tener una ruta de donde estás parada.'
|
||||||
i18n:
|
i18n:
|
||||||
|
top: 'Volver al principio'
|
||||||
index: 'Aquí puedes editar todos los textos del sitio que no se
|
index: 'Aquí puedes editar todos los textos del sitio que no se
|
||||||
corresponden con artículos, como la descripción, secciones, textos
|
corresponden con artículos, como la descripción, secciones, textos
|
||||||
de botones... Si cambias los idiomas arriba para que coincidan,
|
de botones... Si cambias los idiomas arriba para que coincidan,
|
||||||
|
@ -120,6 +121,7 @@ es:
|
||||||
translate_into: '. Traducir a'
|
translate_into: '. Traducir a'
|
||||||
change: 'Cambiar'
|
change: 'Cambiar'
|
||||||
translate: 'Traducir'
|
translate: 'Traducir'
|
||||||
|
jump: 'Ir a la sección'
|
||||||
translating:
|
translating:
|
||||||
from: 'Traduciendo desde'
|
from: 'Traduciendo desde'
|
||||||
to: 'a'
|
to: 'a'
|
||||||
|
|
Loading…
Reference in a new issue