Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Creator #580

Merged
merged 19 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Resources/templates/responsive/creator/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php $this->layout("layout", [
'bodyClass' => 'project creator',
]);

$permanentProject = $this->permanentProject;
$listOfProjects = $this->listOfProjects;
?>

<?php $this->section('head'); ?>
<?= $this->insert('creator/partials/styles') ?>
<?php $this->append(); ?>

<?php $this->section('content'); ?>

<main class="container-fluid main-info">
<div class="container-fluid">
<div class="row header text-center">
<h1 class="project-title"><?= $this->markdown($this->ee($permanentProject->name)) ?></h1>
<div class="project-by"><strong><?= $permanentProject->user->name ?></strong></div>
</div>

<div class="row">
<div class="col-md-12">
<?= $this->insert('project/partials/media', ['project' => $permanentProject ]) ?>
</div>
</div>

<?= $this->insert('creator/partials/share_social') ?>

<?= $this->insert('creator/partials/channel', ['project' => $permanentProject]) ?>

<?= $this->insert('creator/partials/subscriptions', ['project' => $permanentProject, 'subscriptions' => $permanentProject->getRewardsOrderBySubscribable()]) ?>

<?= $this->insert('creator/partials/posts', ['project' => $permanentProject, 'subscriptions' => $permanentProject->getSubscribableRewards()]) ?>
</div>
</main>

<?php $this->append(); ?>

<?php $this->section('footer'); ?>
<?= $this->insert('creator/partials/javascript') ?>
<?php $this->append(); ?>
18 changes: 18 additions & 0 deletions Resources/templates/responsive/creator/partials/channel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
$channels = $this->channels;
if (!$channels)
return;
?>

<section class="channel">
<h2><?= $this->t('regular-channels') ?></h2>
<div class="slider slider-channel">
<?php foreach($this->channels as $channel): ?>
<article class="channel">
<a href="/channel/<?= $channel->id ?>">
<img width="100" height="100" src="<?= $channel->getLogo()->getLink(100, 0, false) ?>" alt="<?= $channel->name ?>" title="<?= $channel->name ?>">
</a>
</article>
<?php endforeach; ?>
</div>
</section>
25 changes: 25 additions & 0 deletions Resources/templates/responsive/creator/partials/post_item.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
$post = $this->post;
$user = $this->user;
?>

<article class="post">
<?php if ($post->image): ?>
<div class="post-image">
<img class="post-image" src="<?= $post->image->getLink(80,80,false) ?>" alt="<?= $post->title ?>">
</div>
<?php endif; ?>

<div class="card-body">
<div class="card-info">
<h2><a href="<?= "/blog/$post->slug" ?>" target="_blank" ><?= $post->title ?></a></h2>
<p><?= $post->subtitle ?></p>
</div>
<div class="card-author-info">
<div class="author-image">
<img src="<?= $user->avatar->getLink(30,30,false) ?>" alt="<?= $user->name ?>"> <?= $user->name ?>
</div>
<span><?= date_formater($this->post->date) ?></span>
</div>
</div>
</article>
15 changes: 15 additions & 0 deletions Resources/templates/responsive/creator/partials/posts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
$posts = $this->posts;
if (empty($posts))
return;
?>

<section class="posts">
<h2><?= $this->t('regular-posts') ?></h2>

<div class="post-grid">
<?php foreach($posts as $post): ?>
<?= $this->insert('creator/partials/post_item', ['post' => $post]); ?>
<?php endforeach; ?>
</div>
</section>
15 changes: 15 additions & 0 deletions Resources/templates/responsive/creator/partials/projects.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
$projects = $this->projects;
if (empty($projects))
return;
?>

<section class="projects" >
<h2><?= $this->t('regular-projects') ?></h2>

<div class="project-grid">
<?php foreach ($this->listOfProjects as $project) : ?>
<?= $this->insert('project/widgets/normal', ['project' => $project]) ?>
<?php endforeach ?>
</div>
</section>
25 changes: 25 additions & 0 deletions Resources/templates/responsive/creator/partials/share_social.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
$share_url = $this->get_url() . '/creator/' . $this->user->id;

$user_twitter = str_replace(
[
'https://',
'http://',
'www.',
'twitter.com/',
'#!/',
'@'
], '', $this->user->twitter);
$author_share = !empty($user_twitter) ? ' '.$this->text('regular-by').' @'.$user_twitter.' ' : '';
$share_title = $author_share;

$facebook_url = 'http://facebook.com/sharer.php?u=' . urlencode($share_url) . '&t=' . urlencode($share_title);
$twitter_url = 'http://twitter.com/intent/tweet?text=' . urlencode($share_title . ': ' . $share_url . ' #Goteo');
?>
<section class="share-social">
<ul class="info-extra list-inline">
<li><a class="fa fa-2x fa-twitter" title="" target="_blank" href="<?= $twitter_url ?>"></a></li>
<li><a class="fa fa-2x fa-facebook" title="" target="_blank" href="<?= $facebook_url ?>"></a></li>
<li><a class="fa fa-2x fa-telegram" title="" target="_blank" href="https://telegram.me/share/url?url=<?= $share_url ?>&text=<?= urlencode($share_title) ?>"></a></li>
</ul>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
$project = $this->project;
$subscription = $this->subscription;
?>

<article class="subscription">
<div class="card-header">
<h2 title="<?= $subscription->reward ?>"><?= $subscription->reward ?></h2>
</div>
<div class="card-body">
<div class="amount-box text-center text-uppercase">
<span class="amount"><?= amount_format($subscription->amount) ?></span>
</div>

<p>
<?= $this->markdown($subscription->description) ?>
</p>
</div>
<div class="card-footer">
<div class="reward-donate text-center">
<a class="btn btn-lg btn-cyan text-uppercase" href="/invest/<?= $project->id ?>/<?= $subscription->id ?>">
<?= $this->text('project-regular-support') ?>
</a>
</div>
</div>
</article>
15 changes: 15 additions & 0 deletions Resources/templates/responsive/creator/partials/subscriptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
$subscriptions = $this->subscriptions;
if (empty($subscriptions))
return;
?>

<section class="subscriptions">
<h2><?= $this->t('regular-subscriptions') ?></h2>

<div class="slider slider-subscriptions">
<?php foreach($subscriptions as $subscription): ?>
<?= $this->insert('creator/partials/subscription_item', ['subscription' => $subscription]); ?>
<?php endforeach; ?>
</div>
</section>
79 changes: 79 additions & 0 deletions public/assets/js/creator/creator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
@licstart The following is the entire license notice for the
JavaScript code in this page.

Copyright (C) 2010 Goteo Foundation

The JavaScript code in this page is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.

As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.


@licend The above is the entire license notice
for the JavaScript code in this page.
*/

$(function(){
$('.slider-subscriptions').slick({
dots: true,
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
arrows: true,
cssEase: 'linear',
prevArrow: '<div class="custom-left-arrow"><span class="fa fa-angle-left"></span><span class="sr-only">Prev</span></div>',
nextArrow: '<div class="custom-right-arrow"><span class="fa fa-angle-right"></span><span class="sr-only">Next</span></div>',
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2.5,
arrows:false
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1.5,
}
}
]
});

$('.slider-channel').slick({
dots: true,
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
arrows: true,
cssEase: 'linear',
prevArrow: '<div class="custom-left-arrow"><span class="fa fa-angle-left"></span><span class="sr-only">Prev</span></div>',
nextArrow: '<div class="custom-right-arrow"><span class="fa fa-angle-right"></span><span class="sr-only">Next</span></div>',
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2.5,
arrows:false
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1.5,
}
}
]
});

});
Loading
Loading