Merge pull request #191 from alphagov/last-minute-fixes

Last minute fixes
This commit is contained in:
Chris Hill-Scott
2016-02-23 11:54:04 +00:00
8 changed files with 72 additions and 7 deletions

View File

@@ -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');
}

View File

@@ -37,11 +37,23 @@ from app.utils import (
@main.route("/services/<service_id>/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
)

View File

@@ -14,6 +14,15 @@
<form method="POST" enctype="multipart/form-data">
{% if templates %}
{% if not has_jobs %}
{{ banner(
"""
Send yourself a test message
""",
subhead='Next step',
type="tip"
)}}
{% endif %}
<div class="grid-row">
{% for template in templates %}
<div class="column-two-thirds">

View File

@@ -14,14 +14,21 @@
<div class="grid-row">
<div class="column-two-thirds">
{{ sms_message(template.formatted_as_markup) }}
{{ banner(
'You can upload real data, but well only send to your mobile number until you <a href="{}">request to go live</a>'|safe,
'info'
)}}
</div>
</div>
{{file_upload(form.file, button_text='Upload a CSV file')}}
<p>
<a href="{{ url_for('.get_example_csv', service_id=service_id, template_id=template.id) }}">Download an example CSV file</a>
</p>
{{file_upload(form.file, button_text='Upload a CSV file')}}
{% endblock %}

View File

@@ -23,11 +23,33 @@
</li>
</ul>
{% if not jobs %}
{% if not template_count and not jobs %}
{{ banner(
'Send yourself a text message',
"""
<ol>
<li>
<a href='{}'>Add a template</a>
</li>
<li>
<a href='{}'>Send yourself a text message</a>
</li>
</ol>
""".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(
"""
<a href='{}'>Send yourself a text message</a>
""".format(
url_for(".choose_sms_template", service_id=service_id)
)|safe,
subhead='Next step',
type="tip"
)}}
{% else %}
{% call(item) list_table(

View File

@@ -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',

View File

@@ -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",

View File

@@ -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)