mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 14:37:21 +01:00
various styling fixes
This commit is contained in:
@@ -6,7 +6,9 @@ export default function(props) {
|
||||
{props.text}:
|
||||
<input
|
||||
class={props.name}
|
||||
onchange={props.onchange.bind(null, props.name)} type="text"
|
||||
type="text"
|
||||
placeholder={props.placeholder}
|
||||
onchange={props.onchange.bind(null, props.name)}
|
||||
/>
|
||||
</label>
|
||||
);
|
||||
|
||||
@@ -1,61 +1,98 @@
|
||||
import { h } from 'preact';
|
||||
import Collapsible from 'react-collapsible';
|
||||
import Input from './Input';
|
||||
import TextAreaInput from './TextAreaInput';
|
||||
import Select from './Select';
|
||||
|
||||
const EXAMPLE_ADDRESS="Max Mustermann\nMusterstr. 73\n12345 Musterstadt";
|
||||
|
||||
export default function(props) {
|
||||
const templateTypeOptions = [
|
||||
{
|
||||
value: 'brief-fam',
|
||||
name: "Familie"
|
||||
},
|
||||
{
|
||||
value: 'brief-valerie',
|
||||
name: "Valerie"
|
||||
},
|
||||
{
|
||||
value: 'brief-rain',
|
||||
name: "Rain Baumeister"
|
||||
},
|
||||
{
|
||||
value: 'brief-thomas',
|
||||
name: "Thomas"
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Select
|
||||
name="template"
|
||||
text="Vorlage"
|
||||
onchange={props.onChange}
|
||||
value={props.template}
|
||||
options={templateTypeOptions}
|
||||
/>
|
||||
|
||||
<TextAreaInput
|
||||
name="address"
|
||||
text="Adresse"
|
||||
placeholder={EXAMPLE_ADDRESS}
|
||||
onchange={props.onChange}
|
||||
value={props.address}
|
||||
/>
|
||||
<Input
|
||||
name="subject"
|
||||
text="Betreff"
|
||||
placeholder="Betreffzeile"
|
||||
onchange={props.onChange}
|
||||
value={props.subject}
|
||||
/>
|
||||
<Input
|
||||
name="yourRef"
|
||||
text="Ihr Zeichen"
|
||||
onchange={props.onChange}
|
||||
value={props.yourRef}
|
||||
/>
|
||||
<Input
|
||||
name="yourMail"
|
||||
text="Ihr Schreiben vom"
|
||||
onchange={props.onChange}
|
||||
value={props.yourMail}
|
||||
/>
|
||||
<Input
|
||||
name="customer"
|
||||
text="Kundernummer"
|
||||
onchange={props.onChange}
|
||||
value={props.customer}
|
||||
/>
|
||||
<Input
|
||||
name="invoice"
|
||||
text="Rechnung"
|
||||
onchange={props.onChange}
|
||||
value={props.invoice}
|
||||
/>
|
||||
<Input
|
||||
name="yourMail"
|
||||
text="Ihr Schreiben vom"
|
||||
onchange={props.onChange}
|
||||
value={props.yourMail}
|
||||
/>
|
||||
<Collapsible trigger="Bezugszeichenzeile">
|
||||
<Input
|
||||
name="yourRef"
|
||||
text="Ihr Zeichen"
|
||||
onchange={props.onChange}
|
||||
value={props.yourRef}
|
||||
/>
|
||||
<Input
|
||||
name="yourMail"
|
||||
text="Ihr Schreiben vom"
|
||||
onchange={props.onChange}
|
||||
value={props.yourMail}
|
||||
/>
|
||||
<Input
|
||||
name="customer"
|
||||
text="Kundernummer"
|
||||
onchange={props.onChange}
|
||||
value={props.customer}
|
||||
/>
|
||||
<Input
|
||||
name="invoice"
|
||||
text="Rechnung"
|
||||
onchange={props.onChange}
|
||||
value={props.invoice}
|
||||
/>
|
||||
<Input
|
||||
name="yourMail"
|
||||
text="Ihr Schreiben vom"
|
||||
onchange={props.onChange}
|
||||
value={props.yourMail}
|
||||
/>
|
||||
</Collapsible>
|
||||
<Input
|
||||
name="date"
|
||||
text="Datum"
|
||||
placeholder="Heute"
|
||||
onchange={props.onChange}
|
||||
value={props.date}
|
||||
/>
|
||||
<Input
|
||||
name="opening"
|
||||
text="Anrede"
|
||||
placeholder="Sehr geehrte Damen und Herren"
|
||||
onchange={props.onChange}
|
||||
value={props.opening}
|
||||
/>
|
||||
@@ -63,11 +100,13 @@ export default function(props) {
|
||||
name="body"
|
||||
text="Brieftext"
|
||||
onchange={props.onChange}
|
||||
placeholder="Inhalt des Briefes"
|
||||
value={props.body}
|
||||
/>
|
||||
<Input
|
||||
name="closing"
|
||||
text="Grußformel"
|
||||
placeholder="Mit freundlichen Grüßen"
|
||||
onchange={props.onChange}
|
||||
value={props.closing}
|
||||
/>
|
||||
|
||||
@@ -20,6 +20,6 @@ export default props => {
|
||||
}
|
||||
|
||||
return (
|
||||
<iframe src={props.pdfUrl} style="width:718px; height:700px;" frameborder="0"></iframe>
|
||||
<iframe src={props.pdfUrl} style="width:700px; height:1050px;" frameborder="0"></iframe>
|
||||
);
|
||||
};
|
||||
|
||||
27
webapp/views/components/Select.js
Normal file
27
webapp/views/components/Select.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { h } from 'preact';
|
||||
|
||||
export default (props) => {
|
||||
|
||||
const { options = [] } = props;
|
||||
const optionsMarkup = options.map(option => {
|
||||
return (
|
||||
<option
|
||||
label={option.name}
|
||||
value={option.value}
|
||||
selected={props.value === option.value}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<label>
|
||||
{props.text}:
|
||||
<select
|
||||
class={props.name}
|
||||
onchange={props.onchange.bind(null, props.name)}
|
||||
>
|
||||
{optionsMarkup}
|
||||
</select>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ export default function(props) {
|
||||
{props.text}:
|
||||
<textarea
|
||||
class={props.name}
|
||||
placeholder={props.placeholder}
|
||||
onchange={props.onchange.bind(null, props.name)}
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -14,9 +14,9 @@ class Home extends Component {
|
||||
<div className="home">
|
||||
<div>
|
||||
<LetterOptions onChange={this._onChange.bind(this)} />
|
||||
<Button onClick={this._onGenerate.bind(this)} text="Generiere"/>
|
||||
</div>
|
||||
<div>
|
||||
<Button onClick={this._onGenerate.bind(this)} text="Backe PDF"/>
|
||||
<Preview
|
||||
pdfUrl={this.state.pdfUrl}
|
||||
pdfIsLoading={this.state.pdfIsLoading}
|
||||
|
||||
Reference in New Issue
Block a user