Commit c6298678 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

use ui-box as for all

parent 14d0ef8f
/** /**
* =================================== * ===================================
* Contain 3 main UI block elements: * Contain UI block elements:
* .main_box - for show pages * .ui-box - for any block & widgets
* .ui-box - for simple block & widgets
* =================================== * ===================================
*/ */
/** /**
* UI box element * UI Block
* contains top, middle, bottom blocks
* *
*/ */
.main_box { .ui-box {
@extend .borders; background: #F9F9F9;
@extend .prepend-top-20; margin-bottom: 25px;
@extend .append-bottom-20; border: 1px solid #CCC;
border-width: 1px;
@include solid-shade; @include solid-shade;
&.ui-box-show {
margin:20px 0;
background: #FFF;
}
img { max-width: 100%; } img { max-width: 100%; }
...@@ -27,9 +28,9 @@ ...@@ -27,9 +28,9 @@
} }
} }
.top_box_content, .ui-box-head,
.middle_box_content, .ui-box-body,
.bottom_box_content { .ui-box-bottom {
padding: 15px; padding: 15px;
word-wrap: break-word; word-wrap: break-word;
...@@ -39,19 +40,25 @@ ...@@ -39,19 +40,25 @@
border: none; border: none;
padding: 0; padding: 0;
} }
.clearfix {
margin: 0;
}
} }
.top_box_content { .ui-box-head {
.box-title { .box-title {
color: $style_color; color: $style_color;
font-size: 18px; font-size: 18px;
font-weight: normal; font-weight: normal;
line-height: 28px; line-height: 28px;
} }
h3 {
margin: 0;
}
} }
.middle_box_content { .ui-box-body {
@include border-radius(0);
border: none; border: none;
font-size: 12px; font-size: 12px;
background-color: #f5f5f5; background-color: #f5f5f5;
...@@ -59,24 +66,9 @@ ...@@ -59,24 +66,9 @@
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.bottom_box_content { .ui-box-bottom {
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
}
/**
* Big UI Block for show page content
*
*/
.ui-box {
background: #F9F9F9;
margin-bottom: 25px;
border: 1px solid #eaeaea;
@include border-radius(4px);
border-color: #CCC;
@include solid-shade;
&.white { &.white {
background: #fff; background: #fff;
...@@ -86,45 +78,14 @@ ...@@ -86,45 +78,14 @@
margin: 0; margin: 0;
} }
h5, .title { .title {
padding: 0 10px; padding: 0 10px;
@include border-radius(4px 4px 0 0);
@include bg-gray-gradient; @include bg-gray-gradient;
border-top: 1px solid #eaeaea; border-bottom: 1px solid #CCC;
border-bottom: 1px solid #bbb;
> a { > a {
text-shadow: 0 1px 1px #fff; text-shadow: 0 1px 1px #fff;
} }
&.small {
line-height: 28px;
font-size: 14px;
line-height: 28px;
text-shadow: 0 1px 1px white;
}
form {
padding: 9px 0;
margin: 0px;
}
.nav-pills {
li {
padding: 3px 0;
&.active a { background-color: $style_color; }
a {
@include border-radius(7px);
}
}
}
}
.bottom {
@include bg-gray-gradient;
@include border-radius(0 0 4px 4px);
border-bottom: none;
border-top: 1px solid #bbb;
} }
&.padded { &.padded {
...@@ -143,6 +104,7 @@ ...@@ -143,6 +104,7 @@
color: #777; color: #777;
} }
} }
.row_title { .row_title {
font-weight: bold; font-weight: bold;
color: #444; color: #444;
...@@ -151,8 +113,4 @@ ...@@ -151,8 +113,4 @@
text-decoration: underline; text-decoration: underline;
} }
} }
.ui-box-body {
padding: 10px;
}
} }
...@@ -23,14 +23,8 @@ ...@@ -23,14 +23,8 @@
border-bottom: 1px solid #ADF; border-bottom: 1px solid #ADF;
} }
&:first-child {
@include border-radius(4px 4px 0 0);
border-top: none;
}
&:last-child { &:last-child {
@include border-radius(0 0 4px 4px); border-bottom: none;
border: none;
} }
.author { color: #999; } .author { color: #999; }
......
.commit-box {
@extend .main_box;
.commit-head {
@extend .top_box_content;
.commit-title {
line-height: 26px;
margin: 0;
}
.commit-description {
font-size: 14px;
border: none;
background-color: white;
padding-top: 10px;
}
.browse-button {
@extend .btn;
@extend .btn-small;
float: right;
}
}
.commit-info {
@extend .middle_box_content;
@extend .clearfix;
.sha-block {
text-align: right;
&:first-child {
padding-bottom: 6px;
}
a {
border-bottom: 1px solid #aaa;
margin-left: 9px;
}
}
&.merge-commit .sha-block {
clear: right;
}
.committer {
padding-left: 32px;
}
.author a,
.committer a {
font-size: 14px;
line-height: 22px;
text-shadow: 0 1px 1px #fff;
color: #777;
&:hover {
color: #999;
}
}
.avatar {
margin-right: 10px;
}
}
}
/** /**
* *
* COMMIT SHOw * COMMIT SHOw
* *
*/ */
.commit-committer-link,
.commit-author-link {
font-size: 13px;
color: #555;
&:hover {
color: #999;
}
}
.diff_file { .diff_file {
border: 1px solid #CCC; border: 1px solid #CCC;
margin-bottom: 1em; margin-bottom: 1em;
...@@ -255,13 +198,6 @@ ...@@ -255,13 +198,6 @@
min-width: 65px; min-width: 65px;
font-family: $monospace; font-family: $monospace;
} }
.commit-author-name {
color: #777;
&:hover {
color: #999;
}
}
} }
.diff_file_header a, .diff_file_header a,
......
.issue_form_box {
@extend .main_box;
.issue_title {
@extend .top_box_content;
.clearfix {
margin-bottom: 0px;
input {
@extend .span8;
}
}
}
.issue_middle_block {
@extend .middle_box_content;
height: 30px;
.issue_assignee {
@extend .span6;
float: left;
}
.issue_milestone {
@extend .span4;
float: left;
}
}
.issue_description {
@extend .bottom_box_content;
}
}
.issues_table { .issues_table {
.issue { .issue {
padding: 7px 10px; padding: 7px 10px;
......
/**
* MR form
*
*/
.mr_branch_box {
@extend .ui-box;
margin-bottom: 20px;
.body {
background: #f1f1f1;
}
}
/** /**
* MR -> show: Automerge widget * MR -> show: Automerge widget
...@@ -121,19 +107,3 @@ li.merge_request { ...@@ -121,19 +107,3 @@ li.merge_request {
.mr_direction_tip { .mr_direction_tip {
margin-top:40px margin-top:40px
} }
.merge_requests_form_box {
@extend .main_box;
.merge_requests_middle_box {
@extend .middle_box_content;
height: 30px;
.merge_requests_assignee {
@extend .span6;
float: left;
}
.merge_requests_milestone {
@extend .span4;
float: left;
}
}
}
...@@ -9,15 +9,17 @@ ...@@ -9,15 +9,17 @@
.groups_box, .groups_box,
.projects_box { .projects_box {
> h5 { > h5 {
color: $style_color; color: #456;
font-size: 16px; font-size: 16px;
text-shadow: 0 1px 1px #fff; text-shadow: 0 1px 1px #fff;
padding: 2px 10px; padding: 2px 15px;
line-height: 32px; line-height: 36px;
font-size: 14px; font-size: 14px;
font-weight: normal;
} }
.nav-projects-tabs li { padding: 0; } .nav-projects-tabs li { padding: 0; }
.well-list { .well-list {
li { padding: 15px; }
.arrow { .arrow {
float: right; float: right;
padding: 10px; padding: 10px;
...@@ -109,7 +111,7 @@ ul.nav.nav-projects-tabs { ...@@ -109,7 +111,7 @@ ul.nav.nav-projects-tabs {
li { li {
a { a {
padding: 4px 20px; padding: 6px 25px;
margin-top: 2px; margin-top: 2px;
border-color: #DDD; border-color: #DDD;
background-color: #EEE; background-color: #EEE;
......
= render "commits/commit_box" = render "commits/commit_box"
%p.right %p.right.cgray
This commit has This commit has
%span.cgreen #{@commit.stats.additions} additions %span.cgreen #{@commit.stats.additions} additions
and and
......
.commit-box{class: @commit.parents_count > 1 ? "merge-commit" : ""} .ui-box.ui-box-show
.commit-head .ui-box-head
.right .right
- if @notes_count > 0 - if @notes_count > 0
%span.btn.disabled.grouped %span.btn.disabled.grouped
%i.icon-comment %i.icon-comment
= @notes_count = @notes_count
.left.btn-group .left.btn-group
%a.btn.small.grouped.dropdown-toggle{ data: {toggle: :dropdown} } %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
%i.icon-download-alt %i.icon-download-alt
Download as Download as
%span.caret %span.caret
%ul.dropdown-menu %ul.dropdown-menu
%li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch) %li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
%li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff) %li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
= link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do = link_to project_tree_path(@project, @commit), class: "btn primary grouped" do
%strong Browse Code » %span Browse Code »
%h3.commit-title.page_title %h3.commit-title.page_title
= gfm escape_once(@commit.title) = gfm escape_once(@commit.title)
- if @commit.description.present? - if @commit.description.present?
%pre.commit-description %pre.commit-description
= gfm escape_once(@commit.description) = gfm escape_once(@commit.description)
.commit-info .ui-box-body
.row .row
.span5 .span5
.author .author
%strong= @commit.author_link avatar: true, size: 40 = @commit.author_link avatar: true, size: 32
authored authored
%time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")} %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.authored_date)} ago #{time_ago_in_words(@commit.authored_date)} ago
- if @commit.different_committer? - if @commit.different_committer?
.committer .committer
→ →
%strong= @commit.committer_link = @commit.committer_link
committed committed
%time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")} %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.committed_date)} ago #{time_ago_in_words(@commit.committed_date)} ago
.span6.right .span6.pull-right
.pull-right
.sha-block .sha-block
%span.cgray commit %span.cgray commit
%code.label_commit= @commit.id %span.label_commit= @commit.id
.clearfix
.pull-right
.sha-block .sha-block
%span.cgray= pluralize(@commit.parents.count, "parent") %span.cgray= pluralize(@commit.parents.count, "parent")
- @commit.parents.each do |parent| - @commit.parents.each do |parent|
......
- @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits|
%div.ui-box %div.ui-box
%h5.small %h6.title
%i.icon-calendar %i.icon-calendar
= day.stamp("28 Aug, 2010") = day.stamp("28 Aug, 2010")
%ul.well-list= render commits %ul.well-list= render commits
.groups_box .groups_box
%h5 %h5.title
Groups Groups
%small %small
(#{groups.count}) (#{groups.count})
......
.projects_box .projects_box
%h5 %h5.title
Projects Projects
%small %small
(#{projects.total_count}) (#{projects.total_count})
......
...@@ -6,26 +6,27 @@ ...@@ -6,26 +6,27 @@
- @issue.errors.full_messages.each do |msg| - @issue.errors.full_messages.each do |msg|
%span= msg %span= msg
%br %br
.issue_form_box .ui-box.ui-box-show
.issue_title .ui-box-head
.clearfix .clearfix
= f.label :title do = f.label :title do
%strong= "Subject *" %strong= "Subject *"
.input .input
= f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true
.issue_middle_block .ui-box-body
.issue_assignee .clearfix
.issue_assignee.pull-left
= f.label :assignee_id do = f.label :assignee_id do
%i.icon-user %i.icon-user
Assign to Assign to
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'}) .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'})
.issue_milestone .issue_milestone.pull-left
= f.label :milestone_id do = f.label :milestone_id do
%i.icon-time %i.icon-time
Milestone Milestone
.input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
.issue_description .ui-box-bottom
.clearfix .clearfix
= f.label :label_list do = f.label :label_list do
%i.icon-tag %i.icon-tag
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
← To issues list ← To issues list
.main_box .ui-box.ui-box-show
.top_box_content .ui-box-head
%h4.box-title %h4.box-title
- if @issue.closed - if @issue.closed
.error.status_info Closed .error.status_info Closed
= gfm escape_once(@issue.title) = gfm escape_once(@issue.title)
.middle_box_content .ui-box-body
%cite.cgray %cite.cgray
Created by #{link_to_member(@project, @issue.author)} Created by #{link_to_member(@project, @issue.author)}
- if @issue.assignee - if @issue.assignee
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
.right .right
- @issue.labels.each do |label| - @issue.labels.each do |label|
%span.label.label-issue %span
%i.icon-tag %i.icon-tag
= label.name = label.name
   
- if @issue.description.present? - if @issue.description.present?
.bottom_box_content .ui-box-bottom
= preserve do = preserve do
= markdown @issue.description = markdown @issue.description
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
- @merge_request.errors.full_messages.each do |msg| - @merge_request.errors.full_messages.each do |msg|
%li= msg %li= msg
%h4.cdark 1. Select Branches %fieldset
%br %legend 1. Select Branches
.row .row
.span5 .span5
...@@ -25,21 +25,23 @@ ...@@ -25,21 +25,23 @@
.padded= f.select(:target_branch, @repository.heads.map(&:name), { include_blank: "Select branch" }, {class: 'chosen span4'}) .padded= f.select(:target_branch, @repository.heads.map(&:name), { include_blank: "Select branch" }, {class: 'chosen span4'})
.mr_target_commit .mr_target_commit
%h4.cdark 2. Fill info %fieldset
%legend 2. Fill info
.ui-box.ui-box-show
.ui-box-head
.clearfix .clearfix
.merge_requests_form_box
.top_box_content
= f.label :title do = f.label :title do
%strong= "Title *" %strong= "Title *"
.input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true .input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true
.merge_requests_middle_box .ui-box-body
.merge_requests_assignee .clearfix
.left
= f.label :assignee_id do = f.label :assignee_id do
%i.icon-user %i.icon-user
Assign to Assign to
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'}) .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'})
.merge_requests_milestone .left
= f.label :milestone_id do = f.label :milestone_id do
%i.icon-time %i.icon-time
Milestone Milestone
......
- if @commits.present? - if @commits.present?
.ui-box .ui-box
%h5 %h6.title
%i.icon-list %i.icon-list
Commits (#{@commits.count}) Commits (#{@commits.count})
.merge-request-commits .merge-request-commits
......
.main_box .ui-box.ui-box-show
.top_box_content .ui-box-head
%h4.box-title %h4.box-title
- if @merge_request.merged - if @merge_request.merged
.error.status_info .error.status_info
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.error.status_info Closed .error.status_info Closed
= gfm escape_once(@merge_request.title) = gfm escape_once(@merge_request.title)
.middle_box_content .ui-box-body
%div %div
%cite.cgray %cite.cgray
Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by #{link_to_member(@project, @merge_request.author)} Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by #{link_to_member(@project, @merge_request.author)}
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
- if @merge_request.closed - if @merge_request.closed
.bottom_box_content .ui-box-bottom
- if @merge_request.merged? - if @merge_request.merged?
%span %span
Merged by #{link_to_member(@project, @merge_request.merge_event.author)} Merged by #{link_to_member(@project, @merge_request.merge_event.author)}
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
%span All issues for this milestone are closed. You may close milestone now. %span All issues for this milestone are closed. You may close milestone now.
= link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {closed: true }), method: :put, class: "btn small danger" = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {closed: true }), method: :put, class: "btn small danger"
.main_box .ui-box.ui-box-show
.top_box_content .ui-box-head
%h4.box-title %h4.box-title
- if @milestone.closed - if @milestone.closed
.error.status_info Closed .error.status_info Closed
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
= gfm escape_once(@milestone.title) = gfm escape_once(@milestone.title)
.middle_box_content .ui-box-body
%h5 %h5
Progress: Progress:
%small %small
......
...@@ -30,4 +30,10 @@ ...@@ -30,4 +30,10 @@
Download Download
- else - else
%h3 No tags %h3.nothing_here_message
Repository has no tags yet.
%br
%small
Use git tag command to add a new one:
%br
%span.monospace git tag -a v1.4 -m 'version 1.4'
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
- @wiki.errors.full_messages.each do |msg| - @wiki.errors.full_messages.each do |msg|
%li= msg %li= msg
.main_box .ui-box.ui-box-show
.top_box_content .ui-box-head
= f.label :title = f.label :title
.input= f.text_field :title, class: 'span8' .input= f.text_field :title, class: 'span8'
= f.hidden_field :slug = f.hidden_field :slug
.middle_box_content .ui-box-body
.input .input
%span.cgray %span.cgray
Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
%code [Link Title](page-slug) %code [Link Title](page-slug)
\. \.
.bottom_box_content .ui-box-bottom
= f.label :content = f.label :content
.input= f.text_area :content, class: 'span8 js-gfm-input' .input= f.text_area :content, class: 'span8 js-gfm-input'
.actions .actions
......
...@@ -2,6 +2,7 @@ require 'spec_helper' ...@@ -2,6 +2,7 @@ require 'spec_helper'
describe Project, "Hooks" do describe Project, "Hooks" do
let(:project) { create(:project) } let(:project) { create(:project) }
before do before do
@key = create(:key, user: project.owner) @key = create(:key, user: project.owner)
@user = @key.user @user = @key.user
......
...@@ -76,31 +76,15 @@ describe Project do ...@@ -76,31 +76,15 @@ describe Project do
describe "Respond to" do describe "Respond to" do
it { should respond_to(:url_to_repo) } it { should respond_to(:url_to_repo) }
it { should respond_to(:path_to_repo) }
it { should respond_to(:valid_repo?) }
it { should respond_to(:repo_exists?) } it { should respond_to(:repo_exists?) }
# Repository Role
it { should respond_to(:satellite) } it { should respond_to(:satellite) }
it { should respond_to(:update_repository) } it { should respond_to(:update_repository) }
it { should respond_to(:destroy_repository) } it { should respond_to(:destroy_repository) }
# Authority Role
it { should respond_to(:reset_access) }
it { should respond_to(:allow_read_for?) }
it { should respond_to(:guest_access_for?) }
it { should respond_to(:report_access_for?) }
it { should respond_to(:dev_access_for?) }
it { should respond_to(:master_access_for?) }
# Project Push Role
it { should respond_to(:observe_push) } it { should respond_to(:observe_push) }
it { should respond_to(:update_merge_requests) } it { should respond_to(:update_merge_requests) }
it { should respond_to(:execute_hooks) } it { should respond_to(:execute_hooks) }
it { should respond_to(:post_receive_data) } it { should respond_to(:post_receive_data) }
it { should respond_to(:trigger_post_receive) } it { should respond_to(:trigger_post_receive) }
# Namespaced Project Role
it { should respond_to(:transfer) } it { should respond_to(:transfer) }
it { should respond_to(:name_with_namespace) } it { should respond_to(:name_with_namespace) }
it { should respond_to(:namespace_owner) } it { should respond_to(:namespace_owner) }
......
require "spec_helper"
describe Repository do describe Repository do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:repository) { project.repository } let(:repository) { project.repository }
......
require "spec_helper"
describe Team do describe Team do
let(:team) { create(:project).team }
describe "Respond to" do describe "Respond to" do
subject { team }
it { should respond_to(:developers) } it { should respond_to(:developers) }
it { should respond_to(:masters) } it { should respond_to(:masters) }
it { should respond_to(:reporters) } it { should respond_to(:reporters) }
......
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