Skip to content

Commit

Permalink
Merge staging into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 21, 2022
2 parents 6f27ee8 + 894d9e2 commit bd9317a
Show file tree
Hide file tree
Showing 43 changed files with 673 additions and 634 deletions.
47 changes: 11 additions & 36 deletions app/components/footer-nav.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -108,44 +108,35 @@
<h5 class='footer-header' itemprop='name'>
Stichting Sociëteit Flux
</h5>
<table class='table table-sm'>
<table class='table table-sm mw-100'>
<tbody>
<tr>
<td class='footer-table-cell'>
<FaIcon @icon='envelope' />
<FaIcon @icon='globe' />
</td>
<td class='footer-table-cell'>
<a
class='footer-text'
href='mailto:[email protected]'
itemprop='email'
content='[email protected]'
itemprop='url'
href='https://societeitflux.nl'
target='_blank'
>
secretaris@societeitflux.nl
www.societeitflux.nl
</a>
</td>
</tr>

<tr
itemprop='contactPoint'
itemscope
itemtype='https://schema.org/ContactPoint'
>
<tr>
<td class='footer-table-cell'>
<FaIcon
@icon='phone'
itemprop='contactType'
content='customer support'
/>
<FaIcon @icon='phone' />
</td>
<td class='footer-table-cell'>
<a
class='footer-text'
href='tel:+31612234738'
itemprop='telephone'
content='+31612234738'
href='https://societeitflux.nl/#/contact'
target='_blank'
>
06-12234738
Neem contact op
</a>
</td>
</tr>
Expand All @@ -166,22 +157,6 @@
</a>
</td>
</tr>

<tr>
<td class='footer-table-cell'>
<FaIcon @icon='globe' />
</td>
<td class='footer-table-cell'>
<a
class='footer-text'
itemprop='url'
href='http://www.societeitflux.nl'
target='_blank'
>
www.societeitflux.nl
</a>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/forum/forum-post-new.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p class='card-text'>
<MdEditor @content={{content}} @textareaId='newForumPost' />
<MdEditor @content={{this.content}} @textareaId='newForumPost' />
</p>
<div class='card-footer'>
<div class='row justify-content-end'>
Expand Down
16 changes: 12 additions & 4 deletions app/components/forum/forum-post-new.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import Component from '@glimmer/component';
import { action } from '@ember/object';

