From 7f6e41fa028e4293e50edbf9fe2ea6cc19957533 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 28 Jan 2012 00:51:02 +0200 Subject: [PATCH] Bootstrap: application layout --- app/assets/stylesheets/common.scss | 24 ++ app/assets/stylesheets/projects.css.scss | 17 - app/assets/stylesheets/projects.css.scss.bak | 384 ++++++++++++++++++ app/assets/stylesheets/projects.css.scss~ | 385 +++++++++++++++++++ app/views/dashboard/_issues_feed.html.haml | 8 +- app/views/dashboard/_projects_feed.html.haml | 29 +- app/views/dashboard/_sidebar.html.haml | 16 - app/views/dashboard/index.html.haml | 2 + app/views/dashboard/issues.html.haml | 5 + app/views/dashboard/merge_requests.html.haml | 2 + app/views/layouts/_app_side.html.haml | 10 + app/views/layouts/_head_panel.html.haml | 25 -- app/views/layouts/_projects_side.html.haml | 35 ++ app/views/layouts/admin.html.haml | 26 +- app/views/layouts/application.html.haml | 8 +- app/views/projects/_form.html.haml | 81 ++-- app/views/projects/_tile.html.haml | 25 +- app/views/projects/create.js.haml | 1 + app/views/projects/index.html.haml | 42 +- app/views/projects/new.html.haml | 27 +- app/views/projects/update.js.haml | 1 + spec/requests/merge_requests_spec.rb | 2 +- 22 files changed, 951 insertions(+), 204 deletions(-) create mode 100644 app/assets/stylesheets/projects.css.scss.bak create mode 100644 app/assets/stylesheets/projects.css.scss~ delete mode 100644 app/views/dashboard/_sidebar.html.haml create mode 100644 app/views/layouts/_app_side.html.haml create mode 100644 app/views/layouts/_projects_side.html.haml diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 1b27814d..3b5c3531 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -105,6 +105,19 @@ $blue_link: "#2fa0bb"; border-right: 1px solid $border_color; height:100%; min-height:450px; + + .fixed { + position:fixed; + } + + aside a { + display:block; + position:relative; + padding:15px 10px; + margin:10px 0 0 0; + font-size:13px; + font-weight:bold; + } } .container-fluid > .content { @@ -112,6 +125,17 @@ $blue_link: "#2fa0bb"; margin-top:20px; } +aside.projects { + margin-left: 0; + padding-left: 20px; +} + +img.avatar { + width:32px; + float:left; + padding-right:5px; +} + @import "reset_bootstrap.scss"; @import "top_panel.scss"; @import "projects.css.scss"; diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 2f83adeb..e63f6dfd 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -1,23 +1,6 @@ .git_url_wrapper { margin-right:50px } - -.project { - .sidebar { - .fixed { - position:fixed; - } - - aside a { - display:block; - position:relative; - padding:15px 10px; - margin:10px 0 0 0; - font-size:13px; - font-weight:bold; - } - } -} .file_stats { span { img { diff --git a/app/assets/stylesheets/projects.css.scss.bak b/app/assets/stylesheets/projects.css.scss.bak new file mode 100644 index 00000000..ba69bf85 --- /dev/null +++ b/app/assets/stylesheets/projects.css.scss.bak @@ -0,0 +1,384 @@ +.git_url_wrapper { margin-right:50px } + +.sidebar aside a{ + display: block; + position: relative; + padding: 15px 10px; + margin: 10px 0 0 0; + + span.number{ + float: right; border-radius: 5px; text-shadow: none; background: rgba(0,0,0,.12); text-align: center; padding: 5px 8px; position: absolute; top: 10px; right: 10px; + } + &.current { + color: white; + background: $active_bg_color; + border: 1px solid $active_bd_color; + border-radius:5px; + + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 0; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 0px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + margin-right: -1px; + } +} + +body table .commit a{color: #{$blue_link}} +body table th, body table td{ border-bottom: 1px solid #DEE2E3;} +body .fixed{position: fixed; } + +/** File stat **/ +.file_stats { + span { + img { + width:14px; + float:left; + margin-right: 6px; + padding:2px 0; + } + } +} + +.round-borders { + @include round-borders-all(4px); + padding: 4px 0px; +} + +table.round-borders { + float:left; + text-align: left; +} + + + +/** PROJECTS **/ +input.ssh_project_url { + padding:5px; + margin:0px; + float:right; + width:400px; + text-align:center; +} + +#projects-list .project { + height:50px; +} + +#tree-slider .tree-item, +#projects-list .project, +#snippets-table .snippet, +#issues-table .issue{ + cursor:pointer; +} + +.clear { + clear: both; +} + + + +#user_projects_limit{ + width: 60px; +} + +.handle:hover{ + cursor: move; +} + +.project-refs-form { + span { + background: none !important; + position:static !important; + width:auto !important; + height: auto !important; + } +} + +.project-refs-select { + width:200px; +} + +.filter .left { margin-right:15px; } + +body table .commit { + a.tree-commit-link { + color:#444; + &:hover { + text-decoration:underline; + } + } +} + +/** NEW PROJECT **/ +.new-project-hodler { + .icon span { background-position: -31px -70px; } + td { border-bottom: 1px solid #DEE2E3; } +} + +/** Feed entry **/ +.commit, +.snippet, +.message { + .title { + color:#666; + a { color:#666 !important; } + p { margin-top:0px; } + } + .author { color: #999 } +} + +/** JQuery UI **/ +.ui-autocomplete { @include round-borders-all(5px); } +.ui-menu-item { cursor: pointer } +.ui-selectmenu{ + @include round-borders-all(4px); + margin-right:10px; + font-size:1.5em; + height:auto; + font-weight:bold; + .ui-selectmenu-status { + padding:3px 10px; + } +} + +#holder { + background:#FAFAFA; + border: 1px solid #EEE; + cursor: move; + height: 70%; + overflow: hidden; +} + +/* Project Dashboard Page */ +html, body { height: 100%; } + +.news-feed h2{float: left;} +.news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;} +.news-feed .project-updates .data{ padding: 0} +.news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +.news-feed .project-updates a.project-update:last-child{border-bottom: 0} +.news-feed .project-updates a.project-update img{float: left; margin-right: 10px;} +.news-feed .project-updates a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;} +.news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px} +.news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;} +.news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;} +/* eo Dashboard Page */ + + +/** Update entry **/ +.update-data { padding: 0 } +.update-data { width:100%; } +.update-data.ui-box .data { padding:0; } +a.update-item {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +a.update-item:last-child{border-bottom: 0} +a.update-item img{float: left; margin-right: 10px;} +a.update-item span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;} +a.update-item span.update-title{margin-bottom: 10px} +a.update-item span.update-author{color: #999; font-weight: normal; font-style: italic;} +a.update-item span.update-author strong{font-weight: bold; font-style: normal;} + + +body .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; } + +body.projects-page input.text.git-url.project_list_url { width:165px; } + + +body table.no-borders th { + background:none; + border-bottom:1px solid #CCC; + color:#333; +} + +body table.no-borders tr, +body table.no-borders td{ + border:none; +} + +.ajax-tab-loading { + padding:40px; + display:none; +} + +#tree-content-holder { float:left; width:100%; } + +#tree-readme-holder { + float:left; + width:100%; + + .readme { + @include round-borders-all(4px); + padding: 4px 15px; + background:#F7F7F7; + } +} + + + +/* Commit Page */ +.entity-info {float: right;} +.entity-button{ + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4)); + background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4); + background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4); + background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4); + box-shadow: 0 -1px 0 white inset; + display: block; + border: 1px solid #eee; + border-radius: 5px; + margin-bottom: 2px; + position: relative; + padding: 4px 10px; + font-size: 11px; + padding-right: 20px; +} + +.entity-button i{ + background: url('images.png') no-repeat -138px -27px; + width: 6px; + height: 9px; + float: right; + position: absolute; + top: 6px; + right: 5px; +} +.box-arrow{float: right; background: #E3E5EA; padding: 10px; border-radius: 5px; margin-top: 2px; text-shadow: none; color: #999; margin: 1.5em 0;} + +h4.dash-tabs { + margin: 0; + border-bottom: 1px solid #ccc; + padding: 10px 10px; + font-size: 11px; + padding-left:20px; + font-weight: bold; text-transform: uppercase; + background: #F7F7F7; + margin-bottom:20px; + height:13px; + +} + +.dash-button { + border-right: 1px solid #ddd; + background:none; + padding: 10px 15px; + float:left; + position:relative; + top:-10px; + left:0px; + height:13px; + + &:first-child { + border-left: 1px solid #ddd; + } + &.active { + background: #eaeaea; + } +} + + +.dashboard-loader { + float:right; + margin-right:30px; + display:none; +} + + +.merge-tabs { + margin: 0; + border: 1px solid #ccc; + padding: 5px; + font-size: 12px; + background: #F7F7F7; + margin-bottom:20px; + height:26px; + + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + + .tab { + font-weight: bold; + border-right: 1px solid #ddd; + background:none; + padding: 10px; + min-width:60px; + float:left; + position:relative; + top:-5px; + left:-5px; + height:16px; + padding-left:34px; + + span { + width: 20px; + height: 20px; + display: inline-block; + position: absolute; + left: 8px; + top: 8px; + } + + &.active { + background: #eaeaea; + } + } +} +.merge-tabs.repository .tab span{ background: url("images.png") no-repeat -38px -77px; } +.activities-tab span { background: url("images.png") no-repeat -161px -1px; } +.stat-tab span, +.team-tab span, +.snippets-tab span { background: url("images.png") no-repeat -38px -77px; } +.files-tab span { background: url("images.png") no-repeat -112px -23px; } + +.merge-notes-tab span { background: url("images.png") no-repeat -161px -1px; } +.merge-commits-tab span { background: url("images.png") no-repeat -86px 1px; } +.merge-diffs-tab span { background: url("images.png") no-repeat -118px 1px; } +.merge-tabs .dashboard-loader { padding:8px; } + +.user-mention { + color: #2FA0BB; + font-weight: bold; +} + +.author { + color: #999; +} + + + + +.dark_scheme_box { + padding:20px 0; + + label { + float:left; + box-shadow: 0 0px 5px rgba(0,0,0,.3); + + img { + } + } +} + +a.project-update.titled { + position: relative; + padding-left: 235px !important; + + .title-block { + padding: 10px; + width: 205px; + position: absolute; + left: 0; + top: 0; + } +} + +.add_new { + float: right; + background: #A6B807; + color: white; + padding: 4px 10px; + @include round-borders-all(4px); + font-size:11px; + margin: 10px 0; +} diff --git a/app/assets/stylesheets/projects.css.scss~ b/app/assets/stylesheets/projects.css.scss~ new file mode 100644 index 00000000..4bdf5dee --- /dev/null +++ b/app/assets/stylesheets/projects.css.scss~ @@ -0,0 +1,385 @@ +.git_url_wrapper { margin-right:50px } + +.sidebar aside a{ + display: block; + position: relative; + padding: 15px 10px; + margin: 10px 0 0 0; + + font-size:13px; + font-weight:bold; + color:#333; + + &.current { + color: white; + background: $active_bg_color; + border: 1px solid $active_bd_color; + border-radius:5px; + + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 0; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 0px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + margin-right: -1px; + } +} + +body table .commit a{color: #{$blue_link}} +body table th, body table td{ border-bottom: 1px solid #DEE2E3;} +body .fixed{position: fixed; } + +/** File stat **/ +.file_stats { + span { + img { + width:14px; + float:left; + margin-right: 6px; + padding:2px 0; + } + } +} + +.round-borders { + @include round-borders-all(4px); + padding: 4px 0px; +} + +table.round-borders { + float:left; + text-align: left; +} + + + +/** PROJECTS **/ +input.ssh_project_url { + padding:5px; + margin:0px; + float:right; + width:400px; + text-align:center; +} + +#projects-list .project { + height:50px; +} + +#tree-slider .tree-item, +#projects-list .project, +#snippets-table .snippet, +#issues-table .issue{ + cursor:pointer; +} + +.clear { + clear: both; +} + + + +#user_projects_limit{ + width: 60px; +} + +.handle:hover{ + cursor: move; +} + +.project-refs-form { + span { + background: none !important; + position:static !important; + width:auto !important; + height: auto !important; + } +} + +.project-refs-select { + width:200px; +} + +.filter .left { margin-right:15px; } + +body table .commit { + a.tree-commit-link { + color:#444; + &:hover { + text-decoration:underline; + } + } +} + +/** NEW PROJECT **/ +.new-project-hodler { + .icon span { background-position: -31px -70px; } + td { border-bottom: 1px solid #DEE2E3; } +} + +/** Feed entry **/ +.commit, +.snippet, +.message { + .title { + color:#666; + a { color:#666 !important; } + p { margin-top:0px; } + } + .author { color: #999 } +} + +/** JQuery UI **/ +.ui-autocomplete { @include round-borders-all(5px); } +.ui-menu-item { cursor: pointer } +.ui-selectmenu{ + @include round-borders-all(4px); + margin-right:10px; + font-size:1.5em; + height:auto; + font-weight:bold; + .ui-selectmenu-status { + padding:3px 10px; + } +} + +#holder { + background:#FAFAFA; + border: 1px solid #EEE; + cursor: move; + height: 70%; + overflow: hidden; +} + +/* Project Dashboard Page */ +html, body { height: 100%; } + +.news-feed h2{float: left;} +.news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;} +.news-feed .project-updates .data{ padding: 0} +.news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +.news-feed .project-updates a.project-update:last-child{border-bottom: 0} +.news-feed .project-updates a.project-update img{float: left; margin-right: 10px;} +.news-feed .project-updates a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;} +.news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px} +.news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;} +.news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;} +/* eo Dashboard Page */ + + +/** Update entry **/ +.update-data { padding: 0 } +.update-data { width:100%; } +.update-data.ui-box .data { padding:0; } +a.update-item {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +a.update-item:last-child{border-bottom: 0} +a.update-item img{float: left; margin-right: 10px;} +a.update-item span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;} +a.update-item span.update-title{margin-bottom: 10px} +a.update-item span.update-author{color: #999; font-weight: normal; font-style: italic;} +a.update-item span.update-author strong{font-weight: bold; font-style: normal;} + + +body .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; } + +body.projects-page input.text.git-url.project_list_url { width:165px; } + + +body table.no-borders th { + background:none; + border-bottom:1px solid #CCC; + color:#333; +} + +body table.no-borders tr, +body table.no-borders td{ + border:none; +} + +.ajax-tab-loading { + padding:40px; + display:none; +} + +#tree-content-holder { float:left; width:100%; } + +#tree-readme-holder { + float:left; + width:100%; + + .readme { + @include round-borders-all(4px); + padding: 4px 15px; + background:#F7F7F7; + } +} + + + +/* Commit Page */ +.entity-info {float: right;} +.entity-button{ + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4)); + background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4); + background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4); + background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4); + box-shadow: 0 -1px 0 white inset; + display: block; + border: 1px solid #eee; + border-radius: 5px; + margin-bottom: 2px; + position: relative; + padding: 4px 10px; + font-size: 11px; + padding-right: 20px; +} + +.entity-button i{ + background: url('images.png') no-repeat -138px -27px; + width: 6px; + height: 9px; + float: right; + position: absolute; + top: 6px; + right: 5px; +} +.box-arrow{float: right; background: #E3E5EA; padding: 10px; border-radius: 5px; margin-top: 2px; text-shadow: none; color: #999; margin: 1.5em 0;} + +h4.dash-tabs { + margin: 0; + border-bottom: 1px solid #ccc; + padding: 10px 10px; + font-size: 11px; + padding-left:20px; + font-weight: bold; text-transform: uppercase; + background: #F7F7F7; + margin-bottom:20px; + height:13px; + +} + +.dash-button { + border-right: 1px solid #ddd; + background:none; + padding: 10px 15px; + float:left; + position:relative; + top:-10px; + left:0px; + height:13px; + + &:first-child { + border-left: 1px solid #ddd; + } + &.active { + background: #eaeaea; + } +} + + +.dashboard-loader { + float:right; + margin-right:30px; + display:none; +} + + +.merge-tabs { + margin: 0; + border: 1px solid #ccc; + padding: 5px; + font-size: 12px; + background: #F7F7F7; + margin-bottom:20px; + height:26px; + + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + + .tab { + font-weight: bold; + border-right: 1px solid #ddd; + background:none; + padding: 10px; + min-width:60px; + float:left; + position:relative; + top:-5px; + left:-5px; + height:16px; + padding-left:34px; + + span { + width: 20px; + height: 20px; + display: inline-block; + position: absolute; + left: 8px; + top: 8px; + } + + &.active { + background: #eaeaea; + } + } +} +.merge-tabs.repository .tab span{ background: url("images.png") no-repeat -38px -77px; } +.activities-tab span { background: url("images.png") no-repeat -161px -1px; } +.stat-tab span, +.team-tab span, +.snippets-tab span { background: url("images.png") no-repeat -38px -77px; } +.files-tab span { background: url("images.png") no-repeat -112px -23px; } + +.merge-notes-tab span { background: url("images.png") no-repeat -161px -1px; } +.merge-commits-tab span { background: url("images.png") no-repeat -86px 1px; } +.merge-diffs-tab span { background: url("images.png") no-repeat -118px 1px; } +.merge-tabs .dashboard-loader { padding:8px; } + +.user-mention { + color: #2FA0BB; + font-weight: bold; +} + +.author { + color: #999; +} + + + + +.dark_scheme_box { + padding:20px 0; + + label { + float:left; + box-shadow: 0 0px 5px rgba(0,0,0,.3); + + img { + } + } +} + +a.project-update.titled { + position: relative; + padding-left: 235px !important; + + .title-block { + padding: 10px; + width: 205px; + position: absolute; + left: 0; + top: 0; + } +} + +.add_new { + float: right; + background: #A6B807; + color: white; + padding: 4px 10px; + @include round-borders-all(4px); + font-size:11px; + margin: 10px 0; +} diff --git a/app/views/dashboard/_issues_feed.html.haml b/app/views/dashboard/_issues_feed.html.haml index 45892664..dbd1efff 100644 --- a/app/views/dashboard/_issues_feed.html.haml +++ b/app/views/dashboard/_issues_feed.html.haml @@ -4,8 +4,8 @@ .data - @issues.each do |update| %a.project-update{:href => dashboard_feed_path(update.project, update)} - %strong.issue-number= "##{update.id}" - %span.update-title + .avatar= image_tag gravatar_icon(update.assignee_email), :class => "avatar", :width => 32 + %div = truncate update.title, :length => 35 .right= truncate update.project.name %span.update-author @@ -15,9 +15,9 @@ ago .right - if update.critical - %span.tag.high critical + %span.label.important critical - if update.today? - %span.tag.today today + %span.label.new today - else %h2 diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml index 0d347246..5beb7485 100644 --- a/app/views/dashboard/_projects_feed.html.haml +++ b/app/views/dashboard/_projects_feed.html.haml @@ -2,19 +2,18 @@ - @active_projects.first(3).each do |project| .project-box.project-updates.ui-box.ui-box-small.ui-box-big = link_to project do - %h3= project.name - .data - - project.updates(3).each do |update| - %a.project-update{:href => dashboard_feed_path(project, update)} - = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 - %span.update-title - = dashboard_feed_title(update) - %span.update-author - %strong= update.author_name - authored - = time_ago_in_words(update.created_at) - ago - .right - - klass = update.class.to_s.split("::").last.downcase - %span.tag{ :class => klass }= klass + %h4= project.name + - project.updates(3).each do |update| + %a.project-update{:href => dashboard_feed_path(project, update)} + = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 + %div + = dashboard_feed_title(update) + %span.update-author + %strong= update.author_name + authored + = time_ago_in_words(update.created_at) + ago + .right + - klass = update.class.to_s.split("::").last.downcase + %span.tag{ :class => klass }= klass diff --git a/app/views/dashboard/_sidebar.html.haml b/app/views/dashboard/_sidebar.html.haml deleted file mode 100644 index 854f8c61..00000000 --- a/app/views/dashboard/_sidebar.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -%aside - %h4 - Your Projects - - if current_user.can_create_project? - = link_to new_project_path, :class => "btn small" do - New Project - %ol.project-list - - @projects.each do |project| - %li - %a{:href => project_path(project)} - -#%span.arrow → - %span.project-name= project.name - %span.time - %strong Last activity: - = project.last_activity_date_cached ? time_ago_in_words(project.last_activity_date_cached) + " ago" : "Never" - diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 2f05bf00..3eba2f47 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1 +1,3 @@ +%h3 Activities +%hr .news-feed= render "dashboard/projects_feed" diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index fb2dd0c7..d93d555b 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1 +1,6 @@ +%h3 + Issues + %small ( authored or assigned to you ) + +%hr .news-feed= render "dashboard/issues_feed" diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index f50abe0c..1a586db7 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1 +1,3 @@ +%h3 Merge Requests +%hr .news-feed= render "dashboard/merge_requests_feed" diff --git a/app/views/layouts/_app_side.html.haml b/app/views/layouts/_app_side.html.haml new file mode 100644 index 00000000..0111afb8 --- /dev/null +++ b/app/views/layouts/_app_side.html.haml @@ -0,0 +1,10 @@ +.fixed + %aside + = link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }" + = link_to "Projects", projects_path, :class => "#{"active" if current_page?(projects_path)}" + = link_to "Issues", dashboard_issues_path, :class => "#{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" + = link_to "Requests", dashboard_merge_requests_path, :class => "#{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" + - if current_user.is_admin? + = link_to admin_root_path, :class => "admin", :title => "Admin" do + Admin + = link_to "Help", help_path, :class => "#{"active" if controller.controller_name == "help"}" diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 5f775228..5b661239 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -16,18 +16,6 @@ = render :partial => "projects/refs", :locals => { :destination => controller.controller_name == "commits" ? "commits" : "tree" } = yield :rss_icon - - else - .dashboard_links - = link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }" - = link_to "Projects", projects_path, :class => "#{"active" if current_page?(projects_path)}" - = link_to "Issues", dashboard_issues_path, :class => "#{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" - = link_to "Requests", dashboard_merge_requests_path, :class => "#{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" - - if current_user.is_admin? - = link_to admin_root_path, :class => "admin", :title => "Admin" do - Admin - = link_to "Help", help_path, :class => "#{"active" if controller.controller_name == "help"}" - .search - = text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" .account-box = link_to profile_path, :class => "pic" do @@ -36,16 +24,3 @@ = link_to profile_path, :class => "username" do My profile = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete - - if current_user - = javascript_tag do - $(function(){ - $("#search").autocomplete({ - source: #{raw search_autocomplete_source}, - select: function(event, ui) { location.href = ui.item.url } - }); - }); - - -#- if current_user.require_ssh_key? - #no_ssh_key_defined.big-message.error - %p - No SSH Key is defined. You won't be able to use any Git command!. Click #{link_to( 'here', keys_path )} to add one! diff --git a/app/views/layouts/_projects_side.html.haml b/app/views/layouts/_projects_side.html.haml new file mode 100644 index 00000000..691b8a6c --- /dev/null +++ b/app/views/layouts/_projects_side.html.haml @@ -0,0 +1,35 @@ +%aside.projects + - if current_user.can_create_project? + .alert-message.block-message.info + You can create at least + = current_user.projects_limit + projects. Click on button to add a new one + = link_to new_project_path, :class => "btn small" do + New Project + + %h4 + Recent Projects: + %ul + - current_user.projects.order("id DESC").limit(5).each do |project| + %li + = link_to project_path(project) do + = project.name + + %h4 + Recent Issues: + %ul + - current_user.assigned_issues.order("id DESC").limit(5).each do |issue| + %li + = link_to project_issue_path(issue.project, issue) do + = truncate issue.title + + + %h4 + Recent Requests: + %ul + - current_user.assigned_merge_requests.order("id DESC").limit(5).each do |issue| + %li + = link_to project_merge_request_path(issue.project, issue) do + = truncate issue.title + + diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 72b6222f..0679b405 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -11,19 +11,17 @@ = javascript_tag do REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; - %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} + %body.admin = render :partial => "layouts/flash" - #container - = render :partial => "layouts/head_panel" - .project-container - .project-sidebar - .fixed - %aside - = link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil - = link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil - = link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil - = link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil - = link_to "Resque", "/info/resque" + = render :partial => "layouts/head_panel" + .container-fluid + .sidebar + .fixed + %aside + = link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil + = link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil + = link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil + = link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil + = link_to "Resque", "/info/resque" - .project-content - = yield + .content= yield diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 96d50672..729d0e7f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -12,5 +12,9 @@ = render :partial => "layouts/flash" = render :partial => "layouts/head_panel" .container-fluid - .sidebar= render :partial => "dashboard/sidebar" - .content= yield + .sidebar + = render :partial => "layouts/app_side" + .content + .row + .span10= yield + .span4= render "layouts/projects_side" diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 84a47b04..b7299b54 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -1,67 +1,38 @@ = form_for(@project, :remote => true) do |f| - %div.form_content - - unless @project.new_record? - %h2.icon - %span - = @project.name - .clear - - if @project.errors.any? - %ul.errors_holder + - if @project.errors.any? + .alert-message.block-message.error + %ul - @project.errors.full_messages.each do |msg| %li= msg - %table - %tr - %td= f.label :name - %td= f.text_field :name, :placeholder => "Example Project" - %tr - %td - .left= f.label :path - %cite.right= "git@#{GIT_HOST["host"]}:" - %td - = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? - %tr - %td - .left= f.label :code - %cite.right= "http://#{GIT_HOST["host"]}/" - %td= f.text_field :code, :placeholder => "example" + .clearfix + = f.label :name + .input= f.text_field :name, :placeholder => "Example Project" + .clearfix + = f.label :path do + Path + %cite= "git@#{GIT_HOST["host"]}:" + .input= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? + .clearfix + = f.label :code do + Code + %cite= "http://#{GIT_HOST["host"]}/" + .input= f.text_field :code, :placeholder => "example" - - unless @project.new_record? || @project.heads.empty? - %tr - %td= f.label :default_branch, "Default Branch" - %td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") + - unless @project.new_record? || @project.heads.empty? + .clearfix + = f.label :default_branch, "Default Branch" + .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") - -#%tr - %td= f.label :tag_list - %td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field - %tr - %td= f.label :description - %td= f.text_area :description, :placeholder => "project description", :style => "height:50px" + + .clearfix + = f.label :description + .input= f.text_area :description, :placeholder => "project description", :style => "height:50px" - %br - %div{ :class => "ajax_loader", :style => "display:none;height:200px;"} - %center - = image_tag "ajax-loader.gif", :class => "append-bottom" - - if @project.new_record? - %h3.prepend-top Creating project & repository. Please wait for few minutes - - else - %h3.prepend-top Updating project & repository. Please wait for few minutes + %br .merge-tabs = f.submit 'Save', :class => "btn primary"   - unless @project.new_record? .right - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "red-button" - - -:javascript - $(function(){ - $('.new_project, .edit_project').bind('ajax:before', function() { - $(this).find(".form_content").hide(); - $('.ajax_loader').show(); - }); - - taggifyForm(); - - $('form #project_default_branch').chosen(); - }) + = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn" diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml index d9549045..360cf340 100644 --- a/app/views/projects/_tile.html.haml +++ b/app/views/projects/_tile.html.haml @@ -1,20 +1,11 @@ -- @projects.in_groups_of(3, false) do |projects| - - projects.each_with_index do |project, i| - %div.grid_1.projects_selector - %div{ :class => "project-box ui-box ui-box-big" } +- @projects.in_groups_of(2, false) do |projects| + .row + - projects.each_with_index do |project, i| + .span4.well = link_to project_path(project) do %h3= truncate(project.name, :length => 20) - .data - %p.title.repository.git_url_wrapper - %span Repository: - %input{ :value => project.url_to_repo, :class => ['git-url', 'one_click_select', 'text', 'project_list_url'], :readonly => 'readonly' } - %p.title.activity - %span Last Activity: - - if project.last_activity_date_cached - = project.last_activity_date_cached.stamp("Aug 24, 2011") - - else - Never + %p.title.repository.git_url_wrapper + %input{ :value => project.url_to_repo, :class => ['git-url', 'one_click_select', 'text', 'project_list_url'], :readonly => 'readonly' } - .buttons - %a.browse-code.button.yellow{:href => tree_project_ref_path(project, project.root_ref)} Browse code - %a.commits.button.green{:href => project_commits_path(project)} Commits + %a.btn{:href => tree_project_ref_path(project, project.root_ref)} Browse code + %a.btn{:href => project_commits_path(project)} Commits diff --git a/app/views/projects/create.js.haml b/app/views/projects/create.js.haml index c457527a..2b3106c8 100644 --- a/app/views/projects/create.js.haml +++ b/app/views/projects/create.js.haml @@ -4,3 +4,4 @@ - else :plain $("#new_project").replaceWith("#{escape_javascript(render('form'))}"); + $('.ajax_loader').hide(); diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index 8a4343b0..725f2e51 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -1,29 +1,17 @@ -- content_for(:body_class, "projects-page") -.container_4 - .grid_4 - - if current_user.can_create_project? - %a.grey-button.right{:href => new_project_path} Create new project - %h2.icon - %span - Projects +%h3 Projects +%hr +- unless @projects.empty? + %div.tile= render "tile" - %div.clear - - unless @projects.empty? - %div{:class => "tile"} - = render "tile" + -# If projects requris paging + -# We add ajax loader & init script + - if @projects.count == @limit + .loading{ :style => "display:none;"} + %center= image_tag "ajax-loader.gif" - -# If projects requris paging - -# We add ajax loader & init script - - if @projects.count == @limit - .clear - .loading{ :style => "display:none;"} - %center= image_tag "ajax-loader.gif" - - :javascript - $(function(){ - ProjectsList.init(16); - }); - - else - %center.prepend-top - %h2 - %cite Nothing here + :javascript + $(function(){ + ProjectsList.init(16); + }); +- else + %h2 Nothing here diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 02ddc683..5883e7b8 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -1,17 +1,14 @@ -- content_for(:body_class, "new-project-page") -- content_for(:page_title) do - .new-project-hodler - .container - %h2.icon - %span - New Project - - %div.clear - = render 'form' +%h3 New Project +%hr += render 'form' +%div{ :class => "ajax_loader", :style => "display:none;height:200px;"} + %center + = image_tag "ajax-loader.gif", :class => "append-bottom" + %h3.prepend-top Creating project & repository. Please wait for few minutes :javascript $(function(){ - $("#project_name").change(function(){ + $("#project_name").live("change", function(){ var slug = slugify($(this).val()); $("#project_code").val(slug); $("#project_path").val(slug); @@ -21,3 +18,11 @@ function slugify(text) { return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase(); } + + $(function(){ + $('.new_project').live('ajax:before', function() { + $(this).hide(); + $('.ajax_loader').show(); + }); + $('form #project_default_branch').chosen(); + }) diff --git a/app/views/projects/update.js.haml b/app/views/projects/update.js.haml index 70d8490e..4c69128b 100644 --- a/app/views/projects/update.js.haml +++ b/app/views/projects/update.js.haml @@ -4,3 +4,4 @@ - else :plain $(".edit_project").replaceWith("#{escape_javascript(render('form'))}"); + $('.ajax_loader').hide(); diff --git a/spec/requests/merge_requests_spec.rb b/spec/requests/merge_requests_spec.rb index 7d9fd67b..dcb4d71c 100644 --- a/spec/requests/merge_requests_spec.rb +++ b/spec/requests/merge_requests_spec.rb @@ -42,7 +42,7 @@ describe "MergeRequests" do it { should have_content(@merge_request.title[0..10]) } it "Show page should inform user that merge request closed" do - within ".merge-tabs" do + within ".tabs" do page.should have_content "Reopen" end end