Skip to content
Snippets Groups Projects
Commit 1bf57da6 authored by Max Henze's avatar Max Henze
Browse files

Iteration

parent 85aa22ca
No related branches found
No related tags found
No related merge requests found
import Controller from '@ember/controller';
export default class ModulesController extends Controller {
}
......@@ -8,4 +8,5 @@ export default class Router extends EmberRouter {
Router.map(function() {
this.route('login');
this.route('modules');
});
import Route from '@ember/routing/route';
export default class ModulesRoute extends Route {
model() {
return [
{
code: 'INF.06528.01',
name: 'Cient-seitige Web-Anwendungen',
actions: {
'delete': {
title: 'Delete this module',
icon: 'mdi mdi-delete warning'
}
},
sections: {
'dates': {
title: 'Show all dates',
icon: 'mdi mdi-calendar-clock'
},
'documents': {
title: 'Show all documents',
icon: 'mdi mdi-file-document-box-multiple-outline'
},
'excercises': {
title: 'Show all excercises',
icon: 'mdi mdi-test-tube'
},
'participants': {
title: 'Show all participants',
icon: 'mdi mdi-account-multiple'
}
}
},
{
code: 'INF.05370.01',
name: 'Informatik in den Geistes- und Kulturwissenschaften',
actions: {
'delete': {
title: 'Delete this module',
icon: 'mdi mdi-delete warning'
}
},
sections: {
'dates': {
title: 'Show all dates',
icon: 'mdi mdi-calendar-clock'
},
'documents': {
title: 'Show all documents',
icon: 'mdi mdi-file-document-box-multiple-outline'
},
'excercises': {
title: 'Show all excercises',
icon: 'mdi mdi-test-tube'
},
'participants': {
title: 'Show all participants',
icon: 'mdi mdi-account-multiple'
}
}
},
{
code: 'INF.06450.01',
name: 'eHumanities Grundlagen',
actions: {
'delete': {
title: 'Delete this module',
icon: 'mdi mdi-delete warning'
}
},
sections: {
'dates': {
title: 'Show all dates',
icon: 'mdi mdi-calendar-clock'
},
'documents': {
title: 'Show all documents',
icon: 'mdi mdi-file-document-box-multiple-outline'
},
'excercises': {
title: 'Show all excercises',
icon: 'mdi mdi-test-tube'
},
'participants': {
title: 'Show all participants',
icon: 'mdi mdi-account-multiple'
}
}
}
]
}
}
......@@ -28,4 +28,14 @@ ul[role="menu"] {
}
}
}
}
/*
* Icon styles
*/
.mdi.warning:link, .mdi.warning:visited {
color: get-color('alert');
}
.mdi.warning:hover, .mdi.warning:focus {
color: lighten(get-color('alert'), 10%);
}
\ No newline at end of file
<main class="grid-container">
<div class="grid-x grid-padding-x">
<h1 class="cell">My Modules</h1>
</div>
<div class="grid-x grid-padding-x">
<nav class="cell shrink" aria-label="Modules">
<ul role="menu" aria-label="Modules">
<li><a href="" tabindex="0" role="menuitem" class="active">Current Semester</a></li>
<li><a href="" tabindex="-1" role="menuitem">Last Semester</a></li>
<li role="separator"></li>
<li><a href="" tabindex="-1" role="menuitem">Enroll in Module</a></li>
</ul>
</nav>
<section class="cell auto">
<table>
<thead>
<tr>
<th>Code</th>
<th>Name</th>
<th>Sections</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{#each model as |module|}}
<tr>
<td><a href="">{{module.code}}</a></td>
<td><a href="">{{module.name}}</a></td>
<td>
<nav aria-label="Sections of {{module.name}}">
<ul role="menu" class="horizontal" aria-label="Sections">
{{#each-in module.sections as |section display|}}
<li><a href="" role="menuitem" aria-label={{display.title}} title={{display.title}} class={{display.icon}} tabindex="0"></a></li>
{{/each-in}}
</ul>
</nav>
</td>
<td>
<nav aria-label="Actions for {{module.name}}">
<ul role="menu" class="horizontal" aria-label="Actions">
{{#each-in module.actions as |action display|}}
<li><a href="" role="menuitem" aria-label={{display.title}} title={{display.title}} class={{display.icon}} tabindex="0"></a></li>
{{/each-in}}
</ul>
</nav>
</td>
</tr>
{{/each}}
</tbody>
</table>
</section>
</div>
</main>
{{outlet}}
\ No newline at end of file
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Controller | modules', function(hooks) {
setupTest(hooks);
// TODO: Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:modules');
assert.ok(controller);
});
});
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | modules', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let route = this.owner.lookup('route:modules');
assert.ok(route);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment