list ausmisten

master
Benjamin Völkl 2021-02-09 12:18:53 -03:00
parent a5b9bf2201
commit 5772ee9379
1 changed files with 0 additions and 818 deletions

View File

@ -27,111 +27,6 @@
</div>
</div>

<div class="container">
<div class="row">
@if (\Route::currentRouteName() == 'author.get')
<div class="col-sm-12 col-md-2 text-center">
<br>
<br>
<img src="{{ $author->gravatar() }}?s=120&d=identicon&r=PG" width="120" class="rounded-circle img-fluid border" title="{{ $author->name }}">
</div>
<div class="col-sm-12 col-md-10">
<br><br>
<h1>{{ $author->name }}</h1>


<p class="intro">
{{ $author->description }}
</p>



<div class="row">
<div class="col-md-7 col-sm-12">
@if (isset($author->social_networks['email']))
<a href="mailto:{{ $author->social_networks['email'] }}"><i class="fal fa-envelope"></i></a>
|
@endif

@if (isset($author->social_networks['site']))
<a href="{{ $author->social_networks['site'] }}">{{ $author->social_networks['site'] }}</a>
@endif
<br>
<br>
</div>

<div class="col-md-5 col-sm-12 text-center">
<?php
$social = [
'telegram',
'behance',
'snapchat',
'stack-overflow',
'vimeo',
'github',
'reddit',
'instagram',
'linkedin',
'pinterest',
'twitter',
'facebook',
'youtube'
];
?>

@foreach ($social as $value)
@if (isset($author->social_networks[$value]))
<a href="{{ $author->social_networks[$value] }}"><i class="fab fa-{{ $value }}"></i></a>
@endif
@endforeach

<br>
<br>
</div>

</div>
</div>
@endif

@if (\Route::currentRouteName() == 'welcome')
<div class="col-12">
<br>
<br>
<h2 class="h4" class="text-center">{{ __('public.popular-authors') }}</h2>
</div>

@foreach ($authors as $author)
<div class="col-4 col-md-2 text-center">
<br>
<a href="{{ route('author.get', [$author->slug]) }}" title="{{ $author->name }}">
<img src="{{ $author->gravatar() }}?s=120&d=identicon&r=PG" width="120" class="rounded-circle img-fluid border">
</a>
</div>
@endforeach

<!--<div class="col-lg-12" style="text-align: center">
<br>
<br>
<a href=""> See all authors <i class="fal fa-arrow-right"></i></a>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>-->

<div class="col-lg-12">
<br>
<br>
<br>
</div>

@endif
</div>
</div>



@ -143,24 +38,6 @@



@if (env('APP_WRITE', false))
<br>
<br>
<br>
<a href="" class="float-right" data-toggle="modal" data-target="#exampleModal"><i class="fal fa-plus"></i> {{ __('public.propose-content') }} Neuen Inhalt einreichen</a>
<br>
<br>


@endif



<br>




<div class="article-feed">
@foreach($nachrichten as $nach)

@ -216,49 +93,6 @@
{!! $nach->nachrichten !!}
</p>

@if ($nach->type_id == 2)
<p class="card-text">
<p style="font-weight:600;">{{ __('public.work-location') }}</p> {{ isset($nach->additional_fields['workplace']) ? $nach->additional_fields['workplace'] : '-'}}
</p>

<p class="card-text">
<p style="font-weight:600;">{{ __('public.contact-data') }}</p> {!! isset($nach->additional_fields['contact_info']) ? $nach->additional_fields['contact_info'] : '-' !!}
</p>
@endif

@if($nach->type_id == 3)
<hr>



<div class="row">
@foreach ($nach->actions as $action)

<div class="col">
<a href="" style="margin-top: 20px;" id="action{{ $action->id }}" class="btn btn-{{ $action->color }} mx-0 d-block get-action-invoice" data-id="{{ $action->id }}" data-type="{{ $action->type }}" data-execute="0"><i class="fal fa-{{ $action->icon }}"></i> {{ $action->name }} for {{ $action->amount }} sats.</a>
</div>
@endforeach
</div>
@endif

