后台默认显示一个账户
This commit is contained in:
parent
c3ff388274
commit
1ed8cf6558
|
|
@ -11,7 +11,7 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
|||
$scope.bookmarkEditHover = false;
|
||||
$scope.hoverBookmark = null;
|
||||
var menusScope = $('div[ng-controller="menuCtr"]').scope();
|
||||
$scope.showStyle = ($stateParams && $stateParams.showStyle) || (menusScope && menusScope.showStyle); // 显示风格'navigate', 'costomTag', 'card', 'table'
|
||||
$scope.showStyle = 'navigate';
|
||||
const perPageItems = 20;
|
||||
var dialog = null;
|
||||
$scope.totalPages = 0;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ app.factory('dataService', [function() {
|
|||
|
||||
loginMenus: [{
|
||||
uiSref: 'bookmarks',
|
||||
title: '书签'
|
||||
title: '导航'
|
||||
}, {
|
||||
uiSref: 'tags',
|
||||
title: '分类'
|
||||
|
|
@ -35,8 +35,8 @@ app.factory('dataService', [function() {
|
|||
title: '留言'
|
||||
}],
|
||||
notLoginMenus: [{
|
||||
uiSref: '/',
|
||||
title: '首页'
|
||||
uiSref: 'bookmarks',
|
||||
title: '导航'
|
||||
}, {
|
||||
uiSref: 'login',
|
||||
title: '登录'
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
<div class="ui hidden info message js-msg" ng-if="showStyle === 'navigate' && bookmarks.length <= 2">
|
||||
<i class="close icon" ng-click="closeMsg()"></i>
|
||||
<div class="content">
|
||||
<div class="header">系统检测到您好像还没添加过书签哦!
|
||||
</div>
|
||||
<div class="header">系统检测到您好像还没添加过书签哦!</div>
|
||||
<ul class="list">
|
||||
<li>您可以将您的IE浏览器或者谷歌浏览器上面的书签导入系统!<a style="cursor:pointer;" ng-click="addBookmarkbyFile()">现在就去</a>
|
||||
</li>
|
||||
<li>您可以将您的IE浏览器或者谷歌浏览器上面的书签导入系统!<a style="cursor:pointer;" ng-click="addBookmarkbyFile()">现在就去</a></li>
|
||||
<li>您也可以点击菜单栏上面的<i class="add square icon"></i>图标进行添加。也可以使用快捷键:Insert键打开添加页面,再次按Insert键保存书签,Esc取消添加。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui segment js-segment-navigate" ng-if="showStyle === 'navigate'" ng-show="!loadBusy">
|
||||
<div class="ui segment js-segment-navigate" ng-show="!loadBusy">
|
||||
<div class="ui container" ng-repeat="tag in bookmarks" ng-init="tagIndex=$index">
|
||||
<div class="ui grid">
|
||||
<div class="row">
|
||||
|
|
@ -27,13 +25,9 @@
|
|||
ng-repeat="bookmark in tag.bookmarks"
|
||||
ng-click="jumpToUrl(bookmark.url, bookmark.id)"
|
||||
title="{{ bookmark.title }}"
|
||||
id="{{bookmark.id}}">
|
||||
<img
|
||||
class="ui ui middle aligned tiny image bookmarkInfo"
|
||||
ng-src="http://favicon.luchenqun.com/?url={{bookmark.url}}"
|
||||
err-src="./images/default.ico"
|
||||
style="width:16px;height:16px;"
|
||||
ng-click="detailBookmark(bookmark);$event.stopPropagation()">
|
||||
id="{{bookmark.id}}"
|
||||
>
|
||||
<img class="ui ui middle aligned tiny image bookmarkInfo" ng-src="http://favicon.luchenqun.com/?url={{bookmark.url}}" err-src="./images/default.ico" style="width:16px;height:16px;" ng-click="detailBookmark(bookmark);$event.stopPropagation()" />
|
||||
<span>{{ bookmark.title}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -43,120 +37,6 @@
|
|||
<div class="ui divider"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui segment js-segment-costomTag" ng-if="showStyle === 'costomTag'" ng-show="!loadBusy">
|
||||
<div class="ui container">
|
||||
<div class="ui grid">
|
||||
<div class="two wide column js-costomTag-label" ng-repeat="tag in costomTags">
|
||||
<div class="ui small label" ng-class="{green:tag.clicked}" ng-click="updateCostomTagBookmarks(tag.index)">
|
||||
{{ tag.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
<div class="ui five column grid">
|
||||
<div
|
||||
class="column js-costomTag-item"
|
||||
ng-class="{bookmarkNormalHover:bookmarkNormalHover, bookmark:(!bookmarkNormalHover)}"
|
||||
ng-mouseover="bookmarkNormalHover=true; setHoverBookmark(bookmark)"
|
||||
ng-mouseleave="bookmarkNormalHover=false; setHoverBookmark(null)"
|
||||
ng-repeat="bookmark in bookmarks"
|
||||
ng-click="jumpToUrl(bookmark.url, bookmark.id)"
|
||||
title="{{ bookmark.title }}"
|
||||
id="{{bookmark.id}}">
|
||||
<img
|
||||
class="ui ui middle aligned tiny image bookmarkInfo"
|
||||
ng-src="http://favicon.luchenqun.com/?url={{bookmark.url}}"
|
||||
err-src="./images/default.ico"
|
||||
style="width:16px;height:16px;"
|
||||
ng-click="detailBookmark(bookmark);$event.stopPropagation()">
|
||||
<span>{{ bookmark.title}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="ui selectable sortable celled table js-table-bookmarks" ng-if="showStyle === 'table'" ng-show="!loadBusy">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="forbid_sorted">标题</th>
|
||||
<th class="forbid_sorted">链接</th>
|
||||
<th style="width:90px;" ng-class="{descending: order[0], sorted:order[0]}" ng-click="changeOrder(0)" title="点击可对表格进行排序">点击次数</th>
|
||||
<th style="width:100px;" ng-class="{descending: order[1], sorted:order[1]}" ng-click="changeOrder(1)" title="点击可对表格进行排序">创建日期</th>
|
||||
<th style="width:100px;" ng-class="{descending: order[2], sorted:order[2]}" ng-click="changeOrder(2)" title="点击可对表格进行排序">最后点击</th>
|
||||
<th style="width:150px;" class="forbid_sorted">分类</th>
|
||||
<th style="width:88px;" class="forbid_sorted">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="bookmark in bookmarks" id="{{ bookmark.id }}" ng-mouseover="setHoverBookmark(bookmark)" ng-mouseleave="setHoverBookmark(null)">
|
||||
<td>
|
||||
<img class="ui ui middle aligned tiny image" ng-src="http://favicon.luchenqun.com/?url={{bookmark.url}}" err-src="./images/default.ico" style="width:16px;height:16px;cursor:pointer;" ng-click="jumpToUrl(bookmark.url, bookmark.id)">
|
||||
<span ng-click="jumpToUrl(bookmark.url, bookmark.id)" title="{{bookmark.title}}" style="cursor:pointer;">
|
||||
{{ bookmark.title }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span title="{{bookmark.url}} 点击复制链接" ng-click="copy(bookmark.url)" style="cursor:default;">{{ bookmark.url }}</span>
|
||||
</td>
|
||||
<td>{{ bookmark.click_count }}</td>
|
||||
<td>
|
||||
<span title="{{bookmark.created_at}}" class="need_to_be_rendered" data-timeago="{{bookmark.created_at}}"></span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="time{{bookmark.id}}" title="{{bookmark.last_click}}" class="need_to_be_rendered" data-timeago="{{bookmark.last_click}}"></span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="ui label" ng-repeat="tag in bookmark.tags" tag-id="{{ tag.id }}" ng-click="jumpToTags(tag.id)">
|
||||
{{ tag.name }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 1px" ng-src="./images/delete.png" ng-click="delBookmark(bookmark)" title="删除书签">
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 1px" ng-src="./images/edit-bookmark.png" ng-click="editBookmark(bookmark.id)" title="编辑书签">
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 1px" ng-src="./images/detail.png" ng-click="detailBookmark(bookmark)" title="书签详情">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="7">
|
||||
<pagination></pagination>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="ui segment js-segment-card" ng-if="showStyle === 'card'" ng-show="!loadBusy || currentPage>1">
|
||||
<div class="ui five stackable cards" infinite-scroll='loadCardData()' infinite-scroll-immediate-check="false">
|
||||
<div class="card" ng-repeat="bookmark in bookmarks" id="{{bookmark.id}}" ng-mouseover="setHoverBookmark(bookmark)" ng-mouseleave="setHoverBookmark(null)">
|
||||
<div class="content" ng-click="jumpToUrl(bookmark.url, bookmark.id)" style="max-height:70px;cursor:pointer">
|
||||
<div class="description bookmarkTitle">
|
||||
{{bookmark.title}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="image" href="{{ bookmark.url }}" ng-click="jumpToUrl(bookmark.url, bookmark.id)" style="cursor:pointer">
|
||||
<img ng-src="./images/snap/{{bookmark.id}}.png" err-src="./images/default.jpg"/>
|
||||
</div>
|
||||
<div class="extra content tags" style="height:50px;">
|
||||
<div class="ui label" ng-repeat="tag in bookmark.tags" tag-id="{{ tag.id }}" ng-click="jumpToTags(tag.id)">
|
||||
{{ tag.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="extra content" ng-show="!bookmark.edit" style="height:50px;padding-right:2px;padding-left:8px;">
|
||||
<span class="left floated like" style="margin-top:6px;">
|
||||
<img class="ui ui middle aligned tiny image" ng-src="http://favicon.luchenqun.com/?url={{bookmark.url}}" err-src="./images/default.ico" style="width:16px;height:16px;cursor:pointer;" ng-click="jumpToUrl(bookmark.url, bookmark.id)">
|
||||
创建于:
|
||||
<span title="{{bookmark.created_at}}" class="need_to_be_rendered" data-timeago="{{bookmark.created_at}}"></span>
|
||||
<!-- {{ bookmark.created_at }} -->
|
||||
</span>
|
||||
<i class="ellipsis horizontal icon right floated" style="margin-top:8px;" ng-mouseover="bookmark.edit=true;"></i>
|
||||
</div>
|
||||
<div class="extra content" ng-show="bookmark.edit" ng-mouseleave="bookmark.edit=false;" style="height:50px;">
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 8px;margin-top:8px;" ng-src="./images/delete.png" ng-click="delBookmark(bookmark)" title="删除书签">
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 8px;margin-top:8px;" ng-src="./images/edit-bookmark.png" ng-click="editBookmark(bookmark.id)" title="编辑书签">
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 8px;margin-top:8px;" ng-src="./images/copy.png" ng-click="copy(bookmark.url)" title="复制链接">
|
||||
<img class="ui mini spaced image" style="width:16px;height:16px;margin:0 8px;margin-top:8px;" ng-src="./images/detail.png" ng-click="detailBookmark(bookmark)" title="书签详情">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui massive text centered inline loader" ng-class="{active:loadBusy, disabled:!loadBusy}">
|
||||
正在加载中...</div>
|
||||
正在加载中...
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,25 +3,6 @@
|
|||
<a class="item js-single-menu" ng-class="{selected:$index===selectLoginIndex}" style="cursor:default;" ui-sref-opts="{reload: true}" ng-repeat="menu in loginMenus"
|
||||
ui-sref="{{ menu.uiSref }}({searchWord:null})" ng-show="menu.show !== false" js-menu-init>
|
||||
<div>{{ menu.title }}</div>
|
||||
<div class="ui floating simple dropdown icon js-bookmark-dropdown" ng-if="$index==0" ng-click="$event.stopPropagation();">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu js-menu-option">
|
||||
<div class="header">显示方式</div>
|
||||
<div class="divider"></div>
|
||||
<div class="field item js-field-navigate" ng-click="updateShowStyle('navigate')">
|
||||
<div class="ui radio checkbox js-radio-navigate">
|
||||
<input type="radio" name="show-style" checked="">
|
||||
<label>导航</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field item js-field-table" ng-click="updateShowStyle('table')">
|
||||
<div class="ui radio checkbox js-radio-table">
|
||||
<input type="radio" name="show-style">
|
||||
<label>表格</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<div id="js-search" style="width: 1500px;">
|
||||
<div class="ui transparent fluid icon input" style="height: 100%;margin-left: 10px;">
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ api.get('/bookmarks', function(req, res) {
|
|||
res.send(401);
|
||||
return;
|
||||
}
|
||||
var userId = req.session.user.id;
|
||||
var userId = 226; //req.session.user.id;
|
||||
var params = req.query;
|
||||
params.showStyle = params.showStyle || req.session.user.show_style; // 如果没有指定风格,那么用系统风格
|
||||
if (params.showStyle === 'navigate') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue