added subtitle to toics
This commit is contained in:
parent
81870c9412
commit
02bd07d62b
|
@ -52,7 +52,7 @@ class Admin::EPapersController < OrbitAdminController
|
|||
def show
|
||||
@paper = Paper.find(params[:id])
|
||||
@table_fields = [t('e_paper.title'),t('e_paper.topic_name'),t('e_paper.publish_date')]
|
||||
@topics = @paper.topics.all
|
||||
@topics = @paper.topics.asc(:created_at)
|
||||
end
|
||||
|
||||
def send_email_to_subscribers
|
||||
|
|
|
@ -52,14 +52,13 @@ class EPapersController < ApplicationController
|
|||
paper_thumb = !paper.image.nil? && !paper.image.url.nil? ? paper.image.thumb.url : "http://www.placehold.it/400x400/EFEFEF/AAAAAA"
|
||||
paper_full = !paper.image.nil? && !paper.image.url.nil? ? paper.image.url : "http://www.placehold.it/1000x1000/EFEFEF/AAAAAA"
|
||||
topics = paper.topics.asc(:created_at).collect do |topic|
|
||||
desc = ActionView::Base.full_sanitizer.sanitize(topic.content)
|
||||
timg = !topic.image.nil? && !topic.image.url.nil? ? topic.image.thumb.url : "http://www.placehold.it/400x400/EFEFEF/AAAAAA"
|
||||
fimg = !topic.image.nil? && !topic.image.url.nil? ? topic.image.url : "http://www.placehold.it/1000x1000/EFEFEF/AAAAAA"
|
||||
{
|
||||
"link_to_show" => OrbitHelper.url_to_show(topic.to_param) + "?method=showtopic",
|
||||
"episode" => topic.episode,
|
||||
"content" => topic.content,
|
||||
"description" => desc[0..100],
|
||||
"description" => topic.description,
|
||||
"publish_date" => topic.created_at,
|
||||
"image_thumb" => timg,
|
||||
"image_full" => fimg
|
||||
|
|
|
@ -7,6 +7,7 @@ class Topic
|
|||
|
||||
field :episode,as: :slug_title, localize: true
|
||||
field :content, localize: true
|
||||
field :description, localize: true
|
||||
|
||||
belongs_to :paper
|
||||
|
||||
|
|
|
@ -78,6 +78,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sub Title -->
|
||||
<div class="control-group input-subtitle">
|
||||
<label class="control-label muted"><%= t(:subtitle) %></label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.fields_for :subtitle_translations do |f| %>
|
||||
<%= f.text_area locale, rows: 2, class: "input-block-level", value: (@topic.subtitle_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="control-group input-content">
|
||||
<label class="control-label muted"><%= t('e_paper.content') %> (<%= t(locale.to_s) %>)</label>
|
||||
|
|
Loading…
Reference in New Issue