This repository has been archived by the owner on Nov 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kenneth Dahlstrøm <[email protected]>
- Loading branch information
Showing
10 changed files
with
84 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import Ember from 'ember'; | ||
|
||
export function convertAeoaa(params/*, hash*/ ) { | ||
var res = params[0].replace('æ', 'ae').replace('ø', 'oe').replace('å', 'aa').replace('å', 'aa').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-'); | ||
return res; | ||
export function convertAeoaa(params /*, hash*/ ) { | ||
|
||
if (typeof params[0] === 'undefined') { | ||
return; | ||
} else { | ||
|
||
|
||
var res = params[0].replace('æ', 'ae').replace('ø', 'oe').replace('å', 'aa').replace('å', 'aa').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-'); | ||
return res; | ||
} | ||
} | ||
|
||
export default Ember.Helper.helper(convertAeoaa); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,55 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
<section class="section-content"> | ||
|
||
{{#if titletype}} | ||
{{#if (eq titletype 1)}} | ||
<h1 id="{{convert-aeoaa basename}}">{{title}}</h1> | ||
{{/if}} | ||
|
||
{{#if (eq titletype 2)}} | ||
<h2 id="{{convert-aeoaa basename}}">{{title}}</h2> | ||
{{/if}} | ||
|
||
{{#if (eq titletype 3)}} | ||
<h3 id="{{convert-aeoaa basename}}">{{title}}</h3> | ||
{{/if}} | ||
{{else}} | ||
<h2 id="{{convert-aeoaa basename}}">{{title}}</h2> | ||
{{/if}} | ||
|
||
{{markdown-to-html markdown=content}} | ||
|
||
{{#if assetpath}} | ||
<footer> | ||
<a href="https://hiof.no{{assetpath}}{{url}}" class="btn btn-primary"><span class="glyphicon glyphicon-download"></span> {{to-lower-case title}}</a> | ||
</footer> | ||
{{/if}} | ||
{{#if titletype}} | ||
{{#if (eq titletype 1)}} | ||
<h1 id="{{convert-aeoaa basename}}">{{title}}</h1> | ||
{{/if}} | ||
|
||
{{#if (eq titletype 2)}} | ||
<h2 id="{{convert-aeoaa basename}}">{{title}}</h2> | ||
{{/if}} | ||
|
||
{{#if (eq titletype 3)}} | ||
<h3 id="{{convert-aeoaa basename}}">{{title}}</h3> | ||
{{/if}} | ||
{{else}} | ||
<h2 id="{{convert-aeoaa basename}}">{{title}}</h2> | ||
{{/if}} | ||
|
||
{{markdown-to-html markdown=content}} | ||
|
||
{{#if assetpath}} | ||
<footer> | ||
{{#if (is-array url)}} | ||
{{#each url}} | ||
<a href="https://hiof.no/assets/plugins/design-templates/public/{{this}}.zip" class="btn btn-primary"><span class="glyphicon glyphicon-download"></span> {{this}} </a> | ||
{{/each}} | ||
{{else}} | ||
{{#if url}} | ||
<a href="https://hiof.no{{assetpath}}{{url}}.zip" class="btn btn-primary"><span class="glyphicon glyphicon-download"></span> {{url}}</a> | ||
{{/if}} | ||
{{/if}} | ||
|
||
|
||
</footer> | ||
{{/if}} | ||
</section> | ||
{{#if illustration}} | ||
<aside class="section-illustration"> | ||
<img {{action 'openModal' basename}} class="img-illustration" data-id="image-{{convert-aeoaa basename}}" src="https://hiof.no/assets/plugins/design-{{type}}/illustrations/{{illustration}}"> | ||
|
||
|
||
{{#my-modal title=title basename=basename}} | ||
<img src="https://hiof.no/assets/plugins/design-{{type}}/illustrations/{{illustration}}"> | ||
<img src="https://hiof.no/assets/plugins/design-{{type}}/illustrations/{{illustration}}"> | ||
{{/my-modal}} | ||
|
||
</aside> | ||
|
||
{{else}} | ||
<aside class="section-illustration-placeholder"></aside> | ||
<aside class="section-illustration-placeholder"></aside> | ||
{{/if}} | ||
<footer class="visuallyhidden"> | ||
Oppdatert av {{author}} on {{date}} | ||
</footer> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{yield}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
@import "pod-styles"; | ||
html { | ||
overflow-x: hidden; | ||
|
||
} | ||
|
||
h1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/integration/pods/components/tool-presentation/component-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
moduleForComponent('tool-presentation', 'Integration | Component | tool presentation', { | ||
integration: true | ||
}); | ||
|
||
test('it renders', function(assert) { | ||
assert.expect(2); | ||
|
||
// Set any properties with this.set('myProperty', 'value'); | ||
// Handle any actions with this.on('myAction', function(val) { ... }); | ||
|
||
this.render(hbs`{{tool-presentation}}`); | ||
|
||
assert.equal(this.$().text().trim(), ''); | ||
|
||
// Template block usage: | ||
this.render(hbs` | ||
{{#tool-presentation}} | ||
template block text | ||
{{/tool-presentation}} | ||
`); | ||
|
||
assert.equal(this.$().text().trim(), 'template block text'); | ||
}); |