Commit 729618c5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ui-improvements' into 'master'

Ui improvements
parents 67b0857d 95d61a09
......@@ -98,3 +98,7 @@ label {
z-index: 2;
}
}
.fieldset-form fieldset {
margin-bottom: 20px;
}
......@@ -14,6 +14,7 @@ h2.page-title {
h3.page-title {
@include page-title;
font-size: 22px;
}
h6 {
......
......@@ -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%") {
......
......@@ -21,9 +21,19 @@
}
.admin-filter form {
label { width: 110px; }
.controls { margin-left: 130px; }
.form-actions { padding-left: 130px; background: #fff }
.select2-container {
width: 100%
}
.controls {
margin-left: 130px;
}
.form-actions {
padding-left: 130px;
background: #fff
}
.visibility-levels {
.controls {
margin-bottom: 9px;
......
......@@ -57,6 +57,10 @@
}
}
i {
color: $bg_primary;
}
img {
position: relative;
top:-1px;
......
......@@ -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?
......
......@@ -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
......
......@@ -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)
......
.row
.col-md-4
.col-md-3
.admin-filter
= form_tag admin_projects_path, method: :get, class: '' do
.form-group
......@@ -7,9 +7,11 @@
= 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'
= 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]
......@@ -31,12 +33,12 @@
%span.descr
= visibility_level_icon(level)
= label
.form-actions
%hr
= hidden_field_tag :sort, params[:sort]
= submit_tag "Search", class: "btn submit btn-primary"
= link_to "Reset", admin_projects_path, class: "btn"
= 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})
......
.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,16 +61,13 @@
.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 &amp; 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'
......
%h3.page-title
#{@user.name} &rarr;
%i.icon-edit
Edit user
Edit user: #{@user.name}
.back-link
= link_to admin_user_path(@user) do
&larr; Back to user page
%hr
= render 'form'
%h3.page-title
%i.icon-plus
New user
%hr
= render 'form'
%h3.page-title
%span.cgray User:
User:
= @user.name
- if @user.blocked?
%span.cred (Blocked)
......@@ -11,14 +11,23 @@
%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
.tab-content
#account.tab-pane.active
.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:
......@@ -31,6 +40,11 @@
%span.light Email:
%strong
= mail_to @user.email
- @user.emails.each do |email|
%li
%span.light Secondary email:
%strong= email.email
%li
%span.light Can create groups:
%strong
......@@ -74,6 +88,7 @@
%strong
= link_to @user.created_by.name, [:admin, @user.created_by]
.col-md-6
- unless @user == current_user
- if @user.blocked?
.alert.alert-info
......@@ -116,7 +131,24 @@
%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
%span.light Profile page:
%strong
= link_to user_path(@user) do
= @user.username
.col-md-6
= render 'users/profile', user: @user
#groups.tab-pane
- if @user.users_groups.present?
.panel.panel-default
.panel-heading Groups:
......@@ -131,13 +163,32 @@
- 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.
#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
&ndash; access to
#{pluralize(group.projects.count, 'project')}
.row
.col-md-6
= render 'users/projects', projects: @personal_projects
.col-md-6
.panel.panel-default
.panel-heading Projects (#{@projects.count})
.panel-heading Joined projects (#{@joined_projects.count})
%ul.well-list
- @projects.sort_by(&:name_with_namespace).each do |project|
- @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
......
- 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
@
......
......@@ -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
......
.panel.panel-default
.panel-heading Personal projects
%ul.well-list
- @projects.each do |project|
- projects.each do |project|
%li
= link_to_project project
......@@ -13,6 +13,8 @@
%br
%small member since #{@user.created_at.stamp("Nov 12, 2031")}
.clearfix
- if @groups.any?
%h4 Groups:
= render 'groups', groups: @groups
%hr
......@@ -21,4 +23,4 @@
.col-md-4
= render 'profile', user: @user
- if @projects.present?
= render 'projects'
= render 'projects', projects: @projects
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