We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5f5a1079 authored by Sarven Capadisli's avatar Sarven Capadisli

Init UI to show/hide a group of moderation actions.

parent b4ad7d1a
...@@ -304,34 +304,43 @@ class UserProfile extends Widget ...@@ -304,34 +304,43 @@ class UserProfile extends Widget
} }
$this->out->elementEnd('li'); $this->out->elementEnd('li');
if ($cur->hasRight(Right::SANDBOXUSER)) { if ($cur->hasRight(Right::SANDBOXUSER) ||
$this->out->elementStart('li', 'entity_sandbox'); $cur->hasRight(Right::SILENCEUSER) ||
if ($this->user->isSandboxed()) { $cur->hasRight(Right::DELETEUSER)) {
$usf = new UnSandboxForm($this->out, $this->profile, $r2args); $this->out->elementStart('li', 'entity_moderation');
$usf->show(); $this->out->element('p', null, _('Moderate'));
} else { $this->out->elementStart('ul');
$sf = new SandboxForm($this->out, $this->profile, $r2args); if ($cur->hasRight(Right::SANDBOXUSER)) {
$sf->show(); $this->out->elementStart('li', 'entity_sandbox');
if ($this->user->isSandboxed()) {
$usf = new UnSandboxForm($this->out, $this->profile, $r2args);
$usf->show();
} else {
$sf = new SandboxForm($this->out, $this->profile, $r2args);
$sf->show();
}
$this->out->elementEnd('li');
} }
$this->out->elementEnd('li');
}
if ($cur->hasRight(Right::SILENCEUSER)) { if ($cur->hasRight(Right::SILENCEUSER)) {
$this->out->elementStart('li', 'entity_silence'); $this->out->elementStart('li', 'entity_silence');
if ($this->user->isSilenced()) { if ($this->user->isSilenced()) {
$usf = new UnSilenceForm($this->out, $this->profile, $r2args); $usf = new UnSilenceForm($this->out, $this->profile, $r2args);
$usf->show(); $usf->show();
} else { } else {
$sf = new SilenceForm($this->out, $this->profile, $r2args); $sf = new SilenceForm($this->out, $this->profile, $r2args);
$sf->show(); $sf->show();
}
$this->out->elementEnd('li');
} }
$this->out->elementEnd('li');
}
if ($cur->hasRight(Right::DELETEUSER)) { if ($cur->hasRight(Right::DELETEUSER)) {
$this->out->elementStart('li', 'entity_delete'); $this->out->elementStart('li', 'entity_delete');
$df = new DeleteUserForm($this->out, $this->profile, $r2args); $df = new DeleteUserForm($this->out, $this->profile, $r2args);
$df->show(); $df->show();
$this->out->elementEnd('li');
}
$this->out->elementEnd('ul');
$this->out->elementEnd('li'); $this->out->elementEnd('li');
} }
} }
......
...@@ -145,10 +145,15 @@ class FlaggedProfileListItem extends ProfileListItem ...@@ -145,10 +145,15 @@ class FlaggedProfileListItem extends ProfileListItem
$this->startActions(); $this->startActions();
if (Event::handle('StartProfileListItemActionElements', array($this))) { if (Event::handle('StartProfileListItemActionElements', array($this))) {
$this->out->elementStart('li', 'entity_moderation');
$this->out->element('p', null, _('Moderate'));
$this->out->elementStart('ul');
$this->showSandboxButton(); $this->showSandboxButton();
$this->showSilenceButton(); $this->showSilenceButton();
$this->showDeleteButton(); $this->showDeleteButton();
$this->showClearButton(); $this->showClearButton();
$this->out->elementEnd('ul');
$this->out->elementEnd('li');
Event::handle('EndProfileListItemActionElements', array($this)); Event::handle('EndProfileListItemActionElements', array($this));
} }
$this->endActions(); $this->endActions();
......
...@@ -15,3 +15,41 @@ background:url(icon_silence.gif) 5px 5px no-repeat; ...@@ -15,3 +15,41 @@ background:url(icon_silence.gif) 5px 5px no-repeat;
background:url(icon_skull.gif) 5px 5px no-repeat; background:url(icon_skull.gif) 5px 5px no-repeat;
} }
.entity_moderation {
position:relative;
}
.entity_moderation p {
background:transparent url(icon_badge.gif) 5px 5px no-repeat;
box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
-moz-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
-webkit-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.25);
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
font-weight:bold;
padding-bottom:2px;
margin-bottom:7px;
color:#002FA7;
}
.entity_moderation ul {
display:none;
}
.entity_moderation:hover ul {
display:block;
background-color:#FFFFFF;
min-width:21%;
width:100%;
border:1px solid #DDDDDD;
padding:11px;
position:absolute;
top:-1px;
right:-1px;
z-index:1;
box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
-moz-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
-webkit-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.25);
border-radius:7px;
-moz-border-radius:7px;
-webkit-border-radius:7px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment