diff options
-rw-r--r-- | .cypress/cypress/integration/responsive.js | 69 | ||||
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | Vagrantfile | 1 | ||||
-rwxr-xr-x | conf/sysvinit.example | 6 | ||||
-rw-r--r-- | templates/email/default/partial.html | 22 |
5 files changed, 98 insertions, 1 deletions
diff --git a/.cypress/cypress/integration/responsive.js b/.cypress/cypress/integration/responsive.js new file mode 100644 index 000000000..6d1601cea --- /dev/null +++ b/.cypress/cypress/integration/responsive.js @@ -0,0 +1,69 @@ +// See https://github.com/cypress-io/cypress/issues/761 - Cypress dies if we +// go straight to the next test with an XHR in progress. So visit a 404 page +// to cancel anything in progress. +Cypress.Commands.add('cleanUpXHR', function() { + cy.visit('/404', { failOnStatusCode: false }); +}); + +describe('Front page responsive design tests', function() { + it('Shows correct things on mobile', function() { + cy.viewport(480, 800); + cy.visit('/'); + cy.get('a#report-cta').should('be.visible'); + }); + + it('Shows correct things on tablet', function() { + cy.viewport(800, 800); + cy.visit('/'); + cy.get('a#report-cta').should('not.be.visible'); + }); + + it('Shows correct things on desktop', function() { + cy.viewport(1024, 800); + cy.visit('/'); + cy.get('a#report-cta').should('not.be.visible'); + }); +}); + +describe('Around page responsive design tests', function() { + it('Shows correct things on mobile', function() { + cy.viewport(480, 800); + cy.visit('/around?pc=BS10+5EE&js=1'); + cy.get('.mobile-map-banner').should('be.visible'); + cy.get('#sub_map_links').should('be.visible'); + cy.get('#map_links_toggle').should('not.be.visible'); + cy.get('#map_box').click(200, 200); + cy.get('#sub_map_links').should('not.be.visible'); + cy.get('#try_again').should('be.visible'); + cy.get('#mob_ok').click(); + cy.cleanUpXHR(); + }); + + it('Shows correct things on tablet', function() { + cy.viewport(800, 800); + cy.visit('/around?pc=BS10+5EE&js=1'); + cy.get('.mobile-map-banner').should('not.be.visible'); + cy.get('#map_sidebar').should('be.visible'); + cy.get('#side-form').should('not.be.visible'); + cy.get('#sub_map_links').should('be.visible'); + cy.get('#map_links_toggle').should('be.visible'); + cy.get('#map_box').click(200, 200); + cy.get('#sub_map_links').should('be.visible'); + cy.get('#side-form').should('be.visible'); + cy.cleanUpXHR(); + }); + + it('Shows correct things on desktop', function() { + cy.viewport(1024, 800); + cy.visit('/around?pc=BS10+5EE&js=1'); + cy.get('.mobile-map-banner').should('not.be.visible'); + cy.get('#map_sidebar').should('be.visible'); + cy.get('#sub_map_links').should('be.visible'); + cy.get('#map_links_toggle').should('be.visible'); + cy.get('#side-form').should('not.be.visible'); + cy.get('#map_box').click(200, 200); + cy.get('#sub_map_links').should('be.visible'); + cy.get('#side-form').should('be.visible'); + cy.cleanUpXHR(); + }); +}); diff --git a/CHANGELOG.md b/CHANGELOG.md index 53a9752c0..24b439127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Speed up fetching lists of bodies. #2248 - Improve vertical alignment of navigation menu in Internet Explorer 9–11. - Mobile menu button no longer uses -9999px text-indent hack. + - HTML email template for confirming "partial" reports #2263 - Bugfixes: - Fix display of area/pins on body page when using Bing or TonerLite map. - Do not scan through all problems to show /_dev pages. diff --git a/Vagrantfile b/Vagrantfile index c8647b270..c2faf4d6a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -27,6 +27,7 @@ $setup = <<-EOS cd fixmystreet git submodule --quiet update --init --recursive --rebase if [ "$BASEBOX" = "mysociety/fixmystreet" ]; then + [ ! -e /home/vagrant/fixmystreet/local ] && mkdir /home/vagrant/fixmystreet/local mount -o bind /usr/share/fixmystreet/local /home/vagrant/fixmystreet/local chown -R vagrant:vagrant /home/vagrant/fixmystreet/local fi diff --git a/conf/sysvinit.example b/conf/sysvinit.example index 3c457dd64..6b47c4371 100755 --- a/conf/sysvinit.example +++ b/conf/sysvinit.example @@ -30,7 +30,11 @@ start_daemon() { } stop_daemon() { - kill -TERM `cat $PIDFILE` + if [ -e "$PIDFILE" ]; then + kill -TERM `cat $PIDFILE` + else + echo "No $PIDFILE found, skipping KILL." + fi } case "$1" in diff --git a/templates/email/default/partial.html b/templates/email/default/partial.html new file mode 100644 index 000000000..494655df9 --- /dev/null +++ b/templates/email/default/partial.html @@ -0,0 +1,22 @@ +[% + +email_summary = "Confirm your report on " _ site_name; +email_columns = 1; + +PROCESS '_email_settings.html'; + +INCLUDE '_email_top.html'; + +%] + +<th style="[% td_style %][% only_column_style %]"> + <h1 style="[% h1_style %]">Confirm your report</h1> + <p style="[% p_style %]">Hello [% report.name || report.email %],</p> + <p style="[% p_style %]">Please click on the link below, to confirm the report you have uploaded to [% site_name %] via [% report.service %], and to check or add any details:</p> + <p style="margin: 20px auto; text-align: center"> + <a style="[% button_style %]" href="[% token_url %]">Check & confirm report</a> + </p> +</th> + +[% INCLUDE '_email_bottom.html' %] + |