@if(sizeof($nach->files) > 0)
<br>
<h5>{{ __('public.files-download') }}</h5>
<div class="row">


@foreach ($nach->files as $file)
<div class="col-lg-12">
<a href="{{ asset($file->url)}}" class="btn btn-primary" onclick="ga('send', 'event', 'File Download', 'User', '{{$file->filename}}');" >
<i class="fas fa-download"></i>
{{$file->filename}}
</a>
<br>
<br>
</div>
@endforeach
</div>
@endif

</div>

@ -266,49 +100,10 @@



@if (env('APP_COMMENTS', false))
<div class="card-footer" id="comment_button_{{$nach->id}}">

@if(sizeof($nach->comments) > 0)

<a href="#" onclick="showComments(event, {{$nach->id}})"> <span class="badge badge-primary">{{sizeof($nach->comments)}}</span> {{ __('public.see-comments') }}</a>
@else
<i>{{ __('public.no-comments-yet') }}</i>
@endif

<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#exampleModal2" onclick="setCommentId({{$nach->id}}),ga('send', 'event', 'Read Comments', 'Website', '{{$nach->title}}');">
<i class="fas fa-comment"></i> {{ __('public.comment') }}
</button>
</div>
@endif



<div style="display:none" id="comments_{{$nach->id}}">
<div class="card-footer bg-primary">
<a class="text-white"> <span class="badge badge-light">{{sizeof($nach->comments)}}</span> {{ __('public.comments') }}</a>
<button class="btn btn-dark btn-sm float-right" data-toggle="modal" data-target="#exampleModal2" onclick="setCommentId({{$nach->id}}),ga('send', 'event', 'Create Comment', 'Modal for Comment Creation', '{{$nach->title}}');">
<i class="fas fa-comment"></i> {{ __('public.comment') }}
</button>
</div>
<table>
@foreach($nach->comments as $comment)
<row>
<div class="card-footer">
<i class="fas fa-user" style="color: #007BFF"></i> {{$comment->name}}:
<!-- For now taking that out, time is wrong... -->
<span class="float-right" title="{{date('d.m.Y | H:i', strtotime($comment->created_at))}} Uhr">{{date('d.m.Y H:i', strtotime($comment->created_at))}} Uhr</span>

</div>
<div class="card-body comment-text">
<p class="card-text">
{{$comment->comment}}
</p>
</div>
</row>
@endforeach
</table>
</div>

</div>
</div>
@ -329,622 +124,9 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jscroll/2.4.1/jquery.jscroll.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.countdown/2.2.0/jquery.countdown.min.js"></script>

<script src="{{ asset('template/js/dropzone.min.js') }}"></script>
<script src="{{ asset('template/js/fslightbox.js') }}"></script>

<script type="text/javascript" src="https://js.stripe.com/v2/"></script>

<script>
toastr.options = {
"progressBar": true
};
</script>

@if (env('APP_WRITE', false))
<script src="https://cdn.tiny.cloud/1/0015awrvvurgnwz3e0uid83chhzb7lnbi6wyn4ukk7b4lh9k/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
<script src="{{ asset('template/js/tiny-de.js') }}"></script>
@endif

@if (\Session::has('success_plan'))
<script>
toastr.success('{{ \Session::get('success_plan') }}', 'Success!');
</script>
@endif

<script>
$('.enter-premium-code').submit(function() {
event.preventDefault();

var code = $('#premium_code').val();

$('.btn-enter-premium').append('<i class="fas fa-sync fa-spin fa-premium-enter" style="font-size: 17px;color: #fff;margin-left:12px;position: relative;left:6px;display: inline-block !important;margin:auto;text-align:center;"></i>');

$.ajax({
type: 'GET',
dataType : 'json',
url: "{{ url('enterPremiumCode') }}/" + code,
success: function(data) {
$('.fa-premium-enter').remove();

if (data.code == 1) {
$('#content_premium').html('<div class="alert alert-danger" role="alert">Code not found or expired.</div>');
}

if (data.code == 2) {
$('#content_premium').html('<div class="alert alert-info" role="alert">Make the payment to activate your code. Payment expiration: '+data.payment_expired+' <br> <br><a href="lightning:'+data.payment_request+'"><img src="data:image/png;base64,' + data.qr_code + '" class="img-fluid rounded mx-auto d-block"/></a></div>');
}

if (data.code == 3) {
window.location.href = '{{ url("/") }}';
}
},
error: function(data) {
$('.fa-premium-enter').remove();

alert('error!');
}
});
});

