diff --git a/app/assets/stylesheets/components/banner.scss b/app/assets/stylesheets/components/banner.scss index 7c2fd2b99..c62bfe2c6 100644 --- a/app/assets/stylesheets/components/banner.scss +++ b/app/assets/stylesheets/components/banner.scss @@ -64,13 +64,18 @@ } +.banner-info, .banner-important { @extend %banner; background: $white; color: $text-colour; background-image: file-url('icon-important-2x.png'); background-size: 34px 34px; - background-position: 0 0; + background-position: 0 0px; background-repeat: no-repeat; padding: 7px 0 5px 50px; } + +.banner-info { + background-image: file-url('icon-information-2x.png'); +} diff --git a/app/main/views/sms.py b/app/main/views/sms.py index a4ae64aa3..42340cbaa 100644 --- a/app/main/views/sms.py +++ b/app/main/views/sms.py @@ -37,11 +37,23 @@ from app.utils import ( @main.route("/services//sms/send", methods=['GET']) def choose_sms_template(service_id): + try: + jobs = job_api_client.get_job(service_id)['data'] + except HTTPError as e: + if e.status_code == 404: + abort(404) + else: + raise e + print("="*80) + print(jobs) + print(len(jobs)) + print(bool(len(jobs))) return render_template( 'views/choose-sms-template.html', templates=[ Template(template) for template in templates_dao.get_service_templates(service_id)['data'] ], + has_jobs=len(jobs), service_id=service_id ) diff --git a/app/templates/views/choose-sms-template.html b/app/templates/views/choose-sms-template.html index 4fb5595e3..221fa781b 100644 --- a/app/templates/views/choose-sms-template.html +++ b/app/templates/views/choose-sms-template.html @@ -14,6 +14,15 @@
{% if templates %} + {% if not has_jobs %} + {{ banner( + """ + Send yourself a test message + """, + subhead='Next step', + type="tip" + )}} + {% endif %}
{% for template in templates %}
diff --git a/app/templates/views/send-sms.html b/app/templates/views/send-sms.html index 7e44bad16..c8a91388d 100644 --- a/app/templates/views/send-sms.html +++ b/app/templates/views/send-sms.html @@ -14,14 +14,21 @@
+ {{ sms_message(template.formatted_as_markup) }} + + {{ banner( + 'You can upload real data, but we’ll only send to your mobile number until you request to go live'|safe, + 'info' + )}} +
+ {{file_upload(form.file, button_text='Upload a CSV file')}} +

Download an example CSV file

- {{file_upload(form.file, button_text='Upload a CSV file')}} - {% endblock %} diff --git a/app/templates/views/service_dashboard.html b/app/templates/views/service_dashboard.html index e0b5527a5..045a90695 100644 --- a/app/templates/views/service_dashboard.html +++ b/app/templates/views/service_dashboard.html @@ -23,11 +23,33 @@ - {% if not jobs %} + {% if not template_count and not jobs %} {{ banner( - 'Send yourself a text message', + """ +
    +
  1. + Add a template +
  2. +
  3. + Send yourself a text message +
  4. +
+ """.format( + url_for(".add_service_template", service_id=service_id), + url_for(".choose_sms_template", service_id=service_id) + )|safe, subhead='Get started', - type='tip' + type="tip" + )}} + {% elif not jobs %} + {{ banner( + """ + Send yourself a text message + """.format( + url_for(".choose_sms_template", service_id=service_id) + )|safe, + subhead='Next step', + type="tip" )}} {% else %} {% call(item) list_table( diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 006e1505a..030c5eeb7 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -31,6 +31,9 @@ gulp.task('copy:govuk_template:template', () => gulp.src(paths.template + 'views gulp.task('copy:govuk_template:css', () => gulp.src(paths.template + 'assets/stylesheets/**/*.css') .pipe(plugins.sass({outputStyle: 'compressed'})) + .pipe(plugins.cssUrlAdjuster({ + prependRelative: '/static/', + })) .pipe(gulp.dest(paths.dist + 'stylesheets/')) ); @@ -39,6 +42,10 @@ gulp.task('copy:govuk_template:js', () => gulp.src(paths.template + 'assets/java .pipe(gulp.dest(paths.dist + 'javascripts/')) ); +gulp.task('copy:govuk_template:images', () => gulp.src(paths.template + 'assets/stylesheets/images/**/*') + .pipe(gulp.dest(paths.dist + 'images/')) +); + gulp.task('javascripts', () => gulp .src([ paths.toolkit + 'javascripts/govuk/modules.js', @@ -117,6 +124,7 @@ gulp.task('lint', gulp.task('default', [ 'copy:govuk_template:template', + 'copy:govuk_template:images', 'copy:govuk_template:css', 'copy:govuk_template:js', 'javascripts', diff --git a/package.json b/package.json index fdc1d7edf..267f7d7a7 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "query-command-supported": "1.0.0" }, "devDependencies": { + "gulp-css-url-adjuster": "0.2.3", "gulp-jshint": "2.0.0", "gulp-sass-lint": "1.1.1", "jshint": "2.9.1", diff --git a/tests/app/main/views/test_sms.py b/tests/app/main/views/test_sms.py index 0c50631dc..6f9656e25 100644 --- a/tests/app/main/views/test_sms.py +++ b/tests/app/main/views/test_sms.py @@ -9,7 +9,8 @@ def test_choose_sms_template(app_, mock_login, mock_get_user, mock_check_verify_code, - mock_get_service_templates): + mock_get_service_templates, + mock_get_jobs): with app_.test_request_context(): with app_.test_client() as client: client.login(api_user_active)