- Included the edit link into the foundry-base theme

- Added documentation to the tag in Foundry


git-svn-id: https://svn.libreccm.org/ccm/trunk@3105 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2015-01-27 09:10:04 +00:00
parent 2985663511
commit f3e88be801
16 changed files with 141 additions and 17 deletions

View File

@ -290,6 +290,35 @@ main nav ul li.active:after {
border-color:transparent #ff9840;
}
main {
position: relative;
}
main .edit-link {
display: none;
}
main:hover .edit-link {
display: block;
position: absolute;
right: 0;
top: 0;
font-size: 30px;
color: #0776a0;
border: 1px solid #0776a0;
width: 32px;
height: 32px;
text-align: center;
}
main:hover .edit-link a:link,
main:hover .edit-link a:hover,
main:hover .edit-link a:active,
main:hover .edit-link a:visited {
color: #0776a0;
text-decoration: none;
}
footer {
margin: 0;
padding-bottom: 0;

View File

@ -5,6 +5,8 @@
<content-item-title/>
</h2>-->
<include file="fragments/edit-link.xml"/>
<div class="lead">
<lead-text/>
</div>

View File

@ -5,13 +5,7 @@
<content-item-title/>
</h2>-->
<edit-link>
<div class="edit-link">
<a>
Edit
</a>
</div>
</edit-link>
<include file="fragments/edit-link.xml"/>
<div class="lead">
<lead-text/>

View File

@ -7,6 +7,9 @@
</a>
</bookmark-link>
</h2>
<include file="fragments/edit-link.xml"/>
<div>
<bookmark-description/>
</div>

View File

@ -5,6 +5,8 @@
<content-item-title/>
</h2>-->
<include file="fragments/edit-link.xml"/>
<div class="lead">
<show-property name="pageDescription"/>
</div>

View File

@ -3,6 +3,9 @@
<!--<h2>
<content-item-title/>
</h2>-->
<include file="fragments/edit-link.xml"/>
<div>
<show-property name="pageDescription"/>
</div>

View File

@ -5,6 +5,8 @@
<content-item-title/>
</h2>
<include file="fragments/edit-link.xml"/>
<div class="lead">
<lead-text/>
</div>

View File

@ -5,6 +5,8 @@
<fsi-description/>
</div>
<include file="fragments/edit-link.xml"/>
<fsi-link use-filename="yes" mode="stream">
<a>
<show-text module="fsi">links/view</show-text>

View File

@ -5,6 +5,8 @@
<content-item-title/>
</h2>
<include file="fragments/edit-link.xml"/>
<div class="lead">
<mpa-summary/>
</div>

View File

@ -5,6 +5,8 @@
<content-item-title/>
</h2>
<include file="fragments/edit-link.xml"/>
<div class="lead">
<lead-text/>
</div>

View File

@ -5,6 +5,8 @@
<show-property name="summary"/>
</div>
<include file="fragments/edit-link.xml"/>
<div class="main">
<main-text/>
</div>

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<content-item-layout>
<include file="fragments/edit-link.xml"/>
<div>
<siteproxy-content/>
</div>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<fragment-layout>
<edit-link>
<div class="edit-link">
<a>&#x270e;</a>
</div>
</edit-link>
</fragment-layout>

View File

@ -12,8 +12,8 @@
</text>
<text id="layout/page/head/title">
<translation lang="de">Foundry</translation>
<translation lang="en">Foundry</translation>
<translation lang="de">LibreCMS</translation>
<translation lang="en">LibreCMS</translation>
</text>
<text id="layout/page/footer/breadcrumbs">

View File

@ -623,12 +623,80 @@
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Renders an link to edit an item in the content centre if the current user is
logged in and has the permission to edit the item.
Provides the <code>href</code> for creating a link to edit the current item in the
content centre if the current user is logged in and has the permission to edit the
item.
</p>
<p>
To use this feature put the following snippet like the following into the
templates for the content items in your theme:
</p>
<pre>
&#x3c;edit-link&#x3e;
&#x3c;div class="edit-link"&#x3e;
&#x3c;a&#x3e;
&#x3c;a&#x3e;
&#x26;#x270e;
&#x3c;/a&#x3e;
&#x3c;/a&#x3e;
&#x3c;/div&#x3e;
&#x3c;/edit-link&#x3e;
</pre>
<p>
The example uses an UTF-8 character from the <em>Dingbats</em> block (a pencil).
You can of course use another character, text or an image. To
reduce the amount of code needed you may add a fragment template and include this
template using the <code>include</code> tag.
</p>
<p>
You also have to include styles for the edit link into your theme.
The <em>foundry-base</em> theme, for example, puts the edit link the top right
corner of the area which shows the content item. This is done by the following
styles:
</p>
<pre>
/* Sets the reference point for position: absolute
to the main element block */
main {
position: relative;
}
/* Don't show the edit link on a first glance */
main .edit-link {
display: none;
}
/* Display the edit link in the top right corner
of the content item area if the cursor is in
the content item area */
main:hover .edit-link {
display: block;
position: absolute;
right: 0;
top: 0;
font-size: 30px;
color: #0776a0;
/* Blue border around the link */
border: 1px solid #0776a0;
/* Make the link 32px in width and height */
width: 32px;
height: 32px;
text-align: center;
}
/* Remove default decoration for links */
main:hover .edit-link a:link,
main:hover .edit-link a:hover,
main:hover .edit-link a:active,
main:hover .edit-link a:visited {
color: #0776a0;
text-decoration: none;
}
</pre>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="content-item-layout//edit-link">
<xsl:template match="content-item-layout//edit-link | fragment-layout//edit-link">
<xsl:param name="contentitem-tree" tunnel="yes"/>
@ -636,7 +704,8 @@
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
select="concat($context-prefix, '/ccm/', $contentitem-tree/editLink)"/>
select="concat($context-prefix, '/ccm',
$contentitem-tree/editLink)"/>
</xsl:apply-templates>
</xsl:if>

View File

@ -243,9 +243,7 @@ public class DataCollectionRenderer extends LockableImpl {
}
final Element item = Navigation.newElement(content, "item");
// Create a canEdit link if the current user is permitted to edit the item.
// Note: Works only when list specializes the object because an ACSObject instance is needed for creating
// the PermissionDescriptor.
// Create a canEdit attribute if the current user is permitted to edit the item.
Party currentParty = Kernel.getContext().getParty();
if (currentParty == null) {
currentParty = Kernel.getPublicUser();
@ -255,6 +253,9 @@ public class DataCollectionRenderer extends LockableImpl {
edit = new PermissionDescriptor(PrivilegeDescriptor.get(
com.arsdigita.cms.SecurityManager.CMS_EDIT_ITEM), dobj.getOID(), currentParty.getOID());
} else {
//Create a link for editing the item. Works only if the item is specalised because
//the ItemResolver provided by the ContentSection of the item is needed for creating
//the link.
edit = new PermissionDescriptor(PrivilegeDescriptor.get(
com.arsdigita.cms.SecurityManager.CMS_EDIT_ITEM), object, currentParty);
if (PermissionService.checkPermission(edit) && (object instanceof ContentItem)) {