* Finish story view page.

This commit is contained in:
wangyidong
2023-06-25 18:38:22 +08:00
parent 75b984f06b
commit ca910474f8
3 changed files with 39 additions and 7 deletions
+1 -1
View File
@@ -908,7 +908,7 @@ class story extends control
if(isonlybody()) return print(js::reload('parent.parent'));
$locateLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID={$story->product}");
return print(js::locate($locateLink, 'parent'));
return $this->send(array('result' => 'success', 'load' => $locateLink));
}
}
+8
View File
@@ -29,3 +29,11 @@ $(document).on('click', '.unlinkStory', function(e)
if(res) $.get($this.data('url'), function(){$this.closest('li').remove()});
});
});
window.ajaxDelete = function(storyID)
{
zui.Modal.confirm({message: confirmDeleteTip, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) =>
{
if(res) $.get($.createLink('story', 'delete', 'storyID=' + storyID + '&confirm=yes'), function(data){if(data.result == 'success') loadPage(data.load)});
});
}
+30 -6
View File
@@ -10,8 +10,12 @@ declare(strict_types=1);
*/
namespace zin;
$confirmDelete = $this->lang->story->confirmDelete;
if($story->type == 'requirement') $confirmDelete = str_replace($this->lang->SRCommon, $this->lang->URCommon, $confirmDelete);
jsVar('relievedTip', $lang->story->relievedTip);
jsVar('unlinkStoryTip', $lang->story->unlinkStory);
jsVar('confirmDeleteTip', $confirmDelete);
$isInModal = isAjaxRequest('modal');
$otherParam = 'storyID=&projectID=';
@@ -143,8 +147,23 @@ detailHeader
(
to::prefix
(
backBtn(set::icon('back'), set::type('secondary'), $lang->goback),
entityLabel(set(array('entityID' => $story->id, 'level' => 1, 'text' => $story->title))),
$isInModal ? null : backBtn(set::icon('back'), set::type('secondary'), $lang->goback),
div
(
setClass('entity-label flex items-center gap-x-2'),
label(setClass('circle px-1.5 h-3.5'), $story->id),
$story->parent > 0 ? label($this->lang->story->childrenAB) : null,
span
(
setClass('article-h1'),
$story->parent > 0 && isset($story->parentName) ? span
(
a(set::href(inlink('view', "storyID={$story->parent}&version=0&param=0&storyType=$story->type")), $story->parentName),
' / ',
) : null,
$story->title
),
),
count($versions) > 1 ? dropdown
(
btn("#{$version}"),
@@ -181,7 +200,12 @@ detailBody
set::content(empty($story->verify) ? $lang->noDesc : $story->verify),
set::useHtml(true)
),
// $this->fetch('file', 'printFiles', array('files' => $story->files, 'section' => 'true', 'object' => $story, 'method' => 'view', 'showDelete' => false)),
$story->files ? fileList
(
set::files($story->files),
set::showDelete(false),
set::object($story),
) : null,
empty($story->children) ? null : section
(
set::title($story->type == 'requirement' ? $lang->story->story : $lang->story->children),
@@ -192,13 +216,13 @@ detailBody
)
),
),
history(),
history(set::commentUrl(helper::createLink('action', 'comment', "objectType=story&objectID=$story->id"))),
floatToolbar
(
set::object($story),
to::prefix(backBtn(set::icon('back'), $lang->goback)),
set::main($menus['mainMenu']),
set::suffix($menus['suffixMenu']),
$story->deleted ? null : set::main($menus['mainMenu']),
$story->deleted ? null : set::suffix($menus['suffixMenu']),
),
detailSide
(