$(document).on('shown.bs.modal', '.modal', function() {
$(this).find('[autofocus]').focus();
});

$.ajaxSetup({
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
});

if($.cookie('close_premium_alert') == undefined){
$('#alert-premium').css('display', 'block');
$('.bg-premium-code').css('display', 'none');
} else {
$('#alert-premium').css('display', 'none');
$('.bg-premium-code').css('display', 'block');
}

$('.close-premium').click(function() {
$('#alert-premium').css('display', 'none');
$('.bg-premium-code').css('display', 'block');

$.cookie('close_premium_alert', true);
});

$('.bg-premium-code').click(function() {
$('#alert-premium').css('display', 'block');
$('.bg-premium-code').css('display', 'none');

$.removeCookie('close_premium_alert');
});

function update_counter(){
$(".counter-class").each(function() {
var id = $(this).data('id');
var date = $(this).data('date');

$("#counter_" + id)
.countdown(date, function(event) {
$(this).text(
event.strftime('%-D day%!D %Hh %Mmin %Ssec.')
);
});
});
}

update_counter();

$(document).on('submit', '#formStripePremium', function(event) {
event.preventDefault();

$('.btn-sub-stripe').append('<i class="fa fa-spinner fa-spinner-bt fa-spin fa-3x fa-fw" style="font-size:20px;margin-left:10px;"></i>');

Stripe.setPublishableKey('{{ \Setting::get('stripe_publish_key') }}');

var valid = $('[name="card_valid"]').val();
var valid = valid.split('-');
var year = valid[0];
var moth = valid[1];

Stripe.card.createToken({
number: $('[name="card_number"]').val(),
cvc: $('[name="card_csv"]').val(),
exp_month: moth,
exp_year: year
}, stripeResponseHandler);

function stripeResponseHandler(status, response) {

// Grab the form:
var $form = $('#payment-form');

if (response.error) { // Problem!
toastr.remove();

$('.fa-spinner-bt').remove();

toastr.error('Error!', response.error.message);

return;

} else { // Token was created!

// Get the token ID:
var token = response.id;
var id = $('#stripe_premium_code_id').val();

$.ajax({
type: 'POST',
data: {
'token_stripe' : token,
'email_stripe' : $('#email_stripe').val()
},
dataType : 'json',
url: "{{ url('verifyInvoiceByPlanStripe') }}/" + id,
success: function(data) {
if (data.status == 3) {
toastr.remove();

$('.fa-spinner-bt').remove();

alert('Error! Please try again.');
}

if (data.status == 2) {
window.location.href = '{{ url("/") }}';
}
},
error: function(data) {
toastr.remove();

$('.fa-spinner-bt').remove();

toastr.error('Error!', 'Error Ajax');
}
});
}
}
});

function number_format (number, decimals, dec_point, thousands_sep) {
// Strip all characters but numerical ones.
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
s = '',
toFixedFix = function (n, prec) {
var k = Math.pow(10, prec);
return '' + Math.round(n * k) / k;
};
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
if (s[0].length > 3) {
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
}
if ((s[1] || '').length < prec) {
s[1] = s[1] || '';
s[1] += new Array(prec - s[1].length + 1).join('0');
}
return s.join(dec);
}

