diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/around.html | 1 | ||||
-rw-r--r-- | templates/details_extra.html | 6 | ||||
-rw-r--r-- | templates/existing.html | 4 | ||||
-rw-r--r-- | templates/login.html | 16 | ||||
-rw-r--r-- | templates/offline.html | 35 | ||||
-rw-r--r-- | templates/photo.html | 64 | ||||
-rw-r--r-- | templates/reports.html | 2 | ||||
-rw-r--r-- | templates/strings.js | 5 | ||||
-rw-r--r-- | templates/submit_confirm.html | 2 | ||||
-rw-r--r-- | templates/submit_set_password.html | 2 |
10 files changed, 70 insertions, 67 deletions
diff --git a/templates/around.html b/templates/around.html index 6419d6c..d5ff4f3 100644 --- a/templates/around.html +++ b/templates/around.html @@ -33,6 +33,7 @@ <% } %> </form> <a data-role="none" id="relocate" class="nodisplay"></a> + <a data-role="none" id="hidepins" class="nodisplay"></a> <div class="nodisplay" id="front-howto"></div> </div> diff --git a/templates/details_extra.html b/templates/details_extra.html index 6ef02b3..22d18b2 100644 --- a/templates/details_extra.html +++ b/templates/details_extra.html @@ -1,7 +1,11 @@ <div data-role="header" data-position="fixed"> <a data-rel="back" data-icon="arrow-l" class="ui-btn-left">[% loc('Back') %]</a> <h1>[% loc('Further Details') %]</h1> - <a id="next" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Next') %]</a> + <% if (CONFIG.SKIP_CONFIRM_REPORT) { %> + <a id="next" class="ui-btn-right">[% loc('Submit') %]</a> + <% } else { %> + <a id="next" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Next') %]</a> + <% } %> </div> <div data-role="content" data-enhance="false"> <%= category_extras %> diff --git a/templates/existing.html b/templates/existing.html index 1c326b8..ef9effb 100644 --- a/templates/existing.html +++ b/templates/existing.html @@ -17,8 +17,8 @@ <p><% print( moment( created ).fromNow() ) %></p> </div> - <% if ( file ) { %> - <div class="photo" style="background-image: url(<%= file %>)"></div> + <% if ( files.length > 0 ) { %> + <div class="photo" style="background-image: url(<%= files[0] %>)"></div> <% } %> <% if ( details ) { %> diff --git a/templates/login.html b/templates/login.html index 43e93d9..0cc7c51 100644 --- a/templates/login.html +++ b/templates/login.html @@ -12,13 +12,9 @@ <input type="button" id="logout" name="logout" value="[% loc('Sign Out') %]" data-theme="a"> </div> </div> - <div id="password_row" class="nodisplay"> - <p class="notopmargin"> - [% loc('Signed out!') %] - </p> <% } else { %> <div id="password_row"> - <% } %> + <p class="notopmargin">[% loc('You are not signed in.') %]</p> <form name="signinForm" class="inputcard" id="signinForm"> <div> <input data-role="none" type="email" value="" name="email" id="form_email" placeholder="[% loc('Your Email') %]" required> @@ -31,13 +27,5 @@ </div> </form> </div> - <div id="success_row" class="nodisplay"> - <p class="notopmargin"> - [% loc('Signed in!') %] - </p> - <div id="err" class="nodisplay"></div> - <div class="bottom-btn"> - <input type="button" id="logout" name="logout" value="[% loc('Sign Out') %]" data-theme="a"> - </div> - </div> + <% } %> </div> diff --git a/templates/offline.html b/templates/offline.html index 432fb09..214170e 100644 --- a/templates/offline.html +++ b/templates/offline.html @@ -1,7 +1,7 @@ <div data-role="header" data-position="fixed"> <a id="offline-prev-btn" class="ui-btn-left">[% loc('Try Again') %]</a> <h1>[% loc('Offline') %]</h1> - <a id="offline-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Skip') %]</a> + <a id="offline-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right"><%= files.length == 0 ? "[% loc('Skip') %]" : "[% loc('Next') %]" %></a> </div> <div id="locating" class="nodisplay"> <div class="radar"></div> @@ -42,30 +42,25 @@ </div> <div> - <textarea data-role="none" rows="7" cols="26" name="detail" id="form_detail" placeholder="Please fill in details of the problem." required><%= details %></textarea> + <textarea data-role="none" rows="2" cols="26" name="detail" id="form_detail" placeholder="Please fill in details of the problem." required><%= details %></textarea> </div> </div> - <% if ( file != '' ) { %> - <div id="add_photo" style="display: none"> - <% } else { %> - <div id="add_photo"> + <% if ( files.length < CONFIG.MAX_PHOTOS ) { %> + <div id="add_photo"> + <input data-icon="fms-photo-new" value="[% loc('Take a new photo') %]" type="button" name="photo_button" id="id_photo_button" data-role="button" data-theme="a"> + <input data-icon="fms-photo-existing" value="[% loc('Add an existing photo') %]" type="button" name="existing" id="id_existing" data-role="button" data-theme="c"> + </div> <% } %> - <label>[% loc('Add a Photo ') %]<em>[% loc('(optional)') %]</em></label> - <input data-icon="fms-photo-new" value="[% loc('Take a new photo') %]" type="button" name="photo_button" id="id_photo_button" data-role="button" data-theme="a"> - <input data-icon="fms-photo-existing" value="[% loc('Add an existing photo') %]" type="button" name="existing" id="id_existing" data-role="button" data-theme="c"> - </div> - <% if ( file == '' ) { %> - <div id="display_photo" style="display: none"> - <% } else { %> - <div id="display_photo"> - <% } %> - <label>[% loc('Your Photo') %]</label> - <div class="photo"> - <img class="small" id="photo" src="<%= file %>" /> + <% if ( files.length > 0 ) { %> + <div class="photo-wrapper"> + <% _.each(files, function(file, index) { %> + <div class="photo" style="background-image: url('<%= file %>');"> + <a data-role="none" class="photo-corner-button del_photo_button" data-file-index="<%= index %>">X</a> + </div> + <% }); %> </div> - <input value="[% loc('Remove Photo') %]" type="button" name="del_photo_button" id="id_del_photo_button" data-role="button" data-theme="a"> - </div> + <% } %> </div> </div> diff --git a/templates/photo.html b/templates/photo.html index 286dac3..0646b4a 100644 --- a/templates/photo.html +++ b/templates/photo.html @@ -1,37 +1,49 @@ <div data-role="header"> <a data-rel="back" data-icon="arrow-l" class="ui-btn-left">[% loc('Back') %]</a> - <h1>[% loc('Add Photo') %]</h1> - <% if ( file == '' ) { %> - <a id="photo-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Skip') %]</a> + <h1>[% loc('Add Photos') %]</h1> + <% if ( files.length == 0 ) { %> + <% if ( !CONFIG.PHOTO_REQUIRED ) { %> + <a id="photo-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Skip') %]</a> + <% } %> <% } else { %> <a id="photo-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Next') %]</a> <% } %> </div> + <div data-role="content"> - <% var photoClass = 'nodisplay', nophotoClass = 'nodisplay'; - if ( file != '' ) { - photoClass = ''; - } else { - nophotoClass = ''; - } %> - <h2 id="nophoto_title" class="<% print( nophotoClass ); %>"> - [% loc('Add a Photo') %] <em>[% loc('(optional)') %]</em> - </h2> - <h2 id="photo_title" class="<% print( photoClass ); %>"> - [% loc('Photo for report') %] - </h2> - <div class="photo-wrapper"> - <div class="photo"> - <% if ( file == '' ) { %> - <img class="placeholder" src="images/placeholder-photo.png" alt="" id="photo"> + <% if ( files.length == 0 ) { %> + <h2 id="nophoto_title"> + [% loc('Add a Photo') %] + <% if ( !CONFIG.PHOTO_REQUIRED ) { %> + <em>[% loc('(optional)') %]</em> + <% } else if ( files.length == 0) { %> + <em>[% loc('(required)') %]</em> + <%} %> + </h2> <% } else { %> - <img class="small" id="photo" src="<%= file %>" /> + <h2 id="photo_title"> + [% loc('Photos for report') %] + </h2> <% } %> - <a data-role="none" id="id_del_photo_button" class="photo-corner-button">X</a> - </div> - </div> - <div class="bottom-btn"> - <input data-icon="fms-photo-existing" type="button" id="id_existing" data-theme="c" value="[% loc('Add an existing photo') %]" > - <input data-icon="fms-photo-new" id="id_photo_button" type="button" data-theme="a" value="[% loc('Take a new photo') %]"> + + <div class="photo-wrapper"> + <% if ( files.length == 0 ) { %> + <div class="photo"> + <img class="placeholder" src="images/placeholder-photo.png" alt=""> + </div> + <% } else { %> + <% _.each(files, function(file, index) { %> + <div class="photo" style="background-image: url('<%= file %>');"> + <a data-role="none" class="photo-corner-button del_photo_button" data-file-index="<%= index %>">X</a> + </div> + <% });%> + <% } %> </div> + + <% if ( files.length < CONFIG.MAX_PHOTOS ) { %> + <div class="bottom-btn"> + <input data-icon="fms-photo-existing" type="button" id="id_existing" data-theme="c" value="[% loc('Add an existing photo') %]" > + <input data-icon="fms-photo-new" id="id_photo_button" type="button" data-theme="a" value="[% loc('Take a new photo') %]"> + </div> + <% } %> </div> diff --git a/templates/reports.html b/templates/reports.html index e70dd3d..a08ffc6 100644 --- a/templates/reports.html +++ b/templates/reports.html @@ -15,7 +15,7 @@ if ( draft.get('lat') ) { classes.push('with_location'); } - if ( draft.get('file') ) { + if ( draft.get('files').length > 0 ) { classes.push('with_photo'); } var draftClass = ''; diff --git a/templates/strings.js b/templates/strings.js index 55f68d4..b7b2388 100644 --- a/templates/strings.js +++ b/templates/strings.js @@ -17,7 +17,10 @@ required: '[% loc('Please enter your email') %]', email: '[% loc('Please enter a valid email') %]' }, - password: '[% loc('Please enter a password') %]' + password: { + required: '[% loc('Please enter a password') %]', + short: '[% loc('Please enter a password at least %d characters long') %]' + } }, strings: { next: '[% loc('Next') %]', diff --git a/templates/submit_confirm.html b/templates/submit_confirm.html index bca55fc..1d3e862 100644 --- a/templates/submit_confirm.html +++ b/templates/submit_confirm.html @@ -3,7 +3,7 @@ <h1>[% loc('Your details') %]</h1> </div> -<div data-role="content"> +<div data-role="content"<% if (CONFIG.SKIP_CONFIRM_REPORT) { %> class="hidden"<% } %>> <p class="notopmargin"> [% tprintf(loc('You are logged in as %s'), '<%= user.email %>') %]. </p> diff --git a/templates/submit_set_password.html b/templates/submit_set_password.html index ee681cc..ef06040 100644 --- a/templates/submit_set_password.html +++ b/templates/submit_set_password.html @@ -12,7 +12,7 @@ </p> <div class="inputcard"> <div> - <input data-role="none" type="password" value="" name="password" id="form_password" placeholder="[% loc('Your password') %]" required> + <input data-role="none" type="password" value="<%= FMS.currentUser.get('password') %>" name="password" id="form_password" placeholder="[% loc('Your password') %]" required> </div> </div> <div class="noborder"> |