Commit 77b0d605 authored by Regis's avatar Regis

count passing through - last page known

parent c249fb2e
......@@ -18,12 +18,12 @@
const project = document.querySelector('.pipelines');
Vue.use(VueResource);
// Vue.config.silent = true;
return new Vue({
el: '.vue-pipelines-index',
data: {
scope: project.dataset.projectId,
count: project.dataset.count,
store: new gl.PipelineStore(),
},
components: {
......@@ -31,7 +31,12 @@
},
template: `
<div>
<vue-pipelines :scope='scope' :store='store'></vue-pipelines>
<vue-pipelines
:scope='scope'
:store='store'
:count='count'
>
</vue-pipelines>
</div>
`,
});
......
......@@ -23,6 +23,7 @@
props: [
'scope',
'store',
'count',
],
created() {
const url = window.location.toString();
......@@ -78,6 +79,7 @@
<vue-gl-pagination
:changepage='changepage'
:pages='pipelines.length'
:count='count'
>
</vue-gl-pagination>
</div>
......
......@@ -6,7 +6,14 @@
props: [
'changepage',
'pages',
'count',
],
computed: {
lastpage() {
const lastPage = Math.ceil(+this.count / 5);
return `pipelines?page=${lastPage}`;
},
},
template: `
<div class="gl-pagination">
<ul class="pagination clearfix">
......@@ -45,7 +52,7 @@
</a>
</li>
<li class="last">
<a href="pipelines?page=936">Last »</a>
<a :href='lastpage'>Last »</a>
</li>
</ul>
</div>
......
......@@ -36,7 +36,7 @@
= link_to ci_lint_path, class: 'btn btn-default' do
%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
- if @pipelines.blank?
%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