##// END OF EJS Templates
meta-tags: fixes #4305, metatags are not taken into account when truncating output....
marcink -
r1102:e81bd352 default
parent child Browse files
Show More
@@ -254,9 +254,11 b' class RepoModel(BaseModel):'
254
254
255 def desc(desc):
255 def desc(desc):
256 if c.visual.stylify_metatags:
256 if c.visual.stylify_metatags:
257 return h.urlify_text(h.escaped_stylize(h.truncate(desc, 60)))
257 desc = h.urlify_text(h.escaped_stylize(desc))
258 else:
258 else:
259 return h.urlify_text(h.html_escape(h.truncate(desc, 60)))
259 desc = h.urlify_text(h.html_escape(desc))
260
261 return _render('repo_desc', desc)
260
262
261 def state(repo_state):
263 def state(repo_state):
262 return _render("repo_state", repo_state)
264 return _render("repo_state", repo_state)
@@ -48,7 +48,7 b' log = logging.getLogger(__name__)'
48 class RepoGroupModel(BaseModel):
48 class RepoGroupModel(BaseModel):
49
49
50 cls = RepoGroup
50 cls = RepoGroup
51 PERSONAL_GROUP_DESC = '[personal] repo group: owner `%(username)s`'
51 PERSONAL_GROUP_DESC = 'personal repo group of user `%(username)s`'
52 PERSONAL_GROUP_PATTERN = '${username}' # default
52 PERSONAL_GROUP_PATTERN = '${username}' # default
53
53
54 def _get_user_group(self, users_group):
54 def _get_user_group(self, users_group):
@@ -656,11 +656,15 b' class RepoGroupModel(BaseModel):'
656 def repo_group_lnk(repo_group_name):
656 def repo_group_lnk(repo_group_name):
657 return _render('repo_group_name', repo_group_name)
657 return _render('repo_group_name', repo_group_name)
658
658
659 def desc(desc):
659 def desc(desc, personal):
660 prefix = h.escaped_stylize(u'[personal] ') if personal else ''
661
660 if c.visual.stylify_metatags:
662 if c.visual.stylify_metatags:
661 return h.urlify_text(h.escaped_stylize(h.truncate(desc, 60)))
663 desc = h.urlify_text(prefix + h.escaped_stylize(desc))
662 else:
664 else:
663 return h.urlify_text(h.html_escape(h.truncate(desc, 60)))
665 desc = h.urlify_text(prefix + h.html_escape(desc))
666
667 return _render('repo_group_desc', desc)
664
668
665 def repo_group_actions(repo_group_id, repo_group_name, gr_count):
669 def repo_group_actions(repo_group_id, repo_group_name, gr_count):
666 return _render(
670 return _render(
@@ -679,7 +683,7 b' class RepoGroupModel(BaseModel):'
679 "menu": quick_menu(group.group_name),
683 "menu": quick_menu(group.group_name),
680 "name": repo_group_lnk(group.group_name),
684 "name": repo_group_lnk(group.group_name),
681 "name_raw": group.group_name,
685 "name_raw": group.group_name,
682 "desc": desc(group.group_description),
686 "desc": desc(group.group_description, group.personal),
683 "top_level_repos": 0,
687 "top_level_repos": 0,
684 "owner": user_profile(group.user.username)
688 "owner": user_profile(group.user.username)
685 }
689 }
@@ -129,6 +129,13 b' table.dataTable {'
129
129
130 &.td-description {
130 &.td-description {
131 min-width: 350px;
131 min-width: 350px;
132
133 &.truncate, .truncate-wrap {
134 white-space: nowrap;
135 overflow: hidden;
136 text-overflow: ellipsis;
137 max-width: 450px;
138 }
132 }
139 }
133
140
134 &.td-componentname {
141 &.td-componentname {
@@ -72,6 +72,10 b''
72 </div>
72 </div>
73 </%def>
73 </%def>
74
74
75 <%def name="repo_desc(description)">
76 <div class="truncate-wrap">${description}</div>
77 </%def>
78
75 <%def name="last_change(last_change)">
79 <%def name="last_change(last_change)">
76 ${h.age_component(last_change)}
80 ${h.age_component(last_change)}
77 </%def>
81 </%def>
@@ -167,6 +171,10 b''
167 </div>
171 </div>
168 </%def>
172 </%def>
169
173
174 <%def name="repo_group_desc(description)">
175 <div class="truncate-wrap">${description}</div>
176 </%def>
177
170 <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)">
178 <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)">
171 <div class="grid_edit">
179 <div class="grid_edit">
172 <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}">Edit</a>
180 <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}">Edit</a>
General Comments 0
You need to be logged in to leave comments. Login now