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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
997a317b
Commit
997a317b
authored
Feb 07, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set of small improvements to wiki frontend
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
6a7f2b99
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
64 additions
and
54 deletions
+64
-54
app/assets/javascripts/wikis.js.coffee
app/assets/javascripts/wikis.js.coffee
+2
-1
app/assets/stylesheets/framework/nav.scss
app/assets/stylesheets/framework/nav.scss
+11
-2
app/assets/stylesheets/pages/wiki.scss
app/assets/stylesheets/pages/wiki.scss
+0
-5
app/views/projects/wikis/_main_links.html.haml
app/views/projects/wikis/_main_links.html.haml
+11
-12
app/views/projects/wikis/_nav.html.haml
app/views/projects/wikis/_nav.html.haml
+1
-1
app/views/projects/wikis/_new.html.haml
app/views/projects/wikis/_new.html.haml
+7
-6
app/views/projects/wikis/edit.html.haml
app/views/projects/wikis/edit.html.haml
+13
-9
app/views/projects/wikis/history.html.haml
app/views/projects/wikis/history.html.haml
+8
-5
app/views/projects/wikis/pages.html.haml
app/views/projects/wikis/pages.html.haml
+5
-8
app/views/projects/wikis/show.html.haml
app/views/projects/wikis/show.html.haml
+6
-5
No files found.
app/assets/javascripts/wikis.js.coffee
View file @
997a317b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
class
@
Wikis
class
@
Wikis
constructor
:
->
constructor
:
->
$
(
'.
build-new-wiki'
).
bind
'click
'
,
(
e
)
=>
$
(
'.
new-wiki-page'
).
on
'submit
'
,
(
e
)
=>
$
(
'[data-error~=slug]'
).
addClass
(
'hidden'
)
$
(
'[data-error~=slug]'
).
addClass
(
'hidden'
)
field
=
$
(
'#new_wiki_path'
)
field
=
$
(
'#new_wiki_path'
)
slug
=
@
slugify
(
field
.
val
())
slug
=
@
slugify
(
field
.
val
())
...
@@ -10,6 +10,7 @@ class @Wikis
...
@@ -10,6 +10,7 @@ class @Wikis
if
(
slug
.
length
>
0
)
if
(
slug
.
length
>
0
)
path
=
field
.
attr
(
'data-wikis-path'
)
path
=
field
.
attr
(
'data-wikis-path'
)
location
.
href
=
path
+
'/'
+
slug
location
.
href
=
path
+
'/'
+
slug
e
.
preventDefault
()
dasherize
:
(
value
)
->
dasherize
:
(
value
)
->
value
.
replace
(
/[_\s]+/g
,
'-'
)
value
.
replace
(
/[_\s]+/g
,
'-'
)
...
...
app/assets/stylesheets/framework/nav.scss
View file @
997a317b
...
@@ -77,12 +77,21 @@
...
@@ -77,12 +77,21 @@
margin-bottom
:
0px
;
margin-bottom
:
0px
;
>
.dropdown
{
>
.dropdown
{
margin-right
:
10px
;
margin-right
:
$gl-padding-top
;
display
:
inline-block
;
display
:
inline-block
;
}
}
>
.btn
{
>
.btn
{
margin-right
:
$gl-padding-top
;
display
:
inline-block
;
display
:
inline-block
;
&
:last-child
{
margin-right
:
0
;
}
}
>
.btn-grouped
{
float
:
none
;
}
}
>
form
{
>
form
{
...
@@ -94,7 +103,7 @@
...
@@ -94,7 +103,7 @@
display
:
inline-block
;
display
:
inline-block
;
position
:
relative
;
position
:
relative
;
top
:
1px
;
top
:
1px
;
margin-right
:
10px
;
margin-right
:
$gl-padding-top
;
/* Medium devices (desktops, 992px and up) */
/* Medium devices (desktops, 992px and up) */
@media
(
min-width
:
$screen-md-min
)
{
width
:
200px
;
}
@media
(
min-width
:
$screen-md-min
)
{
width
:
200px
;
}
...
...
app/assets/stylesheets/pages/wiki.scss
View file @
997a317b
...
@@ -4,8 +4,3 @@
...
@@ -4,8 +4,3 @@
margin-right
:
auto
;
margin-right
:
auto
;
padding-right
:
7px
;
padding-right
:
7px
;
}
}
.wiki-last-edit-by
{
font-size
:
80%
;
font-weight
:
normal
;
}
app/views/projects/wikis/_main_links.html.haml
View file @
997a317b
%span
.pull-right
-
if
(
@page
&&
@page
.
persisted?
)
-
if
(
@page
&&
@page
.
persisted?
)
=
link_to
namespace_project_wiki_history_path
(
@project
.
namespace
,
@project
,
@page
),
class:
"btn btn-grouped"
do
=
link_to
namespace_project_wiki_history_path
(
@project
.
namespace
,
@project
,
@page
),
class:
"btn btn-grouped"
do
Page History
Page History
-
if
can?
(
current_user
,
:create_wiki
,
@project
)
-
if
can?
(
current_user
,
:create_wiki
,
@project
)
...
...
app/views/projects/wikis/_nav.html.haml
View file @
997a317b
...
@@ -16,4 +16,4 @@
...
@@ -16,4 +16,4 @@
=
icon
(
'plus'
)
=
icon
(
'plus'
)
New Page
New Page
=
render
'projects/wikis/new'
=
render
'projects/wikis/new'
app/views/projects/wikis/_new.html.haml
View file @
997a317b
...
@@ -5,9 +5,10 @@
...
@@ -5,9 +5,10 @@
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%h3
.page-title
New Wiki Page
%h3
.page-title
New Wiki Page
.modal-body
.modal-body
%form
.new-wiki-page
.form-group
.form-group
=
label_tag
:new_wiki_path
do
=
label_tag
:new_wiki_path
do
%span
Page slug
%span
Page slug
=
text_field_tag
:new_wiki_path
,
nil
,
placeholder:
'how-to-setup'
,
class:
'form-control'
,
required:
true
,
:'data-wikis-path'
=>
namespace_project_wikis_path
(
@project
.
namespace
,
@project
)
=
text_field_tag
:new_wiki_path
,
nil
,
placeholder:
'how-to-setup'
,
class:
'form-control'
,
required:
true
,
:'data-wikis-path'
=>
namespace_project_wikis_path
(
@project
.
namespace
,
@project
),
autofocus:
true
.form-actions
.form-actions
=
link_to
'Create Page'
,
'#
'
,
class:
'build-new-wiki btn btn-create'
=
button_tag
'Create Page
'
,
class:
'build-new-wiki btn btn-create'
app/views/projects/wikis/edit.html.haml
View file @
997a317b
-
page_title
"Edit"
,
@page
.
title
.
capitalize
,
"Wiki"
-
page_title
"Edit"
,
@page
.
title
.
capitalize
,
"Wiki"
=
render
"header_title"
=
render
"header_title"
=
render
'nav'
=
render
'nav'
.gray-content-block
.pull-right
=
render
'main_links'
%h3
.page-title.oneline
.top-area
%span
.light
Edit Page
.nav-text
%strong
-
if
@page
.
persisted?
-
if
@page
.
persisted?
=
link_to
@page
.
titl
e
,
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
@page
)
=
link_to
@page
.
title
.
capitaliz
e
,
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
@page
)
-
else
-
else
=
@page
.
title
=
@page
.
title
.
capitalize
%span
.light
·
Edit
.nav-controls
=
render
'main_links'
=
render
'form'
=
render
'form'
app/views/projects/wikis/history.html.haml
View file @
997a317b
-
page_title
"History"
,
@page
.
title
.
capitalize
,
"Wiki"
-
page_title
"History"
,
@page
.
title
.
capitalize
,
"Wiki"
=
render
"header_title"
=
render
"header_title"
=
render
'nav'
=
render
'nav'
.gray-content-block
%h3
.page-title
.top-area
%span
.light
History for
.nav-text
=
link_to
@page
.
title
,
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
@page
)
%strong
=
link_to
@page
.
title
.
capitalize
,
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
@page
)
%span
.light
·
History
.table-holder
.table-holder
%table
.table
%table
.table
...
...
app/views/projects/wikis/pages.html.haml
View file @
997a317b
...
@@ -2,13 +2,10 @@
...
@@ -2,13 +2,10 @@
=
render
"header_title"
=
render
"header_title"
=
render
'nav'
=
render
'nav'
.gray-content-block
All pages in this wiki are listed below.
%ul
.content-list
%ul
.content-list
-
@wiki_pages
.
each
do
|
wiki_page
|
-
@wiki_pages
.
each
do
|
wiki_page
|
%li
%li
%h4
=
link_to
wiki_page
.
title
,
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
wiki_page
)
=
link_to
wiki_page
.
title
,
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
wiki_page
)
%small
(
#{
wiki_page
.
format
}
)
%small
(
#{
wiki_page
.
format
}
)
.pull-right
.pull-right
...
...
app/views/projects/wikis/show.html.haml
View file @
997a317b
-
page_title
@page
.
title
.
capitalize
,
"Wiki"
-
page_title
@page
.
title
.
capitalize
,
"Wiki"
=
render
"header_title"
=
render
"header_title"
=
render
'nav'
=
render
'nav'
.gray-content-block
.top-area
=
render
'main_links'
.nav-text
%h3
.page-title.oneline
%strong
=
@page
.
title
.
capitalize
=
@page
.
title
.
capitalize
%span
.wiki-last-edit-by
%span
.wiki-last-edit-by
·
·
last edited by
#{
@page
.
commit
.
author
.
name
}
#{
time_ago_with_tooltip
(
@page
.
commit
.
authored_date
)
}
last edited by
#{
@page
.
commit
.
author
.
name
}
#{
time_ago_with_tooltip
(
@page
.
commit
.
authored_date
)
}
.nav-controls
=
render
'main_links'
-
if
@page
.
historical?
-
if
@page
.
historical?
.warning_message
.warning_message
This is an old version of this page.
This is an old version of this page.
...
...
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