# HG changeset patch # User Mads Kiilerich # Date 2015-07-23 00:52:29 # Node ID 5d161c09626032ebe7e009b7450b761ed825b57c # Parent d23d70cce785259d211e0103853f8a456898a5ad helpers: drop h.tooltip h.tooltip did more magic in the past - now it just did a douple (or triple?) escape of html. c9cfaeb1cdfe removed most of the need for double escaping - and the places where it is used, it must be 'tagged' with the safe-html-title class. Thus, none of the remaining uses of h.tooltip are relevant (and might even be wrong); normal automatic template escaping is just fine. This is mostly: sed -i 's,title="\${h.tooltip(\([^}]*\))}",title="${\1}",g' `hg mani` diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -148,21 +148,6 @@ class _GetError(object): get_error = _GetError() -class _ToolTip(object): - - def __call__(self, tooltip_title, trim_at=50): - """ - Special function just to wrap our text into nice formatted - autowrapped text - - :param tooltip_title: - """ - tooltip_title = escape(tooltip_title) - tooltip_title = tooltip_title.replace('<', '<').replace('>', '>') - return tooltip_title -tooltip = _ToolTip() - - class _FilesBreadCrumbs(object): def __call__(self, repo_name, rev, paths): diff --git a/kallithea/templates/admin/admin.html b/kallithea/templates/admin/admin.html --- a/kallithea/templates/admin/admin.html +++ b/kallithea/templates/admin/admin.html @@ -8,7 +8,7 @@ <%def name="breadcrumbs_links()">
- ? + ? ${_('Admin Journal')} - ${ungettext('%s Entry', '%s Entries', c.users_log.item_count) % (c.users_log.item_count)}
diff --git a/kallithea/templates/admin/permissions/permissions_globals.html b/kallithea/templates/admin/permissions/permissions_globals.html --- a/kallithea/templates/admin/permissions/permissions_globals.html +++ b/kallithea/templates/admin/permissions/permissions_globals.html @@ -22,7 +22,7 @@ ${h.form(url('admin_permissions'), metho ${h.checkbox('overwrite_default_repo','true')} ${_('Permissions for the Default user on new repositories.')} @@ -36,7 +36,7 @@ ${h.form(url('admin_permissions'), metho ${h.checkbox('overwrite_default_group','true')} ${_('Permissions for the Default user on new repository groups.')} @@ -50,7 +50,7 @@ ${h.form(url('admin_permissions'), metho ${h.checkbox('overwrite_default_user_group','true')} ${_('Permissions for the Default user on new user groups.')} diff --git a/kallithea/templates/admin/settings/settings_vcs.html b/kallithea/templates/admin/settings/settings_vcs.html --- a/kallithea/templates/admin/settings/settings_vcs.html +++ b/kallithea/templates/admin/settings/settings_vcs.html @@ -66,7 +66,7 @@ ${h.form(url('admin_settings'), method='
${h.text('paths_root_path',size=60,readonly="readonly", class_="disabled")} + title="${_('Click to unlock. You must restart Kallithea in order to make this setting take effect.')}">
${_('Filesystem location where repositories are stored. After changing this value, a restart and rescan of the repository folder are both required.')} diff --git a/kallithea/templates/bookmarks/bookmarks_data.html b/kallithea/templates/bookmarks/bookmarks_data.html --- a/kallithea/templates/bookmarks/bookmarks_data.html +++ b/kallithea/templates/bookmarks/bookmarks_data.html @@ -23,7 +23,7 @@ ${book[1]._timestamp} - ${h.fmt_date(book[1].date)} + ${h.fmt_date(book[1].date)} ${h.person(book[1].author)} ${book[1].revision} diff --git a/kallithea/templates/branches/branches_data.html b/kallithea/templates/branches/branches_data.html --- a/kallithea/templates/branches/branches_data.html +++ b/kallithea/templates/branches/branches_data.html @@ -24,7 +24,7 @@ ${branch[1]._timestamp} - ${h.fmt_date(branch[1].date)} + ${h.fmt_date(branch[1].date)} ${h.person(branch[1].author)} ${branch[1].revision} @@ -51,7 +51,7 @@ ${branch[1]._timestamp} - ${h.fmt_date(branch[1].date)} + ${h.fmt_date(branch[1].date)} ${h.person(branch[1].author)} ${branch[1].revision} diff --git a/kallithea/templates/changelog/changelog_details.html b/kallithea/templates/changelog/changelog_details.html --- a/kallithea/templates/changelog/changelog_details.html +++ b/kallithea/templates/changelog/changelog_details.html @@ -1,11 +1,11 @@ ## small box that displays changed/added/removed details fetched by AJAX % if len(c.cs.affected_files) <= c.affected_files_cut_off: -${len(c.cs.removed)} -${len(c.cs.changed)} -${len(c.cs.added)} +${len(c.cs.removed)} +${len(c.cs.changed)} +${len(c.cs.added)} % else: - ! - ! - ! + ! + ! + ! % endif diff --git a/kallithea/templates/changelog/changelog_summary_data.html b/kallithea/templates/changelog/changelog_summary_data.html --- a/kallithea/templates/changelog/changelog_summary_data.html +++ b/kallithea/templates/changelog/changelog_summary_data.html @@ -44,7 +44,7 @@ ${h.urlify_commit(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)} diff --git a/kallithea/templates/changeset/changeset.html b/kallithea/templates/changeset/changeset.html --- a/kallithea/templates/changeset/changeset.html +++ b/kallithea/templates/changeset/changeset.html @@ -51,13 +51,13 @@ ${self.repo_context_bar('changelog', c.c %endif
- + - + - + ${c.ignorews_url(request.GET)} diff --git a/kallithea/templates/changeset/changeset_range.html b/kallithea/templates/changeset/changeset_range.html --- a/kallithea/templates/changeset/changeset_range.html +++ b/kallithea/templates/changeset/changeset_range.html @@ -45,7 +45,7 @@ ${self.repo_context_bar('changelog')} ${cs.date} %if c.statuses: -
+
%endif
${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}
@@ -78,7 +78,7 @@ ${self.repo_context_bar('changelog')} ##${comment.comment_inline_form(cs)} ## diff block
- ${h.show_id(cs)} + ${h.show_id(cs)}
${h.gravatar(h.email_or_none(cs.author), size=20)}
diff --git a/kallithea/templates/changeset/diff_block.html b/kallithea/templates/changeset/diff_block.html --- a/kallithea/templates/changeset/diff_block.html +++ b/kallithea/templates/changeset/diff_block.html @@ -18,16 +18,16 @@ revision=cs2,f_path=h.safe_unicode(path)))}
- + - + - + - + ${c.ignorews_url(request.GET, h.FID(cs2,path))} @@ -96,7 +96,7 @@ %endif
- + ${c.ignorews_url(request.GET)} diff --git a/kallithea/templates/compare/compare_cs.html b/kallithea/templates/compare/compare_cs.html --- a/kallithea/templates/compare/compare_cs.html +++ b/kallithea/templates/compare/compare_cs.html @@ -51,7 +51,7 @@ ${index} - ${cs.date} + ${cs.date}
${h.gravatar(h.email_or_none(cs.author), size=14)}
${h.person(cs.author)}
${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} diff --git a/kallithea/templates/data_table/_dt_elements.html b/kallithea/templates/data_table/_dt_elements.html --- a/kallithea/templates/data_table/_dt_elements.html +++ b/kallithea/templates/data_table/_dt_elements.html @@ -87,7 +87,7 @@ <%def name="last_change(last_change)"> - ${h.age(last_change)} + ${h.age(last_change)} <%def name="revision(name,rev,tip,author,last_msg)"> diff --git a/kallithea/templates/files/diff_2way.html b/kallithea/templates/files/diff_2way.html --- a/kallithea/templates/files/diff_2way.html +++ b/kallithea/templates/files/diff_2way.html @@ -40,16 +40,16 @@ ${self.repo_context_bar('changelog')} revision=c.cs2.raw_id,f_path=h.safe_unicode(c.node1.path)))}
- + - + - + - + ${h.checkbox('ignorews', label=_('Ignore whitespace'))} diff --git a/kallithea/templates/files/files_browser.html b/kallithea/templates/files/files_browser.html --- a/kallithea/templates/files/files_browser.html +++ b/kallithea/templates/files/files_browser.html @@ -90,12 +90,12 @@ %if node.is_file(): - ${h.show_id(node.last_changeset)} + ${h.show_id(node.last_changeset)} %endif %if node.is_file(): - + ${h.age(node.last_changeset.date)} %endif diff --git a/kallithea/templates/files/files_history_box.html b/kallithea/templates/files/files_history_box.html --- a/kallithea/templates/files/files_history_box.html +++ b/kallithea/templates/files/files_history_box.html @@ -1,7 +1,7 @@
${h.literal(ungettext(u'%s author',u'%s authors',len(c.authors)) % ('%s' % len(c.authors))) }
%for email, user in c.authors: -
+
${h.gravatar(email, size=20)}
diff --git a/kallithea/templates/files/files_source.html b/kallithea/templates/files/files_source.html --- a/kallithea/templates/files/files_source.html +++ b/kallithea/templates/files/files_source.html @@ -22,7 +22,7 @@
-
${h.link_to(h.show_id(c.file_changeset),h.url('changeset_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id))}
+
${h.link_to(h.show_id(c.file_changeset),h.url('changeset_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id))}
${h.format_byte_size(c.file.size,binary=True)}
${c.file.mimetype}
diff --git a/kallithea/templates/followers/followers_data.html b/kallithea/templates/followers/followers_data.html --- a/kallithea/templates/followers/followers_data.html +++ b/kallithea/templates/followers/followers_data.html @@ -10,7 +10,7 @@
${_('Started following -')} - ${h.age(f.follows_from)}
+ ${h.age(f.follows_from)}
% endfor diff --git a/kallithea/templates/forks/forks_data.html b/kallithea/templates/forks/forks_data.html --- a/kallithea/templates/forks/forks_data.html +++ b/kallithea/templates/forks/forks_data.html @@ -15,7 +15,7 @@
${_('Forked')} - - ${h.age(f.created_on)} + ${h.age(f.created_on)} ${_('Compare Fork')} diff --git a/kallithea/templates/journal/journal.html b/kallithea/templates/journal/journal.html --- a/kallithea/templates/journal/journal.html +++ b/kallithea/templates/journal/journal.html @@ -7,7 +7,7 @@
- ? + ? ${_('Journal')} - ${ungettext('%s Entry', '%s Entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
diff --git a/kallithea/templates/journal/journal_data.html b/kallithea/templates/journal/journal_data.html --- a/kallithea/templates/journal/journal_data.html +++ b/kallithea/templates/journal/journal_data.html @@ -28,7 +28,7 @@
${h.literal(h.action_parser(entry)[1]())}
-
${h.age(entry.action_date)}
+
${h.age(entry.action_date)}
%endfor
diff --git a/kallithea/templates/pullrequests/pullrequest_data.html b/kallithea/templates/pullrequests/pullrequest_data.html --- a/kallithea/templates/pullrequests/pullrequest_data.html +++ b/kallithea/templates/pullrequests/pullrequest_data.html @@ -61,7 +61,7 @@ ${pr.author.full_name_and_username} - + ${h.age(pr.created_on)} diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html +++ b/kallithea/templates/pullrequests/pullrequest_show.html @@ -94,7 +94,7 @@ ${self.repo_context_bar('showpullrequest
% if len(c.pull_request_pending_reviewers) > 0: -
${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}
+
${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}
% elif len(c.pull_request_reviewers) > 0:
${_('Pull request was reviewed by all reviewers')}
%else: @@ -217,7 +217,7 @@ ${self.repo_context_bar('showpullrequest ## If you change something here it should be reflected in the template too.
  • -
    +
    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 @@ -122,7 +122,7 @@ summary = lambda n:{False:'summary-short ${h.hidden('download_options')} - + %endif
    diff --git a/kallithea/templates/tags/tags_data.html b/kallithea/templates/tags/tags_data.html --- a/kallithea/templates/tags/tags_data.html +++ b/kallithea/templates/tags/tags_data.html @@ -24,7 +24,7 @@ ${tag[1]._timestamp} - ${h.fmt_date(tag[1].date)} + ${h.fmt_date(tag[1].date)} ${h.person(tag[1].author)} ${tag[1].revision}