Modifiche per il documento homeopathsSheet

Ultima modifica di Jip-jan Alunkel il marzo 26, 17:31

Dalla versione 1.5
modificato da Jip-jan Alunkel
il marzo 06, 19:02
Cambia il commento: Nessun commento per questa versione
Alla versione 1.11
modificato da Jip-jan Alunkel
il marzo 07, 17:48
Cambia il commento: Nessun commento per questa versione

Summary

Details

Page properties
Content
... ... @@ -9,18 +9,15 @@
9 9  #set($isInline = $xcontext.action == 'edit' && $request.get('editor') == 'inline')
10 10  ## Create object (important for sheet binding, do not remove)
11 11  #set($theDocObj = $doc.getObject("homeopaths.Code.homeopathsClass", true))
12 -#set($hasRight = $theDocObj.getProperty('user').value)
12 +#set($hasRight = !$isGuest && ($theDocObj.getProperty('user').value == $context.getUser() || $hasAdmin))
13 13  $theDoc.getContent()
14 -
15 -$hasRight
16 -
17 17  {{html wiki="true" clean="false"}}
18 - #if(!$isGuest)
15 +#if(!$isGuest)
19 19  <script>
20 20   var pagemakerOffspring = "disable";
21 21  </script>
22 - #end
23 - #if(!$isGuest)
19 +#end
20 +#if($hasRight)
24 24   <p class="buttons text-align-right">
25 25   <a class="btn btn-primary" title="Edit" href="$doc.getURL("edit")?editor=wysiwyg" role="button" rel="nofollow">
26 26   <span class="fa fa-pencil"></span>
... ... @@ -27,7 +27,7 @@
27 27   <span class="btn-label">Edit contents</span>
28 28   </a>
29 29   </p>
30 - #end
27 +#end
31 31  #set($spaceReference = $services.model.resolveDocument('', 'default', $doc.documentReference.lastSpaceReference).parent)
32 32  #set($spaceTitle = $spaceReference.getName())
33 33  <div class="clearfix"></div>
... ... @@ -34,7 +34,22 @@
34 34  #if($xcontext.action == "view")
35 35  <div id="${spaceTitle}" class="box sheet_properties">
36 36   <h2>Details</h2>
37 - <div id="non_free_occupation">
34 +#set($classProperties = ['pmCountry','pmState','pmCounty','pmPostcode','pmCity','pmStreet','pmHousenumber'])
35 +#*
36 +{
37 + 'pmCountry': '$services.localization.render("homeopaths.pmCountry")',
38 + 'pmState': '$services.localization.render("homeopaths.classproperty.pmState")',
39 + 'pmCounty': '$services.localization.render("homeopaths.classproperty.pmCounty")',
40 + 'pmPostcode': '$services.localization.render("homeopaths.classproperty.pmPostcode")',
41 + 'pmCity': '$services.localization.render("homeopaths.classproperty.pmCity")',
42 + 'pmStreet': '$services.localization.render("homeopaths.classproperty.pmStreet")',
43 + 'pmHousenumber': '$services.localization.render("homeopaths.classproperty.pmHousenumber")'
44 +})
45 +*#
46 +#foreach($property in $classProperties)
47 + $services.localization.render("homeopaths.classproperty.${property}")
48 +#end
49 +## <div id="non_free_occupation">
38 38   <p class="property">
39 39   <span class="property-name">Medical degree mandatory</span> <span class="property-value">$doc.display('non_free_occupation')</span>
40 40   </p>
... ... @@ -41,8 +41,9 @@
41 41   <p class="help-block">
42 42   Countries over the world have different rules regarding the neccessity of a medical degree to practice homeopathy.
43 43   </p>
44 - </div>
45 - #if(!$isGuest)
56 +## </div>
57 +
58 + #if($hasRight)
46 46   <p class="buttons text-align-right">
47 47   <a class="btn btn-secondary" title="Edit" data-toggle="modal" data-target="#detailsModal" role="button" rel="nofollow">
48 48   <span class="btn-label">Edit details</span>
... ... @@ -50,7 +50,7 @@
50 50   </p>
51 51   #end
52 52  </div>
53 - #if(!$isGuest) ## Ook de rechts situatie uitlezen en meenemen.
66 + #if($hasRight) ## Ook de rechts situatie uitlezen en meenemen.
54 54   #set($form_start = {
55 55   "id": "homeopaths_form",
56 56   "product": "homeopath details",
... ... @@ -65,8 +65,8 @@
65 65   "label" : "City",
66 66   "data-create-xobj" : "true",
67 67   "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
68 - "data-xobj-fieldname" : "city",
69 - "value": "$theDocObj.getProperty('city').value"
81 + "data-xobj-fieldname" : "pmCity",
82 + "value": "$theDocObj.getProperty('pmCity').value"
70 70   })
71 71   #set($submit = {
72 72   "id" : "edit_details",
... ... @@ -99,6 +99,8 @@
99 99   </div>
100 100  </div>
101 101   #end
115 +#else
116 + This page can not be viewed in inline mode.
102 102  #end
103 103  {{/html}}
104 104  {{/velocity}}