Commit 3b3a261fb6cd62cda56edb6155be96f9fd95c7b8

Authored by Zambom
1 parent 6e102f5c

Adjusting bugs involving image in user create/update by admin

amadeus/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid ""
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
amadeus/static/js/crop.js 0 → 100644
... ... @@ -0,0 +1,98 @@
  1 +$(function () {
  2 + /* Script para abrir o modal com a imagem selecionada */
  3 + $("#id_image").change(function () {
  4 + var max_size = 2*1024*1024;
  5 + var submit_btn = $("#user-form").find("input[type='submit']");
  6 + var regex = new RegExp("(.*?)\.(jpg|jpeg|png)$");
  7 + var errors = 0;
  8 +
  9 + $(".client-file-errors").hide();
  10 + $(".size").hide();
  11 + $(".format").hide();
  12 + $(submit_btn).prop('disable', false);
  13 + $(submit_btn).prop('disabled', false);
  14 +
  15 + if (this.files && this.files[0]) {
  16 + if (this.files[0].size > max_size) {
  17 + $(submit_btn).prop('disable', true);
  18 + $(submit_btn).prop('disabled', true);
  19 +
  20 + $(".client-file-errors").show();
  21 + $(".size").show();
  22 +
  23 + errors++;
  24 + }
  25 +
  26 + if (!this.files[0].type.match(/^image\//)) {
  27 + $(submit_btn).prop('disable', true);
  28 + $(submit_btn).prop('disabled', true);
  29 +
  30 + $(".client-file-errors").show();
  31 + $(".format").show();
  32 +
  33 + errors++;
  34 + }
  35 +
  36 + if (errors == 0) {
  37 + var reader = new FileReader();
  38 + reader.onload = function (e) {
  39 + $("#image").attr("src", e.target.result);
  40 + $("#modalCrop").modal("show");
  41 + }
  42 + reader.readAsDataURL(this.files[0]);
  43 + }
  44 + }
  45 + });
  46 +
  47 + /* Scripts da caixa de corte da imagem */
  48 + var $image = $("#image");
  49 + var cropBoxData;
  50 + var canvasData;
  51 + $("#modalCrop").on("shown.bs.modal", function () {
  52 + $image.cropper({
  53 + viewMode: 1,
  54 + aspectRatio: 1/1,
  55 + minCropBoxWidth: 200,
  56 + minCropBoxHeight: 200,
  57 + ready: function () {
  58 + $image.cropper("setCanvasData", canvasData);
  59 + $image.cropper("setCropBoxData", cropBoxData);
  60 + }
  61 + });
  62 + }).on("hidden.bs.modal", function () {
  63 + cropBoxData = $image.cropper("getCropBoxData");
  64 + canvasData = $image.cropper("getCanvasData");
  65 + $image.cropper("destroy");
  66 + });
  67 +
  68 + $(".js-zoom-in").click(function () {
  69 + $image.cropper("zoom", 0.1);
  70 + });
  71 +
  72 + $(".js-zoom-out").click(function () {
  73 + $image.cropper("zoom", -0.1);
  74 + });
  75 +
  76 + /* Script para pegar os valores das dimensões e depois fechar o modal */
  77 + $(".js-crop-and-upload").click(function () {
  78 + var cropData = $image.cropper("getData");
  79 + $("#id_x").val(cropData["x"]);
  80 + $("#id_y").val(cropData["y"]);
  81 + $("#id_height").val(cropData["height"]);
  82 + $("#id_width").val(cropData["width"]);
  83 + $("#modalCrop").modal('hide');
  84 + });
  85 +
  86 + /* Script para remover o arquivo enviado caso o usuário clique em cancelar*/
  87 + $("#id_image").on('change', function(){
  88 + console.log(this.value);
  89 + });
  90 +
  91 + $('#crop_cancel').on('click', function(e){
  92 + var input = $("#id_image");
  93 + var holder = $("#pic_holder");
  94 + input.replaceWith(input.val('').clone(true));
  95 + holder.replaceWith(holder.val('').clone(true));
  96 + });
  97 +
  98 +});
... ...
amadeus/static/js/crop_news.js
1 1 $(function () {
2 2  
3   - /* Script para abrir o modal com a imagem selecionada */
4   - $("#id_image").change(function () {
5   - if (this.files && this.files[0]) {
6   - var reader = new FileReader();
7   - reader.onload = function (e) {
8   - $("#image").attr("src", e.target.result);
9   - $("#modalCrop").modal("show");
10   - }
11   - reader.readAsDataURL(this.files[0]);
12   - }
13   - });
  3 + /* Script para abrir o modal com a imagem selecionada */
  4 + $("#id_image").change(function () {
  5 + if (this.files && this.files[0]) {
  6 + var reader = new FileReader();
  7 + reader.onload = function (e) {
  8 + $("#image").attr("src", e.target.result);
  9 + $("#modalCrop").modal("show");
  10 + }
  11 + reader.readAsDataURL(this.files[0]);
  12 + }
  13 + });
14 14  
15   - /* Scripts da caixa de corte da imagem */
16   - var $image = $("#image");
17   - var cropBoxData;
18   - var canvasData;
19   - $("#modalCrop").on("shown.bs.modal", function () {
20   - $image.cropper({
21   - viewMode: 1 ,
22   - aspectRatio: 24/5,
23   - minCropBoxWidth: 200,
24   - minCropBoxHeight: 200,
25   - dragMode: 'move',
26   - ready: function () {
27   - $image.cropper("setCanvasData", canvasData);
28   - $image.cropper("setCropBoxData", cropBoxData);
29   - }
30   - });
31   - }).on("hidden.bs.modal", function () {
32   - cropBoxData = $image.cropper("getCropBoxData");
33   - canvasData = $image.cropper("getCanvasData");
34   - $image.cropper("destroy");
35   - });
  15 + /* Scripts da caixa de corte da imagem */
  16 + var $image = $("#image");
  17 + var cropBoxData;
  18 + var canvasData;
  19 + $("#modalCrop").on("shown.bs.modal", function () {
  20 + $image.cropper({
  21 + viewMode: 1 ,
  22 + aspectRatio: 24/5,
  23 + minCropBoxWidth: 200,
  24 + minCropBoxHeight: 200,
  25 + dragMode: 'move',
  26 + ready: function () {
  27 + $image.cropper("setCanvasData", canvasData);
  28 + $image.cropper("setCropBoxData", cropBoxData);
  29 + }
  30 + });
  31 + }).on("hidden.bs.modal", function () {
  32 + cropBoxData = $image.cropper("getCropBoxData");
  33 + canvasData = $image.cropper("getCanvasData");
  34 + $image.cropper("destroy");
  35 + });
36 36  
37   - $(".js-zoom-in").click(function () {
38   - $image.cropper("zoom", 0.1);
39   - });
  37 + $(".js-zoom-in").click(function () {
  38 + $image.cropper("zoom", 0.1);
  39 + });
40 40  
41   - $(".js-zoom-out").click(function () {
42   - $image.cropper("zoom", -0.1);
43   - });
  41 + $(".js-zoom-out").click(function () {
  42 + $image.cropper("zoom", -0.1);
  43 + });
44 44  
45   - /* Script para pegar os valores das dimensões e depois fechar o modal */
46   - $(".js-crop-and-upload").click(function () {
47   - var cropData = $image.cropper("getData");
48   - $("#id_x").val(cropData["x"]);
49   - $("#id_y").val(cropData["y"]);
50   - $("#id_height").val(cropData["height"]);
51   - $("#id_width").val(cropData["width"]);
52   - $("#modalCrop").modal('hide');
53   - });
  45 + /* Script para pegar os valores das dimensões e depois fechar o modal */
  46 + $(".js-crop-and-upload").click(function () {
  47 + var cropData = $image.cropper("getData");
  48 + $("#id_x").val(cropData["x"]);
  49 + $("#id_y").val(cropData["y"]);
  50 + $("#id_height").val(cropData["height"]);
  51 + $("#id_width").val(cropData["width"]);
  52 + $("#modalCrop").modal('hide');
  53 + });
54 54  
55   - /* Script para remover o arquivo enviado caso o usuário clique em cancelar*/
56   - $("#id_image").on('change', function(){
57   - console.log(this.value);
58   - });
  55 + /* Script para remover o arquivo enviado caso o usuário clique em cancelar*/
  56 + $("#id_image").on('change', function(){
  57 + console.log(this.value);
  58 + });
59 59  
60   - $('#crop_cancel').on('click', function(e){
61   - var input = $("#id_image");
62   - var holder = $("#pic_holder");
63   - input.replaceWith(input.val('').clone(true));
64   - holder.replaceWith(holder.val('').clone(true));
65   - });
  60 + $('#crop_cancel').on('click', function(e){
  61 + var input = $("#id_image");
  62 + var holder = $("#pic_holder");
  63 + input.replaceWith(input.val('').clone(true));
  64 + holder.replaceWith(holder.val('').clone(true));
  65 + });
66 66  
67 67 });
... ...
analytics/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
api/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
bulletin/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
categories/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
chat/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
dashboards/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
file_link/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
goals/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
links/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
log/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
mailsender/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
mural/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
news/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
notifications/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
pdf_file/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
pendencies/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
reports/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
security/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
students_group/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
subjects/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
themes/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
topics/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
users/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -22,7 +22,7 @@ msgstr &quot;&quot;
22 22 msgid "You must insert an email address"
23 23 msgstr "Você deve inserir um endereço de email"
24 24  
25   -#: users/forms.py:43
  25 +#: users/forms.py:43 users/templates/users/_form.html:94
26 26 msgid "The image is too large. It should have less than 2MB."
27 27 msgstr "A imagem é muito grande. Ela deve conter menos de 2MB."
28 28  
... ... @@ -87,7 +87,7 @@ msgstr &quot;Email&quot;
87 87 msgid "You must insert a valid email address"
88 88 msgstr "Você deve inserir um endereço de email válido"
89 89  
90   -#: users/models.py:18
  90 +#: users/models.py:18 users/templates/users/_form.html:95
91 91 msgid "File not supported."
92 92 msgstr "Arquivo não suportado."
93 93  
... ... @@ -173,15 +173,24 @@ msgstr &quot;Sim&quot;
173 173 msgid "Is not an admin"
174 174 msgstr "Não é administrador"
175 175  
176   -#: users/templates/users/_form.html:16 users/templates/users/register.html:53
  176 +#: users/templates/users/_form.html:18 users/templates/users/register.html:53
177 177 msgid "Choose your photo..."
178 178 msgstr "Escolha sua foto..."
179 179  
180   -#: users/templates/users/_form.html:76
  180 +#: users/templates/users/_form.html:32
  181 +msgid "Click or drop the file here"
  182 +msgstr ""
  183 +
  184 +#: users/templates/users/_form.html:34
  185 +msgid "The photo could not exceed 2MB."
  186 +msgstr "A imagem não pode exceder o tamanho de 2MB."
  187 +
  188 +#: users/templates/users/_form.html:103
181 189 msgid "Save"
182 190 msgstr "Salvar"
183 191  
184   -#: users/templates/users/_form.html:79 users/templates/users/modal_crop.html:24
  192 +#: users/templates/users/_form.html:106
  193 +#: users/templates/users/modal_crop.html:24
185 194 msgid "Cancel"
186 195 msgstr "Cancelar"
187 196  
... ... @@ -259,7 +268,7 @@ msgstr &quot;Entrar&quot;
259 268 msgid "Sign Up"
260 269 msgstr "Cadastrar"
261 270  
262   -#: users/templates/users/login.html:81 users/templates/users/login.html:114
  271 +#: users/templates/users/login.html:79 users/templates/users/login.html:107
263 272 msgid "Forgot your password?"
264 273 msgstr "Esqueceu sua senha?"
265 274  
... ...
users/static/js/crop.js
... ... @@ -1,66 +0,0 @@
1   -$(function () {
2   -
3   - /* Script para abrir o modal com a imagem selecionada */
4   - $("#id_image").change(function () {
5   - if (this.files && this.files[0]) {
6   - var reader = new FileReader();
7   - reader.onload = function (e) {
8   - $("#image").attr("src", e.target.result);
9   - $("#modalCrop").modal("show");
10   - }
11   - reader.readAsDataURL(this.files[0]);
12   - }
13   - });
14   -
15   - /* Scripts da caixa de corte da imagem */
16   - var $image = $("#image");
17   - var cropBoxData;
18   - var canvasData;
19   - $("#modalCrop").on("shown.bs.modal", function () {
20   - $image.cropper({
21   - viewMode: 1,
22   - aspectRatio: 1/1,
23   - minCropBoxWidth: 200,
24   - minCropBoxHeight: 200,
25   - ready: function () {
26   - $image.cropper("setCanvasData", canvasData);
27   - $image.cropper("setCropBoxData", cropBoxData);
28   - }
29   - });
30   - }).on("hidden.bs.modal", function () {
31   - cropBoxData = $image.cropper("getCropBoxData");
32   - canvasData = $image.cropper("getCanvasData");
33   - $image.cropper("destroy");
34   - });
35   -
36   - $(".js-zoom-in").click(function () {
37   - $image.cropper("zoom", 0.1);
38   - });
39   -
40   - $(".js-zoom-out").click(function () {
41   - $image.cropper("zoom", -0.1);
42   - });
43   -
44   - /* Script para pegar os valores das dimensões e depois fechar o modal */
45   - $(".js-crop-and-upload").click(function () {
46   - var cropData = $image.cropper("getData");
47   - $("#id_x").val(cropData["x"]);
48   - $("#id_y").val(cropData["y"]);
49   - $("#id_height").val(cropData["height"]);
50   - $("#id_width").val(cropData["width"]);
51   - $("#modalCrop").modal('hide');
52   - });
53   -
54   - /* Script para remover o arquivo enviado caso o usuário clique em cancelar*/
55   - $("#id_image").on('change', function(){
56   - console.log(this.value);
57   - });
58   -
59   - $('#crop_cancel').on('click', function(e){
60   - var input = $("#id_image");
61   - var holder = $("#pic_holder");
62   - input.replaceWith(input.val('').clone(true));
63   - holder.replaceWith(holder.val('').clone(true));
64   - });
65   -
66   -});
users/templates/users/_form.html
1 1 {% load static i18n %}
2 2 {% load widget_tweaks %}
3 3  
4   -<form method="post" action="" enctype="multipart/form-data">
  4 +<form id="user-form" method="post" action="" enctype="multipart/form-data">
5 5 {% csrf_token %}
6 6 {% for field in form %}
7 7 <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput col-lg-12 col-md-12 col-sm-12">
... ... @@ -10,16 +10,31 @@
10 10 <label for="{{ field.auto_id }}">{{ field.label }} <span>*</span></label>
11 11 {% else %}
12 12 <label for="{{ field.auto_id }}">{{ field.label }}</label>
13   - {% endif %}
14   - {% render_field field class='form-control' %}
15   - <div class="input-group">
16   - <input type="text" readonly="" class="form-control" id="pic_holder" placeholder="{% trans 'Choose your photo...' %}">
17   - <span class="input-group-btn input-group-sm">
18   - <button type="button" class="btn btn-fab btn-fab-mini">
19   - <i class="material-icons">image</i>
20   - </button>
21   - </span>
22   - </div>
  13 + {% endif %}
  14 +
  15 + {% render_field field class='file-selector' %}
  16 +
  17 + <div class="input-group common-file-input">
  18 + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}">
  19 + <span class="input-group-btn input-group-sm">
  20 + <button type="button" class="btn btn-fab btn-fab-mini">
  21 + <i class="material-icons">attach_file</i>
  22 + </button>
  23 + </span>
  24 + </div>
  25 +
  26 + <div class="filedrag">
  27 + {% if acc.image %}
  28 + <i class="fa fa-file-archive-o"></i> <br />
  29 +
  30 + <small>{{ acc.image.path }}</small>
  31 + {% else %}
  32 + {% trans 'Click or drop the file here' %}<br />
  33 +
  34 + <small>{% trans 'The photo could not exceed 2MB.' %}</small>
  35 + {% endif %}
  36 + </div>
  37 +
