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
08cad2c92811
Commit
08cad2c92811
authored
16 years ago
by
Graziella Toutoungis
Browse files
Options
Downloads
Patches
Plain Diff
add condition to control the visibility of the archive_box
parent
6c1ce3728726
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views.py
+9
-4
9 additions, 4 deletions
views.py
with
9 additions
and
4 deletions
views.py
+
9
−
4
View file @
08cad2c9
...
...
@@ -158,9 +158,10 @@
"""
display a list of entities by calling their <item_vid> view
"""
rset = self.req.execute(
'
Any
CD
ORDERBY
CD
DESC
WHERE
B
is
BlogEntry
,
B
creation_date
CD
'
)
blogmonths = []
items = []
for (blogdate,) in rset:
year, month = blogdate.year, blogdate.month
if (year, month) not in blogmonths:
blogmonths.append( (year, month) )
...
...
@@ -161,10 +162,10 @@
blogmonths = []
items = []
for (blogdate,) in rset:
year, month = blogdate.year, blogdate.month
if (year, month) not in blogmonths:
blogmonths.append( (year, month) )
if maxentries is None:
if maxentries is None:
displayed_months = blogmonths
needmore = False
else:
...
...
@@ -193,4 +194,6 @@
def call(self, **kwargs):
"""
display blogs archive
"""
count_blogentry = self.req.execute(
'
Any
B
,
COUNT
(
B
)
GROUPBY
B
,
CD
ORDERBY
CD
DESC
'
'
WHERE
B
is
BlogEntry
,
B
creation_date
CD
HAVING
COUNT
(
B
)
>
0
'
)
_ = self.req._
...
...
@@ -196,7 +199,9 @@
_ = self.req._
box = BoxWidget(_(self.title), id=self.id, islist=False)
box.append(BoxHtml(self.view(
'
blog_archive
'
, None, maxentries=12)))
box.render(self.w)
if count_blogentry:
box = BoxWidget(_(self.title), id=self.id, islist=False)
box.append(BoxHtml(self.view(
'
blog_archive
'
, None, maxentries=12)))
box.render(self.w)
class BlogEntryListBox(BoxTemplate):
...
...
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