Awards as separate menu item
This commit is contained in:
1 parent
aef05d6937
commit
f27cc4003f
7 files changed
+35
-11
No files matched your search
+12
-4
@@ -32,6 +32,7 @@ import PageTeacher from './components/PageTeacher'
|
||||
import PageGallery from './components/PageGallery'
|
||||
import PageAlbum from './components/PageAlbum'
|
||||
import PageDocuments from './components/PageDocuments'
|
||||
import PageAwards from './components/PageAwards'
|
||||
import PageDocument from './components/PageDocument'
|
||||
|
||||
import AppController from './controllers/AppController'
|
||||
@@ -180,14 +181,20 @@ app.config(($locationProvider, $routeProvider) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '/documents',
|
||||
template: '<page-documents awards="$resolve.awards" documents="$resolve.documents"></page-documents>',
|
||||
title: 'Документы',
|
||||
name: '/awards',
|
||||
template: '<page-awards items="$resolve.awards"></page-awards>',
|
||||
title: 'Награды',
|
||||
resolve: {
|
||||
awards: api => api.document
|
||||
.awards()
|
||||
.then(i => i.data),
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '/documents',
|
||||
template: '<page-documents documents="$resolve.documents"></page-documents>',
|
||||
title: 'Документы',
|
||||
resolve: {
|
||||
documents: api => api.document
|
||||
.documents()
|
||||
.then(i => i.data)
|
||||
@@ -295,6 +302,7 @@ app.run(($location, $rootScope, $http) => {
|
||||
PageGallery,
|
||||
PageAlbum,
|
||||
PageDocuments,
|
||||
PageAwards,
|
||||
PageDocument,
|
||||
AppController,
|
||||
CopyrightController,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import template from '../../templates/components/page-awards.html'
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageAwards', {
|
||||
bindings: {
|
||||
items: '<',
|
||||
},
|
||||
template: template,
|
||||
controllerAs: '$',
|
||||
})
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import {unique} from '../../utils/common';
|
||||
export default function (app) {
|
||||
app.component('pageDocuments', {
|
||||
bindings: {
|
||||
awards: '<',
|
||||
documents: '<'
|
||||
},
|
||||
template: template,
|
||||
|
||||
@@ -29,6 +29,11 @@ export default [
|
||||
"url": "/gallery",
|
||||
"color": "red"
|
||||
},
|
||||
{
|
||||
"text": "Награды",
|
||||
"url": "/awards",
|
||||
"color": "yellow"
|
||||
},
|
||||
{
|
||||
"text": "Документы",
|
||||
"url": "/documents",
|
||||
|
||||
@@ -54,7 +54,7 @@ function type() {
|
||||
return route.get('/documents/type/:type', async(ctx, type) => {
|
||||
let types = {
|
||||
'document': ['documents', {type: 'document'}, populateDocPreview],
|
||||
'award': ['documents', {type: 'award'}, populateDocPreview]
|
||||
'award': ['awards', {type: 'award'}, populateDocPreview]
|
||||
}
|
||||
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Награды</h2>
|
||||
<div class="documents-container">
|
||||
<award ng-repeat="i in $.awards" document="i"></award>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user