Skip to content
Snippets Groups Projects
Commit 4a0c6101be41 authored by Aurelien Campeas's avatar Aurelien Campeas
Browse files

drop embed support (closes #2894686)

parent 306f23768f4a
No related branches found
No related tags found
No related merge requests found
......@@ -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
drop_attribute('Link', 'embed')
......@@ -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',),
}
# -*- 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')
......
......@@ -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'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment