Make sure that repo has a slug when creating a link to repo
Raw repo data is sometimes passed to linkTo helpers and in such case Repo instance is created by id and it does not include slug. This commit will be reverted after fixing "incomplete" implementation, which will allow to preload Repo with both id and slug before searching for it.
This commit is contained in:
parent
86670def14
commit
42ed7cf4de
|
@ -24,7 +24,7 @@
|
|||
<td class="number">
|
||||
<span class="status"></span>
|
||||
{{#if job.id}}
|
||||
{{#if job.repo}}
|
||||
{{#if job.repo.slug}}
|
||||
{{#linkTo "job" repo job}}{{number}}{{/linkTo}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
<dd class="number">
|
||||
<span class="status"></span>
|
||||
{{#if job.id}}
|
||||
{{#linkTo job repo job}}{{job.number}}{{/linkTo}}
|
||||
{{#if job.repo.slug}}
|
||||
{{#linkTo job repo job}}{{job.number}}{{/linkTo}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</dd>
|
||||
<dt>{{t jobs.state}}</dt>
|
||||
|
|
|
@ -9,10 +9,14 @@
|
|||
{{#with view.repo}}
|
||||
<div class="slug-and-status">
|
||||
<span class="status"></span>
|
||||
{{#linkTo repo this class="slug"}}{{slug}}{{/linkTo}}
|
||||
{{#if slug}}
|
||||
{{#linkTo repo this class="slug"}}{{slug}}{{/linkTo}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#with lastBuildHash}}
|
||||
{{#linkTo build repo id class="last_build"}}{{number}}{{/linkTo}}
|
||||
{{#if repo.slug}}
|
||||
{{#linkTo build repo id class="last_build"}}{{number}}{{/linkTo}}
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
|
||||
<p class="summary">
|
||||
|
|
Loading…
Reference in New Issue
Block a user