mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-20 17:37:23 +08:00
tag add description
This commit is contained in:
@@ -51,6 +51,7 @@ class TagResource extends Resource
|
||||
->label(__('label.search_box.taxonomy.mode'))
|
||||
->helperText(__('label.search_box.taxonomy.mode_help'))
|
||||
,
|
||||
Forms\Components\Textarea::make('description')->label(__('label.description')),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Tag extends NexusModel
|
||||
protected $fillable = [
|
||||
'id', 'name', 'color', 'priority', 'created_at', 'updated_at',
|
||||
'font_size', 'font_color', 'padding', 'margin', 'border_radius',
|
||||
'mode',
|
||||
'mode', 'description'
|
||||
];
|
||||
|
||||
const DEFAULTS = [
|
||||
|
||||
@@ -75,8 +75,8 @@ class TagRepository extends BaseRepository
|
||||
$tagId = $value->id;
|
||||
if ($value) {
|
||||
$item = sprintf(
|
||||
"<span style=\"background-color:%s;color:%s;border-radius:%s;font-size:%s;margin:%s;padding:%s\">%s</span>",
|
||||
$value->color, $value->font_color, $value->border_radius, $value->font_size, $value->margin, $value->padding, $value->name
|
||||
"<span style=\"background-color:%s;color:%s;border-radius:%s;font-size:%s;margin:%s;padding:%s\" title=\"%s\">%s</span>",
|
||||
$value->color, $value->font_color, $value->border_radius, $value->font_size, $value->margin, $value->padding, $value->description, $value->name
|
||||
);
|
||||
if ($withFilterLink) {
|
||||
$html .= sprintf('<a href="?tag_id=%s">%s</a>', $tagId, $item);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('tags', function (Blueprint $table) {
|
||||
$table->text('description')->after('font_color')->nullable(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('tags', function (Blueprint $table) {
|
||||
$table->dropColumn('description');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-10');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-11');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -6336,8 +6336,11 @@ function build_search_area($searchArea, array $options = [])
|
||||
return $result;
|
||||
}
|
||||
|
||||
function torrent_name_for_admin(\App\Models\Torrent $torrent, $withTags = false)
|
||||
function torrent_name_for_admin(\App\Models\Torrent|null $torrent, $withTags = false)
|
||||
{
|
||||
if (empty($torrent)) {
|
||||
return '';
|
||||
}
|
||||
$name = sprintf(
|
||||
'<div class="text-primary-600 transition hover:underline hover:text-primary-500 focus:underline focus:text-primary-500"><a href="/details.php?id=%s" target="_blank" title="%s">%s</a></div>',
|
||||
$torrent->id, $torrent->name, Str::limit($torrent->name, 40)
|
||||
|
||||
Reference in New Issue
Block a user