guoren/app/views/layouts/_nav.html.erb

92 lines
2.7 KiB
Plaintext
Raw Normal View History

2016-12-22 20:00:08 +08:00
<div class="navbar navbar-fixed-top scroll-hide">
<div class="container-fluid top-bar">
<div class="pull-right">
<ul class="nav navbar-nav pull-right">
<li class="dropdown user hidden-xs"><a data-toggle="dropdown" class="dropdown-toggle" href="/logout">
2016-12-22 20:05:38 +08:00
<img width="34" height="34" src="<%= @user.picurl %>"/><%= @user.name %><b class="caret"></b></a>
2016-12-22 20:00:08 +08:00
<ul class="dropdown-menu">
2016-12-25 16:44:43 +08:00
<li><a href="/profile">
2016-12-22 20:00:08 +08:00
<i class="icon-user"></i>个人设置</a>
</li>
<li><a href="/logout">
<i class="icon-signout"></i>退出</a>
</li>
</ul>
</li>
</ul>
</div>
2016-12-22 20:05:38 +08:00
<a class="logo" href="/main"></a>
2016-12-22 20:00:08 +08:00
<button class="navbar-toggle"><span class="icon-bar"></span><span class="icon-bar"></span><span
class="icon-bar"></span></button>
</div>
<div class="container-fluid main-nav clearfix">
<div class="nav-collapse">
<ul class="nav">
2016-12-22 20:05:38 +08:00
<li class="dropdown">
<a data-toggle="dropdown" href="#">
<span aria-hidden="true" class="se7en-star"></span>随便看看<b class="caret"></b>
</a>
2016-12-22 20:00:08 +08:00
<ul class="dropdown-menu">
2016-12-22 20:05:38 +08:00
<li>
<a href="/main">果仁动态</a>
</li>
2016-12-22 20:00:08 +08:00
<li>
<a href="#">失物信息</a>
</li>
<li>
<a href="#">组团信息</a>
</li>
</ul>
</li>
<li>
2016-12-22 20:05:38 +08:00
<a href="/microposts"><span aria-hidden="true" class="se7en-home"></span>我的动态</a>
2016-12-22 20:00:08 +08:00
</li>
<li>
<a href="/chat">
<span aria-hidden="true" class="se7en-envelope"></span>
私信
<div id="msgNum" class="label label-info">0</div>
</a>
</li>
2016-12-22 20:05:38 +08:00
<li>
<a href="/logout"><span aria-hidden="true" class="se7en-pages"></span>退出</a>
</li>
2016-12-22 20:00:08 +08:00
</ul>
</div>
</div>
</div>
<script>
function addNotifyLable(uniquename) {
var yuandian = '<i class="icon-circle text-success"></i>';
var results = $('.user_name:contains(' + uniquename + ')');
for (var i = 0; i < results.length; i++) {
if ($(results[i]).text() === uniquename) {
$(results[i]).parent().append(yuandian);
}
}
}
function notify() {
$.ajax({
type: 'get',
dataType: 'json',
url: '/notify',
success: function (data, textStatus, jqXHR) {
$("#msgNum"
).text(data["unreaded"]);
}
});
return false;
}
var notify_num_ticker;
$(document).ready(function () {
notify();
notify_num_ticker = setInterval('notify()', 10000);
2016-12-22 20:05:38 +08:00
$("#msg").attr("disabled", true);
2016-12-22 20:00:08 +08:00
});
</script>