Merge branch 'design_team' of https://github.com/Rulingcom/orbit into design_team

Conflicts:
	vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb
This commit is contained in:
Matthew K. Fu JuYuan committed 2012-05-18 18:50:10 +08:00
commit 661fcafe70
32 files changed
+53 -36

No files matched your search

@@ -55,7 +55,6 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
# GET /bulletins/1/edit
def edit
@bulletin_category = BulletinCategory.find(params[:id])
@i18n_variable = @bulletin_category.i18n_variable
@url = panel_announcement_back_end_bulletin_category_path(@bulletin_category)
@@ -45,7 +45,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
if(!is_admin? || !is_manager?)
@bulletins.delete_if{ |bulletin|
bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
bulletin.is_pending == true && ((!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || bulletin.create_user_id!=current_user.id)
}
end
@@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
def show_approval_link(bulletin)
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
by_user = ((bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?)
by_bulletin and by_user
end
@@ -28,7 +28,7 @@
</div>
</div>
</td>
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
<td>
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
@@ -1,7 +1,7 @@
<ul>
<li>
<b><%= t('announcement.category') %></b>
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
</li>
<li>
<b><%= t('announcement.postdate') %></b>
@@ -18,7 +18,7 @@
<% @bulletins.each do |post| %>
<tr>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
</td>
@@ -12,7 +12,7 @@
<% @bulletins.each do |post| %>
<tr>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
</td>
<td><%= post.postdate %></td>
@@ -56,7 +56,6 @@ class Panel::News::BackEnd::NewsBulletinCategorysController < OrbitBackendContro
# GET /news_bulletins/1/edit
def edit
@news_bulletin_category = NewsBulletinCategory.find(params[:id])
@i18n_variable = @news_bulletin_category.i18n_variable
@url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category)
@@ -43,7 +43,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
@link_url = panel_news_back_end_news_bulletins_path
@news_bulletins.delete_if{ |news_bulletin|
news_bulletin.is_pending == true && (!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || news_bulletin.create_user_id!=current_user.id)
news_bulletin.is_pending == true && ((!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || news_bulletin.create_user_id!=current_user.id)
}
@news_bulletin_file = NewsBulletinFile.new
@@ -28,7 +28,7 @@
</div>
</div>
</td>
<td><%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %></td>
<td><%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
<td>
<%= link_to news_bulletin.title[I18n.locale], panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue ''%>
@@ -1,7 +1,7 @@
<ul>
<li>
<b><%= t('news.category') %></b>
<%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %>
<%= @news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] rescue nil %>
</li>
<li>
<b><%= t('news.postdate') %></b>
@@ -38,7 +38,6 @@ class Panel::WebResource::BackEnd::WebLinkCategorysController < OrbitBackendCont
# GET /web_links/1/edit
def edit
@web_link_category = WebLinkCategory.find(params[:id])
@i18n_variable = @web_link_category.i18n_variable
@url = panel_web_resource_back_end_web_link_category_path(@web_link_category)
@@ -19,7 +19,7 @@
</div>
</div>
</td>
<td><%= web_link.web_link_category.i18n_variable[I18n.locale] %></td>
<td><%= web_link.web_link_category.i18n_variable[I18n.locale] rescue nil %></td>
<td>
<%= link_to web_link.name[I18n.locale], panel_web_resource_back_end_web_link_path(web_link) %>
<div class="quick-edit">
@@ -9,7 +9,7 @@
<ul>
<li>
<b><%= t('announcement.category') %></b>
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
</li>
<li>
<b><%= t('announcement.postdate') %></b>
@@ -15,7 +15,7 @@
<% @web_links.each do |post| %>
<tr>
<td><%= post.web_link_category.i18n_variable[I18n.locale] %></td>
<td><%= post.web_link_category.i18n_variable[I18n.locale] rescue nil %></td>
<td>
<%#= link_to post.name[I18n.locale], panel_web_resource_front_end_web_link_path(post) %>
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
@@ -9,7 +9,7 @@
<ul>
<li>
<b><%= t('announcement.category') %></b>
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] %>
<%= @bulletin.bulletin_category.i18n_variable[I18n.locale] rescue nil %>
</li>
<li>
<b><%= t('announcement.postdate') %></b>
@@ -14,7 +14,7 @@
</tr>
<% @web_links.each do |post| %>
<tr>
<td><%= post.web_link_category.i18n_variable[I18n.locale] %></td>
<td><%= post.web_link_category.i18n_variable[I18n.locale] rescue nil %></td>
<td>
<%= link_to post.name[I18n.locale], post.url, {:target => '_blank', :title => post.name[I18n.locale]} %>
</td>
@@ -27,11 +27,13 @@ class Impression
private
def update_impressions_counter_cache
impressionable_class = self.impressionable_type.constantize
if self.referrer
impressionable_class = self.impressionable_type.constantize
if impressionable_class.impressionist_counter_cache_options
resouce = impressionable_class.find(self.impressionable_id)
resouce.try(:update_impressionist_counter_cache)
if impressionable_class.impressionist_counter_cache_options
resouce = impressionable_class.find(self.impressionable_id)
resouce.try(:update_impressionist_counter_cache)
end
end
end
end