$(document).on('click', '.lnd-pay-card', function(event) {
event.preventDefault();

var premium_code_id = $(this).attr('data-premium-id');
var premium_plan_days = $(this).attr('data-premium-days');
var premium_expired_at = $(this).attr('data-expired-at');
var btc_base = parseFloat($('#amountBtc').val());

var premium_amount = (parseInt($(this).attr('data-amount')) / 100000000 * btc_base);
console.log(premium_amount);

var formatted_amount = number_format(premium_amount, 2, '.', '');

$('#stripe_premium_code_id').val(premium_code_id);

if (premium_code_id > 0) {
$('#exampleModalLabelPremiumStripe').html('<i class="fal fa-gem"></i> Buy '+premium_plan_days +' day Premium Plan');
$('.span-cost-premium-stripe').html('$' + formatted_amount);
$('.span-date-premium-stripe').html(premium_expired_at);
$('.span-days-premium-stripe').html(premium_plan_days);

$('.modal').modal('hide');
$('#stripe-modal').modal('show');
}
});

$(document).on("click", '.get-premium-invoice', function(event) {
event.preventDefault();

var id = $(this).data('id');

$(this).append('<i class="fas fa-sync fa-spin fa-premium-plan-icon" style="font-size: 20px;color: #fff;margin-left:12px;position: relative;left:12px;display: inline-block !important;margin:auto;text-align:center;"></i>');

$.ajax({
type: 'GET',
dataType : 'json',
url: "{{ url('createInvoicePlan') }}/" + id,
success: function(data) {
$('.fa-premium-plan-icon').remove();

$('#exampleModalLabelPremium').html('<i class="fal fa-gem"></i> Buy '+data.premium_plan_days +' day Premium Plan');
$('.span-cost-premium').html(data.amount + ' sats');
$('.span-date-premium').html(data.expired_at);
$('.span-days-premium').html(data.premium_plan_days);
$('.span-qrcode-premium').empty().html('<a href="LIGHTNING:'+data.payment_request+'"><img src="data:image/png;base64,' + data.qr_code + '" class="img-fluid rounded mx-auto d-block"/></a>');

$('.lnd-pay-card').attr('data-premium-id', data.premium_code_id);
$('.lnd-pay-card').attr('data-premium-days', data.premium_plan_days);
$('.lnd-pay-card').attr('data-expired-at', data.expired_at);
$('.lnd-pay-card').attr('data-amount', data.amount);

$('.modal').modal('hide');
$('#buy-pass').modal('show');

let interval = setInterval(function(){
verifyIntervalPremium(data.add_index, data.premium_code_id);
}, 1000);

function verifyIntervalPremium(add_index, premium_code_id)
{
$.ajax({
type: 'GET',
dataType : 'json',
url: "{{ url('verifyInvoicePlan') }}/" + add_index + "/" + premium_code_id,
success: function(data) {
if (data.status == 3) {
stopInterval();

alert('Error! Please try again.');
}

if (data.status == 2) {
stopInterval();

//data.days

window.location.href = '{{ url("/") }}';
}
},
error: function(data) {
//alert('error!');
}
});
}

function stopInterval()
{
clearInterval(interval);
}
},
error: function(data) {
$('.fa-premium-plan-icon').remove();

alert('error!');
}
});
});

