mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 22:41:41 +00:00
estilo de los botones
This commit is contained in:
parent
16d7ae55da
commit
5696e41d03
14 changed files with 70 additions and 100 deletions
|
@ -227,6 +227,26 @@ svg {
|
|||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
background-color: $black;
|
||||
color: $white;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
|
||||
&:hover {
|
||||
color: $white;
|
||||
background-color: $magenta;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: $magenta;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 0.2rem $magenta;
|
||||
}
|
||||
}
|
||||
|
||||
.black-bg {
|
||||
color: $white;
|
||||
background-color: $black;
|
||||
|
@ -246,6 +266,11 @@ svg {
|
|||
color: $black;
|
||||
border: none;
|
||||
|
||||
&:hover {
|
||||
color: $black;
|
||||
background-color: $cyan;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: $cyan;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
.row.align-items-center.justify-content-center.full-height
|
||||
.col-md-10.align-self-center
|
||||
= raw CommonMarker.render_doc(@site.config.dig('welcome', 'message') || t('.welcome')).to_html
|
||||
- welcome = @site.config.dig('welcome', 'message') || t('.welcome')
|
||||
= sanitize_markdown welcome
|
||||
|
||||
.col-md-6.align-self-center
|
||||
-# Copiado y pegado de app/views/devise/registrations/new.haml
|
||||
- resource = resource_name = @invitade
|
||||
= form_for(resource, as: resource_name, url: site_collaborate_path(@site), method: :post) do |f|
|
||||
= form_for(resource, as: resource_name,
|
||||
url: site_collaborate_path(@site),
|
||||
method: :post) do |f|
|
||||
- unless current_usuarie
|
||||
= render 'layouts/flash'
|
||||
.form-group
|
||||
|
@ -15,10 +18,11 @@
|
|||
.form-group
|
||||
= f.label :password
|
||||
- if @minimum_password_length
|
||||
%em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
|
||||
%em
|
||||
= t('devise.shared.minimum_password_length',
|
||||
count: @minimum_password_length)
|
||||
= f.password_field :password, autocomplete: 'new-password',
|
||||
class: 'form-control'
|
||||
|
||||
.form-group
|
||||
- button = @site.config.dig('welcome', 'button')
|
||||
= f.submit t('.submit'), class: 'btn btn-lg btn-primary btn-block', style: (button) ? "background-color: #{button};" : ''
|
||||
= f.submit t('.submit'), class: 'btn btn-lg btn-block'
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
= select_tag 'to',
|
||||
options_for_select(@options, @lang_to),
|
||||
class: 'form-control'
|
||||
= submit_tag t('i18n.translate'), class: 'btn btn-info', name: nil
|
||||
= submit_tag t('i18n.translate'), class: 'btn', name: nil
|
||||
- else
|
||||
= t('i18n.translating.from')
|
||||
= select_tag 'from',
|
||||
|
@ -21,7 +21,7 @@
|
|||
= select_tag 'to',
|
||||
options_for_select(@options, @lang_to),
|
||||
class: 'form-control'
|
||||
= submit_tag t('i18n.change'), class: 'btn btn-info', name: nil
|
||||
= submit_tag t('i18n.change'), class: 'btn', name: nil
|
||||
|
||||
= render 'layouts/help', help: t('help.i18n.index')
|
||||
|
||||
|
@ -33,16 +33,16 @@
|
|||
= hidden_field 'i18n', 'lang_to', value: @lang_to
|
||||
.form-group
|
||||
.dropdown.inline
|
||||
%button.btn.btn-info.dropdown-toggle{type: 'button',
|
||||
%button.btn.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'
|
||||
|
||||
= render 'i18n/recursive', data: @site.data.dig(@lang_from), superkeys: []
|
||||
|
||||
.form-group
|
||||
= submit_tag t('i18n.save'), class: 'btn btn-success'
|
||||
= submit_tag t('i18n.save'), class: 'btn'
|
||||
|
|
|
@ -25,4 +25,4 @@
|
|||
= link_to t('.mutual_aid'), mutual_aid_url(local_channel)
|
||||
%li.nav-item
|
||||
= link_to t('.logout'), destroy_usuarie_session_path,
|
||||
method: :delete, role: 'button', class: 'btn btn-primary'
|
||||
method: :delete, role: 'button', class: 'btn'
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
= link_to text, link, class: "btn btn-#{type || secondary}",
|
||||
= link_to text, link, class: 'btn',
|
||||
data: { toggle: 'tooltip' }, 'aria-role': 'button', title: tooltip
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
.form-group
|
||||
= submit_tag t('.save'), class: 'btn btn-success submit-post'
|
||||
= submit_tag t('.save'), class: 'btn submit-post'
|
||||
-# Permitir guardar como borrador
|
||||
- if post.attributes.include? :draft
|
||||
= submit_tag t('.save_draft'),
|
||||
class: 'btn btn-info submit-post-draft',
|
||||
class: 'btn submit-post-draft',
|
||||
name: 'post[draft]'
|
||||
.invalid_help.alert.alert-danger.d-none
|
||||
= site.config.fetch('invalid_help', t('.invalid_help'))
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
.col
|
||||
.btn-group
|
||||
= link_to t('posts.new'), new_site_post_path(@site),
|
||||
class: 'btn btn-success'
|
||||
class: 'btn'
|
||||
|
||||
.row
|
||||
.col
|
||||
|
@ -50,11 +50,11 @@
|
|||
- if policy(post).edit?
|
||||
= link_to t('posts.edit'),
|
||||
edit_site_post_path(@site, post.id),
|
||||
class: 'btn btn-info'
|
||||
class: 'btn'
|
||||
- if policy(post).destroy?
|
||||
= link_to t('posts.destroy'),
|
||||
site_post_path(@site, post.id),
|
||||
class: 'btn btn-danger',
|
||||
class: 'btn',
|
||||
method: :delete,
|
||||
data: { confirm: t('posts.confirm_destroy') }
|
||||
- else
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
%article.content
|
||||
= link_to t('posts.edit'),
|
||||
edit_site_post_path(@site, @post.id),
|
||||
class: 'btn btn-info btn-block'
|
||||
class: 'btn btn-block'
|
||||
|
||||
%table.table.table-condensed.table-striped.table-responsive
|
||||
%thead
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
-# Crea un contenedor para todos los campos agrupados
|
||||
.field-groups{class: template.key}
|
||||
-# Si es un array de valores, indicar a las usuarias que pueden
|
||||
-# agregar más campos
|
||||
- if template.array?
|
||||
%small.text-muted= t('posts.table')
|
||||
|
||||
-# El grupo individual, tenemos que crear uno si el post es nuevo, o
|
||||
-# todos los que sean necesarios si estamos editando un post.
|
||||
-# Obtenemos todos los valores. Puede ser un Hash o un Array
|
||||
-# Creamos un array con un elemento solo para poder tener acceso a :each
|
||||
- groups = @post.get_front_matter(name)
|
||||
-# TODO volver a revisar cuando get_front_matter() tenga valores por defecto
|
||||
- groups = [{}] unless groups
|
||||
- if groups.is_a? Hash
|
||||
- groups = [ groups ]
|
||||
- groups.each_with_index do |group, i|
|
||||
-# A partir del segundo grupo todos son extra
|
||||
- classes = (i > 0) ? [template.key, 'extra'] : [template.key]
|
||||
.field-group{class: classes.join(' ')}
|
||||
-# Crear el botón de borrado si vamos a tener varias filas.
|
||||
-# Luego por CSS ocultamos el primero.
|
||||
- if template.array?
|
||||
.clearfix
|
||||
%button.btn.btn-warning.btn-sm.pull-right.remove-group{data: { group: template.key }}
|
||||
= fa_icon 'close', title: t('posts.row.del', group: template.key.humanize)
|
||||
= t('posts.row.del', group: template.key.humanize)
|
||||
-# Separar los campos en dos columnas
|
||||
- cols = template.cols || 2
|
||||
- template.nested_fields.each_slice(cols).to_a.each do |col|
|
||||
.form-row{class: "align-items-#{template.align || 'start'}"}
|
||||
- col.each do |nf|
|
||||
- last = template.nested_fields.last == nf
|
||||
- odd = (template.nested_fields.count % cols) != 0
|
||||
%div{class: (nf.nested? || (last && odd)) ? 'col-md-12' : "col-md-#{12/cols}"}
|
||||
-# Si el template es un array, quiere decir que esperamos un array de hashes.
|
||||
-# XXX usamos local_name para hacerlo recursivo y sumar el
|
||||
-# name después, sin modificarlo recursivamente.
|
||||
- if template.array?
|
||||
- local_name = [i.to_s, nf.key]
|
||||
- else
|
||||
- local_name = [nf.key]
|
||||
- if @post.new?
|
||||
- value = nf.values
|
||||
- else
|
||||
-# Si el campo es un array, groups es un array de hashes
|
||||
-# y group un hash. De lo contrarios, groups va a ser un
|
||||
-# Hash
|
||||
-# TODO cambiar por get_front_matter
|
||||
- value = (template.array? || template.nested?) ? group[nf.key] : groups[nf.key]
|
||||
= render 'posts/template_field/nested',
|
||||
template: nf,
|
||||
value: value,
|
||||
name: [name, local_name].flatten
|
||||
.extra-groups
|
||||
- if template.array?
|
||||
.clearfix
|
||||
%button.btn.btn-success.btn-block.add-group{data: { group: template.key }}= t('posts.row.add', group: template.key.humanize)
|
|
@ -51,10 +51,10 @@
|
|||
.btn-group{ role: 'group', 'aria-label': t('.design.actions') }
|
||||
- if design.url
|
||||
= link_to t('.design.url'), design.url,
|
||||
target: '_blank', class: 'btn btn-info'
|
||||
target: '_blank', class: 'btn'
|
||||
- if design.license
|
||||
= link_to t('.design.license'), design.license,
|
||||
target: '_blank', class: 'btn btn-info'
|
||||
target: '_blank', class: 'btn'
|
||||
%hr/
|
||||
|
||||
.form-group
|
||||
|
@ -74,7 +74,7 @@
|
|||
|
||||
.btn-group{ role: 'group', 'aria-label': t('.licencia.actions') }
|
||||
= link_to t('.licencia.url'), licencia.url,
|
||||
target: '_blank', class: 'btn btn-info'
|
||||
target: '_blank', class: 'btn'
|
||||
|
||||
%hr/
|
||||
|
||||
|
@ -94,4 +94,4 @@
|
|||
%hr/
|
||||
|
||||
.form-group
|
||||
= f.submit submit, class: 'btn btn-success'
|
||||
= f.submit submit, class: 'btn btn-lg btn-block'
|
||||
|
|
|
@ -30,4 +30,4 @@
|
|||
.row.justify-content-center
|
||||
.col-md-8
|
||||
= link_to t('.merge.request'), site_pull_path(@site),
|
||||
method: 'post', class: 'btn btn-lg btn-success'
|
||||
method: 'post', class: 'btn btn-lg'
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
= t('sites.title')
|
||||
- if policy(Site).new?
|
||||
= link_to t('sites.new.title'), new_site_path,
|
||||
class: 'btn btn-info'
|
||||
|
||||
= render 'layouts/help', help: t('help.sites.index')
|
||||
class: 'btn'
|
||||
|
||||
%table.table.table-striped.table-condensed
|
||||
%tbody
|
||||
|
@ -33,13 +31,13 @@
|
|||
data: { toggle: 'tooltip' },
|
||||
title: t('help.sites.invitations.accept'),
|
||||
method: :patch,
|
||||
class: 'btn btn-success'
|
||||
class: 'btn'
|
||||
= button_to t('sites.invitations.reject'),
|
||||
site_usuaries_reject_invitation_path(site),
|
||||
data: { toggle: 'tooltip' },
|
||||
title: t('help.sites.invitations.reject'),
|
||||
method: :patch,
|
||||
class: 'btn btn-info'
|
||||
class: 'btn'
|
||||
- else
|
||||
- if policy(site).show?
|
||||
= render 'layouts/btn_with_tooltip',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
= render 'layouts/breadcrumb',
|
||||
crumbs: [link_to(t('sites.index'), sites_path),
|
||||
crumbs: [link_to(t('sites.index.title'), sites_path),
|
||||
@site.name,
|
||||
link_to(t('posts.index'),
|
||||
site_usuaries_path(@site))]
|
||||
|
@ -13,21 +13,21 @@
|
|||
-# Una tabla de usuaries y otra de invitades, con acciones
|
||||
- %i[usuaries invitades].each do |u|
|
||||
%h2
|
||||
= t(".#{u.to_s}")
|
||||
.btn-group{role: 'group', 'aria-label': t('.actions')}
|
||||
= t(".#{u}")
|
||||
.btn-group{ role: 'group', 'aria-label': t('.actions') }
|
||||
- if @policy.invite?
|
||||
= link_to t('.invite'),
|
||||
site_usuaries_invite_path(@site, invite_as: u.to_s),
|
||||
class: 'btn btn-success',
|
||||
class: 'btn',
|
||||
data: { toggle: 'tooltip' },
|
||||
title: t('.help.invite', invite_as: u.to_s)
|
||||
- if policy(Collaboration.new(@site)).collaborate?
|
||||
= link_to t('.public_invite'),
|
||||
site_collaborate_path(@site),
|
||||
class: 'btn btn-info',
|
||||
class: 'btn',
|
||||
data: { toggle: 'tooltip' },
|
||||
title: t('.help.public_invite')
|
||||
%p= t(".help.#{u.to_s}")
|
||||
%p= t(".help.#{u}")
|
||||
%table.table.table-striped.table-condensed
|
||||
%tbody
|
||||
- @site.send(u).each do |cuenta|
|
||||
|
@ -42,28 +42,29 @@
|
|||
- if rol.temporal
|
||||
%span.badge.badge-info= t('.invited')
|
||||
%td
|
||||
.btn-group{role: 'group', 'aria-label': t('.individual_actions')}
|
||||
.btn-group{ role: 'group',
|
||||
aria: { label: t('.individual_actions') } }
|
||||
- if @policy.demote? && @site.usuarie?(cuenta)
|
||||
= link_to t('.demote.text'),
|
||||
site_usuarie_demote_path(@site, cuenta),
|
||||
class: 'btn btn-warning',
|
||||
class: 'btn',
|
||||
data: { toggle: 'tooltip',
|
||||
confirm: t('.demote.confirm')},
|
||||
confirm: t('.demote.confirm') },
|
||||
title: t('.help.demote'),
|
||||
method: :patch
|
||||
- if @policy.promote? && @site.invitade?(cuenta)
|
||||
= link_to t('.promote.text'),
|
||||
site_usuarie_promote_path(@site, cuenta),
|
||||
class: 'btn btn-success',
|
||||
class: 'btn',
|
||||
data: { toggle: 'tooltip',
|
||||
confirm: t('.promote.confirm')},
|
||||
confirm: t('.promote.confirm') },
|
||||
title: t('.help.promote'),
|
||||
method: :patch
|
||||
- if @policy.destroy?
|
||||
= link_to t('.destroy.text'),
|
||||
site_usuarie_path(@site, cuenta),
|
||||
class: 'btn btn-danger',
|
||||
class: 'btn',
|
||||
data: { toggle: 'tooltip',
|
||||
confirm: t('.destroy.confirm')},
|
||||
confirm: t('.destroy.confirm') },
|
||||
title: t('.help.destroy'),
|
||||
method: :delete
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
invite_as: invite_as)
|
||||
= f.text_area :invitaciones, class: 'form-control'
|
||||
.form-group
|
||||
= f.submit t('.submit'), class: 'btn btn-success'
|
||||
= f.submit t('.submit'), class: 'btn'
|
||||
|
|
Loading…
Reference in a new issue