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
4a0c6101be41
Commit
4a0c6101be41
authored
11 years ago
by
Aurelien Campeas
Browse files
Options
Downloads
Patches
Plain Diff
drop embed support (closes #2894686)
parent
306f23768f4a
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
entities.py
+1
-3
1 addition, 3 deletions
entities.py
migration/1.7.0_Any.py
+1
-0
1 addition, 0 deletions
migration/1.7.0_Any.py
schema.py
+0
-6
0 additions, 6 deletions
schema.py
test/unittest_link.py
+2
-4
2 additions, 4 deletions
test/unittest_link.py
views.py
+2
-8
2 additions, 8 deletions
views.py
with
6 additions
and
21 deletions
entities.py
+
1
−
3
View file @
4a0c6101
...
...
@@ -17,6 +17,4 @@
return
u
'
%s (%s)
'
%
(
self
.
title
,
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
'
)
or
u
''
)
return
self
.
url
This diff is collapsed.
Click to expand it.
migration/1.7.0_Any.py
0 → 100644
+
1
−
0
View file @
4a0c6101
drop_attribute
(
'
Link
'
,
'
embed
'
)
This diff is collapsed.
Click to expand it.
schema.py
+
0
−
6
View file @
4a0c6101
...
...
@@ -6,8 +6,6 @@
title
=
String
(
required
=
True
,
fulltextindexed
=
True
,
maxsize
=
256
)
url
=
String
(
required
=
True
,
fulltextindexed
=
True
,
maxsize
=
512
,
description
=
_
(
"
link
'
s url
"
))
embed
=
Boolean
(
default
=
False
,
description
=
_
(
"
generate links to embed the page by default?
"
))
description
=
RichString
(
fulltextindexed
=
True
,
description
=
_
(
"
description of the linked page
'
s content
"
))
...
...
@@ -11,7 +9,3 @@
description
=
RichString
(
fulltextindexed
=
True
,
description
=
_
(
"
description of the linked page
'
s content
"
))
class
embed
(
RelationType
):
__permissions__
=
{
'
read
'
:
(
'
managers
'
,
'
users
'
,
'
guests
'
),
'
update
'
:
(
'
managers
'
,),
}
This diff is collapsed.
Click to expand it.
test/unittest_link.py
+
2
−
4
View file @
4a0c6101
# -*- coding: utf-8 -*-
from
cubicweb.devtools.testlib
import
CubicWebTC
from
cubicweb.web.views
import
uicfg
,
actions
,
embedding
from
cubicweb.web.views
import
uicfg
,
actions
from
cubes.link
import
views
...
...
@@ -23,9 +23,9 @@
actions
.
AddRelatedActions
,
actions
.
DeleteAction
,
actions
.
CopyAction
,
embedding
.
EmbedAction
])
])
def
test_relations_by_category
(
self
):
def
rbc
(
iterable
):
return
[(
rschema
.
type
,
x
)
for
rschema
,
tschemas
,
x
in
iterable
]
e
=
self
.
vreg
[
"
etypes
"
].
etype_class
(
'
Link
'
)(
self
.
request
())
...
...
@@ -27,8 +27,7 @@
def
test_relations_by_category
(
self
):
def
rbc
(
iterable
):
return
[(
rschema
.
type
,
x
)
for
rschema
,
tschemas
,
x
in
iterable
]
e
=
self
.
vreg
[
"
etypes
"
].
etype_class
(
'
Link
'
)(
self
.
request
())
# we should only see embed when we are in the managers group
self
.
assertEqual
(
rbc
(
afs
.
relations_by_section
(
e
,
'
main
'
,
'
attributes
'
,
'
update
'
)),
[(
'
title
'
,
'
subject
'
),
(
'
url
'
,
'
subject
'
),
...
...
@@ -33,6 +32,5 @@
self
.
assertEqual
(
rbc
(
afs
.
relations_by_section
(
e
,
'
main
'
,
'
attributes
'
,
'
update
'
)),
[(
'
title
'
,
'
subject
'
),
(
'
url
'
,
'
subject
'
),
(
'
embed
'
,
'
subject
'
),
(
'
description
'
,
'
subject
'
)])
self
.
create_user
(
self
.
session
,
'
toto
'
)
self
.
login
(
'
toto
'
)
...
...
This diff is collapsed.
Click to expand it.
views.py
+
2
−
8
View file @
4a0c6101
...
...
@@ -12,8 +12,5 @@
from
cubicweb.predicates
import
is_instance
from
cubicweb.view
import
EntityView
from
cubicweb.web
import
formwidgets
from
cubicweb.web.views
import
uicfg
,
primary
,
baseviews
,
xbel
,
bookmark
,
embedding
class
LinkIEmbedableAdapter
(
embedding
.
IEmbedableAdapter
):
__select__
=
is_instance
(
'
Link
'
)
from
cubicweb.web.views
import
primary
,
baseviews
,
xbel
,
bookmark
...
...
@@ -19,5 +16,2 @@
def
embeded_url
(
self
):
"""
embed action interface
"""
return
self
.
entity
.
url
...
...
@@ -23,5 +17,5 @@
for
attr
in
(
'
title
'
,
'
url
'
,
'
embed
'
):
for
attr
in
(
'
title
'
,
'
url
'
):
uicfg
.
primaryview_section
.
tag_attribute
((
'
Link
'
,
attr
),
'
hidden
'
)
uicfg
.
autoform_field_kwargs
.
tag_attribute
((
'
Link
'
,
'
url
'
),
...
...
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