diff options
Diffstat (limited to 'app')
60 files changed, 458 insertions, 446 deletions
diff --git a/app/assets/images/Storage-UI.PNG b/app/assets/images/Storage-UI.PNG Binary files differdeleted file mode 100644 index 8ab6678de32..00000000000 --- a/app/assets/images/Storage-UI.PNG +++ /dev/null diff --git a/app/assets/images/file_bin.png b/app/assets/images/file_bin.png Binary files differdeleted file mode 100644 index b3feafcce0b..00000000000 --- a/app/assets/images/file_bin.png +++ /dev/null diff --git a/app/assets/images/file_dir.png b/app/assets/images/file_dir.png Binary files differdeleted file mode 100644 index ea277bb14db..00000000000 --- a/app/assets/images/file_dir.png +++ /dev/null diff --git a/app/assets/images/file_empty.png b/app/assets/images/file_empty.png Binary files differdeleted file mode 100644 index 2e85bb48737..00000000000 --- a/app/assets/images/file_empty.png +++ /dev/null diff --git a/app/assets/images/file_img.png b/app/assets/images/file_img.png Binary files differdeleted file mode 100644 index ca554c5aefe..00000000000 --- a/app/assets/images/file_img.png +++ /dev/null diff --git a/app/assets/images/file_txt.png b/app/assets/images/file_txt.png Binary files differdeleted file mode 100644 index b3230b5add0..00000000000 --- a/app/assets/images/file_txt.png +++ /dev/null diff --git a/app/assets/images/rss_ui.png b/app/assets/images/rss_ui.png Binary files differdeleted file mode 100644 index c45afbab519..00000000000 --- a/app/assets/images/rss_ui.png +++ /dev/null diff --git a/app/assets/images/submodule.png b/app/assets/images/submodule.png Binary files differdeleted file mode 100644 index 62a88cc619b..00000000000 --- a/app/assets/images/submodule.png +++ /dev/null diff --git a/app/assets/javascripts/markdown_area.js.coffee b/app/assets/javascripts/markdown_area.js.coffee index 67e8290bd57..def5d12a820 100644 --- a/app/assets/javascripts/markdown_area.js.coffee +++ b/app/assets/javascripts/markdown_area.js.coffee @@ -1,3 +1,6 @@ +formatLink = (str) -> + "![" + str.alt + "](" + str.url + ")" + $(document).ready -> alertClass = "alert alert-danger alert-dismissable div-dropzone-alert" alertAttr = "class=\"close\" data-dismiss=\"alert\"" + "aria-hidden=\"true\"" @@ -10,12 +13,15 @@ $(document).ready -> project_image_path_upload = window.project_image_path_upload or null $("textarea.markdown-area").wrap "<div class=\"div-dropzone\"></div>" + $(".div-dropzone").parent().addClass "div-dropzone-wrapper" + $(".div-dropzone").append divHover $(".div-dropzone-hover").append iconPicture $(".div-dropzone").append divSpinner $(".div-dropzone-spinner").append iconSpinner + dropzone = $(".div-dropzone").dropzone( url: project_image_path_upload dictDefaultMessage: "" @@ -30,7 +36,7 @@ $(document).ready -> previewContainer: false processing: -> - closeAlertMessage() + $(".div-dropzone-alert").alert "close" dragover: -> $(".div-dropzone > textarea").addClass "div-dropzone-focus" @@ -49,127 +55,31 @@ $(document).ready -> return success: (header, response) -> - appendToTextArea(formatLink(response.link)) + child = $(dropzone[0]).children("textarea") + $(child).val $(child).val() + formatLink(response.link) + "\n" return error: (temp, errorMessage) -> - showError(errorMessage) + checkIfMsgExists = $(".error-alert").children().length + if checkIfMsgExists is 0 + $(".error-alert").append divAlert + $(".div-dropzone-alert").append btnAlert + errorMessage return sending: -> - showSpinner() + $(".div-dropzone-spinner").css "opacity", 0.7 return complete: -> $(".dz-preview").remove() $(".markdown-area").trigger "input" - closeSpinner() + $(".div-dropzone-spinner").css "opacity", 0 return ) - child = $(dropzone[0]).children("textarea") - - formatLink = (str) -> - "![" + str.alt + "](" + str.url + ")" - - handlePaste = (e) -> - e.preventDefault() - my_event = e.originalEvent - - if my_event.clipboardData and my_event.clipboardData.items - i = 0 - while i < my_event.clipboardData.items.length - item = my_event.clipboardData.items[i] - processItem(my_event, item) - i++ - - processItem = (e, item) -> - if isImage(item) - filename = getFilename(e) or "image.png" - text = "{{" + filename + "}}" - pasteText(text) - uploadFile item.getAsFile(), filename - else if e.clipboardData.items.length == 1 - text = e.clipboardData.getData("text/plain") - pasteText(text) - - isImage = (item) -> - if item - item.type.indexOf("image") isnt -1 - - pasteText = (text) -> - caretStart = $(child)[0].selectionStart - caretEnd = $(child)[0].selectionEnd - textEnd = $(child).val().length - - beforeSelection = $(child).val().substring 0, caretStart - afterSelection = $(child).val().substring caretEnd, textEnd - $(child).val beforeSelection + text + afterSelection - $(".markdown-area").trigger "input" - - getFilename = (e) -> - if window.clipboardData and window.clipboardData.getData - value = window.clipboardData.getData("Text") - else if e.clipboardData and e.clipboardData.getData - value = e.clipboardData.getData("text/plain") - - value = value.split("\r") - value.first() - - uploadFile = (item, filename) -> - formData = new FormData() - formData.append "markdown_img", item, filename - $.ajax - url: project_image_path_upload - type: "POST" - data: formData - dataType: "json" - processData: false - contentType: false - headers: - "X-CSRF-Token": $("meta[name=\"csrf-token\"]").attr("content") - - beforeSend: -> - showSpinner() - closeAlertMessage() - - success: (e, textStatus, response) -> - insertToTextArea(filename, formatLink(response.responseJSON.link)) - - error: (response) -> - showError(response.responseJSON.message) - - complete: -> - closeSpinner() - - insertToTextArea = (filename, url) -> - $(child).val (index, val) -> - val.replace("{{" + filename + "}}", url + "\n") - - appendToTextArea = (url) -> - $(child).val (index, val) -> - val + url + "\n" - - showSpinner = (e) -> - $(".div-dropzone-spinner").css "opacity", 0.7 - - closeSpinner = -> - $(".div-dropzone-spinner").css "opacity", 0 - - showError = (message) -> - checkIfMsgExists = $(".error-alert").children().length - if checkIfMsgExists is 0 - $(".error-alert").append divAlert - $(".div-dropzone-alert").append btnAlert + message - - closeAlertMessage = -> - $(".div-dropzone-alert").alert "close" - $(".markdown-selector").click (e) -> e.preventDefault() $(".div-dropzone").click() return - $(".div-dropzone").on "paste", handlePaste - return
\ No newline at end of file diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index a9849aa487c..36fc771a9dc 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -67,8 +67,6 @@ &.disabled, &[disabled] { color: #ffffff; - background-color: #3286b1; - border-color: #286e8e; } } @@ -83,8 +81,6 @@ &.disabled, &[disabled] { color: #ffffff; - background-color: #47a447; - border-color: #398439; } } @@ -99,8 +95,6 @@ &.disabled, &[disabled] { color: #ffffff; - background-color: #d2322d; - border-color: #ac2925; } } @@ -115,8 +109,6 @@ &.disabled, &[disabled] { color: #ffffff; - background-color: #e38c02; - border-color: #e38c02; } } diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 0cb2090f53d..3b034b757b4 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -3,12 +3,7 @@ .clgray { color: #BBB } .cred { color: #D12F19 } .cgreen { color: #4a2 } -.cblue { color: #29A } -.cblack { color: #111 } .cdark { color: #444 } -.camber { color: #ffc000 } -.cwhite { color: #fff!important } -.bgred { background: #F2DEDE!important } /** COMMON CLASSES **/ .prepend-top-10 { margin-top:10px } diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss index 36551f85b6a..5258acca466 100644 --- a/app/assets/stylesheets/generic/forms.scss +++ b/app/assets/stylesheets/generic/forms.scss @@ -82,6 +82,7 @@ label { font-family: $monospace_font; $left: 12px; .max-width-marker { + width: 72ch; color: rgba(0, 0, 0, 0.0); font-family: inherit; left: $left; @@ -98,3 +99,7 @@ label { z-index: 2; } } + +.fieldset-form fieldset { + margin-bottom: 20px; +} diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss index 2e3559f3c8c..0cab6c44c91 100644 --- a/app/assets/stylesheets/generic/lists.scss +++ b/app/assets/stylesheets/generic/lists.scss @@ -8,7 +8,7 @@ list-style: none; li { - padding: 10px; + padding: 10px 15px; min-height: 20px; border-bottom: 1px solid #eee; border-bottom: 1px solid rgba(0, 0, 0, 0.05); diff --git a/app/assets/stylesheets/generic/markdown_area.scss b/app/assets/stylesheets/generic/markdown_area.scss index ae7ace61d49..fbfa72c5e5e 100644 --- a/app/assets/stylesheets/generic/markdown_area.scss +++ b/app/assets/stylesheets/generic/markdown_area.scss @@ -43,11 +43,6 @@ display: none; } } - - .hint { - padding: 0; - margin: 0; - } } .div-dropzone-alert { diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss index 4ab83786b50..9aa819d40fc 100644 --- a/app/assets/stylesheets/generic/typography.scss +++ b/app/assets/stylesheets/generic/typography.scss @@ -14,6 +14,7 @@ h2.page-title { h3.page-title { @include page-title; + font-size: 22px; } h6 { diff --git a/app/assets/stylesheets/gl_bootstrap.scss b/app/assets/stylesheets/gl_bootstrap.scss index 3bff2156c33..8ab305695fd 100644 --- a/app/assets/stylesheets/gl_bootstrap.scss +++ b/app/assets/stylesheets/gl_bootstrap.scss @@ -253,9 +253,19 @@ ul.breadcrumb { } } + .panel-footer { + .pagination { + margin: 0; + } + } + &.panel-small { .panel-heading { padding: 6px 15px; + font-size: 13px; + a { + color: #777; + } } } } diff --git a/app/assets/stylesheets/main/mixins.scss b/app/assets/stylesheets/main/mixins.scss index 747676620b3..289490712b6 100644 --- a/app/assets/stylesheets/main/mixins.scss +++ b/app/assets/stylesheets/main/mixins.scss @@ -117,11 +117,11 @@ } @mixin page-title { - color: #333; - font-size: 20px; + color: #555; line-height: 1.5; + font-weight: normal; margin-top: 0px; - margin-bottom: 15px; + margin-bottom: 10px; } @mixin str-truncated($max_width: "82%") { diff --git a/app/assets/stylesheets/main/variables.scss b/app/assets/stylesheets/main/variables.scss index 8bcdad35792..68f7f6b8581 100644 --- a/app/assets/stylesheets/main/variables.scss +++ b/app/assets/stylesheets/main/variables.scss @@ -14,8 +14,8 @@ $link_hover_color: #2FA0BB; /* * Success colors (green) */ -$border_success: #469408; -$bg_success: #469408; +$border_success: #019875; +$bg_success: #019875; /* * Danger colors (red) @@ -32,8 +32,8 @@ $bg_primary: #446e9b; /* * Warning colors (yellow) */ -$bg_warning: #d9831f; -$border_warning: #d9831f; +$bg_warning: #EB9532; +$border_warning: #EB9532; /** * Commit Diff Colors diff --git a/app/assets/stylesheets/sections/admin.scss b/app/assets/stylesheets/sections/admin.scss index a558633d112..a51deee7970 100644 --- a/app/assets/stylesheets/sections/admin.scss +++ b/app/assets/stylesheets/sections/admin.scss @@ -21,12 +21,22 @@ } .admin-filter form { - label { width: 110px; } - .controls { margin-left: 130px; } - .form-actions { padding-left: 130px; background: #fff } - .visibility-levels { - .controls { - margin-bottom: 9px; + .select2-container { + width: 100% + } + + .controls { + margin-left: 130px; + } + + .form-actions { + padding-left: 130px; + background: #fff + } + + .visibility-levels { + .controls { + margin-bottom: 9px; } i { diff --git a/app/assets/stylesheets/sections/dashboard.scss b/app/assets/stylesheets/sections/dashboard.scss index 0ec21ff50fa..abc9e57f2ac 100644 --- a/app/assets/stylesheets/sections/dashboard.scss +++ b/app/assets/stylesheets/sections/dashboard.scss @@ -60,7 +60,7 @@ } .project-row, .group-row { - padding: 8px 12px !important; + padding: 8px 15px !important; font-size: 14px; line-height: 24px; @@ -74,7 +74,6 @@ .arrow { float: right; - padding: 0px 5px; margin: 0; font-size: 20px; color: #666; diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss index 02c9123178f..949c528bdbd 100644 --- a/app/assets/stylesheets/sections/issues.scss +++ b/app/assets/stylesheets/sections/issues.scss @@ -1,6 +1,6 @@ .issues-list { .issue { - padding: 10px; + padding: 10px 15px; position: relative; .issue-title { @@ -42,7 +42,7 @@ height: 32px; float: left; margin-right: 12px; - padding: 6px 10px; + padding: 6px 15px; border: 1px solid #ccc; @include border-radius(4px); } diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index 5d716ddec3b..c1eaae82e5e 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -20,18 +20,14 @@ } .merge-request .merge-request-tabs{ - border-color: #AAA; + border-bottom: 2px solid $border_primary; + padding-bottom: 10px; + margin-bottom: 20px; + li { a { - border-color: #AAA; - padding: 14px 40px; + padding: 20px 40px; font-size: 14px; - background-color: #F9F9F9; - } - &.active a { - border-color: #AAA; - border-bottom-color: #FFF; - background-color: #FFF; } } } @@ -70,7 +66,7 @@ .mr-list { .merge-request { - padding: 10px; + padding: 10px 15px; position: relative; .merge-request-title { diff --git a/app/assets/stylesheets/sections/notifications.scss b/app/assets/stylesheets/sections/notifications.scss new file mode 100644 index 00000000000..f11c5dff4ab --- /dev/null +++ b/app/assets/stylesheets/sections/notifications.scss @@ -0,0 +1,22 @@ +.global-notifications-form .level-title { + font-size: 15px; + color: #333; + font-weight: bold; +} + +.notification-icon-holder { + width: 20px; + float: left; +} + +.ns-part { + color: $bg_primary; +} + +.ns-watch { + color: $bg_success; +} + +.ns-mute { + color: $bg_danger; +} diff --git a/app/assets/stylesheets/sections/profile.scss b/app/assets/stylesheets/sections/profile.scss index 67aaa369381..ed73e1630f2 100644 --- a/app/assets/stylesheets/sections/profile.scss +++ b/app/assets/stylesheets/sections/profile.scss @@ -1,9 +1,3 @@ -.update-notifications { - .radio-inline { - margin-right: 9%; - } -} - .account-page { fieldset { margin-bottom: 15px; @@ -114,14 +108,3 @@ height: 50px; } } - -.global-notifications-form .level-title { - font-size: 15px; - color: #333; - font-weight: bold; -} - -.notification-icon-holder { - width: 20px; - float: left; -} diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 949d646afcd..35279bff6a5 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -232,3 +232,15 @@ ul.nav.nav-projects-tabs { .deploy-project-label { margin: 1px; } + +.vs-public { + color: $bg_primary; +} + +.vs-internal { + color: $bg_warning; +} + +.vs-private { + color: $bg_success; +} diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index db177a0083c..b0ce78ddb35 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -57,6 +57,10 @@ } } + i { + color: $bg_primary; + } + img { position: relative; top:-1px; diff --git a/app/assets/stylesheets/themes/ui_modern.scss b/app/assets/stylesheets/themes/ui_modern.scss index 67616a4a10d..308a03477db 100644 --- a/app/assets/stylesheets/themes/ui_modern.scss +++ b/app/assets/stylesheets/themes/ui_modern.scss @@ -16,28 +16,28 @@ @extend .header-dark; &.navbar-gitlab { .navbar-inner { - background: #00AC7E; - border-bottom: 1px solid #00AC7E; + background: #019875; + border-bottom: 1px solid #019875; .app_logo, .navbar-toggle { &:hover { - background-color: #009C6E; + background-color: #018865; } } .separator { - background: #009C6F; - border-left: 1px solid #10BC8E; + background: #018865; + border-left: 1px solid #11A885; } .nav > li > a { color: #ADC; } .search-input { - border-color: #7fd5be; + border-color: #8ba; } } } } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { - background: #00AC7E; + background: #019875; } } diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 4bb3cf07da0..1a523d081dd 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -8,6 +8,8 @@ class Admin::GroupsController < Admin::ApplicationController end def show + @members = @group.members.order("group_access DESC").page(params[:members_page]).per(30) + @projects = @group.projects.page(params[:projects_page]).per(30) end def new diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 92ef5963373..d2f86369b58 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -4,10 +4,8 @@ class Admin::ProjectsController < Admin::ApplicationController before_filter :repository, only: [:show, :transfer] def index - owner_id = params[:owner_id] - user = User.find_by(id: owner_id) - - @projects = user ? user.owned_projects : Project.all + @projects = Project.all + @projects = @projects.where(namespace_id: params[:namespace_id]) if params[:namespace_id].present? @projects = @projects.where("visibility_level IN (?)", params[:visibility_levels]) if params[:visibility_levels].present? @projects = @projects.with_push if params[:with_push].present? @projects = @projects.abandoned if params[:abandoned].present? @@ -17,6 +15,11 @@ class Admin::ProjectsController < Admin::ApplicationController end def show + if @group + @group_members = @group.members.order("group_access DESC").page(params[:group_members_page]).per(30) + end + + @project_members = @project.users_projects.page(params[:project_members_page]).per(30) end def transfer diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 5b06af79d5a..5ecdfbd807e 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -8,7 +8,8 @@ class Admin::UsersController < Admin::ApplicationController end def show - @projects = user.authorized_projects + @personal_projects = user.personal_projects + @joined_projects = user.projects.joined(@user) end def new diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6ea9b2cf27d..b9af36a0c7e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -11,8 +11,6 @@ class ProjectsController < ApplicationController layout 'navless', only: [:new, :create, :fork] before_filter :set_title, only: [:new, :create] - rescue_from CarrierWave::IntegrityError, with: :invalid_file - def new @project = Project.new end @@ -187,10 +185,6 @@ class ProjectsController < ApplicationController %w(png jpg jpeg gif) end - def invalid_file(error) - render json: { message: error.message }, status: :internal_server_error - end - def set_title @title = 'New Project' end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d42c2db9e5f..c17c6f9694a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -11,7 +11,8 @@ class UsersController < ApplicationController end @groups = @user.groups.accessible_to(current_user) - @events = @user.recent_events.where(project_id: @projects.pluck(:id)).limit(20) + accessible_projects = @user.authorized_projects.accessible_to(current_user) + @events = @user.recent_events.where(project_id: accessible_projects.pluck(:id)).limit(20) @title = @user.name end diff --git a/app/helpers/branches_helper.rb b/app/helpers/branches_helper.rb index e08ffccb94c..2ec2cc96157 100644 --- a/app/helpers/branches_helper.rb +++ b/app/helpers/branches_helper.rb @@ -1,11 +1,22 @@ module BranchesHelper def can_remove_branch?(project, branch_name) - if project.protected_branch? branch_name - false - elsif branch_name == project.repository.root_ref - false - else - can?(current_user, :push_code, project) - end + if project.protected_branch? branch_name + false + elsif branch_name == project.repository.root_ref + false + else + can?(current_user, :push_code, project) + end + end + + def can_push_branch?(project, branch_name) + return false unless project.repository.branch_names.include?(branch_name) + action = if project.protected_branch?(branch_name) + :push_code_to_protected_branches + else + :push_code + end + + current_user.can?(action, project) end end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index b2399bb6db1..6c43f97446b 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -1,13 +1,13 @@ module NotificationsHelper def notification_icon(notification) if notification.disabled? - content_tag :i, nil, class: 'icon-volume-off cred' + content_tag :i, nil, class: 'icon-volume-off ns-mute' elsif notification.participating? - content_tag :i, nil, class: 'icon-volume-down cblue' + content_tag :i, nil, class: 'icon-volume-down ns-part' elsif notification.watch? - content_tag :i, nil, class: 'icon-volume-up cgreen' + content_tag :i, nil, class: 'icon-volume-up ns-watch' else - content_tag :i, nil, class: 'icon-circle-blank cblue' + content_tag :i, nil, class: 'icon-circle-blank ns-default' end end end diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index f39d0081dce..2d82b6a0b47 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -25,8 +25,13 @@ module TreeHelper # # type - String type of the tree item; either 'folder' or 'file' def tree_icon(type) - image = type == 'folder' ? 'file_dir.png' : 'file_txt.png' - image_tag(image, size: '16x16') + icon_class = if type == 'folder' + 'icon-folder-close' + else + 'icon-file-alt' + end + + content_tag :i, nil, class: icon_class end def tree_hex_class(content) diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 81e10f3685c..8b83b8ff640 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -2,11 +2,11 @@ module VisibilityLevelHelper def visibility_level_color(level) case level when Gitlab::VisibilityLevel::PRIVATE - 'cgreen' + 'vs-private' when Gitlab::VisibilityLevel::INTERNAL - 'camber' + 'vs-internal' when Gitlab::VisibilityLevel::PUBLIC - 'cblue' + 'vs-public' end end diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index de167f8803a..713eab5ad7d 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -42,7 +42,7 @@ module Issuable module ClassMethods def search(query) - where("title like :query", query: "%#{query}%") + where("LOWER(title) like :query", query: "%#{query.downcase}%") end def sort(method) diff --git a/app/views/admin/groups/_form.html.haml b/app/views/admin/groups/_form.html.haml new file mode 100644 index 00000000000..31990ee5932 --- /dev/null +++ b/app/views/admin/groups/_form.html.haml @@ -0,0 +1,57 @@ += form_for [:admin, @group], html: { class: "form-horizontal" } do |f| + - if @group.errors.any? + .alert.alert-danger + %span= @group.errors.full_messages.first + .form-group.group_name_holder + = f.label :name, class: 'control-label' do + Group name + .col-sm-10 + = f.text_field :name, placeholder: "Example Group", class: "form-control" + + .form-group.group-description-holder + = f.label :description, "Details", class: 'control-label' + .col-sm-10 + = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4 + + .form-group.group-description-holder + = f.label :avatar, "Group avatar", class: 'control-label' + .col-sm-10 + %a.choose-btn.btn.btn-small.js-choose-group-avatar-button + %i.icon-paper-clip + %span Choose File ... + + %span.file_name.js-avatar-filename File name... + = f.file_field :avatar, class: "js-group-avatar-input hidden" + .light The maximum file size allowed is 100KB. + + - if @group.new_record? + .form-group + .col-sm-2 + .col-sm-10 + .bs-callout.bs-callout-info + %ul + %li A group is a collection of several projects + %li Groups are private by default + %li Members of a group may only view projects they have permission to access + %li Group project URLs are prefixed with the group namespace + %li Existing projects may be moved into a group + .form-actions + = f.submit 'Create group', class: "btn btn-create" + = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" + + - else + .form-group.group_name_holder + = f.label :path, class: 'control-label' do + %span Group path + .col-sm-10 + = f.text_field :path, placeholder: "example-group", class: "form-control danger" + .bs-callout.bs-callout-danger + %ul + %li Changing group path can have unintended side effects. + %li Renaming group path will rename directory for all related projects + %li It will change web url for access group and group projects. + %li It will change the git path to repositories under this group. + .form-actions + = f.submit 'Save changes', class: "btn btn-primary" + = link_to 'Cancel', admin_group_path(@group), class: "btn btn-cancel" + diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index eb5c91050af..824e51c1cf1 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -1,31 +1,3 @@ -%h3.page-title Edit Group +%h3.page-title Edit group: #{@group.name} %hr -= form_for [:admin, @group], html: { class: "form-horizontal" } do |f| - - if @group.errors.any? - .alert.alert-danger - %span= @group.errors.full_messages.first - .form-group.group_name_holder - = f.label :name, class: 'control-label' do - Group name - .col-sm-10 - = f.text_field :name, placeholder: "Example Group", class: "form-control" - - .form-group.group-description-holder - = f.label :description, "Details", class: 'control-label' - .col-sm-10 - = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4 - - .form-group.group_name_holder - = f.label :path, class: 'control-label' do - %span.cred Group path - .col-sm-10 - = f.text_field :path, placeholder: "example-group", class: "form-control danger" - %ul.cred - %li Changing group path can have unintended side effects. - %li Renaming group path will rename directory for all related projects - %li It will change web url for access group and group projects. - %li It will change the git path to repositories under this group. - - .form-actions - = f.submit 'Save changes', class: "btn btn-primary" - = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" += render 'form' diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index ae0604cf984..f46f45c5514 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -1,31 +1,3 @@ -%h3.page-title New Group +%h3.page-title New group %hr -= form_for [:admin, @group], html: { class: 'group-form form-horizontal' } do |f| - - if @group.errors.any? - .alert.alert-danger - %span= @group.errors.full_messages.first - .form-group - = f.label :name, class: 'control-label' do - Group name - .col-sm-10 - = f.text_field :name, placeholder: "Ex. OpenSource", class: "form-control" - - .form-group.group-description-holder - = f.label :description, "Details", class: 'control-label' - .col-sm-10 - = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4 - - .form-group - .col-sm-2 - .col-sm-10 - %ul - %li A group is a collection of several projects - %li Groups are private by default - %li Members of a group may only view projects they have permission to access - %li Group project URLs are prefixed with the group namespace - %li Existing projects may be moved into a group - - .form-actions - = f.submit 'Create group', class: "btn btn-create" - - += render 'form' diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 183203aac75..8634f46053d 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -1,7 +1,7 @@ %h3.page-title Group: #{@group.name} - = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do + = link_to edit_admin_group_path(@group), class: "btn pull-right" do %i.icon-edit Edit %hr @@ -12,6 +12,8 @@ Group info: %ul.well-list %li + = image_tag group_icon(@group.path), class: "avatar s60" + %li %span.light Name: %strong= @group.name %li @@ -31,11 +33,12 @@ .panel.panel-default .panel-heading - Projects - %small - (#{@group.projects.count}) + %h3.panel-title + Projects + %span.badge + #{@group.projects.count} %ul.well-list - - @group.projects.sort_by(&:name).each do |project| + - @projects.each do |project| %li %strong = link_to project.name_with_namespace, [:admin, project] @@ -43,6 +46,8 @@ = repository_size(project) %span.pull-right.light %span.monospace= project.path_with_namespace + ".git" + .panel-footer + = paginate @projects, param_name: 'projects_page', theme: 'gitlab' .col-md-6 .panel.panel-default @@ -62,12 +67,12 @@ = submit_tag 'Add users into group', class: "btn btn-create" .panel.panel-default .panel-heading - %strong #{@group.name} - Group Members - %small - (#{@group.users_groups.count}) + %h3.panel-title + Members + %span.badge + #{@group.users_groups.count} %ul.well-list.group-users-list - - @group.users_groups.order('group_access DESC').each do |member| + - @members.each do |member| - user = member.user %li{class: dom_class(user)} .list-item-name @@ -77,3 +82,5 @@ = member.human_access = link_to group_users_group_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do %i.icon-minus.icon-white + .panel-footer + = paginate @members, param_name: 'members_page', theme: 'gitlab' diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 7a23b7020cc..5ca6090f8d3 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,5 +1,5 @@ .row - .col-md-4 + .col-md-3 .admin-filter = form_tag admin_projects_path, method: :get, class: '' do .form-group @@ -7,19 +7,21 @@ = text_field_tag :name, params[:name], class: "form-control" .form-group - = label_tag :owner_id, 'Owner:' - %div - = users_select_tag :owner_id, selected: params[:owner_id], class: 'input-large input-clamp' - .checkbox - = label_tag :with_push, 'Not empty' - = check_box_tag :with_push, 1, params[:with_push] - - %span.light Projects with push events - .checkbox - = label_tag :abandoned, 'Abandoned' - = check_box_tag :abandoned, 1, params[:abandoned] - - %span.light No activity over 6 month + = label_tag :namespace_id, "Namespace" + = namespace_select_tag :namespace_id, selected: params[:namespace_id], class: 'input-large' + + .form-group + %strong Activity + .checkbox + = label_tag :with_push, 'Not empty' + = check_box_tag :with_push, 1, params[:with_push] + + %span.light Projects with push events + .checkbox + = label_tag :abandoned, 'Abandoned' + = check_box_tag :abandoned, 1, params[:abandoned] + + %span.light No activity over 6 month %fieldset %strong Visibility level: @@ -31,12 +33,12 @@ %span.descr = visibility_level_icon(level) = label - .form-actions - = hidden_field_tag :sort, params[:sort] - = submit_tag "Search", class: "btn submit btn-primary" - = link_to "Reset", admin_projects_path, class: "btn" + %hr + = hidden_field_tag :sort, params[:sort] + = submit_tag "Search", class: "btn submit btn-primary" + = link_to "Reset", admin_projects_path, class: "btn btn-cancel" - .col-md-8 + .col-md-9 .panel.panel-default .panel-heading Projects (#{@projects.total_count}) diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index 3f25eb7fdb9..66a72449f40 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -100,8 +100,10 @@ = link_to admin_group_path(@group), class: 'btn btn-small' do %i.icon-edit %ul.well-list - - @group.users_groups.order('group_access DESC').each do |member| + - @group_members.each do |member| = render 'users_groups/users_group', member: member, show_controls: false + .panel-footer + = paginate @group_members, param_name: 'group_members_page', theme: 'gitlab' .panel.panel-default .panel-heading @@ -113,7 +115,7 @@ %i.icon-edit Manage Access %ul.well-list.team_members - - @project.users_projects.each do |users_project| + - @project_members.each do |users_project| - user = users_project.user %li.users_project .list-item-name @@ -126,3 +128,5 @@ %span.light= users_project.human_access = link_to project_team_member_path(@project, user), data: { confirm: remove_from_project_team_message(@project, user)}, method: :delete, remote: true, class: "btn btn-small btn-remove" do %i.icon-remove + .panel-footer + = paginate @project_members, param_name: 'project_members_page', theme: 'gitlab' diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index b9e6382ea88..d00772d4dfe 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -1,5 +1,5 @@ .user_new - = form_for [:admin, @user], html: { class: 'form-horizontal' } do |f| + = form_for [:admin, @user], html: { class: 'form-horizontal fieldset-form' } do |f| -if @user.errors.any? #error_explanation .alert.alert-danger @@ -61,17 +61,14 @@ .col-sm-10 You cannot remove your own admin rights - else .col-sm-10= f.check_box :admin - - unless @user.new_record? || current_user == @user - .alert.alert-danger - - if @user.blocked? - %p This user is blocked and is not able to login to GitLab - = link_to 'Unblock User', unblock_admin_user_path(@user), method: :put, class: "btn btn-small" - - else - %p Blocked users will be removed from all projects & will not be able to login to GitLab. - = link_to 'Block User', block_admin_user_path(@user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-small btn-remove" %fieldset %legend Profile .form-group + = f.label :avatar, class: 'control-label' + .col-sm-10 + = f.file_field :avatar + + .form-group = f.label :skype, class: 'control-label' .col-sm-10= f.text_field :skype, class: 'form-control' .form-group diff --git a/app/views/admin/users/edit.html.haml b/app/views/admin/users/edit.html.haml index 2a4f8c60546..d71d8189c51 100644 --- a/app/views/admin/users/edit.html.haml +++ b/app/views/admin/users/edit.html.haml @@ -1,6 +1,7 @@ %h3.page-title - #{@user.name} → - %i.icon-edit - Edit user + Edit user: #{@user.name} +.back-link + = link_to admin_user_path(@user) do + ← Back to user page %hr = render 'form' diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml index a1c90c48946..8fbb757f424 100644 --- a/app/views/admin/users/new.html.haml +++ b/app/views/admin/users/new.html.haml @@ -1,5 +1,4 @@ %h3.page-title - %i.icon-plus New user %hr = render 'form' diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 28c91c2c3e2..a255c64fc27 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -1,5 +1,5 @@ %h3.page-title - %span.cgray User: + User: = @user.name - if @user.blocked? %span.cred (Blocked) @@ -11,112 +11,144 @@ %i.icon-edit Edit %hr +%ul.nav.nav-tabs + %li.active + %a{"data-toggle" => "tab", href: "#account"} Account + %li + %a{"data-toggle" => "tab", href: "#profile"} Profile + %li + %a{"data-toggle" => "tab", href: "#groups"} Groups + %li + %a{"data-toggle" => "tab", href: "#projects"} Projects -.row - .col-md-6 - .panel.panel-default - .panel-heading - Account: - .pull-right - = image_tag avatar_icon(@user.email, 32), class: "avatar s32" - %ul.well-list - %li - %span.light Name: - %strong= @user.name - %li - %span.light Username: - %strong - = @user.username - %li - %span.light Email: - %strong - = mail_to @user.email - %li - %span.light Can create groups: - %strong - = @user.can_create_group ? "Yes" : "No" - %li - %span.light Personal projects limit: - %strong - = @user.projects_limit - %li - %span.light Member since: - %strong - = @user.created_at.stamp("Nov 12, 2031") - - if @user.confirmed_at - %li - %span.light Confirmed at: - %strong - = @user.confirmed_at.stamp("Nov 12, 2031") - - else - %li - %span.light Confirmed: - %strong.cred - No +.tab-content + #account.tab-pane.active + .row + .col-md-6 + .panel.panel-default + .panel-heading + Account: + %ul.well-list + %li + %span.light Name: + %strong= @user.name + %li + %span.light Username: + %strong + = @user.username + %li + %span.light Email: + %strong + = mail_to @user.email + - @user.emails.each do |email| + %li + %span.light Secondary email: + %strong= email.email - %li - %span.light Last sign-in at: - %strong - - if @user.last_sign_in_at - = @user.last_sign_in_at.stamp("Nov 12, 2031") + %li + %span.light Can create groups: + %strong + = @user.can_create_group ? "Yes" : "No" + %li + %span.light Personal projects limit: + %strong + = @user.projects_limit + %li + %span.light Member since: + %strong + = @user.created_at.stamp("Nov 12, 2031") + - if @user.confirmed_at + %li + %span.light Confirmed at: + %strong + = @user.confirmed_at.stamp("Nov 12, 2031") - else - never + %li + %span.light Confirmed: + %strong.cred + No + + %li + %span.light Last sign-in at: + %strong + - if @user.last_sign_in_at + = @user.last_sign_in_at.stamp("Nov 12, 2031") + - else + never - - if @user.ldap_user? - %li - %span.light LDAP uid: - %strong - = @user.extern_uid + - if @user.ldap_user? + %li + %span.light LDAP uid: + %strong + = @user.extern_uid - - if @user.created_by - %li - %span.light Created by: - %strong - = link_to @user.created_by.name, [:admin, @user.created_by] + - if @user.created_by + %li + %span.light Created by: + %strong + = link_to @user.created_by.name, [:admin, @user.created_by] - - unless @user == current_user - - if @user.blocked? - .alert.alert-info - %h4 This user is blocked - %p Blocking user has the following effects: - %ul - %li User will not be able to login - %li User will not be able to access git repositories - %li User will be removed from joined projects and groups - %li Personal projects will be left - %li Owned groups will be left - %br - = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-new", data: { confirm: 'Are you sure?' } - - else - .alert.alert-warning - %h4 Block this user - %p Blocking user has the following effects: - %ul - %li User will not be able to login - %li User will not be able to access git repositories - %li User will be removed from joined projects and groups - %li Personal projects will be left - %li Owned groups will be left - %br - = link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-remove" + .col-md-6 + - unless @user == current_user + - if @user.blocked? + .alert.alert-info + %h4 This user is blocked + %p Blocking user has the following effects: + %ul + %li User will not be able to login + %li User will not be able to access git repositories + %li User will be removed from joined projects and groups + %li Personal projects will be left + %li Owned groups will be left + %br + = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-new", data: { confirm: 'Are you sure?' } + - else + .alert.alert-warning + %h4 Block this user + %p Blocking user has the following effects: + %ul + %li User will not be able to login + %li User will not be able to access git repositories + %li User will be removed from joined projects and groups + %li Personal projects will be left + %li Owned groups will be left + %br + = link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-remove" - .alert.alert-danger - %h4 - Remove user - %p Deleting a user has the following effects: - %ul - %li All user content like authored issues, snippets, comments will be removed - - rp = @user.personal_projects.count - - unless rp.zero? - %li #{pluralize rp, 'personal project'} will be removed and cannot be restored - - if @user.solo_owned_groups.present? + .alert.alert-danger + %h4 + Remove user + %p Deleting a user has the following effects: + %ul + %li All user content like authored issues, snippets, comments will be removed + - rp = @user.personal_projects.count + - unless rp.zero? + %li #{pluralize rp, 'personal project'} will be removed and cannot be restored + - if @user.solo_owned_groups.present? + %li + Next groups with all content will be removed: + %strong #{@user.solo_owned_groups.map(&:name).join(', ')} + %br + = link_to 'Remove user', [:admin, @user], data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove" + + #profile.tab-pane + .row + .col-md-6 + .panel.panel-default + .panel-heading + = @user.name + %ul.well-list + %li + = image_tag avatar_icon(@user.email, 60), class: "avatar s60" %li - Next groups with all content will be removed: - %strong #{@user.solo_owned_groups.map(&:name).join(', ')} - %br - = link_to 'Remove user', [:admin, @user], data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove" + %span.light Profile page: + %strong + = link_to user_path(@user) do + = @user.username + .col-md-6 + = render 'users/profile', user: @user - .col-md-6 + #groups.tab-pane - if @user.users_groups.present? .panel.panel-default .panel-heading Groups: @@ -131,23 +163,42 @@ - unless user_group.owner? = link_to group_users_group_path(group, user_group), data: { confirm: remove_user_from_group_message(group, @user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do %i.icon-remove.icon-white + - else + .nothing-here-block This user has no groups. - .panel.panel-default - .panel-heading Projects (#{@projects.count}) - %ul.well-list - - @projects.sort_by(&:name_with_namespace).each do |project| - - tm = project.team.find_tm(@user.id) - %li.users_project - = link_to admin_project_path(project), class: dom_class(project) do - = project.name_with_namespace + #projects.tab-pane + - if @user.groups.any? + .panel.panel-default + .panel-heading Group projects + %ul.well-list + - @user.groups.each do |group| + %li + %strong= group.name + – access to + #{pluralize(group.projects.count, 'project')} - - if tm - .pull-right - - if tm.owner? - %span.light Owner - - else - %span.light= tm.human_access + .row + .col-md-6 + = render 'users/projects', projects: @personal_projects + + .col-md-6 + .panel.panel-default + .panel-heading Joined projects (#{@joined_projects.count}) + %ul.well-list + - @joined_projects.sort_by(&:name_with_namespace).each do |project| + - tm = project.team.find_tm(@user.id) + %li.users_project + .list-item-name + = link_to admin_project_path(project), class: dom_class(project) do + = project.name_with_namespace + + - if tm + .pull-right + - if tm.owner? + %span.light Owner + - else + %span.light= tm.human_access - - if tm.respond_to? :project - = link_to project_team_member_path(project, @user), data: { confirm: remove_from_project_team_message(project, @user) }, remote: true, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from project' do - %i.icon-remove + - if tm.respond_to? :project + = link_to project_team_member_path(project, @user), data: { confirm: remove_from_project_team_message(project, @user) }, remote: true, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from project' do + %i.icon-remove diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 863e4e3de53..b0cac828f3b 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -8,7 +8,7 @@ - if path - if path.end_with?(@path) = link_to project_blob_path(@project, path) do - %span.cblue + %strong = truncate(title, length: 40) - else = link_to truncate(title, length: 40), project_tree_path(@project, path) diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index 120d70eaa6f..73cbb79665a 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -23,7 +23,7 @@ = f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 14 .col-sm-12.hint .pull-left Issues are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. - .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. + .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. .clearfix .error-alert %hr diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 27ea53c006e..b0e7aa6084a 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -25,7 +25,7 @@ = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 14 .col-sm-12.hint .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. - .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. + .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. .clearfix .error-alert %hr diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 553bc30ee08..01bc10421bd 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -26,7 +26,7 @@ = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 10 .col-sm-12.hint .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. - .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. + .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. .clearfix .error-alert .form-group @@ -84,5 +84,5 @@ $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change"); e.preventDefault(); }); - + window.project_image_path_upload = "#{upload_image_project_path @project}"; diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index 38a0ed567fc..1072728af28 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -7,7 +7,7 @@ = render "projects/merge_requests/show/participants" - if @commits.present? - %ul.nav.nav-tabs.merge-request-tabs + %ul.nav.nav-pills.merge-request-tabs %li.notes-tab{data: {action: 'notes'}} = link_to project_merge_request_path(@project, @merge_request) do %i.icon-comment diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 9f3e0c44b25..979c27daa2b 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -24,7 +24,7 @@ = f.text_area :description, maxlength: 2000, class: "form-control markdown-area", rows: 10 .hint .pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. - .pull-left Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. + .pull-left Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. .clearfix .error-alert .col-md-6 diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index f6a21f79952..b62aada3a9a 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -16,10 +16,10 @@ .note-write-holder = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area' - .light.clearfix.hint + .light.clearfix .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'} - .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. - .error-alert + .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. + .note-preview-holder.hide .js-note-preview diff --git a/app/views/projects/tree/_submodule_item.html.haml b/app/views/projects/tree/_submodule_item.html.haml index ae87dbde67a..3e2655cc4f6 100644 --- a/app/views/projects/tree/_submodule_item.html.haml +++ b/app/views/projects/tree/_submodule_item.html.haml @@ -1,7 +1,7 @@ - tree, commit = submodule_links(submodule_item) %tr{ class: "tree-item" } %td.tree-item-file-name - = image_tag "submodule.png" + %i.icon-archive %span = link_to truncate(submodule_item.name, length: 40), tree @ diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml index ee850e2bc1b..49c9edffc66 100644 --- a/app/views/projects/tree/_tree.html.haml +++ b/app/views/projects/tree/_tree.html.haml @@ -9,7 +9,7 @@ = link_to truncate(title, length: 40), project_tree_path(@project, path) - else = link_to title, '#' - - if current_user && @repository.branch_names.include?(@ref) && current_user.can?(:push_code, @project) + - if current_user && can_push_branch?(@project, @ref) %li = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do %small @@ -36,8 +36,7 @@ - if @path.present? %tr.tree-item %td.tree-item-file-name - = image_tag "file_empty.png", size: '16x16' - = link_to "..", project_tree_path(@project, up_dir_path(tree)) + = link_to "..", project_tree_path(@project, up_dir_path(tree)), class: 'prepend-left-10' %td %td %td diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index a0a56b84a10..0a24e36ae84 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -25,7 +25,7 @@ = f.text_area :content, class: 'form-control js-gfm-input markdown-area', rows: 18 .col-sm-12.hint .pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'} - .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. + .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }. .clearfix .error-alert .form-group @@ -39,7 +39,7 @@ - else = f.submit 'Create page', class: "btn-create btn" = link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel" - + :javascript window.project_image_path_upload = "#{upload_image_project_path @project}"; diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml index cca7a0efc9b..4365947e701 100644 --- a/app/views/shared/_commit_message_container.html.haml +++ b/app/views/shared/_commit_message_container.html.haml @@ -1,5 +1,3 @@ .commit-message-container .max-width-marker - -# When the `ch` CSS length unit becomes widely supported `http://www.quirksmode.org/css/units-values` remove this workaround. - = 'a' * 72 = textarea diff --git a/app/views/users/_projects.html.haml b/app/views/users/_projects.html.haml index bcaec4a27e7..1d38f8e8ab8 100644 --- a/app/views/users/_projects.html.haml +++ b/app/views/users/_projects.html.haml @@ -1,6 +1,6 @@ .panel.panel-default .panel-heading Personal projects %ul.well-list - - @projects.each do |project| + - projects.each do |project| %li = link_to_project project diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 948b59fead1..60159a29b99 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -13,12 +13,14 @@ %br %small member since #{@user.created_at.stamp("Nov 12, 2031")} .clearfix - %h4 Groups: - = render 'groups', groups: @groups - %hr + + - if @groups.any? + %h4 Groups: + = render 'groups', groups: @groups + %hr %h4 User Activity: = render @events .col-md-4 = render 'profile', user: @user - if @projects.present? - = render 'projects' + = render 'projects', projects: @projects |