fix error
This commit is contained in:
parent
b7bb28cec7
commit
40a6273fe5
|
@ -78,7 +78,8 @@ class JournalsController < ApplicationController
|
||||||
page: node.page,
|
page: node.page,
|
||||||
text: node.text,
|
text: node.text,
|
||||||
link_to_show: OrbitHelper.url_to_show("#{node.to_param}?list=chapter"),
|
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
|
end
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@ class Journal
|
||||||
field :pub_date, type: DateTime
|
field :pub_date, type: DateTime
|
||||||
field :author, type: String, localize: true
|
field :author, type: String, localize: true
|
||||||
field :author_description, type: String, localize: true
|
field :author_description, type: String, localize: true
|
||||||
|
field :pub_information, localize: true
|
||||||
|
|
||||||
mount_uploader :cover, ImageUploader
|
mount_uploader :cover, ImageUploader
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
<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: :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>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
@ -54,6 +52,8 @@
|
||||||
|
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
<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} %>
|
<%= render partial: 'form_text_area', locals: {f: f, node: :text, locale: locale} %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
<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_locale', locals: {f: f, node: :author, locale: locale, style: nil} %>
|
||||||
|
<%= render partial: 'form_text_area', locals: {f: f, node: :pub_information, locale: locale} %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -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>
|
|
@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
||||||
s.version = Journals::VERSION
|
s.version = Journals::VERSION
|
||||||
s.authors = ["Archer Lin"]
|
s.authors = ["Archer Lin"]
|
||||||
s.email = ["twbcs@yahoo.com.tw"]
|
s.email = ["twbcs@yahoo.com.tw"]
|
||||||
s.homepage = "no"
|
s.homepage = "https://github.com/twbcs"
|
||||||
s.summary = "Journals."
|
s.summary = "Journals."
|
||||||
s.description = "Description of Journals."
|
s.description = "Description of Journals."
|
||||||
s.license = "MIT"
|
s.license = "MIT"
|
||||||
|
|
Loading…
Reference in New Issue