// todo: incorporate the model-save-util into components?
export default class ForumPostNewComponent extends Component {
@service store;
@service flashNotice;

get content() {
return this.args.content;
}

set content(content) {
this.args.updateContent(content);
}

@action
async save() {
let { content, thread } = this;
let { content, thread } = this.args;
await this.store
.createRecord('forum/post', {
message: content,
thread,
})
.save();
this.flashNotice.sendSuccess('Forumbericht toegevoegd!');
this.set('content', '');
this.onSubmit();
this.content = '';
this.args.onSubmit();
}

@action
Expand Down
2 changes: 1 addition & 1 deletion app/components/photo-comments/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { action } from '@ember/object';

export default class Comments extends Component {
@service store;
@service('flash-notice') flashNotice;
@service flashNotice;
@tracked
content = null;

Expand Down
2 changes: 1 addition & 1 deletion app/components/users/privacy-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isPresent } from '@ember/utils';
import { tracked } from '@glimmer/tracking';

export default class PrivacySettingsComponent extends Component {
@service('flash-notice') flashNotice;
@service flashNotice;
@service session;

@tracked errorMessage = null;
Expand Down
47 changes: 23 additions & 24 deletions app/controllers/activities/generate-alias.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import { isInvalidResponse } from 'ember-fetch/errors';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';

export default Controller.extend({
fetch: service(),
errorMessage: null,
actions: {
async generateAlias() {
this.set('errorMessage', null);
const response = await this.fetch.post(
`/activities/${this.model.id}/generate_alias`
);

if (response.ok) {
const json = await response.json();
this.set('alias', json.data.alias);
this.set('expires_at', json.data.expires_at);
} else if (isInvalidResponse(response)) {
const json = await response.json();
this.set(
'errorMessage',
json.errors ? json.errors[0].detail : response
);
}
},
},
});
export default class GenerateAliasController extends Controller {
@service fetch;
@tracked errorMessage = null;
@tracked alias;
@tracked expiresAt;
@action
async generateAlias() {
this.errorMessage = null;
const response = await this.fetch.post(
`/activities/${this.model.id}/generate_alias`
);
if (response.ok) {
const json = await response.json();
this.alias = json.data.alias;
this.expiresAt = json.data.expires_at;
} else if (isInvalidResponse(response)) {
const json = await response.json();
this.errorMessage = json.errors ? json.errors[0].detail : response;
}
}
}
118 changes: 65 additions & 53 deletions app/controllers/activities/print-enrolled.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,66 @@
import Controller from '@ember/controller';
import { sort } from '@ember/object/computed';

export default Controller.extend({
showAllergyInfo: true,
showCheckbox: true,
currentTab: 'form', // Possible options: [ form, consumptionList ]
options: ['Bier', 'Fris'],
newOption: '',
additionalEmptyRows: 5,
showRobertHofstra: true,

sortedString: Object.freeze(['userFullName']),
sortedResponses: sort('model.form.responses', 'sortedString'),

actions: {
print() {
const { title } = this.model;
const popup = window.open('', 'PRINT', 'height=400,width=600');

popup.document.write(
`<html><head><title>Inschrijflijst ${title}</title>`
);
popup.document.write('<link rel="stylesheet" href="/assets/vendor.css">');
popup.document.write(
'<link rel="stylesheet" href="/assets/amber-ui.css">'
);
popup.document.write(
'</head><body onload="window.print()" onfocus="setTimeout(window.close, 500)">'
);
popup.document.write(document.getElementById('printarea').innerHTML);
popup.document.write('</body></html>');
popup.document.close(); // Necessary for IE >= 10
popup.focus(); // Necessary for IE >= 10*/
},
selectForm() {
this.set('currentTab', 'form');
},
selectConsumptionList() {
this.set('currentTab', 'consumptionList');
},
removeOption(index) {
this.options.removeAt(index, 1);
},
addOption() {
const option = this.newOption;
this.options.pushObject(option);
this.set('newOption', '');
},
reorderItems(itemModels) {
this.set('options', itemModels);
},
},
});
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';

const tabs = ['form', 'consumptionList'];
const formTab = tabs[0];
const consumptionListTab = tabs[1];

export default class PrintEnrolledController extends Controller {
@tracked showAllergyInfo = true;
@tracked showCheckbox = true;
@tracked currentTab = formTab;
@tracked options = ['Bier', 'Fris'];
@tracked newOption = '';
@tracked showRobertHofstra = true;
additionalEmptyRows = 5;

get sortedResponses() {
return this.model.form.get('responses').sortBy('userFullName');
}

@action
print() {
const { title } = this.model;
const popup = window.open('', 'PRINT', 'height=400,width=600');

popup.document.write(`<html><head><title>Inschrijflijst ${title}</title>`);
popup.document.write('<link rel="stylesheet" href="/assets/vendor.css"/>');
popup.document.write(
'<link rel="stylesheet" href="/assets/amber-ui.css"/>'
);
popup.document.write(
'</head><body onload="window.print()" onfocus="setTimeout(window.close, 500)">'
);
popup.document.write(document.getElementById('printarea').innerHTML);
popup.document.write('</body></html>');
popup.document.close(); // Necessary for IE >= 10
popup.focus(); // Necessary for IE >= 10*/
}

@action
selectForm() {
this.currentTab = formTab;
}

@action
selectConsumptionList() {
this.currentTab = consumptionListTab;
}

@action
removeOption(index) {
this.options.removeAt(index, 1);
}

@action
addOption() {
this.options.pushObject(this.newOption);
this.newOption = '';
}

@action
reorderItems(itemModels) {
this.options = itemModels;
}
}
19 changes: 7 additions & 12 deletions app/controllers/activities/show.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { isNone } from '@ember/utils';

export default Controller.extend({
flashNotice: service('flash-notice'),
canSubmitResponse: computed(
'model.form',
'model.form.currentUserCanRespond',
function () {
const { form } = this.model;
return !isNone(form) && form.get('currentUserCanRespond');
}
),
});
export default class ShowActivityController extends Controller {
@service flashNotice;
get canSubmitResponse() {
const { form } = this.model;
return !isNone(form) && form.get('currentUserCanRespond');
}
}
9 changes: 5 additions & 4 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';

export default Controller.extend({
session: service(),
layoutManager: service('layout-manager'),
});
export default class ApplicationController extends Controller {
@service session;

@service layoutManager;
}
Loading

0 comments on commit bd9317a

Please sign in to comment.