Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
squareui
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
squareui
Commits
b3f11a9075c6
Commit
b3f11a9075c6
authored
11 years ago
by
Katia Saurfelt
Browse files
Options
Downloads
Patches
Plain Diff
[main template] clean the TheMainTemplate structure
parent
bc487b9ade28
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/basetemplates.py
+10
-15
10 additions, 15 deletions
views/basetemplates.py
with
10 additions
and
15 deletions
views/basetemplates.py
+
10
−
15
View file @
b3f11a90
...
@@ -32,6 +32,12 @@
...
@@ -32,6 +32,12 @@
self
.
template_footer
(
view
)
self
.
template_footer
(
view
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
template_header
(
self
,
content_type
,
view
=
None
,
page_title
=
''
,
additional_headers
=
()):
page_title
=
page_title
or
view
.
page_title
()
additional_headers
=
additional_headers
or
view
.
html_headers
()
self
.
template_html_header
(
content_type
,
page_title
,
additional_headers
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
template_html_header
(
self
,
content_type
,
page_title
,
def
template_html_header
(
self
,
content_type
,
page_title
,
additional_headers
=
()):
additional_headers
=
()):
w
=
self
.
whead
w
=
self
.
whead
...
@@ -56,12 +62,6 @@
...
@@ -56,12 +62,6 @@
if
page_title
:
if
page_title
:
w
(
u
'
<title>%s</title>
\n
'
%
xml_escape
(
page_title
))
w
(
u
'
<title>%s</title>
\n
'
%
xml_escape
(
page_title
))
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
template_body_header
(
self
,
view
):
self
.
w
(
u
'
<body>
\n
'
)
self
.
wview
(
'
header
'
,
rset
=
self
.
cw_rset
,
view
=
view
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
template_page_content
(
self
,
view
):
def
template_page_content
(
self
,
view
):
w
=
self
.
w
w
=
self
.
w
...
@@ -65,6 +65,8 @@
...
@@ -65,6 +65,8 @@
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
template_page_content
(
self
,
view
):
def
template_page_content
(
self
,
view
):
w
=
self
.
w
w
=
self
.
w
self
.
w
(
u
'
<body>
\n
'
)
self
.
wview
(
'
header
'
,
rset
=
self
.
cw_rset
,
view
=
view
)
w
(
u
'
<div id=
"
page
"
class=
"
container
"
>
\n
'
)
w
(
u
'
<div id=
"
page
"
class=
"
container
"
>
\n
'
)
w
(
u
'
<div class=
"
row
"
>
\n
'
)
w
(
u
'
<div class=
"
row
"
>
\n
'
)
left_boxes
=
list
(
self
.
_cw
.
vreg
[
'
ctxcomponents
'
].
poss_visible_objects
(
left_boxes
=
list
(
self
.
_cw
.
vreg
[
'
ctxcomponents
'
].
poss_visible_objects
(
...
@@ -79,6 +81,8 @@
...
@@ -79,6 +81,8 @@
self
.
content_column
(
view
,
content_cols
)
self
.
content_column
(
view
,
content_cols
)
self
.
nav_column
(
view
,
right_boxes
,
'
right
'
)
self
.
nav_column
(
view
,
right_boxes
,
'
right
'
)
self
.
w
(
u
'
</div>
\n
'
)
# closes class=row
self
.
w
(
u
'
</div>
\n
'
)
# closes class=row
self
.
w
(
u
'
</div>
\n
'
)
# closes id="page" from template_page_content
self
.
w
(
u
'
</body>
\n
'
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
get_components
(
self
,
view
,
context
):
def
get_components
(
self
,
view
,
context
):
...
@@ -87,7 +91,6 @@
...
@@ -87,7 +91,6 @@
rset
=
self
.
cw_rset
,
rset
=
self
.
cw_rset
,
view
=
view
,
view
=
view
,
context
=
context
)
context
=
context
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
state_header
(
self
):
def
state_header
(
self
):
state
=
self
.
_cw
.
search_state
state
=
self
.
_cw
.
search_state
...
@@ -149,11 +152,6 @@
...
@@ -149,11 +152,6 @@
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
content_footer
(
self
,
view
=
None
):
self
.
wview
(
'
contentfooter
'
,
rset
=
self
.
cw_rset
,
view
=
view
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
content_components
(
self
,
view
,
components
):
def
content_components
(
self
,
view
,
components
):
"""
TODO : should use context
"""
"""
TODO : should use context
"""
rqlcomp
=
components
.
select_or_none
(
'
rqlinput
'
,
self
.
_cw
,
rset
=
self
.
cw_rset
)
rqlcomp
=
components
.
select_or_none
(
'
rqlinput
'
,
self
.
_cw
,
rset
=
self
.
cw_rset
)
...
@@ -174,9 +172,6 @@
...
@@ -174,9 +172,6 @@
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
@monkeypatch
(
basetemplates
.
TheMainTemplate
)
def
template_footer
(
self
,
view
=
None
):
def
template_footer
(
self
,
view
=
None
):
self
.
wview
(
'
footer
'
,
rset
=
self
.
cw_rset
)
self
.
wview
(
'
footer
'
,
rset
=
self
.
cw_rset
)
self
.
w
(
u
'
</div>
\n
'
)
# closes id="page"
self
.
w
(
u
'
</body>
\n
'
)
# main header
# main header
...
...
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