mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
modified js str with 'trans' for french; improved some code
This commit is contained in:
@@ -77,7 +77,8 @@ $('.contact-edit').click(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$('#contact-edit-form').submit(function() {
|
$('#contact-edit-form').submit(function() {
|
||||||
var form = $(this);
|
var form = $(this),
|
||||||
|
form_id = $(this).attr('id');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{% url contact_edit %}',
|
url: '{% url contact_edit %}',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@@ -103,9 +104,9 @@ $('#contact-edit-form').submit(function() {
|
|||||||
for (var i in errors) {
|
for (var i in errors) {
|
||||||
str += errors[i].join();
|
str += errors[i].join();
|
||||||
}
|
}
|
||||||
apply_form_error('contact-edit-form', str);
|
apply_form_error(form_id, str);
|
||||||
} else {
|
} else {
|
||||||
apply_form_error('contact-edit-form', '{% trans "Failed." %}');
|
apply_form_error(form_id, "{% trans "Failed. Please check the network." %}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -113,29 +114,21 @@ $('#contact-edit-form').submit(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
addConfirmTo($('.contact-delete'), {'title':'{% trans "Delete Contact" %}', 'con':'{% trans "Are you sure you want to delete %s ?" %}'});
|
addConfirmTo($('.contact-delete'), {'title':"{% trans "Delete Contact" %}", 'con':"{% trans "Are you sure you want to delete %s ?" %}"});
|
||||||
|
|
||||||
$('#contact-add')
|
$('#contact-add').click(function() {
|
||||||
.click(function() {
|
|
||||||
$('#contact-add-form').modal({appendTo: '#main'});
|
$('#contact-add-form').modal({appendTo: '#main'});
|
||||||
})
|
})
|
||||||
.hover(
|
|
||||||
function() {
|
|
||||||
$(this).css({'background-color': '#fff', 'cursor': 'pointer'});
|
|
||||||
},
|
|
||||||
function() {
|
|
||||||
$(this).css('background-color', '#f5f5f5');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
$('#contact-add-form').submit(function() {
|
$('#contact-add-form').submit(function() {
|
||||||
var form = $(this);
|
var form = $(this),
|
||||||
var email = $.trim(form.find('input[name="contact_email"]').val());
|
form_id = $(this).attr('id'),
|
||||||
|
email = $.trim(form.find('input[name="contact_email"]').val());
|
||||||
if(!email) {
|
if(!email) {
|
||||||
apply_form_error('contact-add-form', '{% trans "Email is required." %}');
|
apply_form_error(form_id, "{% trans "Email is required." %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (email == '{{request.user.username}}') {
|
if (email == '{{request.user.username}}') {
|
||||||
apply_form_error('contact-add-form', "{% trans "You can't add yourself." %}");
|
apply_form_error(form_id, "{% trans "You can't add yourself." %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,9 +157,9 @@ $('#contact-add-form').submit(function() {
|
|||||||
for (var i in errors) {
|
for (var i in errors) {
|
||||||
str += errors[i].join();
|
str += errors[i].join();
|
||||||
}
|
}
|
||||||
apply_form_error('contact-add-form', str);
|
apply_form_error(form_id, str);
|
||||||
} else {
|
} else {
|
||||||
apply_form_error('contact-add-form', '{% trans "Failed." %}');
|
apply_form_error(form_id, "{% trans "Failed. Please check the network." %}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -698,7 +698,7 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
margin:0 0 0.6em;
|
margin:0 0 0.6em;
|
||||||
}
|
}
|
||||||
.narrow-panel input.submit {
|
.narrow-panel input.submit {
|
||||||
width:4em;
|
width:auto; /*for fr,de etc*/
|
||||||
margin:8px 0 0;
|
margin:8px 0 0;
|
||||||
}
|
}
|
||||||
.narrow-panel .note {
|
.narrow-panel .note {
|
||||||
|
@@ -150,14 +150,14 @@ $('.share-permission-select').change(function() {
|
|||||||
},
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data['success']) {
|
if (data['success']) {
|
||||||
feedback('{% trans "Edit succeeded" %}', 'success');
|
feedback("{% trans "Edit succeeded" %}", 'success');
|
||||||
select.prev().children('.share-permission-cur-value').html(select.children('option[value="' +select.val() + '"]').text());
|
select.prev().children('.share-permission-cur-value').html(select.children('option[value="' +select.val() + '"]').text());
|
||||||
}
|
}
|
||||||
select.addClass('hide');
|
select.addClass('hide');
|
||||||
select.prev().removeClass('hide');
|
select.prev().removeClass('hide');
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
feedback('{% trans "Edit failed." %}', 'error');
|
feedback("{% trans "Edit failed." %}", 'error');
|
||||||
select.addClass('hide');
|
select.addClass('hide');
|
||||||
select.prev().removeClass('hide');
|
select.prev().removeClass('hide');
|
||||||
}
|
}
|
||||||
|
@@ -1,43 +0,0 @@
|
|||||||
{% extends base_template %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% block title %}{% trans "Add User" %}{% endblock %}
|
|
||||||
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
|
||||||
{% block main_panel %}
|
|
||||||
<div class="narrow-panel">
|
|
||||||
<h3>{% trans "Add User" %}</h3>
|
|
||||||
<form action="" method="post">
|
|
||||||
<label for="id_email">{% trans "Email" %}</label>
|
|
||||||
{{ form.email }} {{ form.email.errors }}
|
|
||||||
<label for="id_password1">{% trans "Password" %}</label>
|
|
||||||
{{ form.password1 }} {{ form.password1.errors }}
|
|
||||||
<label for="id_password2">{% trans "Confirm Password" %}</label>
|
|
||||||
{{ form.password2 }} {{ form.password2.errors }}
|
|
||||||
<p class="error hide" id="error"></p>
|
|
||||||
|
|
||||||
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block extra_script %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
$('input[type="submit"]').click(function(){
|
|
||||||
if (!$.trim($('input[name="email"]').attr('value'))) {
|
|
||||||
$('.error').removeClass('hide').html('{% trans "Email cannot be blank" %}');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!$.trim($('input[name="password1"]').attr('value'))) {
|
|
||||||
$('.error').removeClass('hide').html('{% trans "Password cannot be blank" %}');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!$.trim($('input[name="password2"]').attr('value'))) {
|
|
||||||
$('.error').removeClass('hide').html('{% trans "Confirm password cannot be blank" %}');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if ($.trim($('input[name="password1"]').attr('value')) != $.trim($('input[name="password2"]').attr('value'))) {
|
|
||||||
$('.error').removeClass('hide').html('{% trans "The two password fields not match" %}');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
@@ -351,7 +351,7 @@ var local_toolbar_strs = {
|
|||||||
|
|
||||||
link: "{% trans "Hyperlink <a> Ctrl+L" %}",
|
link: "{% trans "Hyperlink <a> Ctrl+L" %}",
|
||||||
linkdescription: "{% trans "enter link description here" %}",
|
linkdescription: "{% trans "enter link description here" %}",
|
||||||
linkdialog: "{% blocktrans %}<h3>Insert Hyperlink</h3><p>http://example.com/ \"optional title\"</p>{% endblocktrans %}",
|
linkdialog: "<h3>{% trans "Insert Hyperlink" %}</h3><p>http://example.com/ \"{% trans "optional title" %}\"</p>",
|
||||||
|
|
||||||
quote: "{% trans "Blockquote <blockquote> Ctrl+Q" %}",
|
quote: "{% trans "Blockquote <blockquote> Ctrl+Q" %}",
|
||||||
quoteexample: "{% trans "Blockquote" %}",
|
quoteexample: "{% trans "Blockquote" %}",
|
||||||
@@ -361,7 +361,7 @@ var local_toolbar_strs = {
|
|||||||
|
|
||||||
image: "{% trans "Image <img> Ctrl+G" %}",
|
image: "{% trans "Image <img> Ctrl+G" %}",
|
||||||
imagedescription: "{% trans "enter image description here" %}",
|
imagedescription: "{% trans "enter image description here" %}",
|
||||||
imagedialog: "{% blocktrans %}<h3>Insert Image</h3><p>http://example.com/images/diagram.jpg \"optional title\"</p>{% endblocktrans %}",
|
imagedialog: "<h3>{% trans "Insert Image" %}</h3><p>http://example.com/images/diagram.jpg \"{% trans "optional title" %}\"</p>",
|
||||||
|
|
||||||
olist: "{% trans "Numbered List <ol> Ctrl+O" %}",
|
olist: "{% trans "Numbered List <ol> Ctrl+O" %}",
|
||||||
ulist: "{% trans "Bulleted List <ul> Ctrl+U" %}",
|
ulist: "{% trans "Bulleted List <ul> Ctrl+U" %}",
|
||||||
@@ -463,10 +463,8 @@ function editSubmit() {
|
|||||||
$('#repo-decrypt-form').modal();
|
$('#repo-decrypt-form').modal();
|
||||||
$('#simplemodal-container').css({'height':'auto'});
|
$('#simplemodal-container').css({'height':'auto'});
|
||||||
}
|
}
|
||||||
} else if (xhr.readyState == 0) {
|
|
||||||
feedback("{% trans "Submit failed. Please check the network." %}", 'error');
|
|
||||||
} else {
|
} else {
|
||||||
feedback("{% trans "Submit failed." %}", 'error');
|
feedback("{% trans "Submit failed. Please check the network." %}", 'error');
|
||||||
}
|
}
|
||||||
enable($('#file-edit-submit'));
|
enable($('#file-edit-submit'));
|
||||||
}
|
}
|
||||||
@@ -484,9 +482,9 @@ $('#repo-decrypt-form').submit(function() {
|
|||||||
var pwd = $.trim(pwd_input.val());
|
var pwd = $.trim(pwd_input.val());
|
||||||
var err = $(this).find('.error');
|
var err = $(this).find('.error');
|
||||||
if (!pwd) {
|
if (!pwd) {
|
||||||
err.html('{% trans "Password is required." %}');
|
err.html("{% trans "Password is required." %}");
|
||||||
} else if (pwd.length < 3 || pwd.length > 30) {
|
} else if (pwd.length < 3 || pwd.length > 30) {
|
||||||
err.html('{% trans "Password should be 3 to 30 characters." %}');
|
err.html("{% trans "Password should be 3 to 30 characters." %}");
|
||||||
} else {
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{% url 'repo_set_password' %}',
|
url: '{% url 'repo_set_password' %}',
|
||||||
@@ -515,7 +513,7 @@ $('#repo-decrypt-form').submit(function() {
|
|||||||
if (jqXHR.responseText) {
|
if (jqXHR.responseText) {
|
||||||
err_str = $.parseJSON(jqXHR.responseText).error;
|
err_str = $.parseJSON(jqXHR.responseText).error;
|
||||||
} else {
|
} else {
|
||||||
err_str = '{% trans "Failed. Please check the network." %}';
|
err_str = "{% trans "Failed. Please check the network." %}";
|
||||||
}
|
}
|
||||||
err.html(err_str);
|
err.html(err_str);
|
||||||
pwd_input.val('');
|
pwd_input.val('');
|
||||||
|
@@ -24,12 +24,12 @@
|
|||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('input[type="submit"]').click(function(){
|
$('input[type="submit"]').click(function(){
|
||||||
if (!$.trim($('input[name="username"]').attr('value'))) {
|
if (!$.trim($('input[name="username"]').val())) {
|
||||||
$('.error').removeClass('hide').html('{% trans "Email cannot be blank" %}');
|
$('.error').removeClass('hide').html("{% trans "Email cannot be blank" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$.trim($('input[name="password"]').attr('value'))) {
|
if (!$.trim($('input[name="password"]').val())) {
|
||||||
$('.error').removeClass('hide').html('{% trans "Password cannot be blank" %}');
|
$('.error').removeClass('hide').html("{% trans "Password cannot be blank" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -23,21 +23,25 @@
|
|||||||
|
|
||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('input[type="submit"]').click(function(){
|
$('form').submit(function(){
|
||||||
if (!$.trim($('input[name="email"]').attr('value'))) {
|
var email = $.trim($('input[name="email"]').val()),
|
||||||
$('.error').removeClass('hide').html('{% trans "Email cannot be blank" %}');
|
pwd1 = $.trim($('input[name="password1"]').val()),
|
||||||
|
pwd2 = $.trim($('input[name="password2"]').val());
|
||||||
|
|
||||||
|
if (!email) {
|
||||||
|
$('.error').removeClass('hide').html("{% trans "Email cannot be blank" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$.trim($('input[name="password1"]').attr('value'))) {
|
if (!pwd1) {
|
||||||
$('.error').removeClass('hide').html('{% trans "Password cannot be blank" %}');
|
$('.error').removeClass('hide').html("{% trans "Password cannot be blank" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$.trim($('input[name="password2"]').attr('value'))) {
|
if (!pwd2) {
|
||||||
$('.error').removeClass('hide').html('{% trans "Confirm password cannot be blank" %}');
|
$('.error').removeClass('hide').html("{% trans "Please enter the password again" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($.trim($('input[name="password1"]').attr('value')) != $.trim($('input[name="password2"]').attr('value'))) {
|
if (pwd1 != pwd2) {
|
||||||
$('.error').removeClass('hide').html('{% trans "The two password fields not match" %}');
|
$('.error').removeClass('hide').html("{% trans "Passwords don't match" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -426,7 +426,7 @@ $('#repo-setting-form').submit(function() {
|
|||||||
if (jqXHR.responseText) {
|
if (jqXHR.responseText) {
|
||||||
apply_form_error('repo-setting-form', $.parseJSON(jqXHR.responseText).error);
|
apply_form_error('repo-setting-form', $.parseJSON(jqXHR.responseText).error);
|
||||||
} else {
|
} else {
|
||||||
apply_form_error('repo-setting-form', '{% trans "Failed. Please check the network." %}');
|
apply_form_error('repo-setting-form', "{% trans "Failed. Please check the network." %}");
|
||||||
}
|
}
|
||||||
enable(submit_btn);
|
enable(submit_btn);
|
||||||
}
|
}
|
||||||
@@ -445,7 +445,7 @@ $('#upload-file').click(function () {
|
|||||||
list: '#upload-file-list',
|
list: '#upload-file-list',
|
||||||
STRING: {
|
STRING: {
|
||||||
file: '<span title="{% trans "Click to remove" %}" onclick="$(this).parent().prev().click()">$file</span>',
|
file: '<span title="{% trans "Click to remove" %}" onclick="$(this).parent().prev().click()">$file</span>',
|
||||||
duplicate: '{% trans "This file has already been selected:\n$file!" %}'
|
duplicate: "{% trans "This file has already been selected:\n$file!" %}"
|
||||||
},
|
},
|
||||||
afterFileAppend:function() {
|
afterFileAppend:function() {
|
||||||
$('#upload-file-form .files-add input').css({'right':$('#upload-add-tip').width()});
|
$('#upload-file-form .files-add input').css({'right':$('#upload-add-tip').width()});
|
||||||
@@ -605,23 +605,23 @@ $('.file-cp, .file-mv, .dir-cp, .dir-mv').click(function () {
|
|||||||
file_type = '';
|
file_type = '';
|
||||||
if ($(this).hasClass('file-cp') || $(this).hasClass('dir-cp')) {
|
if ($(this).hasClass('file-cp') || $(this).hasClass('dir-cp')) {
|
||||||
$('#mv-type').val('cp');
|
$('#mv-type').val('cp');
|
||||||
mv_type = '{% trans "Copy " %}';
|
mv_type = "{% trans "Copy " %}";
|
||||||
} else {
|
} else {
|
||||||
$('#mv-type').val('mv');
|
$('#mv-type').val('mv');
|
||||||
mv_type = '{% trans "Move " %}';
|
mv_type = "{% trans "Move " %}";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).hasClass('file-cp') || $(this).hasClass('file-mv')) {
|
if ($(this).hasClass('file-cp') || $(this).hasClass('file-mv')) {
|
||||||
file_type = '{% trans "File" %}';
|
file_type = "{% trans "File" %}";
|
||||||
$('input[name="obj_type"]').val('file');
|
$('input[name="obj_type"]').val('file');
|
||||||
} else {
|
} else {
|
||||||
file_type = '{% trans "Directory" %}';
|
file_type = "{% trans "Directory" %}";
|
||||||
$('input[name="obj_type"]').val('dir');
|
$('input[name="obj_type"]').val('dir');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('input[name="obj_name"]').val(obj_name);
|
$('input[name="obj_name"]').val(obj_name);
|
||||||
$('#mv-hd').html(mv_type + file_type);
|
$('#mv-hd').html(mv_type + file_type);
|
||||||
$('#mv-detail').html(mv_type + ' <span class="op-target">' + obj_name + '</span> {% trans "to:" %}');
|
$('#mv-detail').html(mv_type + ' <span class="op-target">' + obj_name + "</span> {% trans "to:" %}");
|
||||||
$('#mv-form').modal({appendTo:'#main', autoResize:true, focus:false});
|
$('#mv-form').modal({appendTo:'#main', autoResize:true, focus:false});
|
||||||
renderDirTree($('#current-repo-dirs'), current_repo);
|
renderDirTree($('#current-repo-dirs'), current_repo);
|
||||||
return false;
|
return false;
|
||||||
@@ -654,9 +654,9 @@ $('.file-star').click(function() {
|
|||||||
success:function(data) {
|
success:function(data) {
|
||||||
if (data['success']) {
|
if (data['success']) {
|
||||||
if (state == 'starred') {
|
if (state == 'starred') {
|
||||||
it.attr('class', 'file-star icon-star-empty').attr('title','{% trans 'unstarred' %}').data('status','unstarred');
|
it.attr('class', 'file-star icon-star-empty').attr('title', "{% trans 'unstarred' %}").data('status','unstarred');
|
||||||
} else {
|
} else {
|
||||||
it.attr('class', 'file-star icon-star').attr('title','{% trans 'starred' %}').data('status','starred');
|
it.attr('class', 'file-star icon-star').attr('title', "{% trans 'starred' %}").data('status','starred');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -664,7 +664,7 @@ $('.file-star').click(function() {
|
|||||||
if (xhr.responseText) {
|
if (xhr.responseText) {
|
||||||
feedback(jQuery.parseJSON(xhr.responseText).error, 'error');
|
feedback(jQuery.parseJSON(xhr.responseText).error, 'error');
|
||||||
} else {
|
} else {
|
||||||
feedback('{% trans "Failed. Please check the network." %}', 'error');
|
feedback("{% trans "Failed. Please check the network." %}", 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -701,7 +701,7 @@ $('.file-share').click(function() {
|
|||||||
if (xhr.responseText) {
|
if (xhr.responseText) {
|
||||||
feedback(jQuery.parseJSON(xhr.responseText).error, 'error');
|
feedback(jQuery.parseJSON(xhr.responseText).error, 'error');
|
||||||
} else {
|
} else {
|
||||||
feedback('{% trans "Failed. Please check the network." %}', 'error');
|
feedback("{% trans "Failed. Please check the network." %}", 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -844,7 +844,7 @@ $('#add-new-file-form, #add-new-dir-form, #rename-form').submit(function() {
|
|||||||
if (xhr.responseText) {
|
if (xhr.responseText) {
|
||||||
err = $.parseJSON(xhr.responseText).error;
|
err = $.parseJSON(xhr.responseText).error;
|
||||||
} else {
|
} else {
|
||||||
err = '{% trans "Failed. Please check the network." %}';
|
err = "{% trans "Failed. Please check the network." %}";
|
||||||
}
|
}
|
||||||
apply_form_error(form_id, err);
|
apply_form_error(form_id, err);
|
||||||
enable(submit_btn);
|
enable(submit_btn);
|
||||||
|
@@ -37,19 +37,19 @@ function changeAvatar(chg_btn, input, form) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
feedback(filename + '{% trans " is not supported. Please choose an image file." %}', 'error');
|
feedback(filename + "{% trans " is not supported. Please choose an image file." %}", 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allow) {
|
if (!allow) {
|
||||||
var err_msg = filename + '{% trans " is not supported. File extensions can only be " %}' + allowed_ext.join(', ');
|
var err_msg = filename + "{% trans " is not supported. File extensions can only be " %}" + allowed_ext.join(', ');
|
||||||
feedback(err_msg, 'error');
|
feedback(err_msg, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if file size is less than 1MB
|
// check if file size is less than 1MB
|
||||||
if (file && file.size > 1024*1024) {
|
if (file && file.size > 1024*1024) {
|
||||||
feedback(filename + '{% trans " is too large. Allowed maximum size is 1MB." %}', 'error');
|
feedback(filename + "{% trans " is too large. Allowed maximum size is 1MB." %}", 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,12 +54,12 @@ $('#discuss-submit').click(function() {
|
|||||||
form_id = form.attr('id');
|
form_id = form.attr('id');
|
||||||
|
|
||||||
if (form.find('.checkbox-checked').length == 0) {
|
if (form.find('.checkbox-checked').length == 0) {
|
||||||
apply_form_error(form_id, '{% trans "Please select at least 1 group." %}');
|
apply_form_error(form_id, "{% trans "Please select at least 1 group." %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$.trim($('#discuss-to-group-form .input').val())) {
|
if (!$.trim($('#discuss-to-group-form .input').val())) {
|
||||||
apply_form_error(form_id, '{% trans "Please input a discussion." %}');
|
apply_form_error(form_id, "{% trans "Please input a discussion." %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
form.find('.error').addClass('hide');
|
form.find('.error').addClass('hide');
|
||||||
@@ -98,7 +98,7 @@ $('#discuss-submit').click(function() {
|
|||||||
if (jqXHR.responseText) {
|
if (jqXHR.responseText) {
|
||||||
err_str = $.parseJSON(jqXHR.responseText).err;
|
err_str = $.parseJSON(jqXHR.responseText).err;
|
||||||
} else {
|
} else {
|
||||||
err_str = '{% trans "Failed. Please check the network." %}';
|
err_str = "{% trans "Failed. Please check the network." %}";
|
||||||
}
|
}
|
||||||
apply_form_error(form_id, err_str);
|
apply_form_error(form_id, err_str);
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ window.onload = function () {
|
|||||||
|
|
||||||
{% if filetype == 'SVG' %}
|
{% if filetype == 'SVG' %}
|
||||||
if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.browser.version) > 8)) {
|
if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.browser.version) > 8)) {
|
||||||
$('#file-view').html('<div id="file-view-tip"><p>{% trans "To view it online, you can use firefox, chrome or IE 9." %}</p></div>');
|
$('#file-view').html('<div id="file-view-tip"><p>' + "{% trans "To view it online, you can use firefox, chrome or IE 9." %}" + '</p></div>');
|
||||||
} else {
|
} else {
|
||||||
$('#file-view').html('<iframe src="{{ raw_path }}" frameborder="0" id="svg-view"></iframe>');
|
$('#file-view').html('<iframe src="{{ raw_path }}" frameborder="0" id="svg-view"></iframe>');
|
||||||
}
|
}
|
||||||
@@ -104,9 +104,9 @@ window.onload = function () {
|
|||||||
error: function(xhr, textStatus, errorThrown) {
|
error: function(xhr, textStatus, errorThrown) {
|
||||||
var str;
|
var str;
|
||||||
if (xhr.responseText) {
|
if (xhr.responseText) {
|
||||||
str = '{% trans "Document convertion failed." %}';
|
str = "{% trans "Document convertion failed." %}";
|
||||||
} else {
|
} else {
|
||||||
str = '{% trans "Failed. Please check the network." %}';
|
str = "{% trans "Failed. Please check the network." %}";
|
||||||
}
|
}
|
||||||
$('#file-view').html('<div id="file-view-tip"><p class="error">' + str + '</p></div>');
|
$('#file-view').html('<div id="file-view-tip"><p class="error">' + str + '</p></div>');
|
||||||
}
|
}
|
||||||
|
@@ -59,8 +59,8 @@
|
|||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
addConfirmTo($('.org-remove-btn'), {
|
addConfirmTo($('.org-remove-btn'), {
|
||||||
'title':'{% trans "Delete Organization" %}',
|
'title':"{% trans "Delete Organization" %}",
|
||||||
'con':'{% trans "Are you sure you want to delete %s ?" %}'
|
'con':"{% trans "Are you sure you want to delete %s ?" %}"
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -84,23 +84,26 @@
|
|||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
addConfirmTo($('.remove-user-btn'), {
|
addConfirmTo($('.remove-user-btn'), {
|
||||||
'title':'{% trans "Delete User" %}',
|
'title':"{% trans "Delete User" %}",
|
||||||
'con':'{% trans "Are you sure you want to delete %s ?" %}'
|
'con':"{% trans "Are you sure you want to delete %s ?" %}"
|
||||||
});
|
});
|
||||||
addConfirmTo($('.reset-user-btn'), {
|
addConfirmTo($('.reset-user-btn'), {
|
||||||
'title':'{% trans "Password Reset" %}',
|
'title':"{% trans "Password Reset" %}",
|
||||||
'con':'{% trans "Are you sure you want to reset the password of %s ?" %}'
|
'con':"{% trans "Are you sure you want to reset the password of %s ?" %}"
|
||||||
});
|
});
|
||||||
addConfirmTo($('.revoke-admin-btn'), {
|
addConfirmTo($('.revoke-admin-btn'), {
|
||||||
'title':'{% trans "Revoke Admin" %}',
|
'title':"{% trans "Revoke Admin" %}",
|
||||||
'con':'{% trans "Are you sure you want to revoke the admin permission of %s ?" %}'
|
'con':"{% trans "Are you sure you want to revoke the admin permission of %s ?" %}"
|
||||||
});
|
});
|
||||||
addConfirmTo($('.set-admin-btn'), {
|
addConfirmTo($('.set-admin-btn'), {
|
||||||
'title':'{% trans "Set Admin" %}',
|
'title':"{% trans "Set Admin" %}",
|
||||||
'con':'{% trans "Are you sure you want to set %s as admin?" %}'
|
'con':"{% trans "Are you sure you want to set %s as admin?" %}"
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#add-user-btn').click(function() {$('#add-user-form').modal();});
|
$('#add-user-btn').click(function() {
|
||||||
|
$('#add-user-form').modal();
|
||||||
|
$('#simplemodal-container').css({'width':'auto'});
|
||||||
|
});
|
||||||
$('#add-user-form').submit(function() {
|
$('#add-user-form').submit(function() {
|
||||||
var form = $(this),
|
var form = $(this),
|
||||||
form_id = $(this).attr('id'),
|
form_id = $(this).attr('id'),
|
||||||
@@ -109,15 +112,15 @@ $('#add-user-form').submit(function() {
|
|||||||
pwd2 = $.trim(form.children('[name="password2"]').val());
|
pwd2 = $.trim(form.children('[name="password2"]').val());
|
||||||
|
|
||||||
if (!email) {
|
if (!email) {
|
||||||
apply_form_error(form_id, '{% trans "Email cannot be blank" %}');
|
apply_form_error(form_id, "{% trans "Email cannot be blank" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!pwd1) {
|
if (!pwd1) {
|
||||||
apply_form_error(form_id, '{% trans "Password cannot be blank" %}');
|
apply_form_error(form_id, "{% trans "Password cannot be blank" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!pwd2) {
|
if (!pwd2) {
|
||||||
apply_form_error(form_id, '{% trans "Please enter the password again" %}');
|
apply_form_error(form_id, "{% trans "Please enter the password again" %}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (pwd1 != pwd2) {
|
if (pwd1 != pwd2) {
|
||||||
@@ -146,7 +149,7 @@ $('#add-user-form').submit(function() {
|
|||||||
if (jqXHR.responseText) {
|
if (jqXHR.responseText) {
|
||||||
apply_form_error(form_id, $.parseJSON(jqXHR.responseText).err);
|
apply_form_error(form_id, $.parseJSON(jqXHR.responseText).err);
|
||||||
} else {
|
} else {
|
||||||
apply_form_error(form_id, '{% trans "Failed. Please check the network." %}');
|
apply_form_error(form_id, "{% trans "Failed. Please check the network." %}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user