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)
|
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)
|
Kaminari.paginate_array(objects).page(params[:page]).per(10)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ zh_tw:
|
||||||
submit: 送出
|
submit: 送出
|
||||||
sure?: 您肯定嗎?
|
sure?: 您肯定嗎?
|
||||||
update: 更新
|
update: 更新
|
||||||
update: 更新失敗
|
update_failed: 更新失敗
|
||||||
view: 檢視
|
view: 檢視
|
||||||
view_count: 查看次數
|
view_count: 查看次數
|
||||||
yes_: "Yes"
|
yes_: "Yes"
|
||||||
|
|
|
@ -135,6 +135,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
|
|
||||||
@bulletin = Bulletin.new(params[:bulletin])
|
@bulletin = Bulletin.new(params[:bulletin])
|
||||||
|
@bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate
|
||||||
|
|
||||||
@bulletin.create_user_id = current_user.id
|
@bulletin.create_user_id = current_user.id
|
||||||
@bulletin.update_user_id = current_user.id
|
@bulletin.update_user_id = current_user.id
|
||||||
|
@ -243,6 +244,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
|
|
||||||
@bulletin = Bulletin.find(params[:id])
|
@bulletin = Bulletin.find(params[:id])
|
||||||
|
@bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate
|
||||||
|
|
||||||
@bulletin.update_user_id = current_user.id
|
@bulletin.update_user_id = current_user.id
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="upload-picture">
|
<div class="upload-picture">
|
||||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||||
<% if @bulletin.image %>
|
<% if @bulletin.image %>
|
||||||
<%= image_tag @bulletin.image, :width=> "456", :height=>'700' rescue ''%>
|
<%= image_tag @bulletin.image rescue ''%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -136,6 +136,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
|
|
||||||
@news_bulletin = NewsBulletin.new(params[:news_bulletin])
|
@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.create_user_id = current_user.id
|
||||||
@news_bulletin.update_user_id = current_user.id
|
@news_bulletin.update_user_id = current_user.id
|
||||||
|
@ -244,6 +245,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
|
|
||||||
@news_bulletin = NewsBulletin.find(params[:id])
|
@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
|
@news_bulletin.update_user_id = current_user.id
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,10 @@
|
||||||
<div class="upload-picture">
|
<div class="upload-picture">
|
||||||
<!--請程式務必將圖片尺寸加入到行內裡-->
|
<!--請程式務必將圖片尺寸加入到行內裡-->
|
||||||
<% if @news_bulletin.image %>
|
<% if @news_bulletin.image %>
|
||||||
<%= image_tag @news_bulletin.image, :width=> "456", :height=>'700' rescue ''%>
|
<%= image_tag @news_bulletin.image rescue ''%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
<img class="pull-left upload-picture" src="/assets/default-img.png" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="controls file-upload input-prepend">
|
<div class="controls file-upload input-prepend">
|
||||||
<label class="control-label add-on btn" for="input-upload">
|
<label class="control-label add-on btn" for="input-upload">
|
||||||
|
@ -29,6 +28,7 @@
|
||||||
<span id='fu' class="file-name"></span>
|
<span id='fu' class="file-name"></span>
|
||||||
<br>
|
<br>
|
||||||
<input name='fu' class="input-medium" type="text">
|
<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>
|
<br>
|
||||||
<% if @news_bulletin.image.file %>
|
<% if @news_bulletin.image.file %>
|
||||||
<%= f.check_box :remove_image %>
|
<%= f.check_box :remove_image %>
|
||||||
|
|
Reference in New Issue