5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-05 07:36:56 +00:00
This commit is contained in:
f 2019-07-29 15:20:19 -03:00
parent dc726fdbe0
commit bb55551266
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 26 additions and 23 deletions

View file

@ -56,7 +56,7 @@ class PostsController < ApplicationController
# Las usuarias pueden especificar una autora, de la contrario por # Las usuarias pueden especificar una autora, de la contrario por
# defecto es la usuaria actual # defecto es la usuaria actual
if current_user.is_a? Usuaria if @site.usuarie? current_usuarie
@post.update_attributes(author: params[:post][:author]) @post.update_attributes(author: params[:post][:author])
else else
# Todo lo que crean lxs invitadxs es borrador # Todo lo que crean lxs invitadxs es borrador
@ -99,7 +99,7 @@ class PostsController < ApplicationController
@post.update_attributes(repair_nested_params(post_params)) @post.update_attributes(repair_nested_params(post_params))
# Solo las usuarias pueden modificar la autoría # Solo las usuarias pueden modificar la autoría
if current_user.is_a? Usuaria if @site.usuarie? current_usuarie
if params[:post][:author].present? if params[:post][:author].present?
@post.update_attributes(author: params[:post][:author]) @post.update_attributes(author: params[:post][:author])
end end

View file

@ -1,3 +1,5 @@
- tags = %w[h1 h2 h3 h4 h5 h6 p a ul ol li table tr td th tbody thead tfoot em strong sup blockquote cite pre]
.row .row
.col .col
= render 'layouts/breadcrumb', = render 'layouts/breadcrumb',
@ -13,7 +15,8 @@
%p %p
- translations = @post.translations.map do |translation| - translations = @post.translations.map do |translation|
- link_to translation.title, site_post_path(@site, translation, lang: translation.lang) - link_to translation.title,
site_post_path(@site, translation, lang: translation.lang)
= raw translations.join(' / ') = raw translations.join(' / ')
.row .row
@ -25,15 +28,16 @@
.row .row
.col .col
.content{ class: @post.get_front_matter(:dir) } .content{ class: @post.get_front_matter(:dir) }
= sanitized_markdown @post.content, = sanitize_markdown @post.content,
tags: %w[h1 h2 h3 h4 h5 h6 p a ul ol li table tr td th tbody thead tfoot em strong sup blockquote cite pre] tags: tags
-# Representar los datos en una tabla: -#
-# Texto: tal cual en una celda Representar los datos en una tabla:
-# Array: píldoras Texto: tal cual en una celda
-# Array de Hashes: Tabla Array: píldoras
-# Hash: Tabla Array de Hashes: Tabla
-# TODO DRY Hash: Tabla
TODO DRY
%table.table.table-condensed.table-striped.table-responsive %table.table.table-condensed.table-striped.table-responsive
%tbody %tbody
- @post.front_matter.each do |key, data| - @post.front_matter.each do |key, data|
@ -73,8 +77,7 @@
%td= v %td= v
- elsif data.respond_to? :content - elsif data.respond_to? :content
-# Contenido del artículo -# Contenido del artículo
= sanitized_markdown data.content, = sanitize_markdown data.content, tags: tags
tags: %w[h1 h2 h3 h4 h5 h6 p a ul ol li table tr td th tbody thead tfoot em strong sup blockquote cite pre]
- elsif data.respond_to? :strftime - elsif data.respond_to? :strftime
-# Fecha -# Fecha
= data.strftime('%F') = data.strftime('%F')