Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Add WYSIWYG editor to the Email Pesion tool
Browse files Browse the repository at this point in the history
  • Loading branch information
vincemtnz committed Apr 12, 2018
1 parent ddd1382 commit 74cf8f2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Expand Up @@ -2,6 +2,7 @@
<PROJECT_ROOT>/node_modules/fbjs/.*
<PROJECT_ROOT>/node_modules/eslint-plugin-jsx-a11y/.*
<PROJECT_ROOT>/vendor/bundle/.*
<PROJECT_ROOT>/node_modules/draft-js/.*

[include]

Expand Down
3 changes: 1 addition & 2 deletions app/javascript/components/EmailEditor/EmailEditor.js
@@ -1,4 +1,4 @@
// @flow
// @flow weak
import React, { Component } from 'react';
import Input from '../SweetInput/SweetInput';
import FormGroup from '../Form/FormGroup';
Expand All @@ -21,7 +21,6 @@ import './EmailEditor.scss';
export type EmailProps = {
subject: string,
body: string,
emailBody: string,
};

type Props = {
Expand Down
26 changes: 17 additions & 9 deletions app/views/plugins/email_pensions/_form.slim
Expand Up @@ -25,14 +25,22 @@

= render 'plugins/shared/subject_editor', name: name, f: f, plugin: plugin

.form-group
= f.label(:email_body_header, t('plugins.email_tool.email_header'))
= f.text_area :email_body_header, class: 'form-control height-short'
.email-body-section
.form-group
= f.label(:email_body_header, t('plugins.email_tool.email_header'))
= f.text_area :email_body_header, class: 'wysiwyg form-control height-short'

.form-group
= f.label(:email_body, t('plugins.email_tool.email_body'))
= f.text_area :email_body, class: 'form-control height-large'
.form-group
= f.label(:email_body, t('plugins.email_tool.email_body'))
= f.text_area :email_body, class: 'wysiwyg form-control height-large'

.form-group
= f.label(:email_body_footer, t('plugins.email_tool.email_footer'))
= f.text_area :email_body_footer, class: 'form-control height-short'
.form-group
= f.label(:email_body_footer, t('plugins.email_tool.email_footer'))
= f.text_area :email_body_footer, class: 'wysiwyg form-control height-short'

javascript:
$(function () {
$('.email-body-section .wysiwyg').each(function (index, el) {
$.publish("wysiwyg:setup", el.id);
});
});

0 comments on commit 74cf8f2

Please sign in to comment.