Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f3134c2a
Commit
f3134c2a
authored
Mar 30, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose todos_per_page variable
parent
5c81fc43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/assets/javascripts/todos.js.coffee
app/assets/javascripts/todos.js.coffee
+2
-3
app/controllers/dashboard/todos_controller.rb
app/controllers/dashboard/todos_controller.rb
+1
-0
No files found.
app/assets/javascripts/todos.js.coffee
View file @
f3134c2a
class
@
Todos
PER_PAGE
=
20
constructor
:
(
@
name
)
->
@
todos_per_page
=
gon
.
todos_per_page
||
20
@
clearListeners
()
@
initBtnListeners
()
...
...
@@ -70,7 +69,7 @@ class @Todos
currPages
=
@
getRenderedPages
()
currPage
=
@
getCurrentPage
()
newPages
=
Math
.
ceil
(
total
/
PER_PAGE
)
newPages
=
Math
.
ceil
(
total
/
@
todos_per_page
)
url
=
location
.
href
# Includes query strings
# Refresh if no remaining Todos
...
...
app/controllers/dashboard/todos_controller.rb
View file @
f3134c2a
...
...
@@ -2,6 +2,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
before_action
:find_todos
,
only:
[
:index
,
:destroy
,
:destroy_all
]
def
index
gon
.
todos_per_page
=
Todo
.
default_per_page
@todos
=
@todos
.
page
(
params
[
:page
])
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment