diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-09-27 11:03:55 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-09-28 14:03:18 +0200 |
commit | ba580db6b07d6fcb4877259f13052ddee34afb90 (patch) | |
tree | 9ab109cefad0ee276f696788ea24aad3390eea17 /src/hydrilla/proxy | |
parent | d42379c189c33dac732a1a1341395a9f5683260b (diff) | |
download | haketilo-hydrilla-ba580db6b07d6fcb4877259f13052ddee34afb90.tar.gz haketilo-hydrilla-ba580db6b07d6fcb4877259f13052ddee34afb90.zip |
[proxy] make some (possibly confusing) web UI parts only display to advanced users
Diffstat (limited to 'src/hydrilla/proxy')
-rw-r--r-- | src/hydrilla/proxy/state.py | 2 | ||||
-rw-r--r-- | src/hydrilla/proxy/state_impl/concrete_state.py | 102 | ||||
-rw-r--r-- | src/hydrilla/proxy/tables.sql | 3 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/items.py | 1 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/options.py | 10 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/root.py | 6 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/base.html.jinja | 21 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja | 91 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja | 32 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja | 38 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/options.html.jinja | 26 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja | 21 |
12 files changed, 193 insertions, 160 deletions
diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py index ae80dfb..a94cd75 100644 --- a/src/hydrilla/proxy/state.py +++ b/src/hydrilla/proxy/state.py @@ -468,6 +468,7 @@ class HaketiloGlobalSettings: """....""" mapping_use_mode: MappingUseMode default_allow_scripts: bool + advanced_user: bool repo_refresh_seconds: int @@ -526,6 +527,7 @@ class HaketiloState(ABC): *, mapping_use_mode: t.Optional[MappingUseMode] = None, default_allow_scripts: t.Optional[bool] = None, + advanced_user: t.Optional[bool] = None, repo_refresh_seconds: t.Optional[int] = None ) -> None: """....""" diff --git a/src/hydrilla/proxy/state_impl/concrete_state.py b/src/hydrilla/proxy/state_impl/concrete_state.py index d08a821..04bb67f 100644 --- a/src/hydrilla/proxy/state_impl/concrete_state.py +++ b/src/hydrilla/proxy/state_impl/concrete_state.py @@ -58,21 +58,67 @@ from . import _operations here = Path(__file__).resolve().parent +def _prepare_database(connection: sqlite3.Connection) -> None: + cursor = connection.cursor() + + try: + cursor.execute( + ''' + SELECT + COUNT(name) + FROM + sqlite_master + WHERE + name = 'general' AND type = 'table'; + ''' + ) + + (db_initialized,), = cursor.fetchall() + + if not db_initialized: + cursor.executescript((here.parent / 'tables.sql').read_text()) + else: + cursor.execute( + ''' + SELECT + haketilo_version + FROM + general; + ''' + ) + + (db_haketilo_version,) = cursor.fetchone() + if db_haketilo_version != '3.0b1': + raise HaketiloException(_('err.proxy.unknown_db_schema')) + + cursor.execute('PRAGMA FOREIGN_KEYS;') + if cursor.fetchall() == []: + raise HaketiloException(_('err.proxy.no_sqlite_foreign_keys')) + + cursor.execute('PRAGMA FOREIGN_KEYS=ON;') + finally: + cursor.close() + + def load_settings(cursor: sqlite3.Cursor) -> st.HaketiloGlobalSettings: cursor.execute( ''' SELECT - default_allow_scripts, repo_refresh_seconds, mapping_use_mode + default_allow_scripts, + advanced_user, + repo_refresh_seconds, + mapping_use_mode FROM general ''' ) - (default_allow_scripts, repo_refresh_seconds, + (default_allow_scripts, advanced_user, repo_refresh_seconds, mapping_use_mode), = cursor.fetchall() return st.HaketiloGlobalSettings( default_allow_scripts = default_allow_scripts, + advanced_user = advanced_user, repo_refresh_seconds = repo_refresh_seconds, mapping_use_mode = st.MappingUseMode(mapping_use_mode) ) @@ -80,55 +126,8 @@ def load_settings(cursor: sqlite3.Cursor) -> st.HaketiloGlobalSettings: @dc.dataclass class ConcreteHaketiloState(base.HaketiloStateWithFields): def __post_init__(self) -> None: - sqlite3.enable_callback_tracebacks(True) - - self._prepare_database() - self.rebuild_structures() - def _prepare_database(self) -> None: - """....""" - cursor = self.connection.cursor() - - try: - cursor.execute( - ''' - SELECT - COUNT(name) - FROM - sqlite_master - WHERE - name = 'general' AND type = 'table'; - ''' - ) - - (db_initialized,), = cursor.fetchall() - - if not db_initialized: - cursor.executescript((here.parent / 'tables.sql').read_text()) - - else: - cursor.execute( - ''' - SELECT - haketilo_version - FROM - general; - ''' - ) - - (db_haketilo_version,) = cursor.fetchone() - if db_haketilo_version != '3.0b1': - raise HaketiloException(_('err.proxy.unknown_db_schema')) - - cursor.execute('PRAGMA FOREIGN_KEYS;') - if cursor.fetchall() == []: - raise HaketiloException(_('err.proxy.no_sqlite_foreign_keys')) - - cursor.execute('PRAGMA FOREIGN_KEYS=ON;') - finally: - cursor.close() - def import_items(self, malcontent_path: Path, repo_id: int = 1) -> None: with self.cursor(transaction=(repo_id == 1)) as cursor: # This method without the repo_id argument exposed is part of the @@ -305,6 +304,7 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields): *, mapping_use_mode: t.Optional[st.MappingUseMode] = None, default_allow_scripts: t.Optional[bool] = None, + advanced_user: t.Optional[bool] = None, repo_refresh_seconds: t.Optional[int] = None ) -> None: with self.cursor(transaction=True) as cursor: @@ -315,6 +315,8 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields): set_opt('mapping_use_mode', mapping_use_mode.value) if default_allow_scripts is not None: set_opt('default_allow_scripts', default_allow_scripts) + if advanced_user is not None: + set_opt('advanced_user', advanced_user) if repo_refresh_seconds is not None: set_opt('repo_refresh_seconds', repo_refresh_seconds) @@ -328,6 +330,8 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields): check_same_thread = False ) + _prepare_database(connection) + global_settings = load_settings(connection.cursor()) return ConcreteHaketiloState( diff --git a/src/hydrilla/proxy/tables.sql b/src/hydrilla/proxy/tables.sql index 4465a05..6ceea25 100644 --- a/src/hydrilla/proxy/tables.sql +++ b/src/hydrilla/proxy/tables.sql @@ -30,6 +30,7 @@ BEGIN TRANSACTION; CREATE TABLE general( haketilo_version VARCHAR NOT NULL, default_allow_scripts BOOLEAN NOT NULL, + advanced_user BOOLEAN NOT NULL, repo_refresh_seconds INTEGER NOT NULL, -- "mapping_use_mode" determines whether current mode is AUTO, -- WHEN_ENABLED or QUESTION. @@ -44,6 +45,7 @@ INSERT INTO general( rowid, haketilo_version, default_allow_scripts, + advanced_user, repo_refresh_seconds, mapping_use_mode ) @@ -51,6 +53,7 @@ VALUES( 1, '3.0b1', FALSE, + FALSE, 24 * 60 * 60, 'Q' ); diff --git a/src/hydrilla/proxy/web_ui/items.py b/src/hydrilla/proxy/web_ui/items.py index ec394ee..6195107 100644 --- a/src/hydrilla/proxy/web_ui/items.py +++ b/src/hydrilla/proxy/web_ui/items.py @@ -177,7 +177,6 @@ def show_item_version( f'items/{item_type.alt_name}_viewversion.html.jinja', display_info = display_info, version_display_info = this_info, - settings = state.get_settings(), **errors ) return flask.make_response(html, 200) diff --git a/src/hydrilla/proxy/web_ui/options.py b/src/hydrilla/proxy/web_ui/options.py index 9be1ae0..7d59375 100644 --- a/src/hydrilla/proxy/web_ui/options.py +++ b/src/hydrilla/proxy/web_ui/options.py @@ -41,11 +41,7 @@ bp = flask.Blueprint('options', __package__) @bp.route('/options', methods=['GET']) def options(errors: t.Mapping[str, bool] = {}) -> werkzeug.Response: - html = flask.render_template( - 'options.html.jinja', - settings = _app.get_haketilo_state().get_settings(), - **errors - ) + html = flask.render_template('options.html.jinja', **errors) return flask.make_response(html, 200) @bp.route('/options', methods=['POST']) @@ -64,6 +60,10 @@ def options_post() -> werkzeug.Response: state.update_settings(default_allow_scripts=True) elif action == 'block_scripts': state.update_settings(default_allow_scripts=False) + elif action == 'user_make_advanced': + state.update_settings(advanced_user=True) + elif action == 'user_make_simple': + state.update_settings(advanced_user=False) else: raise ValueError() diff --git a/src/hydrilla/proxy/web_ui/root.py b/src/hydrilla/proxy/web_ui/root.py index ed030d2..21c491b 100644 --- a/src/hydrilla/proxy/web_ui/root.py +++ b/src/hydrilla/proxy/web_ui/root.py @@ -64,11 +64,14 @@ def authenticate_by_referrer() -> t.Optional[werkzeug.Response]: flask.abort(403) -def get_current_endpoint() -> t.Optional[str]: +def get_current_endpoint() -> str: endpoint = flask.request.endpoint assert endpoint is not None return endpoint +def get_settings() -> st.HaketiloGlobalSettings: + return _app.get_haketilo_state().get_settings() + class WebUIAppImpl(_app.WebUIApp): def __init__(self): @@ -87,6 +90,7 @@ class WebUIAppImpl(_app.WebUIApp): } self.jinja_env.globals['get_current_endpoint'] = get_current_endpoint + self.jinja_env.globals['get_settings'] = get_settings self.jinja_env.globals['EnabledStatus'] = st.EnabledStatus self.jinja_env.globals['FrozenStatus'] = st.FrozenStatus self.jinja_env.globals['InstalledStatus'] = st.InstalledStatus diff --git a/src/hydrilla/proxy/web_ui/templates/base.html.jinja b/src/hydrilla/proxy/web_ui/templates/base.html.jinja index ff9fd71..493398a 100644 --- a/src/hydrilla/proxy/web_ui/templates/base.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/base.html.jinja @@ -20,6 +20,8 @@ code in a proprietary work, I am not going to enforce this in court. -#} <!DOCTYPE html> +{% set settings = get_settings() %} + {% macro button_row(buttons_data, common_fields={}) %} <div class="flex-row"> {% for classes, text, extra_fields in buttons_data %} @@ -236,17 +238,20 @@ code in a proprietary work, I am not going to enforce this in court. {% set active_endpoint = get_current_endpoint() %} {% set navigation_bar = [ - ('home', _('web_ui.base.nav.home')), - ('options.options', _('web_ui.base.nav.options')), - ('rules.rules', _('web_ui.base.nav.rules')), - ('items.packages', _('web_ui.base.nav.packages')), - ('items.libraries', _('web_ui.base.nav.libraries')), - ('repos.repos', _('web_ui.base.nav.repos')), - ('items.load_from_disk', _('web_ui.base.nav.load')) + ('home', _('web_ui.base.nav.home'), false), + ('options.options', _('web_ui.base.nav.options'), false), + ('rules.rules', _('web_ui.base.nav.rules'), false), + ('items.packages', _('web_ui.base.nav.packages'), false), + ('items.libraries', _('web_ui.base.nav.libraries'), true), + ('repos.repos', _('web_ui.base.nav.repos'), false), + ('items.load_from_disk', _('web_ui.base.nav.load'), false) ] %} <ul id="nav"> - {% for endpoint, label in navigation_bar %} + {% + for endpoint, label, advanced_user_only in navigation_bar + if not advanced_user_only or settings.advanced_user + %} {% if not loop.first %} {% set sep_classes = ['nav-separator'] %} {% if loop.last %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja index 952c6b7..a1056b1 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja @@ -48,62 +48,53 @@ code in a proprietary work, I am not going to enforce this in court. <p> TODO: add more info... </p> + {% endblock %} + {% + if settings.advanced_user and + version_display_info.active != ActiveStatus.REQUIRED + %} <div class="horizontal-separator"></div> - {% endblock %} - <p> - {% if version_display_info.active == ActiveStatus.REQUIRED %} - {% block item_required_msg required %}{% endblock %} - {% - elif version_display_info.active == ActiveStatus.NOT_ACTIVE or - settings.mapping_use_mode == MappingUseMode.WHEN_ENABLED - %} - {% block item_not_activated_msg required %}{% endblock %} - {% elif settings.mapping_use_mode == MappingUseMode.QUESTION %} - {% block item_will_be_asked_about_msg required %}{% endblock %} + {% set install_but_classes = ['green-button'] %} + {% set uninstall_but_classes = ['green-button'] %} + {% if version_display_info.installed == InstalledStatus.FAILED_TO_INSTALL %} + {% + set install_text = + _('web_ui.items.single_version.retry_install_button') + %} + {% + set uninstall_text = + _('web_ui.items.single_version.leave_uninstalled_button') + %} + <div>{% block item_install_failed_msg required %}{% endblock %}</div> {% else %} - {# settings.mapping_use_mode == MappingUseMode.AUTO #} - {% block item_auto_activated_msg required %}{% endblock %} - {% endif %} - </p> - - {% set install_but_classes = ['green-button'] %} - {% set uninstall_but_classes = ['green-button'] %} - {% if version_display_info.installed == InstalledStatus.FAILED_TO_INSTALL %} - {% - set install_text = - _('web_ui.items.single_version.retry_install_button') - %} - {% - set uninstall_text = - _('web_ui.items.single_version.leave_uninstalled_button') - %} - <div>{% block item_install_failed_msg required %}{% endblock %}</div> - {% else %} - {% set install_text = _('web_ui.items.single_version.install_button') %} - {% set uninstall_text = _('web_ui.items.single_version.uninstall_button') %} - {% if version_display_info.installed == InstalledStatus.INSTALLED %} - {% do install_but_classes.append('disabled-button') %} + {% set install_text = _('web_ui.items.single_version.install_button') %} {% - if uninstall_disallowed is defined or - version_display_info.active == ActiveStatus.REQUIRED + set uninstall_text = _('web_ui.items.single_version.uninstall_button') %} + {% if version_display_info.installed == InstalledStatus.INSTALLED %} + {% do install_but_classes.append('disabled-button') %} + {% + if uninstall_disallowed is defined or + version_display_info.active == ActiveStatus.REQUIRED + %} + {% do uninstall_but_classes.append('disabled-button') %} + {% endif %} + {% else %} + {# version_display_info.installed == InstalledStatus.NOT_INSTALLED #} {% do uninstall_but_classes.append('disabled-button') %} {% endif %} - {% else %} - {# version_display_info.installed == InstalledStatus.NOT_INSTALLED #} - {% do uninstall_but_classes.append('disabled-button') %} - {% endif %} - {% endif %}{# else/ version_display_info.installed == InstalledStatus.FA... #} - - {% set uninstall_fields = {'action': 'uninstall_item_version'} %} - {% set install_fields = {'action': 'install_item_version'} %} - - {{ - button_row([ - (uninstall_but_classes, uninstall_text, uninstall_fields), - (install_but_classes, install_text, install_fields) - ]) - }} + {% endif %}{# else/ version_display_info.installed == InstalledStatus.... #} + + {% set uninstall_fields = {'action': 'uninstall_item_version'} %} + {% set install_fields = {'action': 'install_item_version'} %} + + {{ + button_row([ + (uninstall_but_classes, uninstall_text, uninstall_fields), + (install_but_classes, install_text, install_fields) + ]) + }} + {% endif %}{# settings.advanced_user #} {% endblock main_info %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja index f1d1b74..13ee41a 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja @@ -38,22 +38,6 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %} {% endblock %} -{% block item_required_msg %} - {{ _('web_ui.items.single_version.library.item_required') }} -{% endblock %} - -{% block item_auto_activated_msg %} - {{ _('web_ui.items.single_version.library.item_auto_activated') }} -{% endblock %} - -{% block item_not_activated_msg %} - {{ _('web_ui.items.single_version.library.item_not_activated') }} -{% endblock %} - -{% block item_will_be_asked_about_msg %} - {{ _('web_ui.items.single_version.library.item_will_be_asked_about') }} -{% endblock %} - {% block item_install_failed_msg %} {{ _('web_ui.items.single_version.library.install_failed') }} {% endblock %} @@ -68,4 +52,20 @@ code in a proprietary work, I am not going to enforce this in court. </p> <div class="horizontal-separator"></div> + + <p> + {% if version_display_info.active == ActiveStatus.REQUIRED %} + {{ _('web_ui.items.single_version.library.item_required') }} + {% + elif version_display_info.active == ActiveStatus.NOT_ACTIVE or + settings.mapping_use_mode == MappingUseMode.WHEN_ENABLED + %} + {{ _('web_ui.items.single_version.library.item_not_activated') }} + {% elif settings.mapping_use_mode == MappingUseMode.QUESTION %} + {{ _('web_ui.items.single_version.library.item_will_be_asked_about') }} + {% else %} + {# settings.mapping_use_mode == MappingUseMode.AUTO #} + {{ _('web_ui.items.single_version.library.item_auto_activated') }} + {% endif %} + </p> {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja index 04caf8c..31f5e2e 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja @@ -38,22 +38,6 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %} {% endblock %} -{% block item_required_msg %} - {{ _('web_ui.items.single_version.package.item_required') }} -{% endblock %} - -{% block item_auto_activated_msg %} - {{ _('web_ui.items.single_version.package.item_auto_activated') }} -{% endblock %} - -{% block item_not_activated_msg %} - {{ _('web_ui.items.single_version.package.item_not_activated') }} -{% endblock %} - -{% block item_will_be_asked_about_msg %} - {{ _('web_ui.items.single_version.package.item_will_be_asked_about') }} -{% endblock %} - {% block item_install_failed_msg %} {{ _('web_ui.items.single_version.package.install_failed') }} {% endblock %} @@ -80,14 +64,24 @@ code in a proprietary work, I am not going to enforce this in court. <p> {% if display_info.enabled == EnabledStatus.NO_MARK %} {% do unenable_but_classes.append('disabled-button') %} - {{ _('web_ui.items.single_version.item_not_marked') }} + {% + if version_display_info.active == ActiveStatus.NOT_ACTIVE or + settings.mapping_use_mode == MappingUseMode.WHEN_ENABLED + %} + {{ _('web_ui.items.single_version.package.item_not_activated') }} + {% elif settings.mapping_use_mode == MappingUseMode.QUESTION %} + {{ _('web_ui.items.single_version.package.item_will_be_asked_about') }} + {% else %} + {# settings.mapping_use_mode == MappingUseMode.AUTO #} + {{ _('web_ui.items.single_version.package.item_auto_activated') }} + {% endif %} {% elif display_info.enabled == EnabledStatus.DISABLED %} {% do disable_but_classes.append('disabled-button') %} - {{ _('web_ui.items.single_version.item_disabled') }} + {{ _('web_ui.items.single_version.package.item_disabled') }} {% else %} {# display_info.enabled == EnabledStatus.ENABLED #} {% do enable_but_classes.append('disabled-button') %} - {{ _('web_ui.items.single_version.item_enabled') }} + {{ _('web_ui.items.single_version.package.item_enabled') }} {% endif %} </p> @@ -99,9 +93,9 @@ code in a proprietary work, I am not going to enforce this in court. ]) }} - <div class="horizontal-separator"></div> - {% if display_info.enabled == EnabledStatus.ENABLED %} + <div class="horizontal-separator"></div> + {% set unpin_but_classes = ['green-button'] %} {% set pin_repo_but_classes = ['green-button'] %} {% set pin_ver_but_classes = ['green-button'] %} @@ -191,7 +185,5 @@ code in a proprietary work, I am not going to enforce this in court. (pin_ver_but_classes, pin_ver_text, {'action': 'freeze_to_version'}) ]) }} - - <div class="horizontal-separator"></div> {% endif %}{# display_info.enabled == EnabledStatus.ENABLED #} {% endblock main_info_bulk %} diff --git a/src/hydrilla/proxy/web_ui/templates/options.html.jinja b/src/hydrilla/proxy/web_ui/templates/options.html.jinja index a7e6d7d..26519c4 100644 --- a/src/hydrilla/proxy/web_ui/templates/options.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/options.html.jinja @@ -83,4 +83,30 @@ code in a proprietary work, I am not going to enforce this in court. (block_but_classes, block_but_text, {'action': 'block_scripts'}) ]) }} + + <div class="horizontal-separator"></div> + + {% set advanced_user_but_classes = ['red-button'] %} + {% set simple_user_but_classes = ['green-button'] %} + + <p> + {% if settings.advanced_user %} + {% do advanced_user_but_classes.append('disabled-button') %} + {{ _('web_ui.options.user_is_advanced_user') }} + {% else %} + {% do simple_user_but_classes.append('disabled-button') %} + {{ _('web_ui.options.user_is_simple_user') }} + {% endif %} + </p> + + {{ + button_row([ + (advanced_user_but_classes, + _('web_ui.options.user_make_advanced_button'), + {'action': 'user_make_advanced'}), + (simple_user_but_classes, + _('web_ui.options.user_make_simple_button'), + {'action': 'user_make_simple'}) + ]) + }} {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja index 25015ae..d2c85df 100644 --- a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja @@ -159,13 +159,20 @@ code in a proprietary work, I am not going to enforce this in court. <div class="horizontal-separator"></div> {% endif %}{# not display_info.deleted (elif) #} <p> - {{ - _('web_ui.repos.item_count_{mappings}_{resources}') - .format( - mappings = display_info.mapping_count, - resources = display_info.resource_count - ) - }} + {% if settings.advanced_user %} + {{ + _('web_ui.repos.item_count_{mappings}_{resources}') + .format( + mappings = display_info.mapping_count, + resources = display_info.resource_count + ) + }} + {% else %} + {{ + _('web_ui.repos.item_count_{mappings}') + .format(mappings = display_info.mapping_count) + }} + {% endif %} </p> {% if not display_info.is_local_semirepo and not display_info.deleted %} |