博客列表修改

yuanke_1
yuanke 9 years ago
parent 4182bb5fe7
commit 29115bca3a

@ -600,10 +600,11 @@ class AdminController < ApplicationController
#设置个空的数组 以便paginateHelper来分页
@code_work_tests = []
@code_work_tests[tCount-1] = {}
if tCount >= 1
@code_work_tests[tCount-1] = {}
end
@code_work_tests = paginateHelper @code_work_tests,30
@page = (params['page'] || 1).to_i - 1 #1111111111
@page = (params['page'] || 1).to_i - 1
#取出需要的那一页数据
tStart = @page*30

@ -3,6 +3,13 @@ class BlogsController < ApplicationController
before_filter :find_user
def index
@article = BlogComment.new
@topics = @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.updated_on desc")
#分页
@topics = paginateHelper @topics,10
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html {render :layout=>'new_base_user'}
end

File diff suppressed because it is too large Load Diff

@ -51,44 +51,9 @@
<% end %>
<% if topics%>
<% topics.each do |topic| %>
<script>
function expand_reply(container, btnid) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {
btn.data('init', 1);
btn.html('收起回复');
target.show();
} else {
btn.data('init', 0);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
}
function expand_reply_input(id) {
$(id).toggle();
}
$(function () {
sd_create_editor_from_data(<%= topic.id%>, null, "100%", "<%=topic.class.to_s%>");
});
</script>
<% if topic %>
<%= render :partial => 'blogs/article', :locals => {:activity => topic, :user_activity_id => topic.id} %>
<% end %>
<% end %>
<%# if topics.count == 10 %>
<!--<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%#= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>-->
<%# end %>
<%= render :partial => 'blogs/article', :locals => {:topics => topics} %>
<% end%>
</div>
<script type="text/javascript">
$("#show_more_course_topic").mouseover(function () {
$("#more_topic_link").click();

@ -30,7 +30,7 @@
<%= import_ke(enable_at: false, prettify: false) %>
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.updated_on desc"), :page => 0, :user => @user} %>
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @topics, :page => 0, :user => @user} %>
<script type="text/javascript">//侧导航

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users',:media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users','application',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -1497,3 +1497,38 @@ a:hover.Blue-btn{ background:#3598db; color:#fff;}
.box-con h4{ font-size:14px; font-weight: bold; width:450px; text-align:center;}
.box-con{ width:450px; margin:0 auto; text-align:center;}
.box-con-a{ width:170px; margin:0 auto; margin-top:10px;}
/*博客列表界面样式*/
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
.bloglistbox{ min-height:690px;}
.list-h2{ font-size:16px; font-weight:bold; color:#000; border-bottom:2px solid #269ac9; padding-bottom:5px;}
.category{ padding:10px 0; border-bottom:1px solid #ddd;}
.category a,.category span{ float:left; margin-right:5px;}
.grayTxt{ color:#9093a6;}
.sortTxt{ color:#000;}
.sortTxt:hover{ color:#28be6c;}
a.sortupbtn{ background: url(../images/liststyle.png) 0 3px no-repeat; width:12px; height:17px; display:block; margin-right:10px; cursor:pointer;}
a.sortdownbtn{ background: url(../images/liststyle.png) 0 -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:708px;}
a:hover.list-title{ color:#269ac9;}
.c_red{ font-weight:normal; font-size:12px;}
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
.list-file li{ line-height:1.9;}
.list-info span{ margin-left:5px;}
.pages a{ display:block; border:1px solid #d1d1d1; color:#000; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; }
.pages a:hover{ background-color:#269ac9; color:#fff;}
a.pages-big{ width:50px;}
.pages .active{ background-color:#269ac9; color:#fff;}
.pages{width:330px; margin:20px auto 10px;}
/*课程列表界面样式*/
a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;}
a:hover.course-title{ color:#269ac9;}
/*通知列表界面样式*/
a.messages-title{font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:630px;}
a:hover.messages-title{ color:#269ac9;}
.massages-content{ width:710px; color:#424242; max-height:65px; overflow:hidden; margin:10px 0;margin-left:15px; line-height:1.9;}
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
Loading…
Cancel
Save