-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/project_post' into beta
- Loading branch information
Showing
22 changed files
with
708 additions
and
64 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
Resources/templates/responsive/dashboard/project/privacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php $this->layout('dashboard/project/layout') ?> | ||
|
||
<?php $this->section('dashboard-content') ?> | ||
|
||
<div class="dashboard-content"> | ||
<div class="inner-container"> | ||
<h2><?= $this->ee($this->post->title) ?></h2> | ||
<p><?= $this->text('dashboard-menu-projects-updates-privacy') ?></p> | ||
<a href="/dashboard/project/<?= $this->project->id ?>/updates/<?= $this->post->id ?>/privacy/new" class="btn btn-cyan spacer-bottom-20"><i class="fa fa-plus"></i> <?= $this->text('form-add-button') ?></a> | ||
|
||
<?php if($this->rewards): ?> | ||
<table class="-footable table"> | ||
<thead> | ||
<tr> | ||
<th data-type="number" data-breakpoints="xs">#</th> | ||
<th><?= $this->text('regular-title') ?></th> | ||
<th style="min-width: 140px"><?= $this->text('regular-actions') ?></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php | ||
foreach($this->rewards as $reward): | ||
?> | ||
<tr> | ||
<td><?= $reward->getReward()->id ?></td> | ||
<td><?= $reward->getReward()->reward ?></td> | ||
<td> | ||
<div class="btn-group"> | ||
<a class="btn btn-default" title="<?= $this->text('regular-delete') ?>" href="/project/<?= $this->project->id ?>/updates/<?= $this->post->id ?>/delete/<?= $reward->getReward()->id ?>"><i class="fa fa-trash"></i></a> | ||
</div> | ||
</td> | ||
</tr> | ||
<?php endforeach ?> | ||
</tbody> | ||
</table> | ||
|
||
<?= $this->insert('partials/utils/paginator', ['total' => $this->total, 'limit' => $this->limit]) ?> | ||
|
||
<?php else: ?> | ||
<blockquote> | ||
<?= $this->text('dashboard-project-blog-privacy-empty') ?> | ||
</blockquote> | ||
<?php endif ?> | ||
</div> | ||
</div> | ||
|
||
<?php $this->replace() ?> |
12 changes: 12 additions & 0 deletions
12
Resources/templates/responsive/dashboard/project/privacy/new.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php $this->layout('dashboard/project/layout') ?> | ||
|
||
<?php $this->section('dashboard-content') ?> | ||
|
||
|
||
<section class="container"> | ||
<h2><?= $this->text('dashboard-project-privacy-add-new-restriction', $this->post->title) ?></h2> | ||
|
||
<?= $this->form_form($this->raw('form')) ?> | ||
</section> | ||
|
||
<?php $this->replace() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
db/migrations/20231030152314_goteo_create_post_reward_access.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Migration Task class. | ||
*/ | ||
class GoteoCreatePostRewardAccess | ||
{ | ||
public function preUp() | ||
{ | ||
// add the pre-migration code here | ||
} | ||
|
||
public function postUp() | ||
{ | ||
// add the post-migration code here | ||
} | ||
|
||
public function preDown() | ||
{ | ||
// add the pre-migration code here | ||
} | ||
|
||
public function postDown() | ||
{ | ||
// add the post-migration code here | ||
} | ||
|
||
/** | ||
* Return the SQL statements for the Up migration | ||
* | ||
* @return string The SQL string to execute for the Up migration. | ||
*/ | ||
public function getUpSQL() | ||
{ | ||
// return sql query to create table that links post with reward to grant access to the post content | ||
return " | ||
ALTER TABLE `post` ADD COLUMN `access_limited` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `allow`; | ||
CREATE TABLE `post_reward_access` ( | ||
`post_id` bigint(20) unsigned NOT NULL, | ||
`reward_id` bigint(20) unsigned NOT NULL, | ||
PRIMARY KEY (`post_id`, `reward_id`), | ||
FOREIGN KEY (`post_id`) REFERENCES `post` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
FOREIGN KEY (`reward_id`) REFERENCES `reward` (`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
"; | ||
} | ||
|
||
/** | ||
* Return the SQL statements for the Down migration | ||
* | ||
* @return string The SQL string to execute for the Down migration. | ||
*/ | ||
public function getDownSQL() | ||
{ | ||
return " | ||
DROP TABLE `post_reward_access`; | ||
ALTER TABLE `post` DROP COLUMN `access_limited`; | ||
"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.