yan
This commit is contained in:
parent
0c501022fd
commit
c1e780a0f8
|
@ -361,22 +361,10 @@ class ProjectsController < ApplicationController
|
||||||
#Added by young
|
#Added by young
|
||||||
def homework
|
def homework
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
@bids = @project.homeworks.order('deadline DESC')
|
@bids = @project.homeworks.order('deadline')
|
||||||
@bids = @bids.like(params[:name]) if params[:name].present?
|
@bids = @bids.like(params[:name]) if params[:name].present?
|
||||||
@bid_count = @bids.count
|
|
||||||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
|
||||||
|
|
||||||
@offset ||= @bid_pages.reverse_offset
|
@bids = paginateHelper @bids
|
||||||
#@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
|
||||||
unless @offset == 0
|
|
||||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
|
||||||
else
|
|
||||||
limit = @bid_count % @limit
|
|
||||||
if limit == 0
|
|
||||||
limit = 10
|
|
||||||
end
|
|
||||||
@bids = @bids.offset(@offset).limit(limit).all.reverse
|
|
||||||
end
|
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -92,9 +92,6 @@
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<ul>
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||||
<%= pagination_links_full bid_pages %>
|
|
||||||
<ul>
|
|
||||||
</div>
|
</div>
|
|
@ -54,7 +54,6 @@
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<% projects = find_miracle_project(10, 3) %>
|
<% projects = find_miracle_project(10, 3) %>
|
||||||
<% projects.map do |project| %>
|
<% projects.map do |project| %>
|
||||||
<!--<% cache cache_key_for_project(project) do %> -->
|
|
||||||
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
||||||
<div style="float: left;">
|
<div style="float: left;">
|
||||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||||
|
@ -75,7 +74,6 @@
|
||||||
:id => "tooltip-#{project.id}" %>
|
:id => "tooltip-#{project.id}" %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<!--<%end %> -->
|
|
||||||
<% end; reset_cycle %>
|
<% end; reset_cycle %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -88,7 +86,6 @@
|
||||||
<div class="user-message-box-list" style="margin-top: 10px;">
|
<div class="user-message-box-list" style="margin-top: 10px;">
|
||||||
<%activities = find_all_activities%>
|
<%activities = find_all_activities%>
|
||||||
<% activities.each do |event| %>
|
<% activities.each do |event| %>
|
||||||
<!--<% cache cache_key_for_event(event) do %> -->
|
|
||||||
<li style="display: block;height:60px; padding-bottom: 4px;">
|
<li style="display: block;height:60px; padding-bottom: 4px;">
|
||||||
<div class="inner-right" style="float: left; height: 100%; ">
|
<div class="inner-right" style="float: left; height: 100%; ">
|
||||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||||
|
@ -99,7 +96,6 @@
|
||||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<!--<%end %> --><!-- cache -->
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -107,7 +103,6 @@
|
||||||
|
|
||||||
<div class="right" style="float: right; width: 48%; ">
|
<div class="right" style="float: right; width: 48%; ">
|
||||||
<ul class="welcome-message-list">
|
<ul class="welcome-message-list">
|
||||||
<!--<% cache 'forum_links' do %> -->
|
|
||||||
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
|
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
|
||||||
<h3 style="color: rgb(21, 188, 207);">
|
<h3 style="color: rgb(21, 188, 207);">
|
||||||
<strong>贴吧动态</strong>
|
<strong>贴吧动态</strong>
|
||||||
|
@ -115,11 +110,9 @@
|
||||||
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
|
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
|
||||||
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
||||||
</div>
|
</div>
|
||||||
<!--<%end %> -->
|
|
||||||
<div class="welcome-box-list-new memo_activity">
|
<div class="welcome-box-list-new memo_activity">
|
||||||
<% topics = find_new_forum_topics(7) %>
|
<% topics = find_new_forum_topics(7) %>
|
||||||
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
|
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
|
||||||
<!--<% cache cache_key_for_topic(topic) do %> -->
|
|
||||||
<li class="message-brief-intro">
|
<li class="message-brief-intro">
|
||||||
<div class='memo_title text_nowrap'>
|
<div class='memo_title text_nowrap'>
|
||||||
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
||||||
|
@ -139,7 +132,6 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<!--<%end %> --> <!-- cache -->
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue