mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Login page geonames plugin integration
This commit is contained in:
@@ -1,103 +1,129 @@
|
||||
{# designed to be printed in a small box #}
|
||||
<div id="QuickAddUser" class="PNB10" callback="{{ callback }}">
|
||||
<form method="POST" action="{{ path('prod_push_do_add_user') }}">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'First Name' %} *</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="firstname" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Last Name' %} *</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="lastname" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Email Name' %} *</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="email" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Job' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="job" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Company' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="company" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'City' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="city" type="text" value="" class="geoname_field"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<button class="valid btn btn-inverse">{% trans 'Add' %}</button>
|
||||
<button class="cancel btn btn-inverse">{% trans 'Cancel' %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<form method="POST" action="{{ path('prod_push_do_add_user') }}">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'First Name' %} *</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="firstname" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Last Name' %} *</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="lastname" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Email Name' %} *</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="email" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Job' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="job" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'Company' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="company" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="">{% trans 'City' %}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="city" type="text" value="" class="geoname_field"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<button class="valid btn btn-inverse">{% trans 'Add' %}</button>
|
||||
<button class="cancel btn btn-inverse">{% trans 'Cancel' %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
a
|
||||
<script type="text/javascript" language="javascript" src="{{ path('minifier', { 'f' : 'assets/geonames-server-jquery-plugin/jquery.geonames.js' }) }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
var geocompleter = $('#QuickAddUser input.geoname_field').geocompleter({
|
||||
"server": "{{ app['phraseanet.registry'].get('GV_i18n_service') }}",
|
||||
"limit": 40
|
||||
});
|
||||
|
||||
$("#QuickAddUser button").button();
|
||||
// On focus add select-state
|
||||
geocompleter.geocompleter("autocompleter", "on", "autocompletefocus", function(event, ui) {
|
||||
$("li", $(event.originalEvent.target)).closest("li").removeClass("selected");
|
||||
$("a.ui-state-active, a.ui-state-hover, a.ui-state-focus", $(event.originalEvent.target)).closest("li").addClass("selected");
|
||||
});
|
||||
|
||||
$("#QuickAddUser form").bind('submit', function(){
|
||||
return false;
|
||||
geocompleter.geocompleter("autocompleter", "on", "autocompletesearch", function(event, ui) {
|
||||
$(this).addClass('input-loading');
|
||||
$(this).removeClass('input-error');
|
||||
});
|
||||
|
||||
geocompleter.geocompleter("autocompleter", "on", "autocompleteresponse", function(event, ui) {
|
||||
$(this).removeClass('input-loading');
|
||||
});
|
||||
|
||||
geocompleter.geocompleter("autocompleter", "on", "autocompleteclose", function(event, ui) {
|
||||
$(this).removeClass('input-loading');
|
||||
});
|
||||
|
||||
geocompleter.geocompleter("autocompleter", "on", "geotocompleter.request.error", function(jqXhr, status, error) {
|
||||
$(this).removeClass('input-loading');
|
||||
$(this).addClass('input-error');
|
||||
});
|
||||
|
||||
$("#QuickAddUser button").button();
|
||||
|
||||
$("#QuickAddUser form").bind('submit', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#QuickAddUser form button.cancel").bind('click', function() {
|
||||
var dialog = $(this).closest('.ui-dialog-content');
|
||||
if (dialog.data("ui-dialog")) {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
|
||||
dialog.remove();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#QuickAddUser form button.valid").bind('click', function() {
|
||||
var $form = $(this).closest('form');
|
||||
var $this = $(this);
|
||||
|
||||
var callback = function() {
|
||||
var dialog = $this.closest('.ui-dialog-content');
|
||||
if (dialog.data("ui-dialog")) {
|
||||
dialog.dialog('destroy').remove();
|
||||
}
|
||||
};
|
||||
|
||||
p4.Feedback.addUser($form, callback);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
$("#QuickAddUser form button.cancel").bind('click', function(){
|
||||
var dialog = $(this).closest('.ui-dialog-content');
|
||||
if (dialog.data("ui-dialog")) {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
|
||||
dialog.remove();
|
||||
|
||||
return false;
|
||||
});
|
||||
$("#QuickAddUser form button.valid").bind('click', function(){
|
||||
|
||||
var $form = $(this).closest('form');
|
||||
var $this = $(this);
|
||||
|
||||
var callback = function(){
|
||||
var dialog = $this.closest('.ui-dialog-content');
|
||||
if (dialog.data("ui-dialog")) {
|
||||
dialog.dialog('destroy').remove();
|
||||
}
|
||||
};
|
||||
|
||||
p4.Feedback.addUser($form, callback);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user