diff --git a/amadeus/static/js/crop_news.js b/amadeus/static/js/crop_news.js index 14f3d96..2d7117a 100644 --- a/amadeus/static/js/crop_news.js +++ b/amadeus/static/js/crop_news.js @@ -1,7 +1,7 @@ $(function () { /* Script para abrir o modal com a imagem selecionada */ $("#id_image").change(function () { - var max_size = 2*1024*1024; + var max_size = 5*1024*1024; var submit_btn = $("#news-form").find("input[type='submit']"); var mimeTypes = $(this).data('mimetypes'); var errors = 0; @@ -21,7 +21,7 @@ $(function () { $(".size").show(); errors++; - } + } if (!mimeTypes.includes(this.files[0].type)) { $(submit_btn).prop('disable', true); @@ -30,8 +30,8 @@ $(function () { $(".client-file-errors").show(); $(".format").show(); - errors++; - } + errors++; + } if (errors == 0) { var reader = new FileReader(); @@ -51,7 +51,7 @@ $(function () { $("#modalCrop").on("shown.bs.modal", function () { $image.cropper({ viewMode: 1 , - aspectRatio: 24/5, + aspectRatio: 3/1, minCropBoxWidth: 200, minCropBoxHeight: 200, dragMode: 'move', diff --git a/news/forms.py b/news/forms.py index 02ded06..a07eb5a 100644 --- a/news/forms.py +++ b/news/forms.py @@ -31,7 +31,7 @@ class NewsForm(forms.ModelForm): image = Image.open(self.instance.image) if not x is None: cropped_image = image.crop((x, y, w+x, h+y)) - resized_image = cropped_image.resize((1200, 250), Image.ANTIALIAS) + resized_image = cropped_image.resize((1200, 400), Image.ANTIALIAS) folder_path = join(settings.MEDIA_ROOT, 'news') #check if the folder already exists diff --git a/news/templates/news/view.html b/news/templates/news/view.html index b8f3703..c92fc9a 100644 --- a/news/templates/news/view.html +++ b/news/templates/news/view.html @@ -29,9 +29,16 @@
{{new.creator}}, em {{new.create_date}}