Merge branch 'ouyangxuhua' into szzh

This commit is contained in:
ouyangxuhua 2015-08-12 16:39:15 +08:00
commit 96c4924c89
4 changed files with 26 additions and 4 deletions

View File

@ -86,8 +86,14 @@ class ProjectsController < ApplicationController
@project_pages = Project.project_entities.visible.like(params[:name]).page(params[:page]).per(10)
else
@project_pages = Project.project_entities.visible.page(params[:page] ).per(10)
@project_pages = Project.project_entities.visible.page(params[:page] ).per(10)
end
@projects = @project_pages.order("created_on desc")
@limit = 10#per_page_option
@project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
@project_pages = Paginator.new @project_count, @limit, params['page']
respond_to do |format|
format.html {
render :layout => 'base'

View File

@ -12,6 +12,7 @@
alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)");
<% elsif @state == 3 %>
alert("您已经加入了课程");
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= course.id%>"
<% elsif @state == 4 %>
alert("您加入的课程不存在");
<% elsif @state == 5 %>

View File

@ -104,9 +104,13 @@
</div>
<% end %>
<div class="pagination">
<ul>
<%= pagination_links_full @project_pages, @project_count %>
</ul>
</div>
<%= paginate @project_pages %>
<%#= paginate @project_pages %>

View File

@ -23,8 +23,19 @@
</tr>
<tr>
<td colspan="2">
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
<%= l(:label_x_has_fans,:count=>user.watcher_users.count, :remote => true)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count, :remote => true) %>
<% if User.current.logged?%>
<% if User.current == user%>
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
<%else%>
<%if(user.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>user.id,:target_id=>user.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<% end %>
<% end%>
<% end %>
</td>
</tr>
</table>