Awards as separate menu item

This commit is contained in:
tmshv committed 2017-02-19 23:29:46 +03:00
1 parent aef05d6937
commit f27cc4003f
7 files changed
+35 -11

No files matched your search

+12 -4
View File
@@ -32,6 +32,7 @@ import PageTeacher from './components/PageTeacher'
import PageGallery from './components/PageGallery' import PageGallery from './components/PageGallery'
import PageAlbum from './components/PageAlbum' import PageAlbum from './components/PageAlbum'
import PageDocuments from './components/PageDocuments' import PageDocuments from './components/PageDocuments'
import PageAwards from './components/PageAwards'
import PageDocument from './components/PageDocument' import PageDocument from './components/PageDocument'
import AppController from './controllers/AppController' import AppController from './controllers/AppController'
@@ -180,14 +181,20 @@ app.config(($locationProvider, $routeProvider) => {
} }
}, },
{ {
name: '/documents', name: '/awards',
template: '<page-documents awards="$resolve.awards" documents="$resolve.documents"></page-documents>', template: '<page-awards items="$resolve.awards"></page-awards>',
title: 'Документы', title: 'Награды',
resolve: { resolve: {
awards: api => api.document awards: api => api.document
.awards() .awards()
.then(i => i.data), .then(i => i.data),
}
},
{
name: '/documents',
template: '<page-documents documents="$resolve.documents"></page-documents>',
title: 'Документы',
resolve: {
documents: api => api.document documents: api => api.document
.documents() .documents()
.then(i => i.data) .then(i => i.data)
@@ -295,6 +302,7 @@ app.run(($location, $rootScope, $http) => {
PageGallery, PageGallery,
PageAlbum, PageAlbum,
PageDocuments, PageDocuments,
PageAwards,
PageDocument, PageDocument,
AppController, AppController,
CopyrightController, CopyrightController,
+11
View File
@@ -0,0 +1,11 @@
import template from '../../templates/components/page-awards.html'
export default function (app) {
app.component('pageAwards', {
bindings: {
items: '<',
},
template: template,
controllerAs: '$',
})
}
-1
View File
@@ -4,7 +4,6 @@ import {unique} from '../../utils/common';
export default function (app) { export default function (app) {
app.component('pageDocuments', { app.component('pageDocuments', {
bindings: { bindings: {
awards: '<',
documents: '<' documents: '<'
}, },
template: template, template: template,
+5
View File
@@ -29,6 +29,11 @@ export default [
"url": "/gallery", "url": "/gallery",
"color": "red" "color": "red"
}, },
{
"text": "Награды",
"url": "/awards",
"color": "yellow"
},
{ {
"text": "Документы", "text": "Документы",
"url": "/documents", "url": "/documents",
+1 -1
View File
@@ -54,7 +54,7 @@ function type() {
return route.get('/documents/type/:type', async(ctx, type) => { return route.get('/documents/type/:type', async(ctx, type) => {
let types = { let types = {
'document': ['documents', {type: 'document'}, populateDocPreview], 'document': ['documents', {type: 'document'}, populateDocPreview],
'award': ['documents', {type: 'award'}, populateDocPreview] 'award': ['awards', {type: 'award'}, populateDocPreview]
} }
if (type in types) { if (type in types) {
@@ -0,0 +1,6 @@
<div class="content content_wide content--padding-top--menu">
<h2>Награды</h2>
<div class="documents-container">
<award ng-repeat="i in $.items" document="i"></award>
</div>
</div>
@@ -6,9 +6,4 @@
<document ng-repeat="i in c.documents" document="i"></document> <document ng-repeat="i in c.documents" document="i"></document>
</div> </div>
</div> </div>
<h2>Награды</h2>
<div class="documents-container">
<award ng-repeat="i in $.awards" document="i"></award>
</div>
</div> </div>