diff --git a/rhodecode/controllers/admin/repos_groups.py b/rhodecode/controllers/admin/repos_groups.py --- a/rhodecode/controllers/admin/repos_groups.py +++ b/rhodecode/controllers/admin/repos_groups.py @@ -360,19 +360,15 @@ class ReposGroupsController(BaseControll .filter(RepoGroup.group_parent_id == c.group.group_id).all() c.groups = self.scm_model.get_repos_groups(groups) - if not c.visual.lightweight_dashboard: - c.repos_list = self.scm_model.get_repos(all_repos=gr_filter) - ## lightweight version of dashboard - else: - c.repos_list = Repository.query()\ - .filter(Repository.group_id == c.group.group_id)\ - .order_by(func.lower(Repository.repo_name))\ - .all() + c.repos_list = Repository.query()\ + .filter(Repository.group_id == c.group.group_id)\ + .order_by(func.lower(Repository.repo_name))\ + .all() - repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, - admin=False) - #json used to render the grid - c.data = json.dumps(repos_data) + repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, + admin=False) + #json used to render the grid + c.data = json.dumps(repos_data) return render('admin/repos_groups/repos_groups.html') diff --git a/rhodecode/controllers/admin/settings.py b/rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py +++ b/rhodecode/controllers/admin/settings.py @@ -198,11 +198,6 @@ class SettingsController(BaseController) form_result['rhodecode_stylify_metatags'] Session().add(sett3) - sett4 = RhodeCodeSetting.get_by_name_or_create('lightweight_dashboard') - sett4.app_settings_value = \ - form_result['rhodecode_lightweight_dashboard'] - Session().add(sett4) - sett4 = RhodeCodeSetting.get_by_name_or_create('repository_fields') sett4.app_settings_value = \ form_result['rhodecode_repository_fields'] diff --git a/rhodecode/controllers/home.py b/rhodecode/controllers/home.py --- a/rhodecode/controllers/home.py +++ b/rhodecode/controllers/home.py @@ -52,19 +52,15 @@ class HomeController(BaseController): c.groups = self.scm_model.get_repos_groups() c.group = None - if not c.visual.lightweight_dashboard: - c.repos_list = self.scm_model.get_repos() - ## lightweight version of dashboard - else: - c.repos_list = Repository.query()\ - .filter(Repository.group_id == None)\ - .order_by(func.lower(Repository.repo_name))\ - .all() + c.repos_list = Repository.query()\ + .filter(Repository.group_id == None)\ + .order_by(func.lower(Repository.repo_name))\ + .all() - repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, - admin=False) - #json used to render the grid - c.data = json.dumps(repos_data) + repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, + admin=False) + #json used to render the grid + c.data = json.dumps(repos_data) return render('/index.html') diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -271,8 +271,7 @@ class BaseController(WSGIController): c.visual.show_public_icon = str2bool(rc_config.get('rhodecode_show_public_icon')) c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon')) c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags')) - c.visual.lightweight_dashboard = str2bool(rc_config.get('rhodecode_lightweight_dashboard')) - c.visual.lightweight_dashboard_items = safe_int(config.get('dashboard_items', 100)) + c.visual.dashboard_items = safe_int(config.get('dashboard_items', 100)) c.visual.repository_fields = str2bool(rc_config.get('rhodecode_repository_fields')) c.repo_name = get_repo_slug(request) # can be empty c.backends = BACKENDS.keys() diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -282,7 +282,6 @@ def ApplicationVisualisationForm(): rhodecode_show_private_icon = v.StringBoolean(if_missing=False) rhodecode_stylify_metatags = v.StringBoolean(if_missing=False) - rhodecode_lightweight_dashboard = v.StringBoolean(if_missing=False) rhodecode_repository_fields = v.StringBoolean(if_missing=False) rhodecode_lightweight_journal = v.StringBoolean(if_missing=False) diff --git a/rhodecode/templates/admin/settings/settings.html b/rhodecode/templates/admin/settings/settings.html --- a/rhodecode/templates/admin/settings/settings.html +++ b/rhodecode/templates/admin/settings/settings.html @@ -130,12 +130,6 @@
- ${h.checkbox('rhodecode_lightweight_dashboard','True')} - -
-
-
-
${h.checkbox('rhodecode_repository_fields','True')}
diff --git a/rhodecode/templates/index_base.html b/rhodecode/templates/index_base.html --- a/rhodecode/templates/index_base.html +++ b/rhodecode/templates/index_base.html @@ -70,160 +70,13 @@ - <%cnt=0%> - <%namespace name="dt" file="/data_table/_dt_elements.html"/> - % if not c.visual.lightweight_dashboard: - ## old full detailed version -
- - - - - - - - - - - - - - %for cnt,repo in enumerate(c.repos_list): - - ##QUICK MENU - - ##REPO NAME AND ICONS - - ##DESCRIPTION - - ##LAST CHANGE DATE - - ##LAST REVISION - - ## - - - - %endfor - -
${_('Name')}${_('Description')}${_('Last change')}${_('Tip')}${_('Owner')}${_('Atom')}
- ${dt.quick_menu(repo['name'])} - - ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],h.AttributeDict(repo['dbrepo_fork']),pageargs.get('short_repo_names'))} - - %if c.visual.stylify_metatags: - ${h.urlify_text(h.desc_stylize(h.truncate(repo['description'],60)))} - %else: - ${h.truncate(repo['description'],60)} - %endif - - ${dt.last_change(repo['last_change'])} - - ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} - ${h.person(repo['contact'])} - ${dt.atom(repo['name'])} -
-
- % else: - ## lightweight version -
-
- % endif + <%cnt=0%> + <%namespace name="dt" file="/data_table/_dt_elements.html"/> +
+
- % if not c.visual.lightweight_dashboard: - - % else: - % endif diff --git a/rhodecode/tests/functional/test_home.py b/rhodecode/tests/functional/test_home.py --- a/rhodecode/tests/functional/test_home.py +++ b/rhodecode/tests/functional/test_home.py @@ -17,19 +17,22 @@ class TestHomeController(TestController) response = self.app.get(url(controller='home', action='index')) #if global permission is set response.mustcontain('Add repository') - response.mustcontain('href="/%s"' % HG_REPO) + # html in javascript variable: + response.mustcontain("""var data = {"totalRecords": %s""" + % len(Repository.getAll())) + response.mustcontain(r'href=\"/%s\"' % HG_REPO) - response.mustcontain("""""") - response.mustcontain("""""") + response.mustcontain(r"""""") + response.mustcontain(r"""""") response.mustcontain( -"""r173:27cd5cce30c9""" +r"""r173:27cd5cce30c9""" ) def test_repo_summary_with_anonymous_access_disabled(self): @@ -66,22 +69,6 @@ merge" class="tooltip" href="/vcs_test_h Session().add(anon) Session().commit() - def _set_l_dash(self, set_to): - self.app.post(url('admin_setting', setting_id='visual'), - params=dict(_method='put', - rhodecode_lightweight_dashboard=set_to,)) - - def test_index_with_lightweight_dashboard(self): - self.log_user() - self._set_l_dash(True) - - try: - response = self.app.get(url(controller='home', action='index')) - response.mustcontain("""var data = {"totalRecords": %s""" - % len(Repository.getAll())) - finally: - self._set_l_dash(False) - def test_index_page_on_groups(self): self.log_user() gr = fixture.create_group('gr1') @@ -94,18 +81,3 @@ merge" class="tooltip" href="/vcs_test_h RepoModel().delete('gr1/repo_in_group') ReposGroupModel().delete(repos_group='gr1', force_delete=True) Session().commit() - - def test_index_page_on_groups_with_lightweight_dashboard(self): - self.log_user() - self._set_l_dash(True) - fixture.create_repo(name='gr1/repo_in_group', - repos_group=fixture.create_group('gr1')) - response = self.app.get(url('repos_group_home', group_name='gr1')) - - try: - response.mustcontain("""gr1/repo_in_group""") - finally: - self._set_l_dash(False) - RepoModel().delete('gr1/repo_in_group') - ReposGroupModel().delete(repos_group='gr1', force_delete=True) - Session().commit()