Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b2eb0e90c | ||
|
|
bbda5bcfac | ||
|
|
67640e0fc4 | ||
|
|
89a472ffb6 | ||
|
|
b14218e312 |
No files matched your search
+2
-14
@@ -16,7 +16,7 @@ class Bulletin
|
|||||||
# include Tire::Model::Search
|
# include Tire::Model::Search
|
||||||
# include Tire::Model::Callbacks
|
# include Tire::Model::Callbacks
|
||||||
|
|
||||||
is_impressionable
|
is_impressionable :counter_cache => { :column_name => :view_count }
|
||||||
|
|
||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :subtitle, localize: true
|
field :subtitle, localize: true
|
||||||
@@ -28,6 +28,7 @@ class Bulletin
|
|||||||
field :view_count, :type => Integer, :default => 0
|
field :view_count, :type => Integer, :default => 0
|
||||||
|
|
||||||
field :public, :type => Boolean, :default => true
|
field :public, :type => Boolean, :default => true
|
||||||
|
field :rss_link
|
||||||
|
|
||||||
field :email_sent, :type => Boolean, :default => false
|
field :email_sent, :type => Boolean, :default => false
|
||||||
field :email_sentdate , :type => DateTime
|
field :email_sentdate , :type => DateTime
|
||||||
@@ -44,8 +45,6 @@ class Bulletin
|
|||||||
|
|
||||||
validates :title, :at_least_one => true
|
validates :title, :at_least_one => true
|
||||||
|
|
||||||
validate :image_size
|
|
||||||
|
|
||||||
# def to_indexed_json
|
# def to_indexed_json
|
||||||
# self.to_json
|
# self.to_json
|
||||||
# end
|
# end
|
||||||
@@ -160,10 +159,6 @@ class Bulletin
|
|||||||
User.find(self.email_user_ids) rescue []
|
User.find(self.email_user_ids) rescue []
|
||||||
end
|
end
|
||||||
|
|
||||||
def view_count
|
|
||||||
Impression.where(:impressionable_id=>self.id).count
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
# def clean_values
|
# def clean_values
|
||||||
@@ -173,12 +168,5 @@ class Bulletin
|
|||||||
# self.tag_ids.delete('')
|
# self.tag_ids.delete('')
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def image_size
|
|
||||||
if self.image.size > 500.kilobyte
|
|
||||||
errors.add( :image, I18n.t("announcement.image_limit"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="image_note"><br /><%= t("announcement.image_note")%><br /><%= t("announcement.image_size_note")%></div>
|
<div class="image_note"><%= t("announcement.image_note")%></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% unless @bulletin.rss_link.blank? %>
|
||||||
|
<div>
|
||||||
|
<%= link_to t('ntu.rss_origin'), @bulletin.rss_link %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= share_links(@bulletin, 'announcement') %>
|
<%= share_links(@bulletin, 'announcement') %>
|
||||||
@@ -28,8 +28,6 @@ en:
|
|||||||
search_result: Search result
|
search_result: Search result
|
||||||
image: Cover image
|
image: Cover image
|
||||||
image_note: The image will not show in content
|
image_note: The image will not show in content
|
||||||
image_size_note: Limited to 500KB
|
|
||||||
image_limit: Image upload size is limited to 500KB
|
|
||||||
link_name: Link Name
|
link_name: Link Name
|
||||||
new_bulletin_category: New Bulletin Category
|
new_bulletin_category: New Bulletin Category
|
||||||
picture: Cover Picture
|
picture: Cover Picture
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ zh_tw:
|
|||||||
search_result: 搜尋結果頁
|
search_result: 搜尋結果頁
|
||||||
image: 封面圖片
|
image: 封面圖片
|
||||||
image_note: 此處上傳的圖片不會在公告內文出現
|
image_note: 此處上傳的圖片不會在公告內文出現
|
||||||
image_size_note: 系統限制上傳500k以下的圖片
|
|
||||||
image_limit: 圖片上傳容量限制為500kB
|
|
||||||
link_name: 連結名稱
|
link_name: 連結名稱
|
||||||
new_bulletin_category: 新增公告類別
|
new_bulletin_category: 新增公告類別
|
||||||
picture: 刊頭圖片
|
picture: 刊頭圖片
|
||||||
|
|||||||
Reference in new issue
Block a user