Commit 77b0d605 authored by Regis's avatar Regis

count passing through - last page known

parent c249fb2e
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
const project = document.querySelector('.pipelines'); const project = document.querySelector('.pipelines');
Vue.use(VueResource); Vue.use(VueResource);
// Vue.config.silent = true;
return new Vue({ return new Vue({
el: '.vue-pipelines-index', el: '.vue-pipelines-index',
data: { data: {
scope: project.dataset.projectId, scope: project.dataset.projectId,
count: project.dataset.count,
store: new gl.PipelineStore(), store: new gl.PipelineStore(),
}, },
components: { components: {
...@@ -31,7 +31,12 @@ ...@@ -31,7 +31,12 @@
}, },
template: ` template: `
<div> <div>
<vue-pipelines :scope='scope' :store='store'></vue-pipelines> <vue-pipelines
:scope='scope'
:store='store'
:count='count'
>
</vue-pipelines>
</div> </div>
`, `,
}); });
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
props: [ props: [
'scope', 'scope',
'store', 'store',
'count',
], ],
created() { created() {
const url = window.location.toString(); const url = window.location.toString();
...@@ -78,6 +79,7 @@ ...@@ -78,6 +79,7 @@
<vue-gl-pagination <vue-gl-pagination
:changepage='changepage' :changepage='changepage'
:pages='pipelines.length' :pages='pipelines.length'
:count='count'
> >
</vue-gl-pagination> </vue-gl-pagination>
</div> </div>
......
...@@ -6,7 +6,14 @@ ...@@ -6,7 +6,14 @@
props: [ props: [
'changepage', 'changepage',
'pages', 'pages',
'count',
], ],
computed: {
lastpage() {
const lastPage = Math.ceil(+this.count / 5);
return `pipelines?page=${lastPage}`;
},
},
template: ` template: `
<div class="gl-pagination"> <div class="gl-pagination">
<ul class="pagination clearfix"> <ul class="pagination clearfix">
...@@ -45,7 +52,7 @@ ...@@ -45,7 +52,7 @@
</a> </a>
</li> </li>
<li class="last"> <li class="last">
<a href="pipelines?page=936">Last »</a> <a :href='lastpage'>Last »</a>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
= link_to ci_lint_path, class: 'btn btn-default' do = link_to ci_lint_path, class: 'btn btn-default' do
%span CI Lint %span CI Lint
%div.content-list.pipelines{"data-project-id": "#{@project.id}"} %div.content-list.pipelines{"data-project-id": "#{@project.id}", "data-count": "#{@pipelines_count}"}
- stages = @pipelines.stages - stages = @pipelines.stages
- if @pipelines.blank? - if @pipelines.blank?
%div %div
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment