diff --git a/week03/app/controllers/modules.js b/week03/app/controllers/modules.js new file mode 100644 index 0000000000000000000000000000000000000000..cec90596127349634fbe18f14af33b1cea0bebca --- /dev/null +++ b/week03/app/controllers/modules.js @@ -0,0 +1,4 @@ +import Controller from '@ember/controller'; + +export default class ModulesController extends Controller { +} diff --git a/week03/app/router.js b/week03/app/router.js index 83186bc0f8ff6db9373351ad8585a17defd3b3b2..039e70239c6544e3654e448dce73a409a73cedde 100644 --- a/week03/app/router.js +++ b/week03/app/router.js @@ -8,4 +8,5 @@ export default class Router extends EmberRouter { Router.map(function() { this.route('login'); + this.route('modules'); }); diff --git a/week03/app/routes/modules.js b/week03/app/routes/modules.js new file mode 100644 index 0000000000000000000000000000000000000000..4c01cabd20d4eebe37e7e84090669a634bf77673 --- /dev/null +++ b/week03/app/routes/modules.js @@ -0,0 +1,92 @@ +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' + } + } + } + ] + } +} diff --git a/week03/app/styles/app.scss b/week03/app/styles/app.scss index 9d645da1f6569b856cc0540c17061fe09dfa210b..0f11a7f879dada1bfa6baee52c63954eb3f2fa8b 100644 --- a/week03/app/styles/app.scss +++ b/week03/app/styles/app.scss @@ -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 diff --git a/week03/app/templates/modules.hbs b/week03/app/templates/modules.hbs new file mode 100644 index 0000000000000000000000000000000000000000..85829872acad2c44c04ebaaf804d6ad8bd0f4f7b --- /dev/null +++ b/week03/app/templates/modules.hbs @@ -0,0 +1,55 @@ +<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 diff --git a/week03/tests/unit/controllers/modules-test.js b/week03/tests/unit/controllers/modules-test.js new file mode 100644 index 0000000000000000000000000000000000000000..a0101afdd6db47b009a8b9afe89ef2560cafc0f6 --- /dev/null +++ b/week03/tests/unit/controllers/modules-test.js @@ -0,0 +1,12 @@ +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); + }); +}); diff --git a/week03/tests/unit/routes/modules-test.js b/week03/tests/unit/routes/modules-test.js new file mode 100644 index 0000000000000000000000000000000000000000..6130f1f44528363ffe2b500f50ef426979c29387 --- /dev/null +++ b/week03/tests/unit/routes/modules-test.js @@ -0,0 +1,11 @@ +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); + }); +});