improve customer hompage

This commit is contained in:
soralee 2017-01-10 12:39:59 +09:00
parent b836354e73
commit f77a32ccbe
3 changed files with 50 additions and 104 deletions

View file

@ -11,102 +11,46 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/ng-template" id="custom_notebook_folder_renderer.html">
<div ng-if="node.children == null"
ng-mouseenter="showNoteButton=true"
ng-mouseleave="showNoteButton=false">
<a style="text-decoration: none;" href="#/notebook/{{node.id}}">
<i style="font-size: 10px;" class="icon-doc"/> {{node.name}}
</a>
<a style="text-decoration: none;">
<i style="font-size: 13px; margin-left: 10px; cursor: pointer; text-decoration: none;"
class="fa fa-pencil" ng-show="showNoteButton" ng-click="renameNote(node)"
tooltip-placement="bottom" tooltip="Rename note">
</i>
</a>
<a style="text-decoration: none;">
<i style="font-size: 13px; margin-left: 2px; cursor: pointer; text-decoration: none;"
class="fa fa-eraser" ng-show="showNoteButton" ng-click="clearAllParagraphOutput(node.id)"
tooltip-placement="bottom" tooltip="Clear output">
</i>
</a>
<a style="text-decoration: none;">
<i style="font-size: 13px; margin-left: 2px; cursor: pointer; text-decoration: none;"
class="fa fa-trash-o" ng-show="showNoteButton" ng-click="removeNote(node.id)"
tooltip-placement="bottom" tooltip="Remove note">
</i>
</a>
</div>
<div ng-if="node.children != null">
<div ng-mouseenter="showFolderButton=true"
ng-mouseleave="showFolderButton=false">
<a style="text-decoration: none; cursor: pointer;" ng-click="toggleFolderNode(node)">
<i style="font-size: 10px;" ng-class="node.hidden ? 'icon-folder' : 'icon-folder-alt'" /> {{node.name}}
</a>
<a style="text-decoration: none;">
<i style="font-size: 13px; margin-left: 10px; cursor: pointer; text-decoration: none;"
class="fa fa-pencil" ng-show="showFolderButton" ng-click="renameFolder(node)"
tooltip-placement="bottom" tooltip="Rename folder">
</i>
</a>
</div>
<div ng-if="!node.hidden">
<ul style="list-style-type: none; padding-left:15px;">
<li ng-repeat="node in node.children" ng-include="'custom_notebook_folder_renderer.html'" />
</ul>
</div>
</div>
</script>
<div ng-controller="CustomHomeCtrl as home">
<div class="row">
<div class="col-md-4">
<h4>Notebook
<i ng-class="isReloadingNotes ? 'fa fa-refresh fa-spin' : 'fa fa-refresh'"
ng-style="!isReloadingNotes && {'cursor': 'pointer'}" style="font-size: 13px;"
ng-click="reloadNoteList();"
tooltip-placement="bottom" tooltip="Reload notes from storage">
</i>
</h4>
<div ng-controller="HomeCtrl as home">
<div class="row">
<div class="col-md-4">
<h4>Notebook
<i ng-class="isReloadingNotes ? 'fa fa-refresh fa-spin' : 'fa fa-refresh'"
ng-style="!isReloadingNotes && {'cursor': 'pointer'}" style="font-size: 13px;"
ng-click="reloadNoteList();"
tooltip-placement="bottom" tooltip="Reload notes from storage">
</i>
</h4>
<h5><a href="" data-toggle="modal" data-target="#noteImportModal" style="text-decoration: none;">
<i style="font-size: 15px;" class="fa fa-upload"></i> Import note</a></h5>
<h5><a href="" data-toggle="modal" data-target="#noteNameModal" style="text-decoration: none;">
<i style="font-size: 15px;" class="icon-notebook"></i> Create new note</a></h5>
<ul id="notebook-names">
<li class="filter-names" ng-include="'components/filterNoteNames/filter-note-names.html'"></li>
<li ng-repeat="note in home.notes.list | filter:query.q | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index">
<i style="font-size: 10px;" class="icon-doc"></i>
<a style="text-decoration: none;" href="#/notebook/{{note.id}}">{{note.name}}</a>
</li>
<div ng-if="!query.q || query.q === ''">
<li ng-repeat="node in home.notes.root.children | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index"
ng-include="'custom_notebook_folder_renderer.html'" />
</div>
<div ng-if="query.q">
<li ng-repeat="node in home.notes.flatList | filter:query.q | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index"
ng-include="'custom_notebook_folder_renderer.html'" />
</div>
</ul>
</div>
</div>
<br/><br/><br/>
<ul id="notebook-names">
<li class="filter-names" ng-include="'components/filterNoteNames/filter-note-names.html'"></li>
<div ng-if="!query.q || query.q === ''">
<li ng-repeat="node in home.notes.root.children | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index"
ng-include src="'app/home/home-template.html'" ng-class="notebook_folder_renderer"/>
</div>
<div ng-if="query.q">
<li ng-repeat="node in home.notes.flatList | filter:query.q | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index"
ng-include src="'app/home/home-template.html'" ng-class="notebook_folder_renderer" />
</div>
</ul>
</div>
<br/><br/><br/>
</div>
<!-- Load notebook -->
<div ng-show="home.notebookHome" id="{{currentParagraph.id}}_paragraphColumn_main"
ng-repeat="currentParagraph in home.note.paragraphs"
ng-controller="ParagraphCtrl"
ng-init="init(currentParagraph, home.note)"
ng-class="columnWidthClass(currentParagraph.config.colWidth)"
class="paragraph-col">
<div id="{{currentParagraph.id}}_paragraphColumn"
ng-if="currentParagraph.result"
ng-include src="'app/notebook/paragraph/paragraph.html'"
ng-class="{'paragraph-space box paragraph-margin': !asIframe, 'focused': paragraphFocused}"
ng-hide="currentParagraph.config.tableHide && home.viewOnly">
</div>
</div>
<div ng-show="home.notebookHome" id="{{currentParagraph.id}}_paragraphColumn_main"
ng-repeat="currentParagraph in home.note.paragraphs"
ng-controller="ParagraphCtrl"
ng-init="init(currentParagraph, home.note)"
ng-class="columnWidthClass(currentParagraph.config.colWidth)"
class="paragraph-col">
<div id="{{currentParagraph.id}}_paragraphColumn"
ng-if="currentParagraph.result"
ng-include src="'app/notebook/paragraph/paragraph.html'"
ng-class="{'paragraph-space box paragraph-margin': !asIframe, 'focused': paragraphFocused}"
ng-hide="currentParagraph.config.tableHide && home.viewOnly">
</div>
</div>

