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
8d2de3fd5b2c
Commit
8d2de3fd5b2c
authored
14 years ago
by
Sandrine Ribeau
Browse files
Options
Downloads
Patches
Plain Diff
ticket #914505, blogentry title should be the same in primary view and blog view
parent
0ab3a2e44be3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
data/cubes.blog.css
+15
-2
15 additions, 2 deletions
data/cubes.blog.css
views/primary.py
+22
-0
22 additions, 0 deletions
views/primary.py
views/secondary.py
+3
-14
3 additions, 14 deletions
views/secondary.py
with
40 additions
and
16 deletions
data/cubes.blog.css
+
15
−
2
View file @
8d2de3fd
...
...
@@ -3,7 +3,7 @@
margin-bottom
:
2em
;
}
div
.post
h1
{
div
.post
h1
,
div
.blogentry_title
h1
{
font-size
:
1.7em
;
position
:
relative
;
border-bottom
:
none
;
...
...
@@ -56,5 +56,5 @@
float
:
right
;
}
div
.author_date
span
{
div
.author_date
div
{
float
:
right
;
...
...
@@ -60,4 +60,6 @@
float
:
right
;
padding-top
:
3px
;
color
:
#999999
;
}
div
.author_date
{
...
...
@@ -67,3 +69,14 @@
border-top-color
:
#CCC
;
border-top-width
:
thin
;
}
/*div.blogentry_title h1{
font-size: 1.7em;
position: relative;
border-bottom: none;
font-weight: normal;
}*/
div
.blogentry_title
{
padding
:
0px
0px
15px
0px
;
}
This diff is collapsed.
Click to expand it.
views/primary.py
+
22
−
0
View file @
8d2de3fd
...
...
@@ -44,6 +44,8 @@
self
.
w
(
strio
.
getvalue
())
class
SubscribeToBlogComponent
(
component
.
EntityVComponent
):
__regid__
=
'
blogsubscribe
'
__select__
=
component
.
EntityVComponent
.
__select__
&
implements
(
'
Blog
'
)
...
...
@@ -56,6 +58,19 @@
self
.
_cw
.
external_resource
(
'
RSS_LOGO_16
'
),
self
.
_cw
.
_
(
u
'
subscribe to this blog
'
)))
def
render_blogentry_title
(
req
,
w
,
entity
):
w
(
u
'
<h1>%s</h1>
'
%
entity
.
view
(
'
incontext
'
))
w
(
u
'
<div class=
"
author_date
"
><div>%s
'
%
req
.
format_date
(
entity
.
creation_date
))
creator
=
entity
.
creator
if
creator
:
vtitle
=
_
(
'
blog entries created by %s
'
)
%
creator
.
name
()
rql
=
'
Any X ORDERBY D DESC WHERE X is BlogEntry, X created_by Y,
'
\
'
Y eid %s, X creation_date D
'
%
creator
.
eid
url
=
req
.
build_url
(
'
view
'
,
rql
=
rql
,
vtitle
=
vtitle
,
page_size
=
10
)
w
(
u
'
%s <a title=
"
%s
"
href=
"
%s
"
>%s</a>
'
%
(
_
(
'
by
'
),
xml_escape
(
vtitle
),
xml_escape
(
url
),
creator
.
name
()))
w
(
u
'
</div></div>
'
)
class
BlogEntryPrimaryView
(
primary
.
PrimaryView
):
__select__
=
implements
(
'
BlogEntry
'
)
...
...
@@ -67,6 +82,13 @@
self
.
w
(
self
.
_cw
.
_
(
'
blogged in
'
))
self
.
wview
(
'
csv
'
,
rset
,
'
null
'
)
def
render_entity_title
(
self
,
entity
):
self
.
_cw
.
add_css
(
'
cubes.blog.css
'
)
w
=
self
.
w
w
(
u
'
<div class=
"
blogentry_title
"
>
'
)
render_blogentry_title
(
self
.
_cw
,
w
,
entity
)
w
(
u
'
</div>
'
)
w
(
u
'
<br class=
"
clear
"
/>
'
)
# don't show workflow history for blog entry
class
BlogEntryWFHistoryVComponent
(
workflow
.
WFHistoryVComponent
):
...
...
This diff is collapsed.
Click to expand it.
views/secondary.py
+
3
−
14
View file @
8d2de3fd
...
...
@@ -16,6 +16,8 @@
from
cubicweb.selectors
import
paginated_rset
,
sorted_rset
,
implements
from
cubicweb.web.views
import
baseviews
,
calendar
,
navigation
from
cubes.blog.views.primary
import
render_blogentry_title
class
BlogEntryArchiveView
(
StartupView
):
"""
control the view of a blog archive
"""
__regid__
=
'
blog_archive
'
...
...
@@ -122,7 +124,6 @@
month
=
month
,
year
=
year
)
return
u
'
<a href=
"
%s
"
>%s</a>
'
%
(
xml_escape
(
url
),
atitle
)
class
BlogEntryBlogView
(
EntityView
):
__regid__
=
'
blog
'
__select__
=
implements
(
'
BlogEntry
'
)
...
...
@@ -132,18 +133,7 @@
w
=
self
.
w
_
=
self
.
_cw
.
_
w
(
u
'
<div class=
"
post
"
>
'
)
w
(
u
'
<h1>%s</h1>
'
%
entity
.
view
(
'
incontext
'
))
w
(
u
'
<div class=
"
author_date
"
><span>%s
'
%
self
.
_cw
.
format_date
(
entity
.
creation_date
))
creator
=
entity
.
creator
if
creator
:
vtitle
=
_
(
'
blog entries created by %s
'
)
%
creator
.
name
()
rql
=
'
Any X ORDERBY D DESC WHERE X is BlogEntry, X created_by Y,
'
\
'
Y eid %s, X creation_date D
'
%
creator
.
eid
url
=
self
.
_cw
.
build_url
(
'
view
'
,
rql
=
rql
,
vtitle
=
vtitle
,
page_size
=
10
)
w
(
u
'
%s <a title=
"
%s
"
href=
"
%s
"
>%s</a>
'
%
(
_
(
'
by
'
),
xml_escape
(
vtitle
),
xml_escape
(
url
),
creator
.
name
()))
w
(
u
'
</span></div>
'
)
render_blogentry_title
(
self
.
_cw
,
w
,
entity
)
w
(
u
'
<div class=
"
entry
"
>
'
)
body
=
entity
.
printable_value
(
'
content
'
)
w
(
body
)
...
...
@@ -152,7 +142,6 @@
w
(
u
'
<div class=
"
postmetadata
"
>%s</div>
'
%
entity
.
view
(
'
post-reldata
'
))
w
(
u
'
</div>
'
)
class
BlogEntryPostMetaData
(
EntityView
):
__regid__
=
'
post-reldata
'
__select__
=
implements
(
'
BlogEntry
'
)
...
...
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