Commit 0000cd29 authored by Dominik Hebeler's avatar Dominik Hebeler

fixed style of thank you page

parent 859242e1
......@@ -137,22 +137,22 @@ class MailController extends Controller
public function donation(Request $request)
{
$name = '';
if($request->input('person') === 'private') {
$firstname = "";
$lastname = "";
$company = "";
$private = $request->input('person', '') === 'private' ? true : false;
if($request->input('person', '') === 'private') {
$firstname = $request->input('firstname');
$lastname = $request->input('lastname');
if($firstname !== '' || $lastname !== '') {
$name = $firstname . ' ' . $lastname;
}
} elseif($request->input('person') === 'company') {
} elseif($request->input('person', '') === 'company') {
$company = $request->input('companyname');
$name = $company;
}
$name = trim($name);
$data = [
'name' => $name,
'person' => $request->input('person', ''),
'firstname' => $request->input('firstname', ''),
'lastname' => $request->input('lastname', ''),
'company' => $company,
'iban' => $request->input('iban', ''),
'bic' => $request->input('bic', ''),
'email' => $request->input('email', ''),
......@@ -189,7 +189,6 @@ class MailController extends Controller
# Check the IBAN
$iban = new IBAN($iban);
$bic = $request->input('Bankleitzahl', '');
$country = new IBANCountry($iban->Country());
$isSEPA = filter_var($country->IsSEPA(), FILTER_VALIDATE_BOOLEAN);
......@@ -200,7 +199,7 @@ class MailController extends Controller
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$email = "anonymous@suma-ev.de";
}
if($name === ''){
if(($private && (empty($firstname) || empty($lastname))) || (!$private && empty($company))){
$messageToUser = trans('spende.error.name');
$messageType = "error";
} elseif (!$iban->Verify()) {
......@@ -223,34 +222,6 @@ class MailController extends Controller
# Generating personalised key for donor
$key = app('App\Models\Key')->generateKey($betrag);
# a complete set of data from the form consists of:
# -- if person == private --
# firstname
# lastname
# -- if person == company --
# companyname
# --
# email
# iban
# bic
# amount
# frequency
# message
$message = "\r\nName: " . $name;
$message .= "\r\nIBAN: " . $iban->HumanFormat();
if ($bic !== "") {
$message .= "\r\nBIC: " . $bic;
}
$message .= "\r\nBetrag: " . $betrag;
$message .= "\r\nHäufigkeit: " . trans('spende.frequency.' . $frequency);
$message .= "\r\nNachricht: " . $nachricht;
if($key){
$message .= "\r\nSchlüssel:" . $key;
}
try {
$postdata = [
"entity" => "Contribution",
......@@ -276,7 +247,7 @@ class MailController extends Controller
$postdata = http_build_query($postdata);
$resulthash = md5($message);
$resulthash = md5(json_encode($postdata));
$mission = [
"resulthash" => $resulthash,
......
......@@ -67,15 +67,15 @@ return [
'drucken' => 'Drucken',
'danke.title' => 'Herzlichen Dank! Wir haben Ihre Spendenbenachrichtigung für MetaGer an SUMA-EV erhalten.',
'danke.title' => 'Herzlichen Dank! Wir haben Ihre Spendenbenachrichtigung erhalten.',
'danke.nachricht' => 'Falls Sie Kontaktdaten angegeben haben, erhalten Sie demnächst auch eine persönliche Nachricht.',
'danke.kontrolle' => 'Folgende Nachricht hat uns erreicht:',
'danke.schluessel' => 'Als kleines Dankeschön bieten wir unseren Spendern einen Schlüssel für werbefreie Suchen. <br> Dieser lässt sich eingeben indem man auf das Schlüsselsymbol in der Suchleiste geht. <br> Ihr Schlüssel lautet: ',
'danke.schluessel' => 'Als kleines Dankeschön bieten wir unseren Spendern einen Schlüssel für werbefreie Suchen. <br> Dieser lässt sich eingeben indem man auf das Schlüsselsymbol neben der Suchleiste klickt. <br> Ihr Schlüssel lautet: ',
'telefonnummer' => 'Telefonnummer',
'iban' => 'IBAN/Kontonummer',
'bic' => 'BIC/Bankleitzahl',
'iban' => 'IBAN',
'bic' => 'BIC',
'betrag' => 'Betrag',
'danke.message' => 'Ihre Nachricht',
......
......@@ -61,6 +61,12 @@ label {
// address browser inconsistencies.
// Override content-box in Normalize (* isn't specific enough)
input[type="text"] {
background-color: @input-background;
color: @input-text;
padding: 4px 8px;
}
input[type="search"] {
.box-sizing(border-box);
}
......
.data-element {
&> label {
min-width: 100px;
}
&> input, textarea {
padding: 4px 8px;
min-width: 250px;
}
}
\ No newline at end of file
......@@ -5,57 +5,64 @@
@section('navbarFocus.donate', 'class="dropdown active"')
@section('content')
<h1>{{ trans('spende.danke.title') }}</h1>
<div class="col">
<div id="left" class="col-lg-6 col-md-12 col-sm-12 others">
<p style="width:100%;" class="text-muted">{{ trans('spende.danke.nachricht') }}</p>
<h2>{{ trans('spende.danke.kontrolle') }}</h2>
<div>
<table class="table table-condensed">
<tr>
<td>{{ trans('spende.lastschrift.3.placeholder')}}</td>
<td>{{ $data['name'] }}</td>
</tr>
<tr>
<td>Email</td>
<td>{{ $data['email'] }}</td>
</tr>
<tr>
<td>{{ trans('spende.iban') }}</td>
<td>{{ $data['iban'] }}</td>
</tr>
<tr>
<td>{{ trans('spende.bic') }}</td>
<td>{{ $data['bic'] }}</td>
</tr>
<tr>
<td>{{ trans('spende.betrag') }}</td>
<td>{{ $data['betrag'] }} </td>
</tr>
<tr>
<td>{{ trans('spende.frequency') }}</td>
<td>{{ trans('spende.frequency.' . $data['frequency']) }} </td>
</tr>
<tr>
<td>{{ trans('spende.danke.message') }}</td>
<td>{{ $data['nachricht'] }}</td>
</tr>
</table>
</div>
<button type="button" class="btn btn-primary noprint" onclick="window.print();">{{ trans('spende.drucken') }}</button>
@if($data['key'] !== false)
<div class="card-light">
<p style="text-align: center; width:100%;">{!! trans('spende.danke.schluessel') . ' ' . $data['key'] !!}</p>
</div>
@endif
</div>
<div class="col-lg-6 col-md-12 col-sm-12 others noprint" id="right">
<h2>{{ trans('about.about.1') }}</h2>
<p>{!! trans('about.about.2') !!}</p>
<p>{!! trans('about.about.3') !!}</p>
<p>{!! trans('about.about.4') !!}</p>
<p>{!! trans('about.about.5') !!}</p>
</div>
<div class="clearfix"></div>
<div id="donation-data" class="card-heavy">
<h2>{{ trans('spende.danke.title') }}</h2>
<p style="width:100%;" class="text-muted">{{ trans('spende.danke.nachricht') }}</p>
<h3>{{ trans('spende.danke.kontrolle') }}</h3>
<div>
@if($data["person"] === "private")
<div class="data-element">
<label for="firstname" style="margin-right: 16px;">{{ trans('spende.lastschrift.3f.placeholder')}}</label>
<input type="text" name="firstname" id="firstname" value="{{ $data['firstname'] }}" readonly>
</div>
<div class="data-element">
<label for="lastname" style="margin-right: 16px;">{{ trans('spende.lastschrift.3l.placeholder')}}</label>
<input type="text" name="lastname" id="lastname" value="{{ $data['lastname'] }}" readonly>
</div>
@else
<div class="data-element">
<label for="company" style="margin-right: 16px;">{{ trans('spende.lastschrift.3c.placeholder')}}</label>
<input type="text" name="company" id="company" value="{{ $data['company'] }}" readonly>
</div>
@endif
@if(!empty($data['email']))
<div class="data-element">
<label for="email" style="margin-right: 16px;">Email</label>
<input type="text" name="email" id="email" value="{{ $data['email'] }}" readonly>
</div>
@endif
<div class="data-element">
<label for="iban" style="margin-right: 16px;">{{ trans('spende.iban') }}</label>
<input type="text" name="iban" id="iban" value="{{ $data['iban'] }}" readonly>
</div>
@if(!empty($data["bic"]))
<div class="data-element">
<label for="bic" style="margin-right: 16px;">{{ trans('spende.bic') }}</label>
<input type="text" name="bic" id="bic" value="{{ $data['bic'] }}" readonly>
</div>
@endif
<div class="data-element">
<label for="betrag" style="margin-right: 16px;">{{ trans('spende.betrag') }}</label>
<input type="text" name="betrag" id="betrag" value="{{ $data['betrag'] }} €" readonly>
</div>
<div class="data-element">
<label for="frequency" style="margin-right: 16px;">{{ trans('spende.frequency') }}</label>
<input type="text" name="frequency" id="frequency" value="{{ trans('spende.frequency.' . $data['frequency']) }}" readonly>
</div>
<div class="data-element">
<label for="nachricht" style="margin-right: 16px;">{{ trans('spende.danke.message') }}</label>
<textarea name="nachricht" id="nachricht" readonly>{{ $data['nachricht'] }}</textarea>
</div>
</div>
<button type="button" style="margin-top: 16px; margin-bottom: 16px;" class="btn btn-primary noprint js-only" onclick="window.print();">{{ trans('spende.drucken') }}</button>
@if($data['key'] !== false)
<div class="card-light">
<p style="text-align: center; width:100%;">{!! trans('spende.danke.schluessel') !!}</p>
<div class="copyLink">
<input id="key" class="loadSettings" type="text" style="text-align: center;" value="{{ $data['key'] }}">
<button class="btn btn-default js-only" onclick="var copyText = document.getElementById('key');copyText.select();copyText.setSelectionRange(0, 99999);document.execCommand('copy');">Kopieren</button>
</div>
</div>
@endif
</div>
@endsection
......@@ -96,13 +96,13 @@
<p>{!! trans('spende.lastschrift.2') !!}</p>
<input type="hidden" name="dt" value="{{ md5(date('Y') . date('m') . date('d')) }}">
<div id="input-picker" class="form-group donation-form-group">
<input type="radio" required="required" id="private" name="person" value="private" checked="checked"><label for="private">{{trans('spende.lastschrift.private')}}</label>
<input type="radio" required="required" id="private" name="person" value="private" @if(empty($data) || $data["person"] === "private")checked="checked"@endif><label for="private">{{trans('spende.lastschrift.private')}}</label>
<div id="input-private" class="show-on-input-checked form-inline">
<input type="text" class="form-control" id="firstname" name="firstname" placeholder="{!! trans('spende.lastschrift.3f.placeholder') !!}" @if(isset($data['firstname'])) value="{{$data['firstname']}}" @endif />
<input type="text" class="form-control" id="lastname" name="lastname" placeholder="{!! trans('spende.lastschrift.3l.placeholder') !!}" @if(isset($data['lastname'])) value="{{$data['lastname']}}" @endif />
</div>
<br>
<input type="radio" id="company" name="person" value="company"><label for="company">{{trans('spende.lastschrift.company')}}</label>
<input type="radio" id="company" name="person" value="company" @if(!empty($data) && $data["person"] === "company")checked="checked"@endif><label for="company">{{trans('spende.lastschrift.company')}}</label>
<div id="input-company" class="show-on-input-checked form-inline">
<input type="text" class="form-control" id="companyname" name="companyname" placeholder="{!! trans('spende.lastschrift.3c.placeholder') !!}" @if(isset($data['company'])) value="{{$data['company']}}" @endif />
</div>
......
......@@ -91,6 +91,7 @@ Route::group(
return view('spende.danke')
->with('title', trans('titles.spende'))
->with('navbarFocus', 'foerdern')
->with('css', [mix('/css/spende/danke.css')])
->with('data', unserialize(base64_decode($data)));
}]);
Route::get('partnershops', function () {
......
......@@ -55,6 +55,9 @@ mix
.less("resources/less/metager/pages/count/style.less", "public/css/count/style.css", {
strictMath: true
})
.less("resources/less/metager/pages/spende/danke.less", "public/css/spende/danke.css", {
strictMath: true
})
// js
.babel(
[
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment