Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
link
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
link
Commits
b109aca28c9f
Commit
b109aca28c9f
authored
14 years ago
by
Stephanie Marcu
Browse files
Options
Downloads
Patches
Plain Diff
remove cw 3.9 deprecation warnings
parent
a235ae9a5c2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
debian/control
+1
-1
1 addition, 1 deletion
debian/control
entities.py
+8
-8
8 additions, 8 deletions
entities.py
hooks.py
+2
-2
2 additions, 2 deletions
hooks.py
uiprops.py
+1
-1
1 addition, 1 deletion
uiprops.py
views.py
+6
-6
6 additions, 6 deletions
views.py
with
18 additions
and
18 deletions
debian/control
+
1
−
1
View file @
b109aca2
...
...
@@ -11,7 +11,7 @@
Architecture: all
Conflicts: erudi-link, erudi-link-server, erudi-link-client, erudi-link-comp
Replaces: erudi-link, erudi-link-server, erudi-link-client, erudi-link-comp
Depends: cubicweb-common (>= 3.
8
.0)
Depends: cubicweb-common (>= 3.
9
.0)
Description: link component for the CubicWeb framework
This CubicWeb component provides links (a URL with a description).
.
...
...
This diff is collapsed.
Click to expand it.
entities.py
+
8
−
8
View file @
b109aca2
...
...
@@ -7,11 +7,10 @@
__docformat__
=
"
restructuredtext en
"
from
cubicweb.entities
import
AnyEntity
,
fetch_config
from
cubicweb.interfaces
import
IEmbedable
from
cubicweb.web.views.embedding
import
IEmbedableAdapter
from
cubicweb.selectors
import
is_instance
class
Link
(
AnyEntity
):
"""
customized class for Link entities
"""
__regid__
=
'
Link
'
fetch_attrs
,
fetch_order
=
fetch_config
([
'
title
'
,
'
url
'
])
...
...
@@ -13,11 +12,10 @@
class
Link
(
AnyEntity
):
"""
customized class for Link entities
"""
__regid__
=
'
Link
'
fetch_attrs
,
fetch_order
=
fetch_config
([
'
title
'
,
'
url
'
])
__implements__
=
(
IEmbedable
,)
def
dc_title
(
self
):
return
u
'
%s (%s)
'
%
(
self
.
title
,
self
.
url
)
...
...
@@ -19,14 +17,10 @@
def
dc_title
(
self
):
return
u
'
%s (%s)
'
%
(
self
.
title
,
self
.
url
)
def
embeded_url
(
self
):
"""
embed action interface
"""
return
self
.
url
def
actual_url
(
self
):
if
not
self
.
embed
:
return
self
.
url
return
self
.
_cw
.
build_url
(
'
embed
'
,
url
=
self
.
url
,
rql
=
self
.
_cw
.
form
.
get
(
'
rql
'
))
...
...
@@ -28,5 +22,11 @@
def
actual_url
(
self
):
if
not
self
.
embed
:
return
self
.
url
return
self
.
_cw
.
build_url
(
'
embed
'
,
url
=
self
.
url
,
rql
=
self
.
_cw
.
form
.
get
(
'
rql
'
))
class
LinkIEmbedableAdapter
(
IEmbedableAdapter
):
__select__
=
is_instance
(
'
Link
'
)
def
embeded_url
(
self
):
"""
embed action interface
"""
return
self
.
entity
.
url
This diff is collapsed.
Click to expand it.
hooks.py
+
2
−
2
View file @
b109aca2
from
cubicweb.selectors
import
i
mplements
from
cubicweb.selectors
import
i
s_instance
from
cubicweb.sobjects.notification
import
ContentAddedView
class
LinkAddedView
(
ContentAddedView
):
"""
get notified from new links
"""
...
...
@@ -2,6 +2,6 @@
from
cubicweb.sobjects.notification
import
ContentAddedView
class
LinkAddedView
(
ContentAddedView
):
"""
get notified from new links
"""
__select__
=
i
mplements
(
'
Link
'
)
__select__
=
i
s_instance
(
'
Link
'
)
content_attr
=
'
description
'
This diff is collapsed.
Click to expand it.
data/external_resources
→
uiprops.py
+
1
−
1
View file @
b109aca2
LINK_ICON =
DATADIR/
icon_link.gif
LINK_ICON
=
data
(
'
icon_link.gif
'
)
This diff is collapsed.
Click to expand it.
views.py
+
6
−
6
View file @
b109aca2
...
...
@@ -9,7 +9,7 @@
from
logilab.mtconverter
import
html_escape
from
cubicweb.selectors
import
i
mplements
from
cubicweb.selectors
import
i
s_instance
from
cubicweb.view
import
EntityView
from
cubicweb.web
import
uicfg
,
formwidgets
from
cubicweb.web.views
import
primary
,
baseviews
...
...
@@ -23,7 +23,7 @@
class
LinkPrimaryView
(
primary
.
PrimaryView
):
__select__
=
i
mplements
(
'
Link
'
)
__select__
=
i
s_instance
(
'
Link
'
)
show_attr_label
=
False
def
render_entity_title
(
self
,
entity
):
...
...
@@ -37,7 +37,7 @@
class
LinkOneLineView
(
baseviews
.
OneLineView
):
__select__
=
i
mplements
(
'
Link
'
)
__select__
=
i
s_instance
(
'
Link
'
)
def
cell_call
(
self
,
row
,
col
):
entity
=
self
.
cw_rset
.
complete_entity
(
row
,
col
)
...
...
@@ -56,7 +56,7 @@
class
LinkView
(
EntityView
):
__regid__
=
'
link
'
__select__
=
i
mplements
(
'
Link
'
)
__select__
=
i
s_instance
(
'
Link
'
)
title
=
_
(
'
link
'
)
def
cell_call
(
self
,
row
,
col
):
...
...
@@ -69,10 +69,10 @@
%
values
)
class
XbelItemLinkView
(
xbel
.
XbelItemView
):
__select__
=
i
mplements
(
'
Link
'
)
__select__
=
i
s_instance
(
'
Link
'
)
def
url
(
self
,
entity
):
return
entity
.
url
class
LinkFollowAction
(
bookmark
.
FollowAction
):
...
...
@@ -73,7 +73,7 @@
def
url
(
self
,
entity
):
return
entity
.
url
class
LinkFollowAction
(
bookmark
.
FollowAction
):
__select__
=
i
mplements
(
'
Link
'
)
__select__
=
i
s_instance
(
'
Link
'
)
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