Commit dd94a4f7 authored by Jacob Schatz's avatar Jacob Schatz Committed by Rémy Coutable

Merge branch 'dz-small-ui-fixes' into 'master'

Set of UI fixes

* Improve wiki pages
* Improve profile pages

cc @skyruler

See merge request !2758
parent 4f946f03
...@@ -8,6 +8,7 @@ v 8.5.1 ...@@ -8,6 +8,7 @@ v 8.5.1
possible with MRs possible with MRs
- Fix an issue where MRs weren't sortable - Fix an issue where MRs weren't sortable
- Restrict permissions on public/uploads - Restrict permissions on public/uploads
- Set of small UI fixes to project, profile, and wiki pages
v 8.5.0 v 8.5.0
- Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu) - Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu)
......
...@@ -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, '-')
......
...@@ -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; }
......
...@@ -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;
}
- page_title "Applications" - page_title "Applications"
- header_title page_title, applications_profile_path - header_title page_title, applications_profile_path
.gray-content-block.top-block .alert.alert-help.prepend-top-default
- if user_oauth_applications? - if user_oauth_applications?
Manage applications that can use GitLab as an OAuth provider, Manage applications that can use GitLab as an OAuth provider,
and applications that you've authorized to use your account. and applications that you've authorized to use your account.
......
- page_title "Audit Log" - page_title "Audit Log"
- header_title page_title, audit_log_profile_path - header_title page_title, audit_log_profile_path
.gray-content-block.top-block .alert.alert-help.prepend-top-default
History of authentications History of authentications
.prepend-top-default .prepend-top-default
......
- page_title "Emails" - page_title "Emails"
- header_title page_title, profile_emails_path - header_title page_title, profile_emails_path
.gray-content-block.top-block .alert.alert-help.prepend-top-default
Control emails linked to your account %ul
%ul.prepend-top-default
%li %li
Your Your
%b Primary Email %b Primary Email
......
- page_title "SSH Keys" - page_title "SSH Keys"
- header_title page_title, profile_keys_path - header_title page_title, profile_keys_path
.gray-content-block.top-block .top-area
.pull-right .nav-text
Before you can add an SSH key you need to
= link_to "generate it.", help_page_path("ssh", "README")
.nav-controls
= link_to new_profile_key_path, class: "btn btn-new" do = link_to new_profile_key_path, class: "btn btn-new" do
= icon('plus') = icon('plus')
Add SSH Key Add SSH Key
.oneline
Before you can add an SSH key you need to
= link_to "generate it.", help_page_path("ssh", "README")
.prepend-top-default .prepend-top-default
= render 'key_table' = render 'key_table'
- page_title "Notifications" - page_title "Notifications"
- header_title page_title, profile_notifications_path - header_title page_title, profile_notifications_path
.gray-content-block.top-block
These are your global notification settings.
.prepend-top-default .prepend-top-default
= form_for @user, url: profile_notifications_path, method: :put, html: { class: 'update-notifications form-horizontal global-notifications-form' } do |f| = form_for @user, url: profile_notifications_path, method: :put, html: { class: 'update-notifications form-horizontal global-notifications-form' } do |f|
-if @user.errors.any? -if @user.errors.any?
......
- page_title "Password" - page_title "Password"
- header_title page_title, edit_profile_password_path - header_title page_title, edit_profile_password_path
.gray-content-block.top-block .alert.alert-help.prepend-top-default
- if @user.password_automatically_set? - if @user.password_automatically_set?
Set your password. Set your password.
- else - else
......
- page_title 'Preferences' - page_title 'Preferences'
- header_title page_title, profile_preferences_path - header_title page_title, profile_preferences_path
- @blank_container = true
.alert.alert-help .alert.alert-help.prepend-top-default
These settings allow you to customize the appearance and behavior of the site. These settings allow you to customize the appearance and behavior of the site.
They are saved with your account and will persist to any device you use to They are saved with your account and will persist to any device you use to
access the site. access the site.
......
.gray-content-block.top-block .alert.alert-help.prepend-top-default
This information will appear on your profile. This information will appear on your profile.
- if current_user.ldap_user? - if current_user.ldap_user?
Some options are unavailable for LDAP accounts Some options are unavailable for LDAP accounts
......
- @blank_container = true
.project-edit-container.prepend-top-default .project-edit-container.prepend-top-default
.project-edit-errors .project-edit-errors
.project-edit-content .project-edit-content
......
%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)
......
...@@ -16,4 +16,4 @@ ...@@ -16,4 +16,4 @@
= icon('plus') = icon('plus')
New Page New Page
= render 'projects/wikis/new' = render 'projects/wikis/new'
...@@ -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'
- 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.title, namespace_project_wiki_path(@project.namespace, @project, @page) = link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page)
- else - else
= @page.title = @page.title.capitalize
%span.light
·
Edit Page
.nav-controls
= render 'main_links'
= render 'form' = render 'form'
- 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
......
...@@ -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
......
- 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.
......
...@@ -97,7 +97,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps ...@@ -97,7 +97,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end end
step "I should see a password error message" do step "I should see a password error message" do
page.within '.alert' do page.within '.alert-danger' do
expect(page).to have_content "Password confirmation doesn't match" expect(page).to have_content "Password confirmation doesn't match"
end end
end end
......
...@@ -238,7 +238,11 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -238,7 +238,11 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I see new wiki page named test' do step 'I see new wiki page named test' do
expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "test") expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "test")
expect(page).to have_content "Edit Page test"
page.within(:css, ".nav-text") do
expect(page).to have_content "Test"
expect(page).to have_content "Edit Page"
end
end end
When 'I go back to wiki page home' do When 'I go back to wiki page home' do
...@@ -252,7 +256,11 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -252,7 +256,11 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I see Gitlab API document' do step 'I see Gitlab API document' do
expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api") expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api")
expect(page).to have_content "Edit Page api"
page.within(:css, ".nav-text") do
expect(page).to have_content "Edit"
expect(page).to have_content "Api"
end
end end
step 'I click on Rake tasks link' do step 'I click on Rake tasks link' do
...@@ -261,7 +269,11 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -261,7 +269,11 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I see Rake tasks directory' do step 'I see Rake tasks directory' do
expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks") expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks")
expect(page).to have_content "Edit Page raketasks"
page.within(:css, ".nav-text") do
expect(page).to have_content "Edit"
expect(page).to have_content "Rake"
end
end end
step 'I go directory which contains README file' do step 'I go directory which contains README file' do
......
...@@ -120,7 +120,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -120,7 +120,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
step 'I should see the new wiki page form' do step 'I should see the new wiki page form' do
expect(current_path).to match('wikis/image.jpg') expect(current_path).to match('wikis/image.jpg')
expect(page).to have_content('New Wiki Page') expect(page).to have_content('New Wiki Page')
expect(page).to have_content('Edit Page image.jpg') expect(page).to have_content('Edit Page')
end end
step 'I create a New page with paths' do step 'I create a New page with paths' do
...@@ -159,7 +159,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps ...@@ -159,7 +159,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end end
step 'I should see the page history' do step 'I should see the page history' do
expect(page).to have_content('History for') page.within(:css, ".nav-text") do
expect(page).to have_content('History')
end
end end
step 'I search for Wiki content' do step 'I search for Wiki content' do
......
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