fix error

This commit is contained in:
Archer Lin 2018-10-04 13:29:27 +08:00
parent b7bb28cec7
commit 40a6273fe5
6 changed files with 17 additions and 4 deletions

View File

@ -78,7 +78,8 @@ class JournalsController < ApplicationController
page: node.page,
text: node.text,
link_to_show: OrbitHelper.url_to_show("#{node.to_param}?list=chapter"),
file: node.file.url
file: (node.file.present? ? node.file.url : ''),
file_class: (node.file.present? ? '' : 'hidden')
}
end
{

View File

@ -10,6 +10,7 @@ class Journal
field :pub_date, type: DateTime
field :author, type: String, localize: true
field :author_description, type: String, localize: true
field :pub_information, localize: true
mount_uploader :cover, ImageUploader

View File

@ -45,8 +45,6 @@
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= render partial: 'form_text_locale', locals: {f: f, node: :title, locale: locale, style: 'long'}%>
<%= render partial: 'form_text_locale', locals: {f: f, node: :author, locale: locale, style: 'long'}%>
<%= render partial: 'form_text_locale', locals: {f: f, node: :author_description, locale: locale, style: 'long'}%>
</div>
<% end %>
@ -54,6 +52,8 @@
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= render partial: 'form_text_locale', locals: {f: f, node: :author, locale: locale, style: 'long'}%>
<%= render partial: 'form_text_area', locals: {f: f, node: :author_description, locale: locale} %>
<%= render partial: 'form_text_area', locals: {f: f, node: :text, locale: locale} %>
</div>
<% end %>

View File

@ -59,6 +59,7 @@
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= render partial: 'form_text_locale', locals: {f: f, node: :author, locale: locale, style: nil} %>
<%= render partial: 'form_text_area', locals: {f: f, node: :pub_information, locale: locale} %>
</div>
<% end %>

View File

@ -0,0 +1,10 @@
<div class="control-group input-title">
<%= f.label node ,t("journal.#{node}"), class: "control-label muted" %>
<%= f.fields_for "#{node}_translations".to_sym do |f| %>
<div class="controls">
<div class="textarea">
<%= f.text_area locale, style: "width:100%", class: 'ckeditor input-block-level', value: (@journal.send("#{node}_translations")[locale] rescue nil) %>
</div>
</div>
<% end %>
</div>

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.version = Journals::VERSION
s.authors = ["Archer Lin"]
s.email = ["twbcs@yahoo.com.tw"]
s.homepage = "no"
s.homepage = "https://github.com/twbcs"
s.summary = "Journals."
s.description = "Description of Journals."
s.license = "MIT"