Commit 7f6e41fa authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Bootstrap: application layout

parent 05d76fc4
...@@ -105,6 +105,19 @@ $blue_link: "#2fa0bb"; ...@@ -105,6 +105,19 @@ $blue_link: "#2fa0bb";
border-right: 1px solid $border_color; border-right: 1px solid $border_color;
height:100%; height:100%;
min-height:450px; 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 { .container-fluid > .content {
...@@ -112,6 +125,17 @@ $blue_link: "#2fa0bb"; ...@@ -112,6 +125,17 @@ $blue_link: "#2fa0bb";
margin-top:20px; 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 "reset_bootstrap.scss";
@import "top_panel.scss"; @import "top_panel.scss";
@import "projects.css.scss"; @import "projects.css.scss";
......
.git_url_wrapper { .git_url_wrapper {
margin-right:50px 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 { .file_stats {
span { span {
img { img {
......
.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;
}
.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;
}
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
.data .data
- @issues.each do |update| - @issues.each do |update|
%a.project-update{:href => dashboard_feed_path(update.project, update)} %a.project-update{:href => dashboard_feed_path(update.project, update)}
%strong.issue-number= "##{update.id}" .avatar= image_tag gravatar_icon(update.assignee_email), :class => "avatar", :width => 32
%span.update-title %div
= truncate update.title, :length => 35 = truncate update.title, :length => 35
.right= truncate update.project.name .right= truncate update.project.name
%span.update-author %span.update-author
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
ago ago
.right .right
- if update.critical - if update.critical
%span.tag.high critical %span.label.important critical
- if update.today? - if update.today?
%span.tag.today today %span.label.new today
- else - else
%h2 %h2
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
- @active_projects.first(3).each do |project| - @active_projects.first(3).each do |project|
.project-box.project-updates.ui-box.ui-box-small.ui-box-big .project-box.project-updates.ui-box.ui-box-small.ui-box-big
= link_to project do = link_to project do
%h3= project.name %h4= project.name
.data
- project.updates(3).each do |update| - project.updates(3).each do |update|
%a.project-update{:href => dashboard_feed_path(project, update)} %a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%span.update-title %div
= dashboard_feed_title(update) = dashboard_feed_title(update)
%span.update-author %span.update-author
%strong= update.author_name %strong= update.author_name
......
%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"
%h3 Activities
%hr
.news-feed= render "dashboard/projects_feed" .news-feed= render "dashboard/projects_feed"
%h3
Issues
%small ( authored or assigned to you )
%hr
.news-feed= render "dashboard/issues_feed" .news-feed= render "dashboard/issues_feed"
%h3 Merge Requests
%hr
.news-feed= render "dashboard/merge_requests_feed" .news-feed= render "dashboard/merge_requests_feed"
.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"}"
...@@ -16,18 +16,6 @@ ...@@ -16,18 +16,6 @@
= render :partial => "projects/refs", :locals => { :destination => controller.controller_name == "commits" ? "commits" : "tree" } = render :partial => "projects/refs", :locals => { :destination => controller.controller_name == "commits" ? "commits" : "tree" }
= yield :rss_icon = 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 .account-box
= link_to profile_path, :class => "pic" do = link_to profile_path, :class => "pic" do
...@@ -36,16 +24,3 @@ ...@@ -36,16 +24,3 @@
= link_to profile_path, :class => "username" do = link_to profile_path, :class => "username" do
My profile My profile
= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete = 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!
%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
...@@ -11,12 +11,11 @@ ...@@ -11,12 +11,11 @@
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)} %body.admin
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
#container
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
.project-container .container-fluid
.project-sidebar .sidebar
.fixed .fixed
%aside %aside
= link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil = link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil
...@@ -25,5 +24,4 @@ ...@@ -25,5 +24,4 @@
= link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil = link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil
= link_to "Resque", "/info/resque" = link_to "Resque", "/info/resque"
.project-content .content= yield
= yield
...@@ -12,5 +12,9 @@ ...@@ -12,5 +12,9 @@
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
.container-fluid .container-fluid
.sidebar= render :partial => "dashboard/sidebar" .sidebar
.content= yield = render :partial => "layouts/app_side"
.content
.row
.span10= yield
.span4= render "layouts/projects_side"
= form_for(@project, :remote => true) do |f| = form_for(@project, :remote => true) do |f|
%div.form_content
- unless @project.new_record?
%h2.icon
%span
= @project.name
.clear
- if @project.errors.any? - if @project.errors.any?
%ul.errors_holder .alert-message.block-message.error
%ul
- @project.errors.full_messages.each do |msg| - @project.errors.full_messages.each do |msg|
%li= msg %li= msg
%table .clearfix
%tr = f.label :name
%td= f.label :name .input= f.text_field :name, :placeholder => "Example Project"
%td= f.text_field :name, :placeholder => "Example Project" .clearfix
%tr = f.label :path do
%td Path
.left= f.label :path %cite= "git@#{GIT_HOST["host"]}:"
%cite.right= "git@#{GIT_HOST["host"]}:" .input= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
%td .clearfix
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? = f.label :code do
%tr Code
%td %cite= "http://#{GIT_HOST["host"]}/"
.left= f.label :code .input= f.text_field :code, :placeholder => "example"
%cite.right= "http://#{GIT_HOST["host"]}/"
%td= f.text_field :code, :placeholder => "example"
- unless @project.new_record? || @project.heads.empty? - unless @project.new_record? || @project.heads.empty?
%tr .clearfix
%td= f.label :default_branch, "Default Branch" = f.label :default_branch, "Default Branch"
%td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")
-#%tr .clearfix
%td= f.label :tag_list = f.label :description
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field .input= f.text_area :description, :placeholder => "project description", :style => "height:50px"
%tr
%td= f.label :description
%td= f.text_area :description, :placeholder => "project description", :style => "height:50px"
%br %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
.merge-tabs .merge-tabs
= f.submit 'Save', :class => "btn primary" = f.submit 'Save', :class => "btn primary"
   
- unless @project.new_record? - unless @project.new_record?
.right .right
= link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "red-button" = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn"
:javascript
$(function(){
$('.new_project, .edit_project').bind('ajax:before', function() {
$(this).find(".form_content").hide();
$('.ajax_loader').show();
});
taggifyForm();
$('form #project_default_branch').chosen();
})
- @projects.in_groups_of(3, false) do |projects| - @projects.in_groups_of(2, false) do |projects|
.row
- projects.each_with_index do |project, i| - projects.each_with_index do |project, i|
%div.grid_1.projects_selector .span4.well
%div{ :class => "project-box ui-box ui-box-big" }
= link_to project_path(project) do = link_to project_path(project) do
%h3= truncate(project.name, :length => 20) %h3= truncate(project.name, :length => 20)
.data
%p.title.repository.git_url_wrapper %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' } %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
.buttons %a.btn{:href => tree_project_ref_path(project, project.root_ref)} Browse code
%a.browse-code.button.yellow{:href => tree_project_ref_path(project, project.root_ref)} Browse code %a.btn{:href => project_commits_path(project)} Commits
%a.commits.button.green{:href => project_commits_path(project)} Commits
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
- else - else
:plain :plain
$("#new_project").replaceWith("#{escape_javascript(render('form'))}"); $("#new_project").replaceWith("#{escape_javascript(render('form'))}");
$('.ajax_loader').hide();
- content_for(:body_class, "projects-page") %h3 Projects
.container_4 %hr
.grid_4 - unless @projects.empty?
- if current_user.can_create_project? %div.tile= render "tile"
%a.grey-button.right{:href => new_project_path} Create new project
%h2.icon
%span
Projects
%div.clear
- unless @projects.empty?
%div{:class => "tile"}
= render "tile"
-# If projects requris paging -# If projects requris paging
-# We add ajax loader & init script -# We add ajax loader & init script
- if @projects.count == @limit - if @projects.count == @limit
.clear
.loading{ :style => "display:none;"} .loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif" %center= image_tag "ajax-loader.gif"
...@@ -23,7 +13,5 @@ ...@@ -23,7 +13,5 @@
$(function(){ $(function(){
ProjectsList.init(16); ProjectsList.init(16);
}); });
- else - else
%center.prepend-top %h2 Nothing here
%h2
%cite Nothing here
- content_for(:body_class, "new-project-page") %h3 New Project
- content_for(:page_title) do %hr
.new-project-hodler = render 'form'
.container %div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
%h2.icon %center
%span = image_tag "ajax-loader.gif", :class => "append-bottom"
New Project %h3.prepend-top Creating project & repository. Please wait for few minutes
%div.clear
= render 'form'
:javascript :javascript
$(function(){ $(function(){
$("#project_name").change(function(){ $("#project_name").live("change", function(){
var slug = slugify($(this).val()); var slug = slugify($(this).val());
$("#project_code").val(slug); $("#project_code").val(slug);
$("#project_path").val(slug); $("#project_path").val(slug);
...@@ -21,3 +18,11 @@ ...@@ -21,3 +18,11 @@
function slugify(text) { function slugify(text) {
return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase(); 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();
})
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
- else - else
:plain :plain
$(".edit_project").replaceWith("#{escape_javascript(render('form'))}"); $(".edit_project").replaceWith("#{escape_javascript(render('form'))}");
$('.ajax_loader').hide();
...@@ -42,7 +42,7 @@ describe "MergeRequests" do ...@@ -42,7 +42,7 @@ describe "MergeRequests" do
it { should have_content(@merge_request.title[0..10]) } it { should have_content(@merge_request.title[0..10]) }
it "Show page should inform user that merge request closed" do it "Show page should inform user that merge request closed" do
within ".merge-tabs" do within ".tabs" do
page.should have_content "Reopen" page.should have_content "Reopen"
end end
end end
......
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