Merge branch 'master' of github.com:cornernote/minetest-bower

This commit is contained in:
cornernote 2016-10-31 10:17:40 +10:30
commit a44651c96e
8 changed files with 429 additions and 246 deletions

View File

@ -26,6 +26,14 @@ composer install
## Using Heroku ## Using Heroku
Setup:
```
sudo apt-get install postgresql-client
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
heroku login
```
Deploy: Deploy:
``` ```
@ -50,16 +58,24 @@ Bash with vim
heroku vim heroku vim
``` ```
View database: View logs:
```
heroku logs --tail
```
Connect to database:
``` ```
heroku pg:psql heroku pg:psql
``` ```
View logs: Database commands:
``` ```
heroku logs --tail \dt # list tables
\d+ package # describe package table
DELETE FROM package WHERE name='modname'; # delete a package
``` ```
More info: More info:

View File

@ -7,7 +7,7 @@
"minimum-stability": "stable", "minimum-stability": "stable",
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.5", "yiisoft/yii2": ">=2.0.9",
"yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-bootstrap": "*",
"fxp/composer-asset-plugin": "*", "fxp/composer-asset-plugin": "*",
"kartik-v/yii2-widgets": "^3.4", "kartik-v/yii2-widgets": "^3.4",

624
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -577,13 +577,16 @@ class Package extends ActiveRecord
return '<pre>' . $bower . '</pre>'; return '<pre>' . $bower . '</pre>';
} }
/**
* @return string
*/
public function getKeywordsHtml() public function getKeywordsHtml()
{ {
$keywordsHtml = []; $keywordsHtml = [];
$keywords = explode(',', $this->keywords); $keywords = explode(',', $this->keywords);
foreach ($keywords as $keyword) { foreach ($keywords as $keyword) {
$keyword = trim($keyword); $keyword = trim($keyword);
$keywordsHtml[] = $keyword; $keywordsHtml[] = Html::a($keyword, ['/mod/index', 'search' => $keyword]);
} }
return implode(', ', $keywordsHtml); return implode(', ', $keywordsHtml);
} }

View File

@ -11,7 +11,7 @@ use yii\helpers\Html;
<div class="package-search"> <div class="package-search">
<?php $form = ActiveForm::begin([ <?php $form = ActiveForm::begin([
'action' => ['index'], 'action' => ['/mod/index'],
'method' => 'get', 'method' => 'get',
]); ?> ]); ?>

View File

@ -27,7 +27,11 @@ use yii\helpers\Html;
'hideIfEmpty' => true, 'hideIfEmpty' => true,
'attributes' => [ 'attributes' => [
'description', 'description',
'keywords', [
'label' => 'Keywords',
'value' => $model->getKeywordsHtml(),
'format' => 'raw',
],
//[ //[
// 'label' => 'Authors', // 'label' => 'Authors',
// 'value' => $model->getAuthorsHtml(), // 'value' => $model->getAuthorsHtml(),

View File

@ -10,7 +10,7 @@ use yii\helpers\Html;
$this->title = $model->name; $this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Mods', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => 'Mods', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = (new GithubMarkdown())->parse($this->title);
?> ?>
<div class="mod-view"> <div class="mod-view">
@ -25,7 +25,11 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [ 'attributes' => [
'name', 'name',
//'description', //'description',
'keywords', [
'label' => 'Keywords',
'value' => $model->getKeywordsHtml(),
'format' => 'raw',
],
[ [
'label' => 'Authors', 'label' => 'Authors',
'value' => $model->getAuthorsHtml(), 'value' => $model->getAuthorsHtml(),

View File

@ -25,6 +25,10 @@ $this->params['jumbotron'] = '/site/_index-jumbotron';
<p>If you'd like to run a Minetest Bower mirror, this is encouraged and simple to set up. Simply copy the <?= Html::a('this JSON file', ['/package/index']) ?> to your website and update it periodically.</p> <p>If you'd like to run a Minetest Bower mirror, this is encouraged and simple to set up. Simply copy the <?= Html::a('this JSON file', ['/package/index']) ?> to your website and update it periodically.</p>
<h2>Search Mods</h2>
<?php echo $this->render('/mod/_search', ['model' => new PackageSearch()]); ?>
<h2>Browse Mods</h2> <h2>Browse Mods</h2>
<div class="row"> <div class="row">
@ -57,7 +61,7 @@ $this->params['jumbotron'] = '/site/_index-jumbotron';
?> ?>
</div> </div>
<h2>Using Bower to Manage Mods and Dependancies</h2> <h2>Using Bower to Manage Mods and Dependencies</h2>
<p>If you are familiar with CLI, you can use Minetest Bower to install Minetest mods and dependency mods quickly and easily under Linux, Windows, and Mac OS X. Minetest Bower needs primarily two software packages named NodeJS and Git, which are easy to install.</p> <p>If you are familiar with CLI, you can use Minetest Bower to install Minetest mods and dependency mods quickly and easily under Linux, Windows, and Mac OS X. Minetest Bower needs primarily two software packages named NodeJS and Git, which are easy to install.</p>