Skip to content

Commit

Permalink
Merged with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyu95 committed Apr 19, 2018
2 parents f7b197c + 077ecc2 commit 40a0264
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 104 deletions.
8 changes: 8 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,14 @@ def agencies_for_forms(self):
def name(self):
return ' '.join((self.first_name.title(), self.last_name.title()))

@property
def formatted_point_of_contact_number(self):
if self.phone_number:
formatted_phone_number = self.phone_number
formatted_phone_number = formatted_phone_number.strip('(')
formatted_phone_number = formatted_phone_number.replace(') ', '-')
return formatted_phone_number

def es_update(self):
"""
Call es_update for any request where this user is the requester
Expand Down
6 changes: 3 additions & 3 deletions app/static/js/request/view-request-responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,16 +364,16 @@ $(function () {
first.find('.note-content').attr("data-parsley-required", "");

// Apply parsley max length validation to note content
first.find('.note-content').attr("data-parsley-maxlength", "500");
first.find('.note-content').attr("data-parsley-maxlength", "5000");

// Apply custom validation messages
first.find('.note-content').attr("data-parsley-required-message",
"Note content must be provided");
first.find('.note-content').attr("data-parsley-maxlength-message",
"Note content must be less than 500 characters");
"Note content must be less than 5000 characters");

$(first.find(".note-content")).keyup(function () {
characterCounter(first.find(".note-content-character-count"), 500, $(this).val().length)
characterCounter(first.find(".note-content-character-count"), 5000, $(this).val().length)
});

break;
Expand Down
5 changes: 3 additions & 2 deletions app/templates/latex/0056/no10_envelope.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{seqsplit}
\usepackage{hyphenat}
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
\setlength\parskip{0pt}
Expand All @@ -14,9 +15,9 @@
\large \VAR{request_id}\par
\vspace*{.5in}

\begin{changemargin}{3.5in}{.25in}
\begin{changemargin}{3.5in}{1in}
\large \VAR{recipient_name}\par
\large \seqsplit{\VAR{company_name}}\par
\large \nohyphens{\VAR{organization}}\par
\large \VAR{street_address}\par
\large \VAR{city} \VAR{state} \ \VAR{zipcode}
\end{changemargin}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/letters/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
{{ request.requester.mailing_address['city'] or '' }}, {{ request.requester.mailing_address['state'] or '' }}, {{ request.requester.mailing_address['zip'] or '' }}<br/>
</div>
<div style="text-align: left; float: right;">
<span class="mceNonEditable">{{ moment(date).format('dddd, MMMM D, YYYY') }}<br/></span>
<span class="mceNonEditable">{{ moment(date).format('MMMM D, YYYY') }}<br/></span>
<span class="mceNonEditable"><br/></span>
<span class="mceNonEditable">FOIL Request #: {{ request_id }}</span>
<span class="mceNonEditable"><br/></span>
<span class="mceNonEditable">Your File #:</span>&nbsp;&nbsp;<span class="mceNonEditable">&nbsp;</span>
<span class="mceNonEditable">Your File #:&nbsp;<span class="mceEditable"></span></span>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/templates/request/responses/modal_body/notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<div class="note-error-messages alert alert-danger" hidden></div>
{% if edit_response_permission %}
<textarea class="input-block-level form-group note-content"
title="content" name="content" maxlength="500">{{ response.content }}</textarea>
title="content" name="content" maxlength="5000">{{ response.content }}</textarea>
<h5 class="required note-content-character-count">
500 characters remaining
5000 characters remaining
</h5>
{% else %}
{{ response.content }}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/response/add_note.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<div class="note-divs form-group" id="note-first">
<label class="note-label">Note Content</label>
<textarea class="input-block-level form-group" id="note-content" name="content"
maxlength="500"></textarea>
<h5 id="note-content-character-count">500 characters remaining</h5>
maxlength="5000"></textarea>
<h5 id="note-content-character-count">5000 characters remaining</h5>
{% if current_user.is_agency %}
{% if permissions['edit_note_privacy'] %}
<div class="radio">
Expand Down
6 changes: 3 additions & 3 deletions app/templates/response/add_note.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
$('#note-content').attr('data-parsley-required', '');

// Apply parsley max length validation to note title and url
$('#note-content').attr('data-parsley-maxlength', '500');
$('#note-content').attr('data-parsley-maxlength', '5000');

// Apply custom validation messages
$('#note-content').attr('data-parsley-required-message', 'Note content must be provided');
$('#note-content').attr('data-parsley-maxlength-message', 'Note content must be less than 500 characters');
$('#note-content').attr('data-parsley-maxlength-message', 'Note content must be less than 5000 characters');

// Set character counter for note content
$("#note-content").keyup(function () {
characterCounter("#note-content-character-count", 500, $(this).val().length)
characterCounter("#note-content-character-count", 5000, $(this).val().length)
});
});
</script>
6 changes: 3 additions & 3 deletions app/templates/response/generate_envelope.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form id="generate-envelope" action="/response/envelope" method="POST">
<form id="generate-envelope" action="/response/envelope" method="POST" data-parsley-validate>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="request_id" value="{{ request.id }}"/>

Expand Down Expand Up @@ -29,7 +29,7 @@
</div>
<div class="form-group">
{{ generate_envelope_form.address_one.label }}<br>
{{ generate_envelope_form.address_one(id="generate-envelope-first-address-one", class="disable-enter-submit form-control") | safe }}
{{ generate_envelope_form.address_one(id="generate-envelope-address-one", class="disable-enter-submit form-control") | safe }}
</div>
<div class="form-group">
{{ generate_envelope_form.address_two.label }}<br>
Expand All @@ -48,7 +48,7 @@
{{ generate_envelope_form.zipcode(id="generate-envelope-zipcode", class="disable-enter-submit form-control") | safe }}
</div>

<button type="submit" class="submit pull-right btn btn-success">Submit</button>
<button type="submit" id="generate-envelope-submit" class="submit pull-right btn btn-success">Submit</button>
</fieldset>
</div>
</form>
9 changes: 4 additions & 5 deletions app/templates/response/generate_envelope.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
"use strict";

$(function () {

var form = $("#generate-envelope");

var first_name = form.find("#generate-envelope-recipient-name");
var recipient_name = form.find("#generate-envelope-recipient-name");
var address_one = form.find("#generate-envelope-address-one");
var city = form.find("#generate-envelope-city");
var state = form.find("#generate-envelope-state");
var zipcode = form.find("#generate-envelope-zip");
var zipcode = form.find("#generate-envelope-zipcode");
var submit = form.find("#generate-envelope-submit");

// Parsley
first_name.attr("data-parsley-required", "");
last_name.attr("data-parsley-required", "");
recipient_name.attr("data-parsley-required", "");
address_one.attr("data-parsley-required", "");
city.attr("data-parsley-required", "");
state.attr("data-parsley-required", "");
Expand Down
Loading

0 comments on commit 40a0264

Please sign in to comment.