зеркало из https://github.com/mozilla/CSOL-site.git
Merge pull request #658 from stenington/572-program-cta
Better program detail call to action and bug fixes
This commit is contained in:
Коммит
9bd85e4244
|
@ -53,8 +53,7 @@ function normalizeProgram(program, id) {
|
|||
if (!program.id)
|
||||
program.id = id;
|
||||
|
||||
if (!program.url)
|
||||
program.url = '/explore/' + program.shortname;
|
||||
program.localUrl = '/explore/' + program.shortname;
|
||||
|
||||
return program;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ test('getProgram', function(t) {
|
|||
t.notOk(err, "no error");
|
||||
t.ok(getStub.calledWithMatch('/program/some-id'), 'endpoint');
|
||||
t.similar(data.program, { name: "Program A" }, 'program');
|
||||
t.similar(data.program, { id: 'some-id', url: '/explore/program-a' }, 'normalized');
|
||||
t.similar(data.program, { id: 'some-id', localUrl: '/explore/program-a' }, 'normalized');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
@ -230,7 +230,7 @@ test('getPrograms', function(t) {
|
|||
t.notOk(err, 'no error');
|
||||
t.same(data.programs.length, 3, 'data length');
|
||||
var program = data.programs[0];
|
||||
t.ok(program.id && program.url && program.name, 'looks like normalized program');
|
||||
t.ok(program.id && program.localUrl && program.name, 'looks like normalized program');
|
||||
t.ok(getStub.calledWithMatch('/programs'), 'endpoint');
|
||||
t.end();
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<figure class="thumbnail">
|
||||
<a href="{{ item.url }}"><img src="{{ item.imageUrl | default(item.issuer.imageUrl) }}"></a>
|
||||
<a href="{{ item.localUrl }}"><img src="{{ item.imageUrl | default(item.issuer.imageUrl) }}"></a>
|
||||
<figcaption class="caption">
|
||||
<p>{{ item.name }}</p>
|
||||
{% block item_actions_wrapper %}
|
||||
<p class="text-right">
|
||||
{% block item_actions %}
|
||||
<a href="{{ item.url }}" class="btn">Details</a>
|
||||
<a href="{{ item.localUrl }}" class="btn">Details</a>
|
||||
{% endblock %}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -10,10 +10,22 @@
|
|||
</figure>
|
||||
</div>
|
||||
<div class="span8">
|
||||
<p><strong>From <a href="{{program.url}}">{{program.issuer.name}}</a>.</strong></p>
|
||||
<p><strong>From
|
||||
{% if program.issuer.url %}
|
||||
<a href="{{program.issuer.url}}">{{program.issuer.name}}</a>
|
||||
{% else %}
|
||||
{{program.issuer.name}}
|
||||
{% endif %}
|
||||
.</strong></p>
|
||||
{% if program.description %}
|
||||
<p class="description">{{program.description}}</p>
|
||||
{% if program.phone %} <p class="description">For more information, call {{program.phone}}</p>{% endif %}
|
||||
{% if program.contact %}
|
||||
<p class="description">Email us at <a href="mailto:{{program.contact}}">{{program.contact}}</a> to sign up</p>
|
||||
{% elif program.url %}
|
||||
<p class="description">Check us out at <a href="{{program.url}}">{{program.url}}</a> to learn more</p>
|
||||
{% elif program.phone %}
|
||||
<p class="description">For more information, call {{program.phone}}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<p class="text-right"></p>
|
||||
</div>
|
||||
|
|
Загрузка…
Ссылка в новой задаче