Commit 087abdf7 authored by Jacob Schatz's avatar Jacob Schatz

New right side gutter design.

[WIP]
parent 48b6b0a4
...@@ -10,18 +10,6 @@ class @IssuableContext ...@@ -10,18 +10,6 @@ class @IssuableContext
$(".issuable-sidebar .inline-update").on "change", ".js-assignee", -> $(".issuable-sidebar .inline-update").on "change", ".js-assignee", ->
$(this).submit() $(this).submit()
$('.issuable-details').waitForImages ->
$('.issuable-affix').on 'affix.bs.affix', ->
$(@).width($(@).outerWidth())
.on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
$(@).width('')
$('.issuable-affix').affix offset:
top: ->
@top = ($('.issuable-affix').offset().top - 70)
bottom: ->
@bottom = $('.footer').outerHeight(true)
$(".edit-link").click (e) -> $(".edit-link").click (e) ->
block = $(@).parents('.block') block = $(@).parents('.block')
block.find('.selectbox').show() block.find('.selectbox').show()
......
...@@ -200,6 +200,10 @@ ...@@ -200,6 +200,10 @@
} }
} }
@mixin expanded-gutter {
padding-right: $gutter_width;
}
@mixin collapsed-sidebar { @mixin collapsed-sidebar {
padding-left: $sidebar_collapsed_width; padding-left: $sidebar_collapsed_width;
...@@ -266,6 +270,7 @@ ...@@ -266,6 +270,7 @@
background: #f2f6f7; background: #f2f6f7;
} }
// page is small enough
@media (max-width: $screen-md-max) { @media (max-width: $screen-md-max) {
.page-sidebar-collapsed { .page-sidebar-collapsed {
@include collapsed-sidebar; @include collapsed-sidebar;
...@@ -280,7 +285,13 @@ ...@@ -280,7 +285,13 @@
} }
} }
// page is large enough
@media(min-width: $screen-md-max) { @media(min-width: $screen-md-max) {
.page-gutter {
@include expanded-gutter;
}
.page-sidebar-collapsed { .page-sidebar-collapsed {
@include collapsed-sidebar; @include collapsed-sidebar;
} }
...@@ -288,4 +299,4 @@ ...@@ -288,4 +299,4 @@
.page-sidebar-expanded { .page-sidebar-expanded {
@include expanded-sidebar; @include expanded-sidebar;
} }
} }
\ No newline at end of file
...@@ -12,6 +12,8 @@ $gl-font-size: 15px; ...@@ -12,6 +12,8 @@ $gl-font-size: 15px;
$list-font-size: 15px; $list-font-size: 15px;
$sidebar_collapsed_width: 62px; $sidebar_collapsed_width: 62px;
$sidebar_width: 230px; $sidebar_width: 230px;
$gutter_collapsed_width: 62px;
$gutter_width: 320px;
$avatar_radius: 50%; $avatar_radius: 50%;
$code_font_size: 13px; $code_font_size: 13px;
$code_line_height: 1.5; $code_line_height: 1.5;
......
...@@ -133,3 +133,16 @@ ...@@ -133,3 +133,16 @@
margin-right: 2px; margin-right: 2px;
} }
} }
.right-sidebar {
position: fixed;
top: 58px;
right: 0;
height: 100%;
transition-duration: .3s;
background: $gray-light;
overflow: scroll;
width: $gutter_width;
padding: 10px 20px;
}
\ No newline at end of file
...@@ -293,6 +293,36 @@ module ApplicationHelper ...@@ -293,6 +293,36 @@ module ApplicationHelper
end end
end end
def issuable_count(entity, project)
if project.nil?
0
elsif current_controller?(:issues)
project.issues.send(entity).count
elsif current_controller?(:merge_requests)
project.merge_requests.send(entity).count
end
end
def next_issuable_for(project)
if project.nil?
nil
elsif current_controller?(:issues)
project.issues.where("id > ?", id).first
elsif current_controller?(:merge_requests)
project.merge_requests.where("id > ?", id).first
end
end
def prev_issuable_for(project)
if project.nil?
nil
elsif current_controller?(:issues)
project.issues.where("id < ?", id).last
elsif current_controller?(:merge_requests)
project.merge_requests.where("id > ?", id).last
end
end
def state_filters_text_for(entity, project) def state_filters_text_for(entity, project)
titles = { titles = {
opened: "Open" opened: "Open"
......
...@@ -19,6 +19,12 @@ module NavHelper ...@@ -19,6 +19,12 @@ module NavHelper
end end
end end
def page_gutter_class
if current_path?('merge_requests#show') || current_path?('issues#show')
"page-gutter"
end
end
def nav_header_class def nav_header_class
if nav_menu_collapsed? if nav_menu_collapsed?
"header-collapsed" "header-collapsed"
......
.page-with-sidebar{ class: page_sidebar_class } .page-with-sidebar{ class: "#{page_sidebar_class} #{page_gutter_class}" }
= render "layouts/broadcast" = render "layouts/broadcast"
.sidebar-wrapper.nicescroll{ class: nav_sidebar_class } .sidebar-wrapper.nicescroll{ class: nav_sidebar_class }
.header-logo .header-logo
......
...@@ -54,11 +54,9 @@ ...@@ -54,11 +54,9 @@
= render 'votes/votes_block', votable: @issue = render 'votes/votes_block', votable: @issue
.row .row
%section.col-md-9 %section.col-md-12
.issuable-discussion .issuable-discussion
= render 'projects/issues/discussion' = render 'projects/issues/discussion'
%aside.col-md-3
= render 'shared/issuable/sidebar', issuable: @issue
= render 'shared/show_aside' = render 'shared/show_aside'
= render 'shared/issuable/sidebar', issuable: @issue
\ No newline at end of file
...@@ -70,11 +70,9 @@ ...@@ -70,11 +70,9 @@
= render 'votes/votes_block', votable: @merge_request = render 'votes/votes_block', votable: @merge_request
.row .row
%section.col-md-9 %section.col-md-12
.issuable-discussion .issuable-discussion
= render "projects/merge_requests/discussion" = render "projects/merge_requests/discussion"
%aside.col-md-3
= render 'shared/issuable/sidebar', issuable: @merge_request
= render 'shared/show_aside' = render 'shared/show_aside'
#commits.commits.tab-pane #commits.commits.tab-pane
...@@ -87,6 +85,8 @@ ...@@ -87,6 +85,8 @@
.mr-loading-status .mr-loading-status
= spinner = spinner
= render 'shared/issuable/sidebar', issuable: @merge_request
:javascript :javascript
var merge_request; var merge_request;
......
.issuable-sidebar.issuable-affix %aside.right-sidebar
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f| .issuable-sidebar
.block.assignee .block
.title = issuable.iid
%label of
Assignee = issuable_count(:all, @project)
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) .issuable-nav.pull-right.btn-group{role: 'group', "aria-label" => '...'}
.pull-right %a.btn.btn-default{href: '#'}
= link_to 'Edit', '#', class: 'edit-link' Prev
.value %a.btn.btn-default{href: '#'}
- if issuable.assignee Next
%strong= link_to_member(@project, issuable.assignee, size: 24) = form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
- if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee) .block.assignee
%a.pull-right.cannot-be-merged{href: '#', data: {toggle: 'tooltip'}, title: 'Not allowed to merge'} .title
= icon('exclamation-triangle') %label
- else Assignee
.light None - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.pull-right
.selectbox = link_to 'Edit', '#', class: 'edit-link'
= users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true, current_user: true, first_user: true) .value
- if issuable.assignee
%strong= link_to_member(@project, issuable.assignee, size: 24)
- if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee)
%a.pull-right.cannot-be-merged{href: '#', data: {toggle: 'tooltip'}, title: 'Not allowed to merge'}
= icon('exclamation-triangle')
- else
.light None
.block.milestone .selectbox
.title = users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true, current_user: true, first_user: true)
%label
Milestone
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.pull-right
= link_to 'Edit', '#', class: 'edit-link'
.value
- if issuable.milestone
%span.back-to-milestone
= link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do
%strong
= icon('clock-o')
= issuable.milestone.title
- else
.light None
.selectbox
= f.select(:milestone_id, milestone_options(issuable), { include_blank: true }, { class: 'select2 select2-compact js-select2 js-milestone', data: { placeholder: 'Select milestone' }})
= hidden_field_tag :issuable_context
= f.submit class: 'btn hide'
- if issuable.project.labels.any? .block.milestone
.block
.title .title
%label Labels %label
Milestone
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.pull-right .pull-right
= link_to 'Edit', '#', class: 'edit-link' = link_to 'Edit', '#', class: 'edit-link'
.value.issuable-show-labels .value
- if issuable.labels.any? - if issuable.milestone
- issuable.labels.each do |label| %span.back-to-milestone
= link_to_label(label) = link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do
%strong
= icon('clock-o')
= issuable.milestone.title
- else - else
.light None .light None
.selectbox .selectbox
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name, = f.select(:milestone_id, milestone_options(issuable), { include_blank: true }, { class: 'select2 select2-compact js-select2 js-milestone', data: { placeholder: 'Select milestone' }})
{ selected: issuable.label_ids }, multiple: true, class: 'select2 js-select2', data: { placeholder: "Select labels" } = hidden_field_tag :issuable_context
= f.submit class: 'btn hide'
= render "shared/issuable/participants", participants: issuable.participants(current_user) - if issuable.project.labels.any?
.block
.title
%label Labels
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.pull-right
= link_to 'Edit', '#', class: 'edit-link'
.value.issuable-show-labels
- if issuable.labels.any?
- issuable.labels.each do |label|
= link_to_label(label)
- else
.light None
.selectbox
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
{ selected: issuable.label_ids }, multiple: true, class: 'select2 js-select2', data: { placeholder: "Select labels" }
- if current_user = render "shared/issuable/participants", participants: issuable.participants(current_user)
- subscribed = issuable.subscribed?(current_user)
.block.light
.title
%label.light Notifications
- subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
%button.btn.btn-block.btn-gray.subscribe-button{:type => 'button'}
%span= subscribed ? 'Unsubscribe' : 'Subscribe'
.subscription-status{data: {status: subscribtion_status}}
.unsubscribed{class: ( 'hidden' if subscribed )}
You're not receiving notifications from this thread.
.subscribed{class: ( 'hidden' unless subscribed )}
You're receiving notifications because you're subscribed to this thread.
- project_ref = cross_project_reference(@project, issuable) - if current_user
.block - subscribed = issuable.subscribed?(current_user)
.title .block.light
.cross-project-reference .title
%span %label.light Notifications
Reference: - subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
%cite{title: project_ref} %button.btn.btn-block.btn-gray.subscribe-button{:type => 'button'}
= project_ref %span= subscribed ? 'Unsubscribe' : 'Subscribe'
= clipboard_button(clipboard_text: project_ref) .subscription-status{data: {status: subscribtion_status}}
.unsubscribed{class: ( 'hidden' if subscribed )}
You're not receiving notifications from this thread.
.subscribed{class: ( 'hidden' unless subscribed )}
You're receiving notifications because you're subscribed to this thread.
- project_ref = cross_project_reference(@project, issuable)
.block
.title
.cross-project-reference
%span
Reference:
%cite{title: project_ref}
= project_ref
= clipboard_button(clipboard_text: project_ref)
:javascript :javascript
new Subscription("#{toggle_subscription_path(issuable)}"); new Subscription("#{toggle_subscription_path(issuable)}");
new IssuableContext(); new IssuableContext();
\ No newline at end of file \ No newline at end of file
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