From c07b3aa160371c324b08ad9587d32a2ca7ff4a13 Mon Sep 17 00:00:00 2001 From: zhaoke Date: Tue, 13 Jun 2023 19:58:06 +0800 Subject: [PATCH] * Refactor detail page of gogs. --- module/gogs/config/dtable.php | 6 +++--- module/gogs/js/browse.ui.js | 2 +- module/gogs/ui/view.html.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 module/gogs/ui/view.html.php diff --git a/module/gogs/config/dtable.php b/module/gogs/config/dtable.php index 12806f9f91..b4a8af65c7 100644 --- a/module/gogs/config/dtable.php +++ b/module/gogs/config/dtable.php @@ -7,20 +7,20 @@ $config->gogs->dtable = new stdclass(); $config->gogs->dtable->fieldList['id']['title'] = 'ID'; $config->gogs->dtable->fieldList['id']['name'] = 'id'; $config->gogs->dtable->fieldList['id']['type'] = 'number'; -$config->gogs->dtable->fieldList['id']['sortType'] = 'desc'; +$config->gogs->dtable->fieldList['id']['sortType'] = true; $config->gogs->dtable->fieldList['id']['checkbox'] = false; $config->gogs->dtable->fieldList['id']['width'] = '80'; $config->gogs->dtable->fieldList['name']['title'] = $lang->gogs->name; $config->gogs->dtable->fieldList['name']['name'] = 'name'; -$config->gogs->dtable->fieldList['name']['type'] = 'desc'; +$config->gogs->dtable->fieldList['name']['type'] = 'text'; $config->gogs->dtable->fieldList['name']['sortType'] = true; $config->gogs->dtable->fieldList['name']['hint'] = true; $config->gogs->dtable->fieldList['name']['minWidth'] = '356'; $config->gogs->dtable->fieldList['url']['title'] = $lang->gogs->url; $config->gogs->dtable->fieldList['url']['name'] = 'url'; -$config->gogs->dtable->fieldList['url']['type'] = 'desc'; +$config->gogs->dtable->fieldList['url']['type'] = 'text'; $config->gogs->dtable->fieldList['url']['sortType'] = true; $config->gogs->dtable->fieldList['url']['hint'] = true; $config->gogs->dtable->fieldList['url']['minWidth'] = '356'; diff --git a/module/gogs/js/browse.ui.js b/module/gogs/js/browse.ui.js index 4bb5886182..59829d6c95 100644 --- a/module/gogs/js/browse.ui.js +++ b/module/gogs/js/browse.ui.js @@ -11,7 +11,7 @@ window.renderCell = function(result, {col, row}) if(col.name === 'name') { var browseProjectLink = $.createLink('gogs', 'view', 'gogsID=' + row.data.id); - if(canBrowseProject) result[0] = {html:'' + row.data.name + '', style:{flexDirection:"column"}}; + if(canBrowseProject) result[0] = {html:'' + row.data.name + '', style:{flexDirection:"column"}}; return result; } diff --git a/module/gogs/ui/view.html.php b/module/gogs/ui/view.html.php new file mode 100644 index 0000000000..e34d11e5ac --- /dev/null +++ b/module/gogs/ui/view.html.php @@ -0,0 +1,33 @@ + + * @package gogs + * @link https://www.zentao.net + */ +namespace zin; +global $lang; + +detailHeader +( + to::title(entityLabel(set(array('entityID' => $gogs->id, 'level' => 1, 'text' => $gogs->name)))), +); + +detailBody +( + sectionList + ( + section + ( + set::title($lang->gogs->url), + set::content("{$gogs->url}"), + set::useHtml(true) + ), + ), + history(), +); + +render(isonlybody() ? 'modalDialog' : 'page');