From f3a747868565498bbce76f37dd6729197fdce18a Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Sat, 12 Oct 2024 02:16:17 -0400 Subject: [PATCH] disable files widget when gv_enable flag is active --- website/project/views/node.py | 1 + website/templates/project/project.mako | 52 +++++++++++++------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/website/project/views/node.py b/website/project/views/node.py index 6d4d1b2984b..a78c9bd2b72 100644 --- a/website/project/views/node.py +++ b/website/project/views/node.py @@ -492,6 +492,7 @@ def view_project(auth, node, **kwargs): addons_widget_data['mendeley'] = mendeley_widget_data ret.update({'addons_widget_data': addons_widget_data}) + ret.update({'enable_gv': flag_is_active(request, features.ENABLE_GV)}) return ret diff --git a/website/templates/project/project.mako b/website/templates/project/project.mako index f22b1c2a58c..180639925c6 100644 --- a/website/templates/project/project.mako +++ b/website/templates/project/project.mako @@ -582,36 +582,36 @@ ${ render_addon_widget.render_addon_widget('wiki', addons_widget_data['wiki']) } %endif - -
-
-

Files

-
- -
-
- % if not node['is_registration'] and not node['anonymous'] and permissions.WRITE in user['permissions']: -
-
- Click on a storage provider or drag and drop to upload + %if not enable_gv: + +
+
+

Files

+
+
-
- %else: -
- %endif -
-
-
-
-
-

Loading files...

+ % if not node['is_registration'] and not node['anonymous'] and permissions.WRITE in user['permissions']: +
+
+ Click on a storage provider or drag and drop to upload
-
- - -
+
+ %else: +
+ %endif +
+
+
+
+
+

Loading files...

+
+
+
+
+ %endif % if addons: