fix news title list show & widget front show & image prompt

This commit is contained in:
nccu 2015-02-13 18:00:33 +08:00
parent 42daeb733a
commit cac763a816
4 changed files with 34 additions and 16 deletions

View File

@ -29,7 +29,7 @@ class Admin::NewsController < OrbitAdminController
end end
@news_bulletin = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil]) @news_bulletin = NewsBulletin.where(:is_preview.in=>[false,nil])
.order_by(sort) .order_by(sort)
.with_categories(filters("category")) .with_categories(filters("category"))
.with_tags(filters("tag")) .with_tags(filters("tag"))

View File

@ -107,7 +107,7 @@ class NewsController < ApplicationController
def widget def widget
params = OrbitHelper.params params = OrbitHelper.params
!params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:is_top=>"desc",:postdate=>"desc"} !params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:is_top=>"desc",:postdate=>"desc"}
news = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:is_hot => true).is_approved.order_by(sort).filter_by_widget_categories if news.nil? news = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:is_hot => true).can_display.is_approved.order_by(sort).filter_by_widget_categories if news.nil?
page = Page.where(:module => "news").first rescue nil page = Page.where(:module => "news").first rescue nil
ma = ModuleApp.find_by_key("news") rescue nil ma = ModuleApp.find_by_key("news") rescue nil

View File

@ -7,7 +7,7 @@
} }
.thumbnail{ .thumbnail{
width: 310px; width: 310px;
height: 130px; /*height: 130px;*/
} }
.thumbnail img{ .thumbnail img{
width: 100%; width: 100%;
@ -475,7 +475,7 @@
} }
} }
if(!validate){ if(!validate){
alert("請於封面圖片中的頁籤,設定您圖片上傳方式"); alert("您還沒有上傳封面圖片");
fileupload_alert.text("<%= t("news.file_size")%>: "+file_size.toFixed(1)+"MB <%= t("news.file_size_exceed_limitation") %>, <%= t("news.file_size_limit") %>: "+fileupload_size_limit_mb+"MB"); fileupload_alert.text("<%= t("news.file_size")%>: "+file_size.toFixed(1)+"MB <%= t("news.file_size_exceed_limitation") %>, <%= t("news.file_size_limit") %>: "+fileupload_size_limit_mb+"MB");
fileupload_alert.show(); fileupload_alert.show();
$("#basic").removeClass("active"); $("#basic").removeClass("active");

View File

@ -19,13 +19,36 @@
<td><%= b.category.title rescue "" %></td> <td><%= b.category.title rescue "" %></td>
<td> <td>
<% if b.expired? %> <% if b.expired? %>
<%= b.title %> <span class='label'><%= t(:expired) %></span> <% if !b.title_translations["zh_tw"].blank? %>
<%= b.title_translations["zh_tw"] %> <span class='label'><%= t(:expired) %></span><br />
<% end %>
<% if !b.title_translations["en"].blank? %>
<%= b.title_translations["en"] %> <span class='label'><%= t(:expired) %></span>
<% end %>
<% elsif b.rejected %> <% elsif b.rejected %>
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a> <span class='label'><%= t(:rejected) %> : <%= b.rejection_reason rescue "" %></span> <% url = page_for_bulletin(b) %>
<% if !b.title_translations["zh_tw"].blank? %>
<a href="<%= url %>" target="_blank"><%= b.title_translations["zh_tw"] %></a> <span class='label'><%= t(:rejected) %> : <%= b.rejection_reason rescue "" %></span><br />
<% end %>
<% if !b.title_translations["en"].blank? %>
<a href="<%= url %>" target="_blank"><%= b.title_translations["en"] %></a> <span class='label'><%= t(:rejected) %> : <%= b.rejection_reason rescue "" %></span>
<% end %>
<% elsif !b.approved? %> <% elsif !b.approved? %>
<a href="<%=page_for_news_bulletin(b)%>" target="_blank"><%= b.title %></a> <span class='label'><%= t(:pending) %></span> <% url = page_for_news_bulletin(b) %>
<% if !b.title_translations["zh_tw"].blank? %>
<a href="<%= url %>" target="_blank"><%= b.title_translations["zh_tw"] %></a> <span class='label'><%= t(:pending) %></span><br />
<% end %>
<% if !b.title_translations["en"].blank? %>
<a href="<%= url %>" target="_blank"><%= b.title_translations["en"] %></a> <span class='label'><%= t(:pending) %></span>
<% end %>
<% else %> <% else %>
<a href="<%=page_for_news_bulletin(b)%>" target="_blank"><%= b.title %></a> <% url = page_for_news_bulletin(b) %>
<% if !b.title_translations["zh_tw"].blank? %>
<a href="<%= url %>" target="_blank"><%= b.title_translations["zh_tw"] %></a><br />
<% end %>
<% if !b.title_translations["en"].blank? %>
<a href="<%= url %>" target="_blank"><%= b.title_translations["en"] %></a>
<% end %>
<% end %> <% end %>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
@ -91,16 +114,13 @@
<% content_for :page_specific_css do %> <% content_for :page_specific_css do %>
<style> <style>
.img-peview { .img-peview {
height: 50px; width: 100px;
overflow: hidden;
} }
td img{ td img{
width: 100% !Important; max-width: 100% !important;
} }
.popover{ .popover{
width: 310px; width: 310px;
height: 140px;
overflow: hidden;
} }
.popover .arrow { .popover .arrow {
border-bottom-color: #333; border-bottom-color: #333;
@ -108,7 +128,7 @@
display: none; display: none;
} }
.popover img { .popover img {
width: 100%; max-width: 100%;
height: auto; height: auto;
} }
.popover-inner { .popover-inner {
@ -122,8 +142,6 @@
text-align: center; text-align: center;
border-radius: 3px; border-radius: 3px;
padding: 5px; padding: 5px;
height: 125px;
overflow: hidden;
} }
</style> </style>
<% end %> <% end %>