5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-06 15:05:45 +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
# defecto es la usuaria actual
if current_user.is_a? Usuaria
if @site.usuarie? current_usuarie
@post.update_attributes(author: params[:post][:author])
else
# Todo lo que crean lxs invitadxs es borrador
@ -99,7 +99,7 @@ class PostsController < ApplicationController
@post.update_attributes(repair_nested_params(post_params))
# Solo las usuarias pueden modificar la autoría
if current_user.is_a? Usuaria
if @site.usuarie? current_usuarie
if params[:post][:author].present?
@post.update_attributes(author: params[:post][:author])
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
.col
= render 'layouts/breadcrumb',
@ -13,7 +15,8 @@
%p
- 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(' / ')
.row
@ -25,15 +28,16 @@
.row
.col
.content{ class: @post.get_front_matter(:dir) }
= sanitized_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]
= sanitize_markdown @post.content,
tags: tags
-# Representar los datos en una tabla:
-# Texto: tal cual en una celda
-# Array: píldoras
-# Array de Hashes: Tabla
-# Hash: Tabla
-# TODO DRY
-#
Representar los datos en una tabla:
Texto: tal cual en una celda
Array: píldoras
Array de Hashes: Tabla
Hash: Tabla
TODO DRY
%table.table.table-condensed.table-striped.table-responsive
%tbody
- @post.front_matter.each do |key, data|
@ -73,8 +77,7 @@
%td= v
- elsif data.respond_to? :content
-# Contenido del artículo
= sanitized_markdown data.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]
= sanitize_markdown data.content, tags: tags
- elsif data.respond_to? :strftime
-# Fecha
= data.strftime('%F')