Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
74945344
Commit
74945344
authored
Sep 03, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: not display duplicated item and clear code
parent
99c09f64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
57 deletions
+42
-57
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createLinkOverview.py
...ins/erp5_corporate_identity/WebPage_createLinkOverview.py
+42
-57
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createLinkOverview.py
View file @
74945344
...
@@ -79,67 +79,52 @@ for citation in re.findall(r'\[(.*?)\]', document_content or ''):
...
@@ -79,67 +79,52 @@ for citation in re.findall(r'\[(.*?)\]', document_content or ''):
citation_dict
=
{}
citation_dict
=
{}
citation_dict
[
"input"
]
=
citation
citation_dict
[
"input"
]
=
citation
citation_type
=
re
.
findall
(
match_citation_type
,
citation
)[
0
]
citation_type
=
re
.
findall
(
match_citation_type
,
citation
)[
0
]
# Those 3 parts has similar codes, leave as it so that it's easy to customize for each other
if
citation_type
==
"AD"
:
if
citation_type
==
"AD"
:
item_dict
=
{}
if
citation_href
not
in
citation_ad_doubles
:
item_dict
[
"type"
]
=
citation_type
item_dict
[
"title"
]
=
citation_info
[
0
]
item_dict
[
"number"
]
=
citation_info
[
1
]
item_dict
[
"version"
]
=
citation_info
[
2
]
item_dict
[
"href"
]
=
citation_href
if
citation_ad_doubles
.
get
(
citation_href
,
None
)
is
None
:
citation_ad_doubles
[
citation_href
]
=
citation_ad_count
citation_ad_doubles
[
citation_href
]
=
citation_ad_count
citation_relevant_count
=
citation_ad_count
citation_id
=
''
.
join
([
citation_type
,
"-"
,
str
(
citation_ad_count
)])
else
:
citation_dict
[
"item"
]
=
{
citation_relevant_count
=
citation_ad_doubles
[
citation_href
]
"type"
:
citation_type
,
citation_id
=
''
.
join
([
citation_type
,
"-"
,
str
(
citation_relevant_count
)])
"title"
:
citation_info
[
0
],
item_dict
[
"id"
]
=
citation_id
"number"
:
citation_info
[
1
],
citation_dict
[
"item"
]
=
item_dict
"version"
:
citation_info
[
2
],
"href"
:
citation_href
,
"id"
:
citation_id
}
citation_dict
[
"output"
]
=
setCitation
(
citation_id
,
citation_info
[
0
])
citation_dict
[
"output"
]
=
setCitation
(
citation_id
,
citation_info
[
0
])
citation_ad_list
.
append
(
citation_dict
)
citation_ad_list
.
append
(
citation_dict
)
citation_ad_count
=
citation_ad_count
+
1
citation_ad_count
=
citation_ad_count
+
1
elif
citation_type
==
"RD"
:
elif
citation_type
==
"RD"
:
item_dict
=
{}
if
citation_href
not
in
citation_rd_doubles
:
item_dict
[
"type"
]
=
citation_type
item_dict
[
"title"
]
=
citation_info
[
0
]
item_dict
[
"number"
]
=
citation_info
[
1
]
item_dict
[
"version"
]
=
citation_info
[
2
]
item_dict
[
"href"
]
=
citation_href
if
citation_rd_doubles
.
get
(
citation_href
,
None
)
is
None
:
citation_rd_doubles
[
citation_href
]
=
citation_rd_count
citation_rd_doubles
[
citation_href
]
=
citation_rd_count
citation_
relevant_count
=
citation_rd_count
citation_
id
=
''
.
join
([
citation_type
,
"-"
,
str
(
citation_rd_count
)])
else
:
citation_dict
[
"item"
]
=
{
citation_relevant_count
=
citation_rd_doubles
[
citation_href
]
"type"
:
citation_type
,
citation_id
=
''
.
join
([
citation_type
,
"-"
,
str
(
citation_relevant_count
)])
"title"
:
citation_info
[
0
],
item_dict
[
"id"
]
=
citation_id
"number"
:
citation_info
[
1
],
citation_dict
[
"item"
]
=
item_dict
"version"
:
citation_info
[
2
],
citation_dict
[
"output"
]
=
setCitation
(
"href"
:
citation_href
,
citation_id
,
"id"
:
citation_id
item_dict
.
get
(
"title"
)
}
)
citation_dict
[
"output"
]
=
setCitation
(
citation_id
,
citation_info
[
0
]
)
citation_rd_list
.
append
(
citation_dict
)
citation_rd_list
.
append
(
citation_dict
)
citation_rd_count
=
citation_rd_count
+
1
citation_rd_count
=
citation_rd_count
+
1
else
:
else
:
if
citation_href
not
in
citation_ab_doubles
:
citation_ab_doubles
[
citation_href
]
=
citation_ab_count
citation_abbreviation
=
citation_type
citation_abbreviation
=
citation_type
citation_type
=
"AB"
citation_type
=
"AB"
item_dict
=
{}
citation_id
=
''
.
join
([
citation_type
,
"-"
,
str
(
citation_ab_count
)])
item_dict
[
"type"
]
=
citation_type
citation_dict
[
"item"
]
=
{
item_dict
[
"abbreviation"
]
=
citation_abbreviation
"type"
:
citation_type
,
item_dict
[
"title"
]
=
citation_info
[
0
]
"abbreviation"
:
citation_abbreviation
,
item_dict
[
"description"
]
=
citation_info
[
1
]
"title"
:
citation_info
[
0
],
item_dict
[
"href"
]
=
citation_href
"description"
:
citation_info
[
1
],
if
citation_ab_doubles
.
get
(
citation_href
,
None
)
is
None
:
"href"
:
citation_href
,
citation_ab_doubles
[
citation_href
]
=
citation_ab_count
"id"
:
citation_id
citation_relevant_count
=
citation_ab_count
}
else
:
citation_dict
[
"output"
]
=
setCitation
(
citation_id
,
citation_info
[
0
])
citation_relevant_count
=
citation_ab_doubles
[
citation_href
]
citation_id
=
''
.
join
([
citation_type
,
"-"
,
str
(
citation_relevant_count
)])
item_dict
[
"id"
]
=
citation_id
citation_dict
[
"item"
]
=
item_dict
citation_dict
[
"output"
]
=
setCitation
(
citation_id
,
item_dict
.
get
(
"title"
)
)
citation_ab_list
.
append
(
citation_dict
)
citation_ab_list
.
append
(
citation_dict
)
citation_ab_count
=
citation_ab_count
+
1
citation_ab_count
=
citation_ab_count
+
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment