mirror of
https://github.com/godotengine/godot-asset-library.git
synced 2026-01-04 14:10:53 +03:00
Enforce usage of repository providers and commit/tag for assets.
Closes #63.
This commit is contained in:
31
data/migration-1.sql
Normal file
31
data/migration-1.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
ALTER TABLE `as_assets` ADD COLUMN `download_provider` TINYINT NOT NULL AFTER `download_url`;
|
||||
ALTER TABLE `as_assets` ADD `download_commit` VARCHAR(64) NOT NULL AFTER `download_provider`;
|
||||
|
||||
UPDATE `as_assets` SET `download_provider`=0,`download_commit`=
|
||||
SUBSTRING(`download_url`,
|
||||
LOCATE('/',`download_url`,LOCATE('/',`download_url`,LOCATE('/',`download_url`,20)+1)+1)+1,
|
||||
-- Matching the last slash, which is V right below the `V`
|
||||
-- https://github.com/.../.../archive/....zip
|
||||
-- ^ This slash is the 19-th character
|
||||
LENGTH(`download_url`) - LOCATE('/',`download_url`,LOCATE('/',`download_url`,LOCATE('/',`download_url`,20)+1)+1) - 4
|
||||
-- Repeating locate formula :/
|
||||
) WHERE `download_url` RLIKE 'https:\/\/github.com\/[^\/]+\/[^\/]+\/archive\/[^\/]+.zip';
|
||||
|
||||
ALTER TABLE `as_assets` DROP COLUMN `download_url`;
|
||||
|
||||
ALTER TABLE `as_asset_edits` ADD COLUMN `download_provider` TINYINT NULL AFTER `download_url`;
|
||||
ALTER TABLE `as_asset_edits` ADD `download_commit` VARCHAR(64) NULL AFTER `download_provider`;
|
||||
|
||||
UPDATE `as_asset_edits` SET `download_provider`=0,`download_commit`=
|
||||
SUBSTRING(`download_url`,
|
||||
LOCATE('/',`download_url`,LOCATE('/',`download_url`,LOCATE('/',`download_url`,20)+1)+1)+1,
|
||||
-- Matching the last slash, which is V right below the `V`
|
||||
-- https://github.com/.../.../archive/....zip
|
||||
-- ^ This slash is the 19-th character
|
||||
LENGTH(`download_url`) - LOCATE('/',`download_url`,LOCATE('/',`download_url`,LOCATE('/',`download_url`,20)+1)+1) - 4
|
||||
-- Repeating locate formula :/
|
||||
) WHERE `download_url` RLIKE 'https:\/\/github.com\/[^\/]+\/[^\/]+\/archive\/[^\/]+.zip';
|
||||
|
||||
ALTER TABLE `as_asset_edits` DROP COLUMN `download_url`;
|
||||
@@ -37,10 +37,17 @@ return $constants = [
|
||||
'moderator' => 50,
|
||||
'admin' => 100,
|
||||
]),
|
||||
'download_provider' => double_map([
|
||||
'GitHub' => 0,
|
||||
'GitLab' => 1,
|
||||
'BitBucket' => 2,
|
||||
'Gogs' => 3,
|
||||
'cgit' => 4,
|
||||
]),
|
||||
'asset_edit_fields' => [
|
||||
'title', 'description', 'category_id',
|
||||
'version_string', 'cost',
|
||||
'download_url', 'browse_url', 'icon_url',
|
||||
'download_provider', 'download_commit', 'browse_url', 'icon_url',
|
||||
],
|
||||
'asset_edit_preview_fields' => [
|
||||
'type', 'link', 'thumbnail',
|
||||
|
||||
@@ -8,6 +8,47 @@ class Utils
|
||||
$this->c = $c;
|
||||
}
|
||||
|
||||
public function get_computed_download_url($repo_url, $provider, $commit, &$warning=null) // i.e. browse_url, download_provider, download_commit
|
||||
{
|
||||
if(is_int($provider)) {
|
||||
$provider = $this->c->constants['download_provider'][$provider];
|
||||
}
|
||||
$warning_suffix = "Please, ensure that the URL and the repository provider are, indeed, correct.";
|
||||
$light_warning_suffix = "Please, doublecheck that the URL and the repository provider are correct.";
|
||||
switch ($provider) {
|
||||
case 'GitHub':
|
||||
if(sizeof(preg_grep('/^https:\/\/github\.com\/.+?\/.+?$/', [$repo_url])) == 0) {
|
||||
$warning = "\"$repo_url\" doesn't look correct; it should be similar to \"https://github.com/<owner>/<name>\". $warning_suffix";
|
||||
}
|
||||
return "$repo_url/archive/$commit.zip";
|
||||
case 'GitLab':
|
||||
if(sizeof(preg_grep('/^https:\/\/(gitlab\.com|[^\/]+)\/.+?\/.+?$/', [$repo_url])) == 0) {
|
||||
$warning = "\"$repo_url\" doesn't look correct; it should be similar to \"https://<gitlab instance>/<owner>/<name>\". $warning_suffix";
|
||||
} elseif(sizeof(preg_grep('/^https:\/\/(gitlab\.com)\/.+?\/.+?$/', [$repo_url])) == 0) {
|
||||
$warning = "\"$repo_url\" might not be correct; it should be similar to \"https://gitlab.com/<owner>/<name>\", unless the asset is hosted on a custom instance of GitLab. $light_warning_suffix";
|
||||
}
|
||||
return "$repo_url/repository/archive.zip?ref=$commit";
|
||||
case 'BitBucket':
|
||||
if(sizeof(preg_grep('/^https:\/\/bitbucket\.org\/.+?\/.+?$/', [$repo_url])) == 0) {
|
||||
$warning = "\"$repo_url\" doesn't look correct; it should be similar to \"https://bitbucket.org/<owner>/<name>\". $warning_suffix";
|
||||
}
|
||||
return "$repo_url/get/$commit.zip";
|
||||
case 'Gogs':
|
||||
if(sizeof(preg_grep('/^https?:\/\/.+?\/.+?\/.+?$/', [$repo_url])) == 0) {
|
||||
$warning = "\"$repo_url\" doesn't look correct; it should be similar to \"http<s>://<gogs instance>/<owner>/<name>\". $warning_suffix";
|
||||
}
|
||||
$warning = "Since Gogs might be self-hosted, we can't be sure that \"$repo_url\" is a valid Gogs URL. $light_warning_suffix";
|
||||
return "$repo_url/archive/$commit.zip";
|
||||
case 'cgit':
|
||||
if(sizeof(preg_grep('/^https?:\/\/.+?\/.+?\/.+?$/', [$repo_url])) == 0) {
|
||||
$warning = "\"$repo_url\" doesn't look correct; it should be similar to \"http<s>://<cgit instance>/<owner>/<name>\". $warning_suffix";
|
||||
}
|
||||
$warning = "Since cgit might be self-hosted, we can't be sure that \"$repo_url\" is a valid cgit URL. $light_warning_suffix";
|
||||
return "$repo_url/snapshot/$commit.zip";
|
||||
default: return "$repo_url/$commit.zip"; // Obviously incorrect, but we would like to have some default case...
|
||||
}
|
||||
}
|
||||
|
||||
public function error_reponse_if_not_user_has_level($currentStatus, &$response, $user, $required_level_name, $message = 'You are not authorized to do this')
|
||||
{
|
||||
if($user === false || $currentStatus) return true;
|
||||
|
||||
@@ -64,7 +64,7 @@ return [
|
||||
OR username LIKE :filter
|
||||
)',
|
||||
|
||||
'get_one' => 'SELECT asset_id, category_type, title, username as author, user_id as author_id, version, version_string, category, category_id, rating, cost, description, support_level, download_url, download_hash, browse_url, icon_url, preview_id, `as_asset_previews`.type, link, thumbnail, searchable FROM `as_assets`
|
||||
'get_one' => 'SELECT asset_id, category_type, title, username as author, user_id as author_id, version, version_string, category, category_id, rating, cost, description, support_level, download_provider, download_commit, download_hash, browse_url, icon_url, preview_id, `as_asset_previews`.type, link, thumbnail, searchable FROM `as_assets`
|
||||
LEFT JOIN `as_categories` USING (category_id)
|
||||
LEFT JOIN `as_users` USING (user_id)
|
||||
LEFT JOIN `as_asset_previews` USING (asset_id)
|
||||
@@ -76,12 +76,12 @@ return [
|
||||
'apply_creational_edit' => 'INSERT INTO `as_assets`
|
||||
SET title=:title, description=:description, category_id=:category_id, user_id=:user_id,
|
||||
version_string=:version_string, cost=:cost,
|
||||
download_url=:download_url, download_hash=:download_hash, browse_url=:browse_url, icon_url=:icon_url,
|
||||
download_provider=:download_provider, download_commit=:download_commit, download_hash=:download_hash, browse_url=:browse_url, icon_url=:icon_url,
|
||||
version=0+:update_version, rating=0, searchable=TRUE',
|
||||
|
||||
'apply_edit' => 'UPDATE `as_assets`
|
||||
SET title=COALESCE(:title, title), description=COALESCE(:description, description), category_id=COALESCE(:category_id, category_id), version_string=COALESCE(:version_string, version_string), cost=COALESCE(:cost, cost),
|
||||
download_url=COALESCE(:download_url, download_url), download_hash=COALESCE(:download_hash, download_hash), browse_url=COALESCE(:browse_url, browse_url), icon_url=COALESCE(:icon_url, icon_url),
|
||||
download_provider=COALESCE(:download_provider, download_provider), download_commit=COALESCE(:download_commit, download_commit), download_hash=COALESCE(:download_hash, download_hash), browse_url=COALESCE(:browse_url, browse_url), icon_url=COALESCE(:icon_url, icon_url),
|
||||
version=version+:update_version
|
||||
WHERE asset_id=:asset_id',
|
||||
|
||||
@@ -99,7 +99,7 @@ return [
|
||||
],
|
||||
'asset_edit' => [
|
||||
'get_one' => 'SELECT edit_id, `as_asset_edits`.asset_id, user_id, title, description, category_id, version_string,
|
||||
cost, download_url, browse_url, icon_url, status, reason,
|
||||
cost, download_provider, download_commit, browse_url, icon_url, status, reason,
|
||||
edit_preview_id, `as_asset_previews`.preview_id, `as_asset_edit_previews`.type, `as_asset_edit_previews`.link, `as_asset_edit_previews`.thumbnail, `as_asset_edit_previews`.operation,
|
||||
`as_asset_previews`.type AS orig_type, `as_asset_previews`.link AS orig_link, `as_asset_previews`.thumbnail AS orig_thumbnail,
|
||||
unedited_previews.preview_id AS unedited_preview_id, unedited_previews.type AS unedited_type, unedited_previews.link AS unedited_link, unedited_previews.thumbnail AS unedited_thumbnail, username AS author
|
||||
@@ -114,7 +114,8 @@ return [
|
||||
'get_one_with_status' => 'SELECT * FROM `as_asset_edits` WHERE edit_id=:edit_id AND status=:status',
|
||||
'get_editable_by_asset_id' => 'SELECT * FROM `as_asset_edits` WHERE asset_id=:asset_id AND status=0',
|
||||
|
||||
'search' => 'SELECT edit_id, asset_id, `as_asset_edits`.user_id, COALESCE(`as_asset_edits`.title, `as_assets`.title) AS title, COALESCE(`as_asset_edits`.description, `as_assets`.description) AS description, category, COALESCE(`as_asset_edits`.version_string, `as_assets`.version_string) AS version_string, COALESCE(`as_asset_edits`.cost, `as_assets`.cost) AS cost, COALESCE(`as_asset_edits`.download_url, `as_assets`.download_url) AS download_url, COALESCE(`as_asset_edits`.browse_url, `as_assets`.browse_url) AS browse_url, COALESCE(`as_asset_edits`.icon_url, `as_assets`.icon_url) AS icon_url, `as_assets`.support_level, status, reason, username AS author FROM `as_asset_edits`
|
||||
'search' => 'SELECT edit_id, asset_id,
|
||||
`as_asset_edits`.user_id, COALESCE(`as_asset_edits`.title, `as_assets`.title) AS title, COALESCE(`as_asset_edits`.description, `as_assets`.description) AS description, category, COALESCE(`as_asset_edits`.version_string, `as_assets`.version_string) AS version_string, COALESCE(`as_asset_edits`.cost, `as_assets`.cost) AS cost, COALESCE(`as_asset_edits`.download_provider, `as_assets`.download_provider) AS download_provider, COALESCE(`as_asset_edits`.download_commit, `as_assets`.download_commit) AS download_commit, COALESCE(`as_asset_edits`.browse_url, `as_assets`.browse_url) AS browse_url, COALESCE(`as_asset_edits`.icon_url, `as_assets`.icon_url) AS icon_url, `as_assets`.support_level, status, reason, username AS author FROM `as_asset_edits`
|
||||
LEFT JOIN `as_users` USING (user_id)
|
||||
LEFT JOIN `as_categories` USING (category_id)
|
||||
LEFT JOIN `as_assets` USING (asset_id)
|
||||
@@ -142,12 +143,12 @@ return [
|
||||
|
||||
'submit' => 'INSERT INTO `as_asset_edits`
|
||||
SET asset_id=:asset_id, user_id=:user_id, title=:title, description=:description, category_id=:category_id, version_string=:version_string,
|
||||
cost=:cost, download_url=:download_url, browse_url=:browse_url, icon_url=:icon_url,
|
||||
cost=:cost, download_provider=:download_provider, download_commit=:download_commit,browse_url=:browse_url, icon_url=:icon_url,
|
||||
status=0',
|
||||
|
||||
'update' => 'UPDATE `as_asset_edits`
|
||||
SET title=:title, description=:description, category_id=:category_id, version_string=:version_string, cost=:cost,
|
||||
download_url=:download_url, browse_url=:browse_url, icon_url=:icon_url
|
||||
download_provider=:download_provider, download_commit=:download_commit, browse_url=:browse_url, icon_url=:icon_url
|
||||
WHERE edit_id=:edit_id AND status=0',
|
||||
|
||||
'add_preview' => 'INSERT INTO `as_asset_edit_previews`
|
||||
|
||||
@@ -152,12 +152,17 @@ $get_asset = function ($request, $response, $args) {
|
||||
$asset_info["type"] = $this->constants['category_type'][(int) $value];
|
||||
} elseif($column==="support_level") {
|
||||
$asset_info["support_level"] = $this->constants['support_level'][(int) $value];
|
||||
} elseif($column==="download_provider") {
|
||||
$asset_info["download_provider"] = $this->constants['download_provider'][(int) $value];
|
||||
} else {
|
||||
$asset_info[$column] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$asset_info['download_url'] = $this->utils->get_computed_download_url($asset_info['browse_url'], $asset_info['download_provider'], $asset_info['download_commit']);
|
||||
|
||||
foreach ($previews as $i => $_) {
|
||||
if(!isset($previews[$i]['thumbnail']) || $previews[$i]['thumbnail'] == '') {
|
||||
if($previews[$i]['type'] == 'video') {
|
||||
|
||||
@@ -43,11 +43,16 @@ function _insert_asset_edit_fields($c, $error, &$response, $query, $body, $requi
|
||||
if($error) return true;
|
||||
|
||||
foreach ($c->constants['asset_edit_fields'] as $i => $field) {
|
||||
if(isset($body[$field]) && $field == 'download_provider') {
|
||||
if(isset($c->constants['download_provider'][$body[$field]])) {
|
||||
$body[$field] = (int) $c->constants['download_provider'][$body[$field]];
|
||||
} else {
|
||||
$body[$field] = 0;
|
||||
}
|
||||
}
|
||||
if(!$required) {
|
||||
if(isset($body[$field]) && ($bare_asset === null || $bare_asset[$field] != $body[$field])) {
|
||||
$query->bindValue(':' . $field, $body[$field]);
|
||||
} elseif(!isset($body[$field]) && $bare_asset !== null) {
|
||||
$query->bindValue(':' . $field, $body[$field]);
|
||||
} else {
|
||||
$query->bindValue(':' . $field, null, PDO::PARAM_NULL);
|
||||
}
|
||||
@@ -277,6 +282,8 @@ $get_edit = function ($request, $response, $args) {
|
||||
$unedited_previews_last_i = $value;
|
||||
} elseif($column==='status') {
|
||||
$asset_edit['status'] = $this->constants['edit_status'][(int) $value];
|
||||
} elseif($column==='download_provider') {
|
||||
$asset_edit['download_provider'] = $this->constants['download_provider'][(int) $value];
|
||||
} else {
|
||||
$asset_edit[$column] = $value;
|
||||
}
|
||||
@@ -309,8 +316,37 @@ $get_edit = function ($request, $response, $args) {
|
||||
$asset = $query_asset->fetchAll()[0];
|
||||
|
||||
$asset_edit['original'] = $asset;
|
||||
$asset_edit['original']['download_provider'] = $this->constants['download_provider'][$asset['download_provider']];
|
||||
|
||||
if($asset_edit['browse_url'] || $asset_edit['download_provider'] || $asset_edit['download_commit']) {
|
||||
$asset_edit['download_url'] = $this->utils->get_computed_download_url(
|
||||
$asset_edit['browse_url'] ?: $asset_edit['original']['browse_url'],
|
||||
$asset_edit['download_provider'] ?: $asset_edit['original']['download_provider'],
|
||||
$asset_edit['download_commit'] ?: $asset_edit['original']['download_commit'],
|
||||
$warning
|
||||
);
|
||||
} else {
|
||||
$asset_edit['download_url'] = null;
|
||||
}
|
||||
|
||||
$asset_edit['original']['download_url'] = $this->utils->get_computed_download_url($asset_edit['original']['browse_url'], $asset_edit['original']['download_provider'], $asset_edit['original']['download_commit'], $warning);
|
||||
} else {
|
||||
$asset_edit['download_url'] = $this->utils->get_computed_download_url($asset_edit['browse_url'], $asset_edit['download_provider'], $asset_edit['download_commit'], $warning);
|
||||
}
|
||||
|
||||
if($warning != null) {
|
||||
$asset_edit['warning'] = $warning;
|
||||
}
|
||||
if($asset_edit['download_commit'] == 'master') {
|
||||
if(isset($asset_edit['warning'])) {
|
||||
$asset_edit['warning'] .= "\n\n";
|
||||
} else {
|
||||
$asset_edit['warning'] = '';
|
||||
}
|
||||
$asset_edit['warning'] .= "Giving 'master' (or any other branch name) as the commit to be downloaded is not recommended, since it would invalidate the asset when you push a new version (since we ensure the version is kept the same via a sha256 hash of the zip). You can try using tags instead.";
|
||||
}
|
||||
|
||||
|
||||
return $response->withJson($asset_edit, 200);
|
||||
};
|
||||
|
||||
@@ -464,7 +500,7 @@ $app->post('/asset/edit/{id:[0-9]+}/accept', function ($request, $response, $arg
|
||||
foreach ($this->constants['asset_edit_fields'] as $i => $field) {
|
||||
if(isset($asset_edit[$field]) && $asset_edit[$field] !== null) {
|
||||
$query->bindValue(':' . $field, $asset_edit[$field]);
|
||||
$update_version = $update_version || ($field === 'download_url' || $field === 'version_string');
|
||||
$update_version = $update_version || ($field === 'browse_url' || $field === 'download_provider' || $field === 'download_commit' || $field === 'version_string');
|
||||
} else {
|
||||
$query->bindValue(':' . $field, null, PDO::PARAM_NULL);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ $_asset_values = array_merge([
|
||||
'title' => '',
|
||||
'category_id' => '0',
|
||||
'version_string' => '',
|
||||
'download_url' => '',
|
||||
'download_provider' => '0',
|
||||
'download_commit' => '',
|
||||
'browse_url' => '',
|
||||
'icon_url' => '',
|
||||
'description' => '',
|
||||
@@ -43,18 +44,32 @@ $_asset_values = array_merge([
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label" for="download">Download URL</label>
|
||||
<label class="col-md-4 control-label" for="download_provider">Repository hoster</label>
|
||||
<div class="col-md-5">
|
||||
<input id="download" name="download_url" type="text" placeholder="Download URL" class="form-control input-md" required="" value="<?php echo esc($_asset_values['download_url']) ?>">
|
||||
<span class="help-block">Set the url to download the asset (directly as a .zip). Should be similar to <code>https://github.com/<user>/<project>/archive/<tag>.zip</code></span>
|
||||
<select id="download_provider" name="download_provider" class="form-control">
|
||||
<?php foreach($constants['download_provider'] as $id => $name) if(is_int($id)) { ?>
|
||||
<option value="<?php echo esc($name) ?>" <?php if($name == $_asset_values['download_provider']) echo 'selected=""'; ?>>
|
||||
<?php echo esc($name) ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<span class="help-block">We really need to know where your repository is hosted in order to compute the final download URL. If your Git repository provider is missing, you might like to <a href="https://github.com/godotengine/asset-library/issues">open an issue</a> about it.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label" for="browse">Browse URL</label>
|
||||
<label class="col-md-4 control-label" for="browse">Repository URL</label>
|
||||
<div class="col-md-5">
|
||||
<input id="browse" name="browse_url" type="text" placeholder="Browse URL" class="form-control input-md" required="" value="<?php echo esc($_asset_values['browse_url']) ?>">
|
||||
<span class="help-block">Set the url to browse the asset's files (webpage). Should be similar to <code>https://github.com/<user>/<project>/</code></span>
|
||||
<input id="browse" name="browse_url" type="text" placeholder="Repository URL" class="form-control input-md" required="" value="<?php echo esc($_asset_values['browse_url']) ?>">
|
||||
<span class="help-block">Set the url to browse the asset's files (webpage). Should be similar to <code>https://github.com/<user>/<project>/</code> (Might be different depending on your "provider")</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label" for="commit">Download Commit/tag</label>
|
||||
<div class="col-md-5">
|
||||
<input id="commit" name="download_commit" type="text" placeholder="Download URL" class="form-control input-md" required="" value="<?php echo esc($_asset_values['download_commit']) ?>">
|
||||
<span class="help-block">Set the commit or tag to download the asset. Should be similar to <code>b1d3172f89b86e52465a74f63a74ac84c491d3e1</code> or <code>v1.0</code>. The final download url would be computed from this.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +85,14 @@ $_asset_values = array_merge([
|
||||
<label class="col-md-4 control-label" for="license">License</label>
|
||||
<div class="col-md-5">
|
||||
<select id="license" name="cost" class="form-control">
|
||||
<?php $licenses = ['MIT' => 'MIT', 'GPLv3' => 'GPL v3', 'GPLv2' => 'GPL v2', 'CC0' => 'CC0', 'BSD-2-Clause' => 'BSD 2-clause License', 'BSL-1.0' => 'Boost Software License'] ?>
|
||||
<?php $licenses = [
|
||||
'MIT' => 'MIT',
|
||||
'GPLv3' => 'GPL v3',
|
||||
'GPLv2' => 'GPL v2',
|
||||
'CC0' => 'CC0',
|
||||
'BSD-2-Clause' => 'BSD 2-clause License',
|
||||
'BSL-1.0' => 'Boost Software License'
|
||||
] ?>
|
||||
<?php foreach($licenses as $id => $name) { ?>
|
||||
<option value="<?php echo raw($id) ?>" <?php if($id == $_asset_values['cost']) echo 'selected=""'; ?>>
|
||||
<?php echo esc($name) ?>
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
'category_id' => 'Category',
|
||||
'version_string' => 'Version String',
|
||||
'cost' => 'License',
|
||||
'download_url' => 'Download Url',
|
||||
'browse_url' => 'Browse Url',
|
||||
'browse_url' => 'Repository Url',
|
||||
'download_provider' => 'Repository Provider',
|
||||
'download_commit' => 'Download Commit',
|
||||
'download_url' => 'Download Url (Computed)',
|
||||
'icon_url' => 'Icon Url',
|
||||
];
|
||||
$preview_field_names = [
|
||||
@@ -60,7 +62,15 @@ $preview_field_names = [
|
||||
|
||||
<?php if($data['status'] == 'rejected') { ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
This asset <?php if($data['asset_id'] != -1) echo 'edit' ?>has been rejected. Reason: <?php echo esc($data['reason']) ?>
|
||||
This asset <?php if($data['asset_id'] != -1) echo 'edit ' ?>has been rejected. Reason: <?php echo esc($data['reason']) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(isset($data['warning'])) { ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<strong>Warning:</strong> <?php echo nl2br(esc($data['warning'])) ?>
|
||||
<br><br>
|
||||
<em>If you think that this warning should not be here, you can allways <a href="https://github.com/godotengine/asset-library/issues">open an issue</a>.</em>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php include("_header.phtml") ?>
|
||||
<div class="alert alert-danger">
|
||||
Error: <?php echo esc($data['error']) ?>
|
||||
<strong>Error:</strong> <?php echo esc($data['error']) ?>
|
||||
</div>
|
||||
<?php include("_footer.phtml") ?>
|
||||
|
||||
Reference in New Issue
Block a user