$(document).on("click", '.get-action-invoice', function(event) {
event.preventDefault();

var id = $(this).data('id');
var type = $(this).data('type');
var message = '';

if (type == 2) {
if ($('#message_action_' + id).val()) {
var message = $('#message_action_' + id).val();
}
}

$(this).append('<i class="fas fa-sync fa-spin fa-action-plan-icon" style="font-size: 20px;color: #fff;margin-left:12px;position: relative;left:12px;display: inline-block !important;margin:auto;text-align:center;"></i>');

$.ajax({
type: 'POST',
dataType : 'json',
data: {
'message' : message
},
url: "{{ url('createInvoiceAction') }}/" + id,
success: function(data) {
$('.fa-action-plan-icon').remove();

$('#exampleModalLabelAction').html('<i class="fal fa-play-circle"></i> '+data.action_name +' for '+data.action_amount+' sats.');
$('.span-cost-action').html(data.action_amount + ' sats');
$('.span-qrcode-action').empty().html('<a href="LIGHTNING:'+data.payment_request+'"><img src="data:image/png;base64,' + data.qr_code + '" class="img-fluid rounded mx-auto d-block"/></a>');
$('.span-name-action').html(data.action_name);

$('#iot-invoice').modal('show');

let interval = setInterval(function(){
verifyIntervalAction(data.add_index, data.id, id);
}, 3000);

function verifyIntervalAction(add_index, id, actionId)
{
console.log($('#action'+actionId).data('execute'));

if ($('#action'+actionId).data('execute') == 1) {
return;
}

$('#action'+actionId).data('execute', 1);

$.ajax({
type: 'GET',
dataType : 'json',
url: "{{ url('verifyInvoiceAction') }}/" + add_index + "/" + id,
success: function(data) {
if (data.status == 3) {
stopInterval();

$('#action'+data.action.id).data('execute', 0);

alert('Error! Please try again.');
}

if (data.status == 2) {
stopInterval();

$('#action'+data.action.id).attr('data-execute', 1);

if (data.action.type == 1) {
window.location.href = '{{ url("/") }}';
}

if (data.action.type == 2) {
toastr.success(data.action.name, 'Success!');
$('.modal').modal('hide');
}

if (data.action.type == 3) {
toastr.success(data.action.name, 'Success!');

$('.modal').modal('hide');
}

if (data.action.type == 4) {
window.open(
data.action.target,
'_blank'
);
toastr.success(data.action.name, 'Success!');
$('.modal').modal('hide');
}
}

if (data.status == 1) {
$('#action'+actionId).data('execute', 0);
}
},
error: function(data) {
//alert('error!');
}
});
}

function stopInterval()
{
clearInterval(interval);
}
},
error: function(data) {
$('.fa-action-plan-icon').remove();

alert('error!');
}
});
});

</script>

<script>
$(document).on('focusin', function(e) {
if ($(e.target).closest(".tox").length) {
e.stopImmediatePropagation();
}
});

$('[name="paid"]').change(function() {
event.preventDefault();

if (this.value == 1) {
var data_html = '<div class="form-group"><label for="paidAmount">Bezahlbarer Betrag</label><input type="number" value="1000" class="form-control" id="paidAmount" placeholder="Bezahlbarer Betrag" name="paidAmount" required="required"></div>';

$('.form-amount').html(data_html);
} else {
$('.form-amount').empty();
}
});

