diff --git a/vipra-ui/app/html/articles/index.html b/vipra-ui/app/html/articles/index.html index 7757ce3ec73bb1049a88c45aaaf8304ca22677bd..4a4f3cf2d2aee87c6b164fbc4895c894860e725b 100644 --- a/vipra-ui/app/html/articles/index.html +++ b/vipra-ui/app/html/articles/index.html @@ -40,6 +40,12 @@ <article-link article="::article"/> </td> </tr> + <tr ng-show="loadingArticles"> + <td>Loading...</td> + </tr> + <tr ng-show="!loadingArticles&&!articles.length"> + <td>No Articles</td> + </tr> </tbody> </table> <div class="panel-footer"> diff --git a/vipra-ui/app/html/articles/show.html b/vipra-ui/app/html/articles/show.html index f9d3cc1e7df75c61981403375e5c9736e13a23f3..3a676eaa2c0881486fda5713f193632c14f32c1c 100644 --- a/vipra-ui/app/html/articles/show.html +++ b/vipra-ui/app/html/articles/show.html @@ -174,6 +174,7 @@ </div> </div> </div> + <div class="loading" ng-hide="article">Loading...</div> </div> </div> <div ng-cloak ui-view></div> diff --git a/vipra-ui/app/html/entities/index.html b/vipra-ui/app/html/entities/index.html index ba03287836eb58b78bcd99a8a32d17e250e731b7..233a0b95cb4ef385a676aa6e8de6f24f900b303b 100644 --- a/vipra-ui/app/html/entities/index.html +++ b/vipra-ui/app/html/entities/index.html @@ -37,6 +37,12 @@ <entity-link entity="::entity" /> </td> </tr> + <tr ng-show="loadingEntities"> + <td>Loading...</td> + </tr> + <tr ng-show="!loadingEntities&&!entities.length"> + <td>No Entities</td> + </tr> </tbody> </table> <div class="panel-footer"> diff --git a/vipra-ui/app/html/entities/show.html b/vipra-ui/app/html/entities/show.html index 4330f3ed3e144c1ad9b801ddf0fe781a0528c17e..3d0a10a34aa001c087e9798ef685fe4b6f5c54d0 100644 --- a/vipra-ui/app/html/entities/show.html +++ b/vipra-ui/app/html/entities/show.html @@ -50,6 +50,7 @@ <p class="text-muted" ng-hide="entity.types.length">No types</p> </div> </div> + <div class="loading" ng-hide="entity">Loading...</div> </div> </div> <div ng-cloak ui-view></div> \ No newline at end of file diff --git a/vipra-ui/app/html/explorer.html b/vipra-ui/app/html/explorer.html index ef29ffe7c102cb3aff71f69626d601ef2674b42c..8058d7f5c6cca5471721bc1011abb788cfb14134 100644 --- a/vipra-ui/app/html/explorer.html +++ b/vipra-ui/app/html/explorer.html @@ -35,7 +35,10 @@ <span class="colorbox" style="background:{{::topic.color}}" bs-popover popover-title="{{topic.name}}" popover-template="partials/topic-popover.html" popover-delay="500"></span> </div> </li> - <li ng-hide="topics.length > 0"> + <li ng-show="!topics"> + <p class="text-muted text-center">Loading...</p> + </li> + <li ng-show="topics&&!topics.length"> <p class="text-muted text-center">No topics</p> </li> </ul> @@ -125,6 +128,12 @@ <article-link article="::article" /> </td> </tr> + <tr ng-show="loadingArticles"> + <td>Loading...</td> + </tr> + <tr ng-show="!loadingArticles&&!articles.length"> + <td>No Articles</td> + </tr> </tbody> </table> <div class="panel-footer"> diff --git a/vipra-ui/app/html/index.html b/vipra-ui/app/html/index.html index 2cca09e34663d1c30b5430e6fde19d8c710e42e4..9d6feb29b48e673c174c8d2f33769580ce583c56 100644 --- a/vipra-ui/app/html/index.html +++ b/vipra-ui/app/html/index.html @@ -45,14 +45,16 @@ <ul class="list-unstyled"> <article-link article="::article" badge="false" menu="false" excerpt="false" ng-repeat="article in latestArticles"/> </ul> - <p class="text-center" ng-if="!latestArticles.length">No articles</p> + <p class="text-center" ng-if="!latestArticles">Loading...</p> + <p class="text-center" ng-if="latestArticles&&!latestArticles.length">No Articles</p> </div> <div class="col-md-4 text-center"> <h4>Latest topics</h4> <ul class="list-unstyled"> <topic-link topic="::topic" badge="false" menu="false" ng-repeat="topic in latestTopics"/> </ul> - <p class="text-center" ng-if="!latestTopics.length">No topics</p> + <p class="text-center" ng-if="!latestTopics">Loading...</p> + <p class="text-center" ng-if="latestTopics&&!latestTopics.length">No Topics</p> </div> </div> </div> diff --git a/vipra-ui/app/html/topics/index.html b/vipra-ui/app/html/topics/index.html index d9e3b962839993ebb690cd659996196d849c2e15..08de6287cc4987ad6c8fadcdc4fbff2bbcf37e38 100644 --- a/vipra-ui/app/html/topics/index.html +++ b/vipra-ui/app/html/topics/index.html @@ -39,6 +39,12 @@ <topic-link topic="::topic" /> </td> </tr> + <tr ng-show="loadingTopics"> + <td>Loading...</td> + </tr> + <tr ng-show="!loadingTopics&&!topics.length"> + <td>No Topics</td> + </tr> </tbody> </table> <div class="panel-footer"> diff --git a/vipra-ui/app/html/topics/show.html b/vipra-ui/app/html/topics/show.html index 9a0b3e68622fcff5504b5b5fe5b965a267e658c5..3f3866d42ec37b73e5c698e66fb06fb35dde578f 100644 --- a/vipra-ui/app/html/topics/show.html +++ b/vipra-ui/app/html/topics/show.html @@ -155,6 +155,7 @@ </div> </div> </div> + <div class="loading" ng-hide="topic">Loading...</div> </div> </div> diff --git a/vipra-ui/app/html/words/index.html b/vipra-ui/app/html/words/index.html index 34a4cac3bc779ab0756ed5a981e4d4c68bedc537..276f1786500965acec4ceb0aeeab3f08f18c5633 100644 --- a/vipra-ui/app/html/words/index.html +++ b/vipra-ui/app/html/words/index.html @@ -37,6 +37,12 @@ <word-link word="::word" /> </td> </tr> + <tr ng-show="loadingWords"> + <td>Loading...</td> + </tr> + <tr ng-show="!loadingWords&&!words.length"> + <td>No Words</td> + </tr> </tbody> </table> <div class="panel-footer"> diff --git a/vipra-ui/app/html/words/show.html b/vipra-ui/app/html/words/show.html index 32c2674426eaadb2c4f8c3da7b738d24434b3ae8..e3746db2d194d0f729c19c87f47ae555ed70ac6e 100644 --- a/vipra-ui/app/html/words/show.html +++ b/vipra-ui/app/html/words/show.html @@ -32,6 +32,7 @@ </table> </div> </div> + <div class="loading" ng-hide="word">Loading...</div> </div> </div> <div ng-cloak ui-view></div> \ No newline at end of file diff --git a/vipra-ui/app/js/controllers.js b/vipra-ui/app/js/controllers.js index 43dc465c4a5c6c5e29b7b398f16836b7ede106e9..e2910e8bfcc97765de7338ea19a0f749462f918b 100644 --- a/vipra-ui/app/js/controllers.js +++ b/vipra-ui/app/js/controllers.js @@ -849,12 +849,16 @@ $scope.sequenceChanged = function() { if(!$scope.explorerModels.activeTopic || !$scope.explorerModels.activeSequence) return; + $scope.loadingArticles = true; TopicFactory.articles({ id: $scope.explorerModels.activeTopic.id, from: new Date($scope.explorerModels.activeSequence.window.startDate).getTime(), to: new Date($scope.explorerModels.activeSequence.window.endDate).getTime() }, function(data) { $scope.articles = data; + $scope.loadingArticles = false; + }, function() { + $scope.loadingArticles = false; }); }; @@ -915,6 +919,7 @@ $scope.reloadArticles = function() { if (!$scope.rootModels.topicModel) return; + $scope.loadingArticles = true; ArticleFactory.query({ skip: ($scope.articlesIndexModels.page - 1) * $scope.articlesIndexModels.limit, limit: $scope.articlesIndexModels.limit, @@ -926,6 +931,9 @@ $scope.articles = data; $scope.articlesTotal = headers("V-Total"); $scope.maxPage = Math.ceil($scope.articlesTotal / $scope.articlesIndexModels.limit); + $scope.loadingArticles = false; + }, function() { + $scope.loadingArticles = false; }); }; @@ -1097,6 +1105,7 @@ $scope.reloadTopics = function() { if (!$scope.rootModels.topicModel) return; + $scope.loadingTopics = true; TopicFactory.query({ topicModel: $scope.rootModels.topicModel.id, skip: ($scope.topicsIndexModels.page - 1) * $scope.topicsIndexModels.limit, @@ -1108,6 +1117,9 @@ $scope.topics = data; $scope.topicsTotal = headers("V-Total"); $scope.maxPage = Math.ceil($scope.topicsTotal / $scope.topicsIndexModels.limit); + $scope.loadingTopics = false; + }, function() { + $scope.loadingTopics = false; }); }; @@ -1158,11 +1170,8 @@ // preselect first sequence if ($scope.topic.sequences && $scope.topic.sequences.length) $scope.topicsShowModels.sequence = $scope.topic.sequences[0]; - - $timeout(function() { - $scope.redrawRelevanceGraph(); - //$scope.redrawWordEvolutionChart(); TODO remove - }, 0); + + $scope.redrawRelevanceGraph(); }); $scope.redrawRelevanceGraph = function() { @@ -1343,6 +1352,7 @@ $scope.reloadEntities = function() { if (!$scope.rootModels.topicModel) return; + $scope.loadingEntities = true; EntityFactory.query({ topicModel: $scope.rootModels.topicModel.id, skip: ($scope.entitiesIndexModels.page - 1) * $scope.entitiesIndexModels.limit, @@ -1354,6 +1364,9 @@ $scope.entities = data; $scope.entitiesTotal = headers("V-Total"); $scope.maxPage = Math.ceil($scope.entitiesTotal / $scope.entitiesIndexModels.limit); + $scope.loadingEntities = false; + }, function() { + $scope.loadingEntities = false; }); }; @@ -1443,6 +1456,7 @@ $scope.reloadWords = function() { if (!$scope.rootModels.topicModel) return; + $scope.loadingWords = true; WordFactory.query({ topicModel: $scope.rootModels.topicModel.id, skip: ($scope.wordsIndexModels.page - 1) * $scope.wordsIndexModels.limit, @@ -1454,6 +1468,9 @@ $scope.words = data; $scope.wordsTotal = headers("V-Total"); $scope.maxPage = Math.ceil($scope.wordsTotal / $scope.wordsIndexModels.limit); + $scope.loadingWords = false; + }, function() { + $scope.loadingWords = false; }); }; diff --git a/vipra-ui/app/less/app.less b/vipra-ui/app/less/app.less index b7ea8434324dfdc0e188fa69090523d227392987..9c4b77a2398d173063c30c8d52a577bcdae21156 100644 --- a/vipra-ui/app/less/app.less +++ b/vipra-ui/app/less/app.less @@ -374,7 +374,7 @@ a:hover { margin: 0; } .menu-button { - left: 5px; + left: 2px; } } @@ -397,6 +397,7 @@ a:hover { label { margin: 0; font-weight: normal; + padding: 0; &:before, &:after { margin-top: 2px; @@ -898,6 +899,11 @@ entity-menu { width: 40px; } +.loading { + text-align: center; + padding: 10px; +} + @keyframes spin { 100% { -webkit-transform: rotateY(360deg);