Fix bugs and changes for nccu
This commit is contained in:
1 parent
f4d663c67d
commit
f13ebc6c46
20 files changed
+98
-61
No files matched your search
+2
-2
@@ -12,9 +12,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
|
||||
|
||||
date_now = Time.now
|
||||
if params[:bulletin_category_id]
|
||||
@bulletins = Bulletin.where(:bulletin_category_id => params[:bulletin_category_id]).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)
|
||||
@bulletins = Bulletin.where(:bulletin_category_id => params[:bulletin_category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||
else
|
||||
@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)
|
||||
@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(10)
|
||||
end
|
||||
|
||||
get_categorys
|
||||
|
||||
Vendored
+5
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
<%= f.error_messages %>
|
||||
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :image, t('announcement.image') %><br />
|
||||
<%= f.file_field :image %>
|
||||
@@ -140,6 +141,7 @@
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
<<<<<<< HEAD
|
||||
|
||||
<!--Widget start-->
|
||||
<!-- <div id="sub-wiget">
|
||||
@@ -527,4 +529,6 @@
|
||||
<button class="btn btn-success" type="submit">Preview/預覽</button>
|
||||
<button class="btn btn-primary" type="submit">Submit/送出</button>
|
||||
<button class="btn" type="reset">Cancel/取消</button>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
=======
|
||||
>>>>>>> Fix bugs and changes for nccu
|
||||
vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
Vendored
+19
-21
@@ -2,30 +2,28 @@
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= paginate @bulletins %>
|
||||
|
||||
<h1 class="h1"><%= t('bulletin.list_announcement') %></h1>
|
||||
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th><%= t('bulletin.postdate') %></th>
|
||||
<th><%= t('bulletin.category') %></th>
|
||||
<th><%= t('bulletin.title') %></th>
|
||||
</tr>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th><%= t('bulletin.category') %></th>
|
||||
<th><%= t('bulletin.title') %></th>
|
||||
<th><%= t('bulletin.postdate') %></th>
|
||||
</tr>
|
||||
|
||||
<% @bulletins.each do |post| %>
|
||||
<tr>
|
||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %>
|
||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||
</td>
|
||||
<td><%= post.postdate %></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<% @bulletins.each do |post| %>
|
||||
<tr>
|
||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %>
|
||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||
</td>
|
||||
<td><%= post.postdate %></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
|
||||
</table>
|
||||
|
||||
</table>
|
||||
|
||||
<br />
|
||||
<%= paginate @bulletins %>
|
||||
|
||||
Vendored
+22
-8
@@ -1,9 +1,23 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<h1 class="h1"><%= @bulletin.title[I18n.locale] %></h1>
|
||||
<div class="info">
|
||||
<div class="info1">
|
||||
<span class="date"><%= @bulletin.postdate %></span>
|
||||
|
|
||||
<a href="" class="unit"><%= User.find(@bulletin.create_user_id).name %></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news_image">
|
||||
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
|
||||
<%= link_to image_tag(@bulletin.image.url, :size => "320x240"), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
|
||||
</div>
|
||||
<div class="news_paragraph">
|
||||
<%= @bulletin.text[I18n.locale].html_safe %>
|
||||
</div>
|
||||
<div class="fb">
|
||||
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nccu.edu.tw&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=35&appId=263319013700607" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
|
||||
</div>
|
||||
<!--
|
||||
<p id="notice"><%= flash_messages %></p>
|
||||
|
||||
<ul>
|
||||
@@ -25,11 +39,11 @@
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.subtitle') %></b>
|
||||
<%= @bulletin.subtitle[I18n.locale] %>
|
||||
<%= @bulletin.subtitle[I18n.locale].html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('announcement.text') %></b>
|
||||
<%= @bulletin.text[I18n.locale] %>
|
||||
<%= @bulletin.text[I18n.locale].html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
@@ -52,6 +66,6 @@
|
||||
<b><%= t('announcement.最後修改時間') %></b>
|
||||
<%= @bulletin.updated_at.strftime("%Y-%m-%d %H:%I:%S") %>
|
||||
</li>
|
||||
|
||||
-->
|
||||
|
||||
<%#= link_back %>
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
<% if @bulletins and !@bulletins.nil? %>
|
||||
|
||||
<h2 class="topic_title"><%= t('焦點新聞')%></h2>
|
||||
<h2 class="topic_title"><%= t('校園新聞')%></h2>
|
||||
<%= link_to "more+",panel_announcement_front_end_bulletins_path(), :class => "topic_note" %>
|
||||
<div class="topic_prev">previous page</div>
|
||||
<div class="topic_next">next page</div>
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
|
||||
<p id="notice"><%= flash_messages %></p>
|
||||
|
||||
<h2><%= @page_context.page.i18n_variable[I18n.locale] %></h2>
|
||||
<h1 class="h1"><%= @page_context.page.i18n_variable[I18n.locale] rescue nil %></h1>
|
||||
|
||||
<div class="page_content"><%= @page_context.context[I18n.locale].html_safe %></div>
|
||||
<div class="page_content"><%= @page_context.context[I18n.locale].html_safe rescue nil %></div>
|
||||
+2
-2
@@ -14,7 +14,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
|
||||
|
||||
# @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first
|
||||
|
||||
@web_links = WebLink.widget_datas.page(params[:page]).per(5)
|
||||
@web_links = WebLink.widget_datas.page(params[:page]).per(9)
|
||||
|
||||
# get_categorys
|
||||
|
||||
@@ -24,7 +24,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
|
||||
end
|
||||
|
||||
def reload_web_links
|
||||
@web_links = WebLink.widget_datas.page(params[:page]).per(5)
|
||||
@web_links = WebLink.widget_datas.page(params[:page]).per(9)
|
||||
end
|
||||
|
||||
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<ul>
|
||||
<% @web_links.each do |widget| -%>
|
||||
<li><%= link_to widget.name[I18n.locale], widget.url, {:target => '_blank', :title => widget.name[I18n.locale]} %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
|
||||
<div class='pagination'>
|
||||
<%= link_to_previous_page @web_links, 'Previous Page', :params => {:controller => 'widget/web_links', :action => 'reload_web_links'}, :remote => true, :class => 'previous' %>
|
||||
<%= link_to_next_page @web_links, 'Next Page', :params => {:controller => 'widget/web_links', :action => 'reload_web_links'}, :remote => true, :class => 'next' %>
|
||||
</div>
|
||||
+1
@@ -0,0 +1 @@
|
||||
$('#web_links_links').html("<%= j render 'web_links' if @web_links %>")
|
||||
Reference in new issue
Block a user