$(document).on("click", '.get-collapse-invoice', function(event) {
event.preventDefault();

var id = $(this).data('id');

var isExpanded = $('#ln-invoice-' + id).hasClass('show');

$('#ln-invoice-' + id).collapse('toggle');

if (isExpanded == false) {
$('.pay-news-' + id).html('<i class="fas fa-sync fa-spin" style="font-size: 34px;color: #fff;display: block;margin:auto;text-align:center;"></i>');

$.ajax({
type: 'GET',
dataType : 'json',
url: "{{ url('createInvoice') }}/" + id,
success: function(data) {
$('.pay-news-' + id).empty().html('<img src="data:image/png;base64,' + data.qr_code + '" class="img-fluid rounded mx-auto d-block"/>');
$('.pay-news-' + id).attr('href', 'LIGHTNING:' + data.payment_request);
$('#pay-news-title-' + id).empty().html('<div class="input-group mb-3"><div class="input-group-prepend"><span class="input-group-text" id="basic-addon1"> <a href=""><i class="fal fa-copy"></i></a></span></div><input type="text" class="form-control" value="'+data.payment_request+'" aria-describedby="basic-addon1"></div>');

let interval = setInterval(function(){
verifyInterval(data.add_index, data.id);
}, 2000);

function verifyInterval(add_index, id)
{
$.ajax({
type: 'GET',
dataType : 'json',
url: "{{ url('verifyInvoice') }}/" + add_index + "/" + id,
success: function(data) {
if (data.status == 3) {
stopInterval();

alert('erro tente novamente!');
}

if (data.status == 2) {
stopInterval();

var content = data.content;
var idContent = data.id;

toastr.remove();
toastr.success('Premium content unlocked.', 'Success!');

$('#payment-request-' + idContent).remove();
$('.pay-preview-' + idContent).remove();
$('.card-preview-' + idContent).css('background', 'none');
$('#text_news_' + idContent).html(content);

if (data.nach_type == 2) {
if (data.additional_fields.workplace) {
var workplace = data.additional_fields.workplace;
} else {
var workplace = "";
}

if (data.additional_fields.contact_info) {
var contact_info = data.additional_fields.contact_info;
} else {
var contact_info = "";
}
}

if (data.nach_type == 3) {
var content_action = '<hr><div class="row">';

jQuery.each( data.actions, function( i, val ) {
var class_act = 'col-md-6';

if (data.actions.length == 1) {
var class_act = 'col-md-12';
}

content_action += '<div class="'+class_act+'">';
content_action += '<small>Description: '+val.description+'</small><br>';

if (data.show_total_paid_action) {
if (data.total_actions == 1) {
content_action += '<p>Total paid: '+data.total_paid_action+' sats</p>';
} else {
if (data.total_paid_action > 0) {
var diff = (val.total_paid * 100) / data.total_paid_action;
} else {
var diff = 0;
}

content_action+= '<div class="progress">';
content_action+= '<div class="progress-bar bg-'+val.color+'" role="progressbar" style="width: '+ diff +'%" aria-valuenow="66" aria-valuemin="0" aria-valuemax="100">'+val.total_paid+' sats</div>';
content_action+= '</div>';
}
}

content_action += '<a href="" id="action'+val.id+'" style="margin-top: 20px;" class="btn btn-'+val.color+' mx-0 d-block get-action-invoice" data-id="'+val.id+'" data-type="'+val.type+'" data-execute="0"><i class="fal fa-'+val.icon+'"></i> '+val.name+' for '+val.amount+' sats.</a>';
content_action += '</div>';
});

content_action += '</div>';

$('#box_action_' +idContent).html(content_action);
}

$('#text_news_workplace_' + idContent).html(workplace);
$('#text_news_contact_info_' + idContent).html(contact_info);

}
},
error: function(data) {
//alert('error!');
}
});
}

function stopInterval()
{
clearInterval(interval);
}
},
error: function(data) {
alert('error!');
}
});
} else {
$('.pay-news-' + id).empty();
$('#pay-news-title-' + id).empty();
}
});

tinymce.init({
selector: '#exampleFormControlTextarea1',
plugins: 'advlist link image lists',
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | link | unlink | image',
height: '250',
directionality : 'de',
language : 'de',
setup: function (editor) {
editor.on('change', function (e) {
editor.save();
});
}
});

var uploadedDocumentMap = {}
myDropzone = Dropzone.options.imageDropzone = {
url: '{{ url('addFile') }}',
maxFilesize: 2, // MB
acceptedFiles: 'image/*,application/pdf,.doc,.docx,.xls,.xlsx',
addRemoveLinks: true,
headers: {
'X-CSRF-TOKEN': "{{ csrf_token() }}"
},
success: function (file, response) {
$('form').append('<input type="hidden" name="files[]" value="' + response.name + '|'+ response.original_name +'">')
uploadedDocumentMap[file.name] = response.name
},
removedfile: function (file) {
file.previewElement.remove()
var name = ''
if (typeof file.file_name !== 'undefined') {
name = file.file_name
} else {
name = uploadedDocumentMap[file.name]
}
$('form').find('input[name="files[]"][value="' + name + '"]').remove()
}
}
</script>
<script>
function setCommentId(id) {
document.getElementById('comment_nach_id').value = id
}

function showComments(event, id) {
event.preventDefault();
document.getElementById('comment_button_' + id).style.display = 'none';
document.getElementById('comments_' + id).style.display = "";

return false;
}

function angebote() {
window.location.href = "{{url('angebote')}}"
}
</script>
@stop