5 Commits
Author SHA1 Message Date
spen 6b2eb0e90c update default_widget field i18n 2014-05-12 11:18:37 +08:00
spen bbda5bcfac fix widget reload_web_links 2014-05-08 14:13:54 +08:00
spen 67640e0fc4 add backend form append note and fix show image 2014-05-02 16:20:06 +08:00
spen 89a472ffb6 fix rss_link 2014-04-28 15:20:56 +08:00
spen b14218e312 ntu osa 2014-04-23 10:37:37 +08:00
5 changed files with 10 additions and 40 deletions

No files matched your search

+2 -7
View File
@@ -16,13 +16,11 @@ class Bulletin
# include Tire::Model::Search
# include Tire::Model::Callbacks
is_impressionable
is_impressionable :counter_cache => { :column_name => :view_count }
field :title, localize: true
field :subtitle, localize: true
field :text, localize: true
field :image_description, localize: true
field :create_user_id
field :update_user_id, :class_name => "User"
@@ -30,6 +28,7 @@ class Bulletin
field :view_count, :type => Integer, :default => 0
field :public, :type => Boolean, :default => true
field :rss_link
field :email_sent, :type => Boolean, :default => false
field :email_sentdate , :type => DateTime
@@ -160,10 +159,6 @@ class Bulletin
User.find(self.email_user_ids) rescue []
end
def view_count
Impression.where(:impressionable_id=>self.id).count
end
protected
# def clean_values
@@ -139,32 +139,7 @@
</label>
</div>
</div>
</div>
</div>
<!-- Image Description -->
<div class="control-group">
<%= f.label t("announcement.image_description"),{:class=>"control-label muted", :func=>"field_label"} %>
<div class="controls add-input">
<div class="add-target">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="image_description_<%= locale %>">
<%= f.fields_for :image_description_translations do |f| %>
<%= f.text_field locale, :value => (@bulletin.image_description_translations[locale] rescue nil), :placeholder=>"#{t("announcement.image_description")}" %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#image_description_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
</div>
</div>
</div>
<div class="image_note"><%= t("announcement.image_note")%></div>
</div>
</div>
@@ -8,11 +8,6 @@
<span><%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %></span>
</div>
</div>
<div class="news_image">
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
<%= link_to image_tag(@bulletin.image.url), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
<span class="image_description"><%= @bulletin.image_description unless @bulletin.image_description.blank? %></span>
</div>
<div class="news_paragraph">
<%= @bulletin.text.html_safe rescue '' %>
</div>
@@ -37,6 +32,11 @@
</div>
</div>
<% end %>
<% unless @bulletin.rss_link.blank? %>
<div>
<%= link_to t('ntu.rss_origin'), @bulletin.rss_link %>
</div>
<% end %>
</div>
<%= share_links(@bulletin, 'announcement') %>
+1 -1
View File
@@ -27,7 +27,7 @@ en:
bulletins: Announcement front-end
search_result: Search result
image: Cover image
image_description: Cover Image Description
image_note: The image will not show in content
link_name: Link Name
new_bulletin_category: New Bulletin Category
picture: Cover Picture
+1 -1
View File
@@ -29,7 +29,7 @@ zh_tw:
bulletins: 公告前台
search_result: 搜尋結果頁
image: 封面圖片
image_description: 封面圖片說明
image_note: 此處上傳的圖片不會在公告內文出現
link_name: 連結名稱
new_bulletin_category: 新增公告類別
picture: 刊頭圖片