announcement path error
This commit is contained in:
1 parent
c6048ada82
commit
964d7b6054
10 files changed
+51
-19
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
|
||||
|
||||
date_now = Time.now
|
||||
|
||||
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate)
|
||||
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(1)
|
||||
|
||||
get_categorys
|
||||
end
|
||||
|
||||
@@ -72,7 +72,7 @@ class Bulletin
|
||||
# find(:all, :conditions => {:postdate => {"$lte" => Date.today}, deadline: nil} ).desc( :is_top, :postdate)
|
||||
# where( :postdate.lte => date_now ).where( :deadline => nil ).desc(:is_top, :postdate)
|
||||
# any_of({ :title => "test" },{:deadline => nil, :title => "123"})
|
||||
any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).limit(5)
|
||||
any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate)
|
||||
|
||||
|
||||
end
|
||||
|
||||
Vendored
+6
-6
@@ -33,18 +33,18 @@
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<b><%= t('announcement.link') %></b>
|
||||
<% @bulletin.bulletin_links.each do | blink | %>
|
||||
<%= link_to blink.name, blink.url, :target => '_blank' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.file') %></b>
|
||||
<% @bulletin.bulletin_files.each do | bfile | %>
|
||||
<%= link_to bfile.filetitle, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<% if @bulletin.url? %>
|
||||
<b><%= t('announcement.url') %></b>
|
||||
<%= link_to @bulletin.url, @bulletin.url, :target => '_blank' %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.張貼者') %></b>
|
||||
<%= User.find(@bulletin.create_user_id).name %>
|
||||
</li>
|
||||
|
||||
vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
Vendored
+2
@@ -2,6 +2,8 @@
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= paginate @bulletins %>
|
||||
|
||||
<h1><%= t('bulletin.list_announcement') %></h1>
|
||||
|
||||
|
||||
|
||||
Vendored
+24
-2
@@ -1,13 +1,18 @@
|
||||
|
||||
|
||||
<% if @bulletin and !@bulletin.nil? %>
|
||||
|
||||
<div id="col1" class="col">
|
||||
|
||||
<h1 class="h1 ini_heading col_title"><%= @bulletin.title %></h1>
|
||||
<p class="ini_txt"><%= @bulletin.subtitle %></p>
|
||||
<%= link_to "read more >",panel_announcement_front_end_bulletin_path(@bulletin.id) %>
|
||||
<a class="btn" href="">read more ></a>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% if @bulletins and !@bulletins.nil? %>
|
||||
|
||||
<div id="col2" class="col">
|
||||
<h1 class="h1 ini_heading col_title">news</h1>
|
||||
<ul class="ini_list">
|
||||
@@ -17,4 +22,21 @@
|
||||
</ul>
|
||||
<%= link_to "read more >",panel_announcement_front_end_bulletins_path(), :class => "btn" %>
|
||||
<a class="btn" href="announcement">read more ></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="col2" class="col">
|
||||
<h1 class="h1 ini_heading col_title">news</h1>
|
||||
<ul class="ini_list">
|
||||
<% @bulletins.each do |post| %>
|
||||
<li>
|
||||
<%= image_tag(post.image.url, :size => "160x140") if post.image.file %>
|
||||
<h4><%= post.title %></h4>
|
||||
<%= post.subtitle %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= link_to "read more >",panel_announcement_front_end_bulletins_path(), :class => "btn" %>
|
||||
<a class="btn" href="announcement">read more ></a>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
+5
-3
@@ -5,17 +5,19 @@ Rails.application.routes.draw do
|
||||
namespace :back_end do
|
||||
root :to => "bulletins#index"
|
||||
resources :bulletins
|
||||
resources :bulletin_categorys, :controller => 'bulletin_categorys' do
|
||||
match "quick_edit/:bulletin_category_id" => "bulletin_categorys#quick_edit" ,:as => :quick_edit
|
||||
end
|
||||
resources :bulletin_categorys, :controller => 'bulletin_categorys' do
|
||||
match "quick_edit/:bulletin_category_id" => "bulletin_categorys#quick_edit" ,:as => :quick_edit
|
||||
end
|
||||
end
|
||||
namespace :front_end do
|
||||
root :to => "bulletins#index"
|
||||
resources :bulletins
|
||||
match "show/:id" => "bulletins#show" ,:as => :bulletin
|
||||
end
|
||||
namespace :widget do
|
||||
root :to => "bulletins#index"
|
||||
end
|
||||
end
|
||||
end
|
||||
match "/appfront/*path" => redirect("/panel/*path")
|
||||
end
|
||||
Reference in new issue
Block a user