Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
blog
Commits
507d56857f85
Commit
507d56857f85
authored
16 years ago
by
sylvain thenault
Browse files
Options
Downloads
Patches
Plain Diff
cleanup, avoid duplicated id causing xhtml error
parent
7ef8a8fe7e22
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views.py
+9
-19
9 additions, 19 deletions
views.py
with
9 additions
and
19 deletions
views.py
+
9
−
19
View file @
507d5685
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
def
cell_call
(
self
,
row
,
col
):
def
cell_call
(
self
,
row
,
col
):
self
.
wview
(
self
.
item_vid
,
self
.
rset
,
row
=
row
,
col
=
col
)
self
.
wview
(
self
.
item_vid
,
self
.
rset
,
row
=
row
,
col
=
col
)
class
SIOCBlogItemView
(
EntityView
):
class
SIOCBlogItemView
(
EntityView
):
id
=
'
sioc_item
'
id
=
'
sioc_item
'
accepts
=
(
'
Blog
'
,)
accepts
=
(
'
Blog
'
,)
...
@@ -67,6 +68,7 @@
...
@@ -67,6 +68,7 @@
self
.
w
(
u
'
<dcterms:title>%s</dcterms:title>
'
%
html_escape
(
unicode
(
entity
.
title
)))
self
.
w
(
u
'
<dcterms:title>%s</dcterms:title>
'
%
html_escape
(
unicode
(
entity
.
title
)))
self
.
w
(
u
'
<dcterms:created>%s</dcterms:created>
'
%
entity
.
creation_date
)
self
.
w
(
u
'
<dcterms:created>%s</dcterms:created>
'
%
entity
.
creation_date
)
self
.
w
(
u
'
<dcterms:modified>%s</dcterms:modified>
'
%
entity
.
modification_date
)
self
.
w
(
u
'
<dcterms:modified>%s</dcterms:modified>
'
%
entity
.
modification_date
)
class
SIOCItemView
(
SIOCBlogItemView
):
class
SIOCItemView
(
SIOCBlogItemView
):
accepts
=
(
'
BlogEntry
'
,)
accepts
=
(
'
BlogEntry
'
,)
...
@@ -89,6 +91,7 @@
...
@@ -89,6 +91,7 @@
self.w(u
'
</
sioc
:
User
>
\
n
'
)
self.w(u
'
</
sioc
:
User
>
\
n
'
)
self.w(u
'
</
sioc
:
has_creator
>
\
n
'
)
self.w(u
'
</
sioc
:
has_creator
>
\
n
'
)
self.w(u
'
</
sioc
:
Post
>
\
n
'
)
self.w(u
'
</
sioc
:
Post
>
\
n
'
)
class BlogPrimaryView(baseviews.PrimaryView):
class BlogPrimaryView(baseviews.PrimaryView):
accepts = (
'
Blog
'
,)
accepts = (
'
Blog
'
,)
...
@@ -109,6 +112,7 @@
...
@@ -109,6 +112,7 @@
html_escape(entity.rss_feed_url()), self.req._(u
'
subscribe
'
),
html_escape(entity.rss_feed_url()), self.req._(u
'
subscribe
'
),
self.req.external_resource(
'
RSS_LOGO_16
'
), self.req._(
'
rss
icon
'
)))
self.req.external_resource(
'
RSS_LOGO_16
'
), self.req._(
'
rss
icon
'
)))
class BlogEntryPrimaryView(baseviews.PrimaryView):
class BlogEntryPrimaryView(baseviews.PrimaryView):
accepts = (
'
BlogEntry
'
,)
accepts = (
'
BlogEntry
'
,)
skip_attrs = baseviews.PrimaryView.skip_attrs + (
'
title
'
,)
skip_attrs = baseviews.PrimaryView.skip_attrs + (
'
title
'
,)
...
@@ -127,6 +131,7 @@
...
@@ -127,6 +131,7 @@
self.w(_(
'
blogged
in
'
))
self.w(_(
'
blogged
in
'
))
self.wview(
'
secondary
'
, rset,
'
null
'
)
self.wview(
'
secondary
'
, rset,
'
null
'
)
class BlogEntryArchiveView(StartupView):
class BlogEntryArchiveView(StartupView):
"""
control the view of a blog archive
"""
"""
control the view of a blog archive
"""
id =
'
blog_archive
'
id =
'
blog_archive
'
...
@@ -168,11 +173,7 @@
...
@@ -168,11 +173,7 @@
url = html_escape(u
"
/?vid=blog_archive
"
)
url = html_escape(u
"
/?vid=blog_archive
"
)
link = u
'
<
a
href
=
"
%s
"
title
=
""
>
[
see
more
archives
]
</
a
>
'
% url
link = u
'
<
a
href
=
"
%s
"
title
=
""
>
[
see
more
archives
]
</
a
>
'
% url
items.append( u
'
<
li
class
=
""
>%
s
</
li
>
\
n
'
% link )
items.append( u
'
<
li
class
=
""
>%
s
</
li
>
\
n
'
% link )
if self.id:
self.w(u
'
<
div
class
=
"
boxFrame
"
>
'
)
self.w(u
'
<
div
class
=
"
boxFrame
"
id
=
"
%s
"
>
'
% self.id)
else:
self.w(u
'
<
div
class
=
"
boxFrame
"
>
'
)
if items:
if items:
self.w(u
'
<
div
class
=
"
boxContent
"
>
\
n
'
)
self.w(u
'
<
div
class
=
"
boxContent
"
>
\
n
'
)
self.w(u
'
<
ul
class
=
"
boxListing
"
>
'
)
self.w(u
'
<
ul
class
=
"
boxListing
"
>
'
)
...
@@ -188,10 +189,9 @@
...
@@ -188,10 +189,9 @@
order = 35
order = 35
def call(self, **kwargs):
def call(self, **kwargs):
"""
display blog archive
"""
display blogs archive
"""
"""
_ = self.req._
_ = self.req._
box = BoxWidget(_(self.title), id=self.id, islist=False)
box = BoxWidget(_(self.title), id=self.id, islist=False)
box.append(BoxHtml(self.view(
'
blog_archive
'
, None, maxentries=12)))
box.append(BoxHtml(self.view(
'
blog_archive
'
, None, maxentries=12)))
box.render(self.w)
box.render(self.w)
...
@@ -193,8 +193,9 @@
...
@@ -193,8 +193,9 @@
_ = self.req._
_ = self.req._
box = BoxWidget(_(self.title), id=self.id, islist=False)
box = BoxWidget(_(self.title), id=self.id, islist=False)
box.append(BoxHtml(self.view(
'
blog_archive
'
, None, maxentries=12)))
box.append(BoxHtml(self.view(
'
blog_archive
'
, None, maxentries=12)))
box.render(self.w)
box.render(self.w)
class BlogEntryListBox(BoxTemplate):
class BlogEntryListBox(BoxTemplate):
"""
display a box with latest blogs and rss
"""
"""
display a box with latest blogs and rss
"""
id =
'
blog_latest_box
'
id =
'
blog_latest_box
'
...
@@ -229,18 +230,6 @@
...
@@ -229,18 +230,6 @@
box.render(self.w)
box.render(self.w)
# class OneLineView(EntityView):
# accepts = (
'
BlogEntry
'
,)
# id =
'
sideboxview
'
# def cell_call(self, row, col):
#
"""
the view to be used in a side box
#
"""
# entity = self.entity(row, col)
# self.w(u
'
<
li
class
=
"
Box
"
><
a
href
=
"
%s
"
>
'
% html_escape(entity.absolute_url()))
# self.w(html_escape(self.view(
'
text
'
, self.rset, row=row, col=col)))
# self.w(u
'
</
a
></
li
>
'
)
## list views #################################################################
## list views #################################################################
class BlogEntryListView(baseviews.ListView):
class BlogEntryListView(baseviews.ListView):
...
@@ -320,6 +309,7 @@
...
@@ -320,6 +309,7 @@
self.view(
'
secondary
'
, rset,
'
null
'
)))
self.view(
'
secondary
'
, rset,
'
null
'
)))
self.w(u
'
|
'
.join(reldata))
self.w(u
'
|
'
.join(reldata))
class BlogNavigation(PageNavigation):
class BlogNavigation(PageNavigation):
accepts = (
'
BlogEntry
'
, )
accepts = (
'
BlogEntry
'
, )
__selectors__ = (paginated_rset, sorted_rset, accept)
__selectors__ = (paginated_rset, sorted_rset, accept)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment