...
  View open merge request
Commits (9)
......@@ -38,6 +38,11 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
*/
protected $hashCryptSha512 = '';
/**
* @var string
*/
public $aboutMe = '';
/**
* @return string
*/
......@@ -102,6 +107,11 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this->termsVersion = $termsVersion;
}
/**
* @var string
*/
public $aboutMe = '';
public function getHashSha1(): string
{
return $this->hashSha1;
......@@ -121,4 +131,14 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
{
$this->hashCryptSha512 = $hashCryptSha512;
}
public function getAboutMe(): string
{
return $this->aboutMe;
}
public function setAboutme(string $aboutMe)
{
$this->aboutMe = $aboutMe;
}
}
......@@ -58,3 +58,5 @@ page {
)
}
}
page.includeJSFooter.privacySettingsHelper = EXT:t3omy/Resources/Public/JS/checkPrivacySettings.js
\ No newline at end of file
......@@ -31,5 +31,6 @@ plugin.tx_userprofile {
twitter = 1
facebook = 1
}
editProfilePID = 406
}
}
<hr/>
<f:link.action action="edit" arguments="{user:user}" class="btn btn-primary" >Edit your profile</f:link.action>
<f:link.action pageUid="{settings.editProfilePID}" controller="MyProfile" extensionName="t3omy" action="edit" arguments="{user:user}" class="btn btn-primary" >Edit your profile</f:link.action>
<f:if condition="{settings.features.enablePublicProfile}">
<f:if condition="{user.publicProfile}">
<f:then>
......
......@@ -2,15 +2,22 @@
<h1>Edit {user.name}</h1>
<f:flashMessages/>
<f:form action="update" objectName="user" object="{user}">
<label for="aboutMe">About me</label>
<div class="input">
<f:form.textarea cols="115" rows="4 " value="{user.aboutMe}" id="aboutMe" property="aboutMe"></f:form.textarea>
</div>
<label for="user.github">Github:</label><br />
<f:form.textfield id="user.github" property="github" value="{user.github}" class="xxlarge form-control"/>
<label for="user.twitter">Github:</label><br />
<label for="user.twitter">Twitter:</label><br />
<f:form.textfield id="user.twitter" property="twitter" value="{user.twitter}" class="xxlarge form-control"/>
<label for="user.facebook">facebook:</label><br />
<f:form.textfield id="user.facebook" property="facebook" value="{user.facebook}" class="xxlarge form-control"/>
<f:link.action action="show" arguments="{user:user}" class="btn btn-secondary">back</f:link.action> <input type="submit" value="update" class="btn btn-success"/>
<f:link.action action="show" arguments="{user:user}" class="btn btn-secondary">back</f:link.action>
<input type="submit" value="update" class="btn btn-success"/>
</f:form>
</section>
<section class="container">
<f:flashMessages/>
<f:if condition="{user}">
<h1>Show {user.name}</h1>
<h1>Profile of {f:if(condition: user.name, then: user.name, else: user.username)}</h1>
<f:if condition="{user.aboutMe}">
<p>{user.aboutMe}</p>
</f:if>
<h1>Profile of {f:if(condition: user.name, then: user.name, else: user.username)}</h1>
<f:if condition="{user.aboutMe}">
<p>
<f:format.nl2br>{user.aboutMe}</f:format.nl2br>
</p>
</f:if>
<ul>
<li>Github User: {user.github}</li>
<li>Facebook: {user.facebook}</li>
<f:if condition="{user.facebook}">
<li>Facebook: {user.facebook}</li>
</f:if>
<li>twitter: {user.twitter}</li>
</ul>
<f:link.action action="edit" arguments="{user:user}" class="btn btn-primary" >Edit your profile</f:link.action>
<f:link.action action="edit" arguments="{user:user}" class="btn btn-primary">Edit your profile</f:link.action>
</f:if>
</section>
......@@ -10,9 +10,21 @@
<table class="table table-striped">
<thead>
<td>show your data to</td>
<td>everyone</td>
<td>community</td>
<td>teams</td>
<td>
<label for="check--public" class="label--hide">Check everything at the everyone list</label>
<input id="check--public" type="checkbox" checked="unchecked" data-checkbox="public">
everyone
</td>
<td>
<label for="check--authenticated" class="label--hide">Check everything at the community list</label>
<input id="check--authenticated" type="checkbox" checked="unchecked" data-checkbox="authenticated">
community
</td>
<td>
<label for="check--groups" class="label--hide">Check everything at the team</label>
<input id="check--groups" type="checkbox" checked="unchecked" data-checkbox="groups">
teams
</td>
</thead>
<f:for each="{privacySettings}" as="privacySetting" key="privacySettingValue">
<tr>
......
const checkForCheckboxes = (elements) => {
let counter = 0;
for(let i = 0; i < elements.length; i++) {
if(elements[i].checked === true) {
counter += 1;
}
}
if(counter === elements.length) {
return true;
}
};
const triggerCheckbox = (triggerSelector, trigger) => {
const triggerElements = document.querySelectorAll("input[name*='" + triggerSelector + "'][type='checkbox']");
const triggerElement = document.querySelector("[data-checkbox='" + trigger + "'][type='checkbox']");
// console.log(triggerElements);
// console.log(triggerElement);
for(let i = 0; i < triggerElements.length; i++) {
triggerElements[i].addEventListener('click', (e) => {
if (checkForCheckboxes(triggerElements)) {
triggerElement.checked = true;
} else {
triggerElement.checked = false;
}
});
}
triggerElement.addEventListener('click', (e) => {
if(triggerElement.checked === true) {
for(let i = 0; i < triggerElements.length; i++) {
triggerElements[i].checked = true;
}
} else if (triggerElement.checked === false) {
for(let i = 0; i < triggerElements.length; i++) {
triggerElements[i].checked = false;
}
}
});
};
triggerCheckbox("public", "public");
triggerCheckbox("groups", "groups");
triggerCheckbox("authenticated", "authenticated");