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) {
}
// @ngInject
var VIEWER_TEMPLATE = require('./templates/viewer.html');
function configureRoutes($routeProvider) {
$routeProvider.when('/a/:id',
{
controller: 'AnnotationViewerController',
template: VIEWER_TEMPLATE,
template: require('./templates/annotation_viewer_content.html'),
reloadOnSearch: false,
resolve: resolve,
});
$routeProvider.when('/stream',
{
controller: 'StreamController',
template: VIEWER_TEMPLATE,
template: require('./templates/stream_content.html'),
reloadOnSearch: false,
resolve: resolve,
});
$routeProvider.otherwise({
controller: 'WidgetController',
template: VIEWER_TEMPLATE,
template: require('./templates/sidebar_content.html'),
reloadOnSearch: false,
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 @@
<search-status-bar
ng-show="!isLoading()"
ng-if="!isStream"
filter-active="!!search.query()"
filter-match-count="visibleCount()"
on-clear-selection="clearSelection()"
......@@ -39,18 +38,16 @@
</p>
</div>
<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="::!isSidebar"
thread="rootThread">
</thread-list>
</span>
<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="false"
thread="rootThread">
</thread-list>
<loggedout-message ng-if="isSidebar && shouldShowLoggedOutMessage()"
<loggedout-message ng-if="shouldShowLoggedOutMessage()"
on-login="login()" ng-cloak>
</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