View file funding/templates/funding/all.html

File size: 7.89Kb
<div class="fundings_parent">
	<div class="valign pg_page_title">
		<h4><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12.75,3.94C13.75,3.22 14.91,2.86 16.22,2.86C16.94,2.86 17.73,3.05 18.59,3.45C19.45,3.84 20.13,4.3 20.63,4.83C21.66,6.11 22.09,7.6 21.94,9.3C21.78,11 21.22,12.33 20.25,13.27L12.66,20.86C12.47,21.05 12.23,21.14 11.95,21.14C11.67,21.14 11.44,21.05 11.25,20.86C11.06,20.67 10.97,20.44 10.97,20.16C10.97,19.88 11.06,19.64 11.25,19.45L15.84,14.86C16.09,14.64 16.09,14.41 15.84,14.16C15.59,13.91 15.36,13.91 15.14,14.16L10.55,18.75C10.36,18.94 10.13,19.03 9.84,19.03C9.56,19.03 9.33,18.94 9.14,18.75C8.95,18.56 8.86,18.33 8.86,18.05C8.86,17.77 8.95,17.53 9.14,17.34L13.73,12.75C14,12.5 14,12.25 13.73,12C13.5,11.75 13.28,11.75 13.03,12L8.44,16.64C8.25,16.83 8,16.92 7.73,16.92C7.45,16.92 7.21,16.83 7,16.64C6.8,16.45 6.7,16.22 6.7,15.94C6.7,15.66 6.81,15.41 7.03,15.19L11.63,10.59C11.88,10.34 11.88,10.11 11.63,9.89C11.38,9.67 11.14,9.67 10.92,9.89L6.28,14.5C6.06,14.7 5.83,14.81 5.58,14.81C5.3,14.81 5.06,14.71 4.88,14.5C4.69,14.3 4.59,14.06 4.59,13.78C4.59,13.5 4.69,13.27 4.88,13.08C7.94,10 9.83,8.14 10.55,7.45L14.11,10.97C14.5,11.34 14.95,11.53 15.5,11.53C16.2,11.53 16.75,11.25 17.16,10.69C17.44,10.28 17.54,9.83 17.46,9.33C17.38,8.83 17.17,8.41 16.83,8.06L12.75,3.94M14.81,10.27L10.55,6L3.47,13.08C2.63,12.23 2.15,10.93 2.04,9.16C1.93,7.4 2.41,5.87 3.47,4.59C4.66,3.41 6.08,2.81 7.73,2.81C9.39,2.81 10.8,3.41 11.95,4.59L16.22,8.86C16.41,9.05 16.5,9.28 16.5,9.56C16.5,9.84 16.41,10.08 16.22,10.27C16.03,10.45 15.8,10.55 15.5,10.55C15.23,10.55 15,10.45 14.81,10.27V10.27Z"></path></svg></span>{{LANG funding_requets}}</h4>
		<?php if ($config['raise_money'] == 'on') { ?>
		<?php if ($config['raise_money_type'] == 0 || ($config['raise_money_type'] == 1 && $context['user_data']['verified'])) { ?>
			<a href="{{CONFIG site_url}}/funding_acquisition" data-ajax="ajax_loading.php?app=funding_acquisition&apph=funding_acquisition" class="btn btn-main btn-mat btn-mat-raised">{{LANG create}}</a>
		<?php } } ?>
	</div>
	<div class="row list">
		<?php if ($context['fund']) { foreach ($context['fund'] as $key => $user) { ?>
			<div class="col-md-6 item fund_item" data-fund="<?php echo($user->id) ?>">
				<div class="fundings">
					<div class="wrapper">
						<a href="{{CONFIG site_url}}/funding/<?php echo(!empty($user->hashed_id) ? $user->hashed_id : $user->id) ?>" data-ajax="ajax_loading.php?app=funding&apph=funding&id=<?php echo(!empty($user->hashed_id) ? $user->hashed_id : $user->id) ?>"><img src="<?php echo($user->image) ?>" alt="Picture" /></a>
						<p><?php echo $context['currency_symbol'].$user->raised; ?> {{LANG raised_of}} <?php echo $context['currency_symbol'].$user->amount; ?></p>
						<?php if ($context['user']['user_id'] == $user->user_id || IS_ADMIN) { ?>
							<div class="dropdown">
								<span class="dropdown-toggle" data-toggle="dropdown">
									<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"></path></svg>
								</span>
								<ul class="dropdown-menu pull-right">
									<li onclick="delete_funding(<?php echo $user->id;?>)"><a href="javascript:void(0);">{{LANG delete}}</a></li>
									<li><a href="{{CONFIG site_url}}/edit_funding/<?php echo $user->id;?>" data-ajax="ajax_loading.php?app=edit_funding&amp;apph=edit_funding&amp;id=<?php echo $user->id;?>">{{LANG edit_funding}}</a></li>
								</ul>
							</div>
						<?php } ?>
					</div>
					<div class="caption">
						<h3><a href="{{CONFIG site_url}}/funding/<?php echo(!empty($user->hashed_id) ? $user->hashed_id : $user->id) ?>" data-ajax="ajax_loading.php?app=funding&apph=funding&id=<?php echo(!empty($user->hashed_id) ? $user->hashed_id : $user->id) ?>"><?php echo $user->title; ?></a></h3>
						<div class="progress">
							<div class="progress-bar" role="progressbar" style="width: <?php echo $user->bar; ?>%" aria-valuenow="<?php echo $user->bar; ?>" aria-valuemin="0" aria-valuemax="<?php echo($user->amount) ?>"></div>
						</div>
					</div>
				</div>
			</div>
		<?php } }else{ ?>
			<div class="empty_state">
				<span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12.75,3.94C13.75,3.22 14.91,2.86 16.22,2.86C16.94,2.86 17.73,3.05 18.59,3.45C19.45,3.84 20.13,4.3 20.63,4.83C21.66,6.11 22.09,7.6 21.94,9.3C21.78,11 21.22,12.33 20.25,13.27L12.66,20.86C12.47,21.05 12.23,21.14 11.95,21.14C11.67,21.14 11.44,21.05 11.25,20.86C11.06,20.67 10.97,20.44 10.97,20.16C10.97,19.88 11.06,19.64 11.25,19.45L15.84,14.86C16.09,14.64 16.09,14.41 15.84,14.16C15.59,13.91 15.36,13.91 15.14,14.16L10.55,18.75C10.36,18.94 10.13,19.03 9.84,19.03C9.56,19.03 9.33,18.94 9.14,18.75C8.95,18.56 8.86,18.33 8.86,18.05C8.86,17.77 8.95,17.53 9.14,17.34L13.73,12.75C14,12.5 14,12.25 13.73,12C13.5,11.75 13.28,11.75 13.03,12L8.44,16.64C8.25,16.83 8,16.92 7.73,16.92C7.45,16.92 7.21,16.83 7,16.64C6.8,16.45 6.7,16.22 6.7,15.94C6.7,15.66 6.81,15.41 7.03,15.19L11.63,10.59C11.88,10.34 11.88,10.11 11.63,9.89C11.38,9.67 11.14,9.67 10.92,9.89L6.28,14.5C6.06,14.7 5.83,14.81 5.58,14.81C5.3,14.81 5.06,14.71 4.88,14.5C4.69,14.3 4.59,14.06 4.59,13.78C4.59,13.5 4.69,13.27 4.88,13.08C7.94,10 9.83,8.14 10.55,7.45L14.11,10.97C14.5,11.34 14.95,11.53 15.5,11.53C16.2,11.53 16.75,11.25 17.16,10.69C17.44,10.28 17.54,9.83 17.46,9.33C17.38,8.83 17.17,8.41 16.83,8.06L12.75,3.94M14.81,10.27L10.55,6L3.47,13.08C2.63,12.23 2.15,10.93 2.04,9.16C1.93,7.4 2.41,5.87 3.47,4.59C4.66,3.41 6.08,2.81 7.73,2.81C9.39,2.81 10.8,3.41 11.95,4.59L16.22,8.86C16.41,9.05 16.5,9.28 16.5,9.56C16.5,9.84 16.41,10.08 16.22,10.27C16.03,10.45 15.8,10.55 15.5,10.55C15.23,10.55 15,10.45 14.81,10.27V10.27Z" /></svg></span>
				<p>{{LANG no_funding_yet}}</p>
			</div>
		<?php } ?>
	</div>
	<?php if (count($context['fund']) > 8) { ?>
		<div class="load_more fund_btn text-center">
			<button class="btn valign" onclick="Pxp_LoadMoreFund(this)"><span class="valign"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"></path></svg></span> {{LANG load_more}}</button>
		</div>
	<?php } ?>
	<div class="clear"></div>
</div>

<div class="confirm--modal delfunding--modal" style="display: none !important;">
	<div class="confirm--modal--inner">
		<div class="confirm--modal--body">
			<h5>{{LANG delete_funding}}?</h5>
			<p>{{LANG confirm_del_fund}}</p>
		</div>
		<div class="confirm--modal--footer">
			<button class="btn btn-default" data-confirm--modal-dismiss>{{LANG cancel}}</button>
			<button class="btn btn-danger btn-red delete--funding-request">{{LANG delete}}</button>
		</div>
	</div>
</div>

<script type="text/javascript">
function Pxp_LoadMoreFund(self) {
    var last_id = $('.fund_item').last().attr('data-fund');
    $(self).html('{{LANG please_wait}}');
    $.post(link('profile/load_more_fund'), {id: last_id}, function(data, textStatus, xhr) {
        if (data.status == 200) {
            if (data.html != '') {
                $('.list').append(data.html);
                $(self).html('<span class="valign"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"></path></svg></span> {{LANG load_more}}');
            }
            else{
                $('.fund_btn').remove();
            }
        }
        else{
            scroll2top();
            $.toast(data.message,{
                duration: 5000, 
                type: 'success',
                align: 'bottom',
                singleton: true
            });
        }
    });
}
</script>