23 38 {% elif field.auto_id == 'id_description' %}
24 39 {% if field.field.required %}
25 40 <label for="{{ field.auto_id }}">{{ field.label }} <span>*</span></label>
... ... @@ -52,23 +67,35 @@
52 67 {% else %}
53 68 {% render_field field class='form-control' %}
54 69 {% endif %}
55   -
56   -
57   - {% endif %}
58   - <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
59   - {% if field.errors %}
60   - <div class="alert alert-danger alert-dismissible" role="alert">
61   - <button type="button" class="close" data-dismiss="alert" aria-label="Close">
62   - <span aria-hidden="true">&times;</span>
63   - </button>
64   - <ul>
65   - {% for error in field.errors %}
66   - <li>{{ error }}</li>
67   - {% endfor %}
68   - </ul>
69   - </div>
70 70 {% endif %}
  71 +
  72 + <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
71 73 </div>
  74 +
  75 + {% if field.errors %}
  76 + <div class="col-lg-12 col-md-12 col-sm-12 alert alert-danger alert-dismissible" role="alert">
  77 + <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  78 + <span aria-hidden="true">&times;</span>
  79 + </button>
  80 + <ul>
  81 + {% for error in field.errors %}
  82 + <li>{{ error }}</li>
  83 + {% endfor %}
  84 + </ul>
  85 + </div>
  86 + {% endif %}
  87 +
  88 + {% if field.auto_id == 'id_image' %}
  89 + <div class="col-lg-12 col-md-12 col-sm-12 alert alert-danger alert-dismissible client-file-errors" style="display:none" role="alert">
  90 + <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  91 + <span aria-hidden="true">&times;</span>
  92 + </button>
  93 + <ul>
  94 + <li class="size" style="display:none">{% trans "The image is too large. It should have less than 2MB." %}</li>
  95 + <li class="format" style="display:none">{% trans 'File not supported.' %}</li>
  96 + </ul>
  97 + </div>
  98 + {% endif %}
