Commit 4758d264 authored by Robert Knight's avatar Robert Knight

Split "viewer" template into different templates for each app type

In preparation for converting the controllers which provide the logic
for the content area of the sidebar (below the top bar) into components,
split up the viewer.html template into one template for each application
type (sidebar, stream, single annotation page).

This allows removing a number of conditionals from the components in
each template.
parent eb22b50b
...@@ -59,26 +59,24 @@ function configureLocation($locationProvider) { ...@@ -59,26 +59,24 @@ function configureLocation($locationProvider) {
} }
// @ngInject // @ngInject
var VIEWER_TEMPLATE = require('./templates/viewer.html');
function configureRoutes($routeProvider) { function configureRoutes($routeProvider) {
$routeProvider.when('/a/:id', $routeProvider.when('/a/:id',
{ {
controller: 'AnnotationViewerController', controller: 'AnnotationViewerController',
template: VIEWER_TEMPLATE, template: require('./templates/annotation_viewer_content.html'),
reloadOnSearch: false, reloadOnSearch: false,
resolve: resolve, resolve: resolve,
}); });
$routeProvider.when('/stream', $routeProvider.when('/stream',
{ {
controller: 'StreamController', controller: 'StreamController',
template: VIEWER_TEMPLATE, template: require('./templates/stream_content.html'),
reloadOnSearch: false, reloadOnSearch: false,
resolve: resolve, resolve: resolve,
}); });
$routeProvider.otherwise({ $routeProvider.otherwise({
controller: 'WidgetController', controller: 'WidgetController',
template: VIEWER_TEMPLATE, template: require('./templates/sidebar_content.html'),
reloadOnSearch: false, reloadOnSearch: false,
resolve: resolve, resolve: resolve,
}); });
......
<thread-list
on-change-collapsed="setCollapsed(id, collapsed)"
on-clear-selection="clearSelection()"
on-focus="focus(annotation)"
on-force-visible="forceVisible(thread)"
on-select="scrollTo(annotation)"
show-document-info="true"
thread="rootThread">
</thread-list>
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<search-status-bar <search-status-bar
ng-show="!isLoading()" ng-show="!isLoading()"
ng-if="!isStream"
filter-active="!!search.query()" filter-active="!!search.query()"
filter-match-count="visibleCount()" filter-match-count="visibleCount()"
on-clear-selection="clearSelection()" on-clear-selection="clearSelection()"
...@@ -39,18 +38,16 @@ ...@@ -39,18 +38,16 @@
</p> </p>
</div> </div>
<span window-scroll="loadMore(20)"> <thread-list
<thread-list on-change-collapsed="setCollapsed(id, collapsed)"
on-change-collapsed="setCollapsed(id, collapsed)" on-clear-selection="clearSelection()"
on-clear-selection="clearSelection()" on-focus="focus(annotation)"
on-focus="focus(annotation)" on-force-visible="forceVisible(thread)"
on-force-visible="forceVisible(thread)" on-select="scrollTo(annotation)"
on-select="scrollTo(annotation)" show-document-info="false"
show-document-info="::!isSidebar" thread="rootThread">
thread="rootThread"> </thread-list>
</thread-list>
</span>
<loggedout-message ng-if="isSidebar && shouldShowLoggedOutMessage()" <loggedout-message ng-if="shouldShowLoggedOutMessage()"
on-login="login()" ng-cloak> on-login="login()" ng-cloak>
</loggedout-message> </loggedout-message>
<span window-scroll="loadMore(20)">
<thread-list
on-change-collapsed="setCollapsed(id, collapsed)"
on-clear-selection="clearSelection()"
on-focus="focus(annotation)"
on-force-visible="forceVisible(thread)"
on-select="scrollTo(annotation)"
show-document-info="true"
thread="rootThread">
</thread-list>
</span>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment