From dd2be2cd9676138e0a4a82070922f90bf99a0fa4 Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Tue, 7 Apr 2026 10:39:40 +0900 Subject: [PATCH 1/7] retry669 --- addons/wiki/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/wiki/models.py b/addons/wiki/models.py index bff16c53d94..8daebcf0aba 100644 --- a/addons/wiki/models.py +++ b/addons/wiki/models.py @@ -59,7 +59,7 @@ def validate_page_name(value): raise NameEmptyError('Page name cannot be blank.') if value.find('/') != -1: raise NameInvalidError('Page name cannot contain forward slashes.') - if len(value) > 100: + if len(value) > 200: raise NameMaximumLengthError('Page name cannot be greater than 100 characters.') return True From e6420d14eacc4222e9b228af94b7ceea87cf09fd Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Tue, 7 Apr 2026 11:08:04 +0900 Subject: [PATCH 2/7] retry663 --- addons/wiki/templates/import_wiki_page.mako | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/addons/wiki/templates/import_wiki_page.mako b/addons/wiki/templates/import_wiki_page.mako index 9e5dfb5745d..ebeb853284a 100644 --- a/addons/wiki/templates/import_wiki_page.mako +++ b/addons/wiki/templates/import_wiki_page.mako @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="stylesheets()"> ${parent.stylesheets()} @@ -115,6 +116,15 @@ const WIKI_IMPORT_TIMEOUT = WIKI_IMPORT_INTERVAL * IMPORT_N; const WIKI_IMPORT_OPERATION = 'import'; const VALIDATE_WIKI_IMPORT_OPERATION = 'validate'; + const MAX_DISPLAY_NAME_LENGTH = 60; // Maximum number of characters to display + + // Function to truncate file name for display + function truncateFileName(fileName, maxLength) { + if (!fileName || fileName.length <= maxLength) { + return fileName; + } + return fileName.substring(0, maxLength) + '...'; + } $wikiImportForm.on('submit', async function (e) { e.preventDefault(); @@ -295,11 +305,15 @@ if (item.status === 'valid_exists') { valid_exists_ctn++; $alertInfoForm.find('.partOperationAll').css('display', ''); - $('#validateInfo ul').append('
  • ' + (item.path).slice(1) + '
  • ') - $('#perFileDifinitionForm ul').append('
  • ' + '
    ' + (item.path).slice(1) + '
    ' + selectOperation + '
  • '); + var displayPath = (item.path).slice(1); + var truncatedPath = truncateFileName(displayPath, MAX_DISPLAY_NAME_LENGTH); + $('#validateInfo ul').append('
  • ' + truncatedPath + '
  • ') + $('#perFileDifinitionForm ul').append('
  • ' + '
    ' + truncatedPath + '
    ' + selectOperation + '
  • '); } else if (item.status === 'valid_duplicated'){ $('#attentionDuplicatedInfo').css('display', ''); - $('#duplicatedInfo ul').append('
  • ' + (item.path).slice(1) + '
  • ') + var displayPath = (item.path).slice(1); + var truncatedPath = truncateFileName(displayPath, MAX_DISPLAY_NAME_LENGTH); + $('#duplicatedInfo ul').append('
  • ' + truncatedPath + '
  • ') } }); if (valid_exists_ctn === 0) { From f78fc0956af5ae557af3e1709b02041fc96d5943 Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Tue, 7 Apr 2026 11:19:06 +0900 Subject: [PATCH 3/7] retry666 --- website/static/css/pages/wiki-page.css | 134 +++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/website/static/css/pages/wiki-page.css b/website/static/css/pages/wiki-page.css index 6928bdc8d83..04a8c8e2079 100644 --- a/website/static/css/pages/wiki-page.css +++ b/website/static/css/pages/wiki-page.css @@ -532,4 +532,138 @@ li[name="WikiImportOperationPerItem"] { .milkdown td { border: 1px solid #ccc; padding: 8px; +} + +/* Hide collaborativeStatus and cp-sidebar-content by default */ +#collaborativeStatus, +.cp-sidebar-content { + display: none !important; + visibility: hidden !important; + height: 0 !important; + overflow: hidden !important; +} + +/* Ensure icons are visible in wiki tree */ +.tb-expand-icon-holder, +.tb-expand-icon-holder > i, +.tb-expand-icon-holder > span { + display: inline-block !important; + visibility: visible !important; + opacity: 1 !important; +} + +/* Fix long file names in wiki tree - truncate with ellipsis */ +.tb-row .tb-td { + overflow: visible !important; +} + +.tb-row .tb-td .fg-file-links { + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + display: inline-block !important; + max-width: calc(100% - 30px) !important; +} + +/* Fix long file names in wiki import modal - truncate with ellipsis */ +#alertInfo #validateInfo ul, +#alertInfo #duplicatedInfo ul, +#alertInfo #duplicatedFolder ul { + padding-left: 20px !important; + margin: 0 !important; + list-style: none !important; +} + +#alertInfo #validateInfo ul li, +#alertInfo #duplicatedInfo ul li, +#alertInfo #duplicatedFolder ul li { + overflow: hidden !important; + text-overflow: ellipsis !important; + display: -webkit-box !important; + -webkit-line-clamp: 2 !important; + -webkit-box-orient: vertical !important; + max-width: 100% !important; + position: relative !important; + padding-left: 15px !important; + margin-left: 0 !important; + cursor: help !important; + word-wrap: break-word !important; + word-break: break-word !important; + line-height: 1.5 !important; + height: auto !important; + max-height: none !important; +} + +#alertInfo #validateInfo ul li::before, +#alertInfo #duplicatedInfo ul li::before, +#alertInfo #duplicatedFolder ul li::before { + content: "・" !important; + position: absolute !important; + left: 0 !important; + display: inline-block !important; + width: 15px !important; +} + +#alertInfo #perFileDifinitionForm ul { + padding-left: 0 !important; + margin: 0 !important; +} + +#alertInfo #perFileDifinitionForm ul li { + display: flex !important; + align-items: flex-start !important; + justify-content: space-between !important; + overflow: visible !important; + width: 100% !important; + box-sizing: border-box !important; + padding: 8px 0 !important; + margin: 0 !important; + list-style: none !important; + position: relative !important; + padding-left: 0 !important; +} + +#alertInfo #perFileDifinitionForm ul li::before { + content: "・" !important; + position: absolute !important; + left: 5px !important; + top: 8px !important; + display: inline-block !important; + width: auto !important; + line-height: 1.5 !important; + margin-right: 0 !important; +} + +#alertInfo #perFileDifinitionForm ul li div[name="WikiImportOperationPerName"] { + overflow: hidden !important; + text-overflow: ellipsis !important; + display: -webkit-box !important; + -webkit-line-clamp: 2 !important; + -webkit-box-orient: vertical !important; + flex: 1 1 auto !important; + min-width: 0 !important; + max-width: calc(100% - 160px) !important; + margin-right: 30px !important; + margin-left: -30px !important; + cursor: help !important; + word-wrap: break-word !important; + word-break: break-word !important; + line-height: 1.5 !important; + align-self: flex-start !important; +} + +#alertInfo #perFileDifinitionForm ul li div[name="WikiImportOperationPer"] { + flex: 0 0 auto !important; + min-width: 120px !important; + max-width: 130px !important; + width: 130px !important; + margin-left: auto !important; + align-self: center !important; + margin-top: 0 !important; +} + +#alertInfo #perFileDifinitionForm ul li div[name="WikiImportOperationPer"] .form-control { + width: 100% !important; + min-width: 120px !important; + max-width: 130px !important; } \ No newline at end of file From cdf000346298a8b591a8b0bbcd9bc0a6c289d123 Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Tue, 7 Apr 2026 11:35:26 +0900 Subject: [PATCH 4/7] wiki58720 --- addons/wiki/models.py | 34 ++++++++++++----------- addons/wiki/templates/sort_wiki_page.mako | 4 +-- addons/wiki/views.py | 6 ++++ website/static/css/pages/wiki-page.css | 15 ++++++++++ 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/addons/wiki/models.py b/addons/wiki/models.py index 8daebcf0aba..d559beb957f 100644 --- a/addons/wiki/models.py +++ b/addons/wiki/models.py @@ -242,7 +242,7 @@ def get_absolute_url(self): class WikiPageNodeManager(models.Manager): - def create_for_node(self, node, name, content, auth, parent=None, is_wiki_import=False): + def create_for_node(self, node, name, content, auth, parent=None, is_wiki_import=False, add_activity_log=True): existing_wiki_page = WikiPage.objects.get_for_node(node, name) if existing_wiki_page: raise NodeStateError('Wiki Page already exists.') @@ -255,7 +255,7 @@ def create_for_node(self, node, name, content, auth, parent=None, is_wiki_import is_wiki_import=is_wiki_import ) # Creates a WikiVersion object - wiki_page.update(auth.user, content, is_wiki_import=is_wiki_import) + wiki_page.update(auth.user, content, is_wiki_import=is_wiki_import, add_log=add_activity_log) return wiki_page def get_for_node(self, node, name=None, id=None): @@ -312,29 +312,31 @@ def save(self, is_wiki_import=False, *args, **kwargs): self.node.update_search(wiki_page=self) return rv - def update(self, user, content, is_wiki_import=False): + def update(self, user, content, is_wiki_import=False, add_log=True): """ Updates the wiki with the provided content by creating a new version :param user: The user that is updating the wiki :param content: Latest content for wiki + :param add_log: Whether to add WIKI_UPDATED to the activity log (default True) """ version = WikiVersion(user=user, wiki_page=self, content=content, identifier=self.current_version_number + 1) version.save(is_wiki_import=is_wiki_import) - self.node.add_log( - action=NodeLog.WIKI_UPDATED, - params={ - 'project': self.node.parent_id, - 'node': self.node._primary_key, - 'page': self.page_name, - 'page_id': self._primary_key, - 'version': version.identifier, - }, - auth=Auth(user), - log_date=version.created, - save=True - ) + if add_log: + self.node.add_log( + action=NodeLog.WIKI_UPDATED, + params={ + 'project': self.node.parent_id, + 'node': self.node._primary_key, + 'page': self.page_name, + 'page_id': self._primary_key, + 'version': version.identifier, + }, + auth=Auth(user), + log_date=version.created, + save=True + ) return version def update_active_sharejs(self, node): diff --git a/addons/wiki/templates/sort_wiki_page.mako b/addons/wiki/templates/sort_wiki_page.mako index a113b566b75..fcc07d69a9c 100644 --- a/addons/wiki/templates/sort_wiki_page.mako +++ b/addons/wiki/templates/sort_wiki_page.mako @@ -14,7 +14,7 @@ -
      +
        \ No newline at end of file diff --git a/addons/wiki/views.py b/addons/wiki/views.py index 2e38ccd7f35..9e680f5d78d 100644 --- a/addons/wiki/views.py +++ b/addons/wiki/views.py @@ -31,6 +31,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.utils import timezone from framework.exceptions import HTTPError +from framework.auth import Auth from framework.auth.utils import privacy_info_handle from framework.auth.decorators import must_be_logged_in from framework.auth.core import get_current_user_id @@ -618,6 +619,11 @@ def format_project_wiki_pages(node, auth): pages = [] can_edit = node.has_permission(auth.user, WRITE) and not node.is_registration project_wiki_pages = _get_wiki_pages_latest(node) + # ホームが存在せず、編集可能な場合は自動作成(Reorder Wiki Tree で表示するため) + # add_activity_log=False: Wikiタブを開いただけの自動作成ではアクティビティログに残さない + if (can_edit and auth.user and + not WikiPage.objects.get_for_node(node, 'home')): + WikiPage.objects.create_for_node(node, 'home', '', Auth(auth.user), add_activity_log=False) home_wiki_page = format_home_wiki_page(node) pages.append(home_wiki_page) for wiki_page in project_wiki_pages: diff --git a/website/static/css/pages/wiki-page.css b/website/static/css/pages/wiki-page.css index 04a8c8e2079..b7975232c1f 100644 --- a/website/static/css/pages/wiki-page.css +++ b/website/static/css/pages/wiki-page.css @@ -552,6 +552,21 @@ li[name="WikiImportOperationPerItem"] { opacity: 1 !important; } +/* Fix icon and file name alignment in wiki tree */ +#grid .tb-expand-icon-holder, +#grid .tb-expand-icon-holder > i, +#grid .tb-expand-icon-holder > span, +#grid .tb-row .tb-td .fg-file-links { + vertical-align: middle !important; +} + +/* Fix icon vertical position (method 3: nudge icon up to align with text) */ +#grid .tb-expand-icon-holder > i, +#grid .tb-expand-icon-holder > span { + position: relative !important; + top: -2px !important; +} + /* Fix long file names in wiki tree - truncate with ellipsis */ .tb-row .tb-td { overflow: visible !important; From 0eff6d5ce5b4f74084776d421a7a5ec25ed42c7f Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Tue, 7 Apr 2026 11:55:52 +0900 Subject: [PATCH 5/7] wiki58721 --- website/static/css/pages/wiki-page.css | 1 - 1 file changed, 1 deletion(-) diff --git a/website/static/css/pages/wiki-page.css b/website/static/css/pages/wiki-page.css index b7975232c1f..ee4a23caf37 100644 --- a/website/static/css/pages/wiki-page.css +++ b/website/static/css/pages/wiki-page.css @@ -535,7 +535,6 @@ li[name="WikiImportOperationPerItem"] { } /* Hide collaborativeStatus and cp-sidebar-content by default */ -#collaborativeStatus, .cp-sidebar-content { display: none !important; visibility: hidden !important; From 96150598493febec8d0e576391d3cda5625ef31b Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Thu, 9 Apr 2026 11:43:59 +0900 Subject: [PATCH 6/7] TraviceCI --- addons/wiki/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/wiki/models.py b/addons/wiki/models.py index d559beb957f..724272770e9 100644 --- a/addons/wiki/models.py +++ b/addons/wiki/models.py @@ -242,7 +242,7 @@ def get_absolute_url(self): class WikiPageNodeManager(models.Manager): - def create_for_node(self, node, name, content, auth, parent=None, is_wiki_import=False, add_activity_log=True): + def create_for_node(self, node, name, content, auth, parent=None, is_wiki_import=False, add_activity_log=True): existing_wiki_page = WikiPage.objects.get_for_node(node, name) if existing_wiki_page: raise NodeStateError('Wiki Page already exists.') From be7f448bc53e227e8c177d06c211e5727bd7a4dc Mon Sep 17 00:00:00 2001 From: Nishikawa Koharu Date: Thu, 9 Apr 2026 14:05:27 +0900 Subject: [PATCH 7/7] TraviceCI --- addons/wiki/tests/test_models.py | 2 +- addons/wiki/tests/test_views.py | 2 +- addons/wiki/tests/test_wiki_import.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/wiki/tests/test_models.py b/addons/wiki/tests/test_models.py index 33e64c536ab..f94093b2fb6 100644 --- a/addons/wiki/tests/test_models.py +++ b/addons/wiki/tests/test_models.py @@ -15,7 +15,7 @@ class TestWikiPageModel: @pytest.mark.enable_implicit_clean def test_page_name_cannot_be_greater_than_100_characters(self): - bad_name = 'a' * 101 + bad_name = 'a' * 201 page = WikiPage(page_name=bad_name) with pytest.raises(NameMaximumLengthError): page.save() diff --git a/addons/wiki/tests/test_views.py b/addons/wiki/tests/test_views.py index eade053cf89..7fa9b335c4b 100644 --- a/addons/wiki/tests/test_views.py +++ b/addons/wiki/tests/test_views.py @@ -222,7 +222,7 @@ def test_rename_new_name_invalid_special_characters(self): self.second_wiki.rename(invalid_name, self.auth) def test_rename_name_maximum_length(self): - new_name = 'a' * 101 + new_name = 'a' * 201 with pytest.raises(NameMaximumLengthError): self.second_wiki.rename(new_name, self.auth) diff --git a/addons/wiki/tests/test_wiki_import.py b/addons/wiki/tests/test_wiki_import.py index 01744d96f4f..d8e55d1dc17 100644 --- a/addons/wiki/tests/test_wiki_import.py +++ b/addons/wiki/tests/test_wiki_import.py @@ -124,7 +124,7 @@ def test_create_for_node_true(self, mock_create): # True? mock_create.assert_called_with(is_wiki_import=True, node=self.project, page_name='home child', parent=None, user=self.user) - wiki_page.update.assert_called_with(self.user, 'home child content', is_wiki_import=True) + wiki_page.update.assert_called_with(self.user, 'home child content', add_log=True, is_wiki_import=True) @mock.patch('addons.wiki.models.WikiPage.objects.create') def test_create_for_node_false(self, mock_create): @@ -142,7 +142,7 @@ def test_create_for_node_false(self, mock_create): # False mock_create.assert_called_with(is_wiki_import=False, node=self.project, page_name='home child', parent=None, user=self.user) - wiki_page.update.assert_called_with(self.user, 'home child content', is_wiki_import=False) + wiki_page.update.assert_called_with(self.user, 'home child content', add_log=True, is_wiki_import=False) def test_create(self): new_node = WikiPage.objects.create(