72 99 {% endfor %}
73 100 <div class="row">
74 101 <div class="col-lg-12 col-md-12 col-sm-12">
... ... @@ -84,3 +111,39 @@
84 111 </form>
85 112 {% include 'users/modal_crop.html' %}
86 113 <script src="{% static 'js/crop.js' %}"></script> <!-- Js for cropper-->
  114 +<script type="text/javascript">
  115 +// check if browser supports drag n drop
  116 +// call initialization file
  117 +if (window.File && window.FileList && window.FileReader) {
  118 + Init();
  119 +}
  120 +
  121 +// initialize
  122 +function Init() {
  123 + var small = $(".file-selector"),
  124 + filedrag = $(".filedrag"),
  125 + common = $(".common-file-input");
  126 +
  127 + // file select
  128 + small.on("change", FileSelectHandler);
  129 +
  130 + // is XHR2 available?
  131 + var xhr = new XMLHttpRequest();
  132 + if (xhr.upload) {
  133 + // file drop
  134 + filedrag.on("drop", FileSelectHandler);
  135 + filedrag.attr('style', 'display:block');
  136 + common.attr('style', 'display:none');
  137 + }
  138 +}
  139 +
  140 +// file selection
  141 +function FileSelectHandler(e) {
  142 + var files = e.target.files || e.dataTransfer.files,
  143 + parent = $(e.target.offsetParent);
  144 + // process all File objects
  145 + for (var i = 0, f; f = files[i]; i++) {
  146 + parent.find('.filedrag').html(f.name);
  147 + }
  148 +}
  149 +</script>
... ...
webconference/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
webpage/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...
youtube_video/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-08-27 21:08-0300\n"
  11 +"POT-Creation-Date: 2017-08-30 22:41-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ...