Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Multiple adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth Dahlstrøm <[email protected]>
  • Loading branch information
kedano committed Jun 21, 2016
1 parent 2d14733 commit c91b5d2
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 39 deletions.
13 changes: 10 additions & 3 deletions app/helpers/convert-aeoaa.js
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);
65 changes: 35 additions & 30 deletions app/pods/components/content-section/template.hbs
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>

4 changes: 4 additions & 0 deletions app/pods/components/tool-presentation/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Component.extend({
});
1 change: 1 addition & 0 deletions app/pods/components/tool-presentation/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{yield}}
4 changes: 2 additions & 2 deletions app/pods/template/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Ember from 'ember';

export default Ember.Route.extend({
model: function() {
var data = Ember.$.getJSON('http://hiof.no/api/v1/designguidelines/?type=templates');
//console.log(data);
var data = Ember.$.getJSON('http://hiof.no/api/v2/designguidelines/?type=templates');
console.log(data);
return data;
}
});
4 changes: 2 additions & 2 deletions app/pods/template/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1>Dokumentmaler</h1>

{{#each model.data as |post|}}
{{content-section type=post.type basename=post.attributes.slug title=post.attributes.title content=post.attributes.body author=post.attributes.author date=post.attributes.date illustration=post.attributes.illustration assetpath=post.attributes.assetpath url=post.attributes.url}}
{{content-section type=post.type basename=post.attributes.slug title=post.attributes.title content=post.attributes.body author=post.attributes.author date=post.attributes.date illustration=post.attributes.illustration assetpath=post.attributes.assetpath url=post.attributes.relatedassets}}
{{/each}}
</section>
{{nav-internal}}
{{nav-internal}}
3 changes: 2 additions & 1 deletion app/pods/webcomponent/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import Ember from 'ember';

export default Ember.Route.extend({
model: function() {

var data = Ember.$.getJSON('http://hiof.no/api/v1/designguidelines/?type=webcomponents');
//console.log(data);
console.log(data);
return data;
},
didInsertElement: function() {
Expand Down
1 change: 1 addition & 0 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import "pod-styles";
html {
overflow-x: hidden;

}

h1,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "design",
"version": "0.0.5",
"version": "0.0.6",
"description": "Small description for designguidlines goes here",
"private": true,
"directories": {
Expand Down
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');
});

0 comments on commit c91b5d2

Please sign in to comment.