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
2ed56ce9
Commit
2ed56ce9
authored
Apr 14, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'speed_up_wiki_pages' into 'master'
Speed up wiki pages page
parents
1b60913e
87248267
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/controllers/projects/wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+1
-1
app/models/wiki_page.rb
app/models/wiki_page.rb
+6
-4
app/views/projects/wikis/pages.html.haml
app/views/projects/wikis/pages.html.haml
+1
-0
No files found.
app/controllers/projects/wikis_controller.rb
View file @
2ed56ce9
...
@@ -7,7 +7,7 @@ class Projects::WikisController < Projects::ApplicationController
...
@@ -7,7 +7,7 @@ class Projects::WikisController < Projects::ApplicationController
before_filter
:load_project_wiki
before_filter
:load_project_wiki
def
pages
def
pages
@wiki_pages
=
@project_wiki
.
pages
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
]).
per
(
30
)
end
end
def
show
def
show
...
...
app/models/wiki_page.rb
View file @
2ed56ce9
...
@@ -61,12 +61,16 @@ class WikiPage
...
@@ -61,12 +61,16 @@ class WikiPage
# The raw content of this page.
# The raw content of this page.
def
content
def
content
@attributes
[
:content
]
@attributes
[
:content
]
||=
if
@page
@page
.
raw_data
end
end
end
# The processed/formatted content of this page.
# The processed/formatted content of this page.
def
formatted_content
def
formatted_content
@attributes
[
:formatted_content
]
@attributes
[
:formatted_content
]
||=
if
@page
@page
.
formatted_data
end
end
end
# The markup format for the page.
# The markup format for the page.
...
@@ -167,8 +171,6 @@ class WikiPage
...
@@ -167,8 +171,6 @@ class WikiPage
def
set_attributes
def
set_attributes
attributes
[
:slug
]
=
@page
.
escaped_url_path
attributes
[
:slug
]
=
@page
.
escaped_url_path
attributes
[
:title
]
=
@page
.
title
attributes
[
:title
]
=
@page
.
title
attributes
[
:content
]
=
@page
.
raw_data
attributes
[
:formatted_content
]
=
@page
.
formatted_data
attributes
[
:format
]
=
@page
.
format
attributes
[
:format
]
=
@page
.
format
end
end
...
...
app/views/projects/wikis/pages.html.haml
View file @
2ed56ce9
...
@@ -9,3 +9,4 @@
...
@@ -9,3 +9,4 @@
%small
(
#{
wiki_page
.
format
}
)
%small
(
#{
wiki_page
.
format
}
)
.pull-right
.pull-right
%small
Last edited
#{
time_ago_with_tooltip
(
wiki_page
.
commit
.
created_at
)
}
%small
Last edited
#{
time_ago_with_tooltip
(
wiki_page
.
commit
.
created_at
)
}
=
paginate
@wiki_pages
,
theme:
'gitlab'
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