fix comments bugs and modify some style css
This commit is contained in:
parent
ff5f2f6ea3
commit
6fc7ec9d88
|
@ -37,7 +37,6 @@ module ChatHelper
|
|||
recieve_user: [user.id, chat_with.id])
|
||||
|
||||
if messages.length >= 1
|
||||
p "==================================="
|
||||
messages = messages.order(create_time: :asc)
|
||||
messages.each do |message|
|
||||
if message.send_user == user.id
|
||||
|
|
|
@ -2,7 +2,7 @@ module CommentsHelper
|
|||
def get_micropost_comments micropost_id
|
||||
comments_array = Array.new()
|
||||
micropost = MicroPost.find_by(id: micropost_id)
|
||||
comments = micropost.comments
|
||||
comments = micropost.comments.order(comment_time: :desc)
|
||||
if !comments.empty?
|
||||
comments.each do |com|
|
||||
temp = Hash.new()
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
<!--自定义CSS文件-->
|
||||
<link href="stylesheets/mystyle.css" media="all" rel="stylesheet" type="text/css"/>
|
||||
<!--自定义CSS文件-->
|
||||
|
||||
<!--引入文件-->
|
||||
<link href="stylesheets/bootstrap.min.css" media="all" rel="stylesheet" type="text/css"/>
|
||||
|
@ -71,4 +68,9 @@
|
|||
<script src="javascripts/jquery.sparkline.min.js" type="text/javascript"></script>
|
||||
<script src="javascripts/main.js" type="text/javascript"></script>
|
||||
<script src="javascripts/respond.js" type="text/javascript"></script>
|
||||
|
||||
<!--自定义CSS文件-->
|
||||
<link href="stylesheets/mystyle.css" media="all" rel="stylesheet" type="text/css"/>
|
||||
<!--自定义CSS文件-->
|
||||
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
|
|
@ -112,14 +112,12 @@
|
|||
'src=' +
|
||||
userpic +
|
||||
'/>' +
|
||||
'<div class="profile-details clearfix">' +
|
||||
'<a class="user-name">' +
|
||||
username +
|
||||
'</a>' +
|
||||
'<p class="content">' +
|
||||
'<p>' +
|
||||
comment +
|
||||
'</p>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
return commentElem;
|
||||
|
@ -137,7 +135,7 @@
|
|||
comments.find(".comment").remove();
|
||||
comments.find("p").remove();
|
||||
if (data["comments"].length == 0) {
|
||||
comments.prepend("<p style='text-align: center'>无评论</p>");
|
||||
comments.prepend("<p class='text-center'>无评论</p>");
|
||||
}
|
||||
else {
|
||||
var comments_array = data["comments"];
|
||||
|
@ -168,6 +166,9 @@
|
|||
|
||||
$(".makecomment").bind("keyup", function (e) {
|
||||
var inputText = $(this).val();
|
||||
if ( inputText.length <= 0 ) {
|
||||
return;
|
||||
}
|
||||
var username = "";
|
||||
var userpic = "";
|
||||
var enterObject = $(this);
|
||||
|
@ -181,8 +182,10 @@
|
|||
url: '/newcomment',
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data["username"] && data["userpic"]) {
|
||||
enterObject.parent().children("p").remove();
|
||||
enterObject.before(comment_process(data["username"], data["userpic"], inputText));
|
||||
}
|
||||
$(".makecomment").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
图片
|
||||
</p>
|
||||
<div id="image-upload">
|
||||
上传图片占位符
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Binary file not shown.
6480
log/development.log
6480
log/development.log
File diff suppressed because it is too large
Load Diff
|
@ -37,18 +37,10 @@
|
|||
height: 100px;
|
||||
}
|
||||
|
||||
.col-md-12.text-center {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.form-group .btn {
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.form-group textarea {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.btn.btn-default-outline.btn-block {
|
||||
margin: 3px 0 3px 0px;
|
||||
}
|
||||
|
@ -97,8 +89,8 @@
|
|||
|
||||
.col-lg-4 .widget-container {
|
||||
margin-top: 15px;
|
||||
margin-left: 25px;
|
||||
margin-right: 25px;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.alert.alert-info {
|
||||
|
@ -111,3 +103,19 @@
|
|||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
.col-md-12.text-center {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
#image-upload {
|
||||
text-align: center;
|
||||
}
|
||||
.alert {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/*.social-wrapper .social-container .social-entry .profile-details {*/
|
||||
/*display: none;*/
|
||||
/*}*/
|
Loading…
Reference in New Issue