View file

@ -34,6 +34,7 @@ function HomeCtrl($scope, noteListDataFactory, websocketMsgSrv, $rootScope, arra
vm.arrayOrderingSrv = arrayOrderingSrv;
vm.notebookHome = false;
vm.noteCustomHome = true;
if ($rootScope.ticket !== undefined) {
vm.staticHome = false;
} else {
@ -46,10 +47,9 @@ function HomeCtrl($scope, noteListDataFactory, websocketMsgSrv, $rootScope, arra
var initHome = function() {
websocketMsgSrv.getHomeNote();
vm.noteCustomHome = false;
};
initHome();
$scope.reloadNoteList = function() {
websocketMsgSrv.reloadAllNotesFromRepo();
$scope.isReloadingNotes = true;
@ -72,6 +72,10 @@ function HomeCtrl($scope, noteListDataFactory, websocketMsgSrv, $rootScope, arra
});
$scope.$on('setNoteContent', function(event, note) {
if (vm.noteCustomHome) {
return;
}
if (note) {
vm.note = note;

View file

@ -18,7 +18,7 @@ limitations under the License.
ng-mouseleave="showNoteButton=false">
<a style="text-decoration: none;" href="#/notebook/{{node.id}}">
<i style="font-size: 10px;"
ng-class="query.q && node.isTrash ? 'fa fa-trash-o' : 'icon-doc'" /> {{noteName(node)}}
ng-class="query.q && node.isTrash ? 'fa fa-trash-o' : 'icon-doc'"></i> {{noteName(node)}}
</a>
<!-- if note is not in trash -->
<a ng-if="!node.isTrash" style="text-decoration: none;">
@ -56,7 +56,7 @@ limitations under the License.
<div ng-mouseenter="showFolderButton=true"
ng-mouseleave="showFolderButton=false">
<a style="text-decoration: none; cursor: pointer;" ng-click="toggleFolderNode(node)">
<i style="font-size: 10px;" ng-class="node.hidden ? 'icon-folder' : 'icon-folder-alt'" /> {{noteName(node)}}
<i style="font-size: 10px;" ng-class="node.hidden ? 'icon-folder' : 'icon-folder-alt'"></i> {{noteName(node)}}
</a>
<a ng-if="!node.isTrash" style="text-decoration: none;">
<i style="margin-left: 10px;"
@ -84,7 +84,7 @@ limitations under the License.
</div>
<div ng-if="!node.hidden">
<ul style="list-style-type: none; padding-left:15px;">
<li ng-repeat="node in node.children" ng-include="'note_renderer.html'" />
<li ng-repeat="node in node.children" ng-include="'note_renderer.html'"></li>
</ul>
</div>
</div>
@ -93,7 +93,7 @@ limitations under the License.
<div ng-mouseenter="showFolderButton=true"
ng-mouseleave="showFolderButton=false">
<a style="text-decoration: none; cursor: pointer;" ng-click="toggleFolderNode(node)">
<i style="font-size: 14px;" class="fa fa-trash-o" /> Trash
<i style="font-size: 14px;" class="fa fa-trash-o"></i> Trash
</a>
<a style="text-decoration: none;">
<i style="margin-left: 10px"
@ -108,14 +108,13 @@ limitations under the License.
</div>
<div ng-if="!node.hidden">
<ul style="list-style-type: none; padding-left:15px;">
<li ng-repeat="node in node.children" ng-include="'note_renderer.html'" />
<li ng-repeat="node in node.children" ng-include="'note_renderer.html'"></li>
</ul>
</div>
</div>
</script>
<!-- HomeCtrl -->
<div ng-controller="HomeCtrl as home">
<div ng-controller="HomeCtrl as home" data-ng-init="initHome()">
<div ng-show="home.staticHome" class="box width-full home">
<div class="zeppelin">
<div class="zeppelin2"></div>
@ -150,11 +149,10 @@ limitations under the License.
</li>
<div ng-if="!query.q || query.q === ''">
<li ng-repeat="node in home.notes.root.children | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index"
ng-include="'note_renderer.html'" />
</div>
ng-include="'note_renderer.html'"></li>
<div ng-if="query.q">
<li ng-repeat="node in home.notes.flatList| filter:query.q | orderBy:home.arrayOrderingSrv.noteListOrdering track by $index"
ng-include="'note_renderer.html'" />
ng-include="'note_renderer.html'"></li>
</div>
</ul>
</div>