# HG changeset patch # User domruf # Date 2016-11-03 19:03:03 # Node ID f92d08061a2493ae0f237f4a2a3593d1413a5f4d # Parent e6e69ed2c89e8a454f37a418a0a577f021867667 summary: use shared changelog_table implementation on summary page The main purpose of this change is to simplify code and avoid duplication. Using the shared implementation also happens to give a slightly different view of the changesets. There will be no table headers, the columns are shown in different order, author gravatars are shown, commit messages can be expanded, and there is slightly different styling. Small remaining amounts of template code is moved from changelog_summary_data.html to summary.html. Patch modified by Mads Kiilerich. diff --git a/kallithea/templates/changelog/changelog_summary_data.html b/kallithea/templates/changelog/changelog_summary_data.html deleted file mode 100644 --- a/kallithea/templates/changelog/changelog_summary_data.html +++ /dev/null @@ -1,103 +0,0 @@ -## -*- coding: utf-8 -*- -%if c.cs_pagination: - - - - - - - - - - -%for cnt,cs in enumerate(c.cs_pagination): - - - - - - - - - -%endfor - -
${_('Revision')}${_('Commit Message')}${_('Age')}${_('Author')}${_('Refs')}
- %if c.cs_statuses.get(cs.raw_id): - %if c.cs_statuses.get(cs.raw_id)[2]: - - - - %else: - - - - %endif - %endif - - %if c.cs_comments.get(cs.raw_id,[]): - - %endif - - ${h.show_id(cs)} - - ${h.urlify_text(h.chop_at(cs.message,'\n'),c.repo_name, h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} - - ${h.age(cs.date)} - ${h.person(cs.author)} - %for book in cs.bookmarks: - - ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} - - %endfor - %for tag in cs.tags: - - ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} - - %endfor - %if cs.branch: - - ${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))} - - %endif -
- -${c.cs_pagination.pager()} - -%else: - -%if h.HasRepoPermissionLevel('write')(c.repo_name): -

${_('Add or upload files directly via Kallithea')}

-
- -
-%endif - - -

${_('Push new repository')}

-
-    ${c.db_repo_scm_instance.alias} clone ${c.clone_repo_url}
-    ${c.db_repo_scm_instance.alias} add README # add first file
-    ${c.db_repo_scm_instance.alias} commit -m "Initial" # commit with message
-    ${c.db_repo_scm_instance.alias} push ${'origin master' if h.is_git(c.db_repo_scm_instance) else ''} # push changes back
-
- -

${_('Existing repository?')}

-
-%if h.is_git(c.db_repo_scm_instance):
-    git remote add origin ${c.clone_repo_url}
-    git push -u origin master
-%else:
-    hg push ${c.clone_repo_url}
-%endif
-
-%endif diff --git a/kallithea/templates/summary/summary.html b/kallithea/templates/summary/summary.html --- a/kallithea/templates/summary/summary.html +++ b/kallithea/templates/summary/summary.html @@ -1,4 +1,5 @@ <%inherit file="/base/base.html"/> +<%namespace name="changelog_table" file="/changelog/changelog_table.html"/> <%block name="title"> ${_('%s Summary') % c.repo_name} @@ -179,7 +180,37 @@
- <%include file='../changelog/changelog_summary_data.html'/> + %if c.cs_pagination: + ${changelog_table.changelog(c.repo_name, c.cs_pagination, c.cs_statuses, c.cs_comments, show_checkbox=False)} + ${c.cs_pagination.pager()} + %else: + %if h.HasRepoPermissionLevel('write')(c.repo_name): +

${_('Add or upload files directly via Kallithea')}

+
+ +
+ %endif + +

${_('Push new repository')}

+
+                    ${c.db_repo_scm_instance.alias} clone ${c.clone_repo_url}
+                    ${c.db_repo_scm_instance.alias} add README # add first file
+                    ${c.db_repo_scm_instance.alias} commit -m "Initial" # commit with message
+                    ${c.db_repo_scm_instance.alias} push ${'origin master' if h.is_git(c.db_repo_scm_instance) else ''} # push changes back
+                
+ +

${_('Existing repository?')}

+
+                %if h.is_git(c.db_repo_scm_instance):
+                    git remote add origin ${c.clone_repo_url}
+                    git push -u origin master
+                %else:
+                    hg push ${c.clone_repo_url}
+                %endif
+                
+ %endif