diff --git a/app/assets/images/icon_external_link.png b/app/assets/images/icon_external_link.png new file mode 100644 index 00000000..16f9b92d Binary files /dev/null and b/app/assets/images/icon_external_link.png differ diff --git a/app/assets/javascripts/external_links.js b/app/assets/javascripts/external_links.js new file mode 100644 index 00000000..17e9cf2e --- /dev/null +++ b/app/assets/javascripts/external_links.js @@ -0,0 +1,5 @@ +$(document).on('turbolinks:load', function() { + $("a[href^='http://']").attr('target', '_blank'); + $("a[href^='https://']").attr('target', '_blank'); + $("a[href^='//']").attr('target', '_blank'); +}); diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 097605d7..e4119a92 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -27,6 +27,15 @@ body { font-family: Saira, sans-serif; } +a { + &[target=_blank] { + /* TODO: Convertir a base64 para no hacer peticiones extra */ + &:after { + content: image-url('icon_external_link.png'); + } + } +} + $footer-height: 60px; /* Colores */ diff --git a/app/views/sites/_form.haml b/app/views/sites/_form.haml index 579d1a93..e9a008aa 100644 --- a/app/views/sites/_form.haml +++ b/app/views/sites/_form.haml @@ -15,6 +15,7 @@ maxlength: 63 - if invalid? site, :name .invalid-feedback= site.errors.messages[:name].join(', ') + .form-group %h2= f.label :title %p.lead= t('.help.title') @@ -22,6 +23,7 @@ required: true - if invalid? site, :title .invalid-feedback= site.errors.messages[:title].join(', ') + .form-group %h2= f.label :description %p.lead= t('.help.description') @@ -29,6 +31,8 @@ maxlength: 160, minlength: 50, required: true - if invalid? site, :description .invalid-feedback= site.errors.messages[:description].join(', ') + %hr/ + .form-group %h2= t('.design.title') %p.lead= t('.help.design') @@ -51,6 +55,8 @@ - if design.license = link_to t('.design.license'), design.license, target: '_blank', class: 'btn btn-info' + %hr/ + .form-group %h2= t('.licencia.title') %p.lead= t('.help.licencia') @@ -72,6 +78,12 @@ %hr/ + .form-group + %h2= t('.privacidad.title') + %p.lead= sanitize_markdown t('.help.privacidad'), tags: %w[a] + + %hr/ + .form-group %h2= t('.deploys.title') %p.lead= t('.help.deploys') diff --git a/config/locales/en.yml b/config/locales/en.yml index 9b03ef04..602ec0f2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -212,11 +212,17 @@ en: means nobody can use our works without explicit permission. By using licenses, we stablish conditions by which we want to share them.' + privacidad: | + The [privacy policy](https://sutty.nl/en/privacy-policy/) and + [code of conduct](https://sutty.nl/en/code-of-conduct/) inform + your visitors about their privacy and expected conduct of the + site's community. We suggest you use the same documents Sutty + uses. You can modify them as articles after creating the + site. deploys: | Sutty allows you to host your site in different places at the same time. This strategy makes your site available even when some of them become unavailable. - design: title: 'Design' actions: 'Information about this design' @@ -225,6 +231,8 @@ en: licencia: title: 'License for the site and everything in it' url: 'Read the license' + privacidad: + title: 'Privacy policy and code of conduct' deploys: title: 'Where do you want your site to be hosted?' fetch: diff --git a/config/locales/es.yml b/config/locales/es.yml index 5f0e5438..7be2b4d4 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -225,6 +225,15 @@ es: de autore. Esto significa que nadie puede hacer uso de nuestras obras sin permiso explícito. Con las licencias establecemos condiciones bajo las que queremos compartir.' + privacidad: | + Las [políticas de + privacidad](https://sutty.nl/es/politica-de-privacidad/) y + [código de + convivencia](https://sutty.nl/es/codigo-de-convivencia/) + informan a les visitantes qué garantías de privacidad vas a + darles y con qué códigos se va a autogestionar su comunidad. + Sugerimos las mismas que las de Sutty. Una vez creado el + sitio, podrás editarlas como artículos. deploys: | Sutty te permite alojar tu sitio en distintos lugares al mismo tiempo. Esta estrategia facilita que el sitio esté disponible @@ -237,6 +246,8 @@ es: licencia: title: 'Licencia del sitio y todo lo que publiques' url: 'Leer la licencia' + privacidad: + title: Políticas de privacidad y código de convivencia deploys: title: '¿Dónde querés alojar tu sitio?' fetch: