Order list by created_at desc
Add best image size in news new
This commit is contained in:
parent
eab82269c1
commit
7c44e94285
|
@ -155,7 +155,7 @@ class OrbitBackendController< ApplicationController
|
|||
|
||||
|
||||
def get_viewable(object_class)
|
||||
objects = get_objects(object_class)
|
||||
objects = get_objects(object_class).order_by(:created_at, :desc)
|
||||
Kaminari.paginate_array(objects).page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ zh_tw:
|
|||
submit: 送出
|
||||
sure?: 您肯定嗎?
|
||||
update: 更新
|
||||
update: 更新失敗
|
||||
update_failed: 更新失敗
|
||||
view: 檢視
|
||||
view_count: 查看次數
|
||||
yes_: "Yes"
|
||||
|
|
|
@ -135,6 +135,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
else
|
||||
|
||||
@bulletin = Bulletin.new(params[:bulletin])
|
||||
@bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate
|
||||
|
||||
@bulletin.create_user_id = current_user.id
|
||||
@bulletin.update_user_id = current_user.id
|
||||
|
@ -243,6 +244,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
else
|
||||
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
@bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate
|
||||
|
||||
@bulletin.update_user_id = current_user.id
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="upload-picture">
|
||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||
<% if @bulletin.image %>
|
||||
<%= image_tag @bulletin.image, :width=> "456", :height=>'700' rescue ''%>
|
||||
<%= image_tag @bulletin.image rescue ''%>
|
||||
<% else %>
|
||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||
<% end %>
|
||||
|
|
|
@ -136,6 +136,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
|||
else
|
||||
|
||||
@news_bulletin = NewsBulletin.new(params[:news_bulletin])
|
||||
@news_bulletin.deadline = nil if @news_bulletin.deadline < @news_bulletin.postdate
|
||||
|
||||
@news_bulletin.create_user_id = current_user.id
|
||||
@news_bulletin.update_user_id = current_user.id
|
||||
|
@ -244,6 +245,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
|||
else
|
||||
|
||||
@news_bulletin = NewsBulletin.find(params[:id])
|
||||
@news_bulletin.deadline = nil if @news_bulletin.deadline < @news_bulletin.postdate
|
||||
|
||||
@news_bulletin.update_user_id = current_user.id
|
||||
|
||||
|
|
|
@ -15,11 +15,10 @@
|
|||
<div class="upload-picture">
|
||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||
<% if @news_bulletin.image %>
|
||||
<%= image_tag @news_bulletin.image, :width=> "456", :height=>'700' rescue ''%>
|
||||
<%= image_tag @news_bulletin.image rescue ''%>
|
||||
<% else %>
|
||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="controls file-upload input-prepend">
|
||||
<label class="control-label add-on btn" for="input-upload">
|
||||
|
@ -29,6 +28,7 @@
|
|||
<span id='fu' class="file-name"></span>
|
||||
<br>
|
||||
<input name='fu' class="input-medium" type="text">
|
||||
<span class="alert widgetInfo"><%= t("admin.ad.widget_info_for_ad_image_size", :best_size=> "290px x 150px") %></span>
|
||||
<br>
|
||||
<% if @news_bulletin.image.file %>
|
||||
<%= f.check_box :remove_image %>
|
||||
|
|
Reference in New Issue