diff --git a/app/classes/Framadate/Message.php b/app/classes/Framadate/Message.php index c7d7edeac3dddd199df4bcd3e1957d9d90014d7f..68b344c910d0db23902a9b8519919d46862729d3 100644 --- a/app/classes/Framadate/Message.php +++ b/app/classes/Framadate/Message.php @@ -23,11 +23,15 @@ class Message { var $type; var $message; var $link; + var $linkTitle; + var $linkIcon; - function __construct($type, $message, $link=null) { + function __construct($type, $message, $link=null, $linkTitle=null, $linkIcon=null) { $this->type = $type; $this->message = $message; $this->link = $link; + $this->linkTitle = $linkTitle; + $this->linkIcon = $linkIcon; } } diff --git a/studs.php b/studs.php index 6070557dafebe5f67ecc648aade6b68cb81a360c..16c76b315c0a5157177c34af6d25c43fd30f9b1a 100644 --- a/studs.php +++ b/studs.php @@ -141,7 +141,12 @@ if ($accessGranted) { $editedVoteUniqueId = filter_input(INPUT_POST, 'edited_vote', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]); $sessionService->set(USER_REMEMBER_VOTES_KEY, $poll_id, $editedVoteUniqueId); $urlEditVote = Utils::getUrlSondage($poll_id, false, $editedVoteUniqueId); - $message = new Message('success', __('studs', 'Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:'), $urlEditVote); + $message = new Message( + 'success', + __('studs', 'Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:'), + $urlEditVote, + __('Poll results', 'Edit the line:').' '.$name, + 'glyphicon-pencil'); } else { $message = new Message('success', __('studs', 'Update vote succeeded')); } diff --git a/tpl/studs.tpl b/tpl/studs.tpl index 7e873ab50639fdb7a2b8f9562d73a91f7e87eb8f..ce45625083867a6595cc3e29ba55a9421f9690da 100644 --- a/tpl/studs.tpl +++ b/tpl/studs.tpl @@ -15,7 +15,20 @@ {* Messages *} <div id="message-container"> {if !empty($message)} - <div class="alert alert-dismissible alert-{$message->type|html} hidden-print" role="alert">{$message->message|html}{if $message->link != null}<br/><a href="{$message->link}">{$message->link}</a>{/if}<button type="button" class="close" data-dismiss="alert" aria-label="{__('Generic', 'CLose')}"><span aria-hidden="true">×</span></button></div> + <div class="alert alert-dismissible alert-{$message->type|html} hidden-print" role="alert"> + {$message->message|html} + {if $message->link != null} + <div class="input-group input-group-sm"> + <span class="input-group-btn"> + <a {if $message->linkTitle != null} title="{$message->linkTitle|escape}" {/if} class="btn btn-default btn-sm" href="{$message->link}"> + {if $message->linkIcon != null}<i class="glyphicon glyphicon-pencil"></i>{if $message->linkTitle != null}<span class="sr-only">{$message->linkTitle|escape}</span>{/if}{/if} + </a> + </span> + <input type="text" aria-hidden="true" value="{$message->link}" class="form-control" readonly="readonly" > + </div> + {/if} + <button type="button" class="close" data-dismiss="alert" aria-label="{__('Generic', 'CLose')}"><span aria-hidden="true">×</span></button> + </div> {/if} </div> <div id="nameErrorMessage" class="hidden alert alert-dismissible alert-danger hidden-print" role="alert">{__('Error', 'The name is invalid.')}<button type="button" class="close" data-dismiss="alert" aria-label="{__('Generic', 'CLose')}"><span aria-hidden="true">×</span></button></div>