[issue #195] Merge branch '203-feed_message' into 195-new_design_for_projects
Conflicts: app/views/layouts/application.html.haml
This commit is contained in:
commit
85f3d956f5
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -25,6 +25,14 @@ $(document).ready(function(){
|
|||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('.data-expander').live('click', function(e) {
|
||||
var $button = $(e.target);
|
||||
var id = "#content-" + $button.attr('id');
|
||||
var $slider = $(id);
|
||||
$slider.slideToggle("slow", function(){
|
||||
$button.toggleClass('expanded collapsed');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).click(function(e) {
|
||||
|
@ -36,9 +44,9 @@ $(document).click(function(e) {
|
|||
function showActivity(elem) {
|
||||
$("#activity-bottom"+elem).slideToggle("slow");
|
||||
var img = $("#expand" + elem).attr("src");
|
||||
if (img == "assets/expand-gray.png") {
|
||||
$("#expand" + elem).attr("src","assets/expand-gray2.png");
|
||||
if (img == "/assets/expand-gray.png") {
|
||||
$("#expand" + elem).attr("src","/assets/expand-gray2.png");
|
||||
} else {
|
||||
$("#expand" + elem).attr("src","assets/expand-gray.png");
|
||||
$("#expand" + elem).attr("src","/assets/expand-gray.png");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
jQuery(document).ready(function(){
|
||||
|
||||
var params = {
|
||||
changedEl: ".lineForm select",
|
||||
visRows: 999999,
|
||||
scrollArrows: false
|
||||
}
|
||||
|
||||
cuSel(params);
|
||||
//var params = {
|
||||
// changedEl: ".lineForm select",
|
||||
// visRows: 999999,
|
||||
// scrollArrows: false
|
||||
// }
|
||||
//
|
||||
// cuSel(params);
|
||||
|
||||
});
|
|
@ -10,11 +10,11 @@ $("#myTable").tablesorter({
|
|||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("a.files-see").click(function() {
|
||||
$("#file1").fadeOut(0);
|
||||
$("#file2").fadeIn("slow");
|
||||
$("#file-name1").fadeOut(0);
|
||||
$("#file-name2").fadeIn("slow");
|
||||
$("#fork-and-edit").fadeIn("slow");
|
||||
});
|
||||
// $("a.files-see").click(function() {
|
||||
// $("#file1").fadeOut(0);
|
||||
// $("#file2").fadeIn("slow");
|
||||
// $("#file-name1").fadeOut(0);
|
||||
// $("#file-name2").fadeIn("slow");
|
||||
// $("#fork-and-edit").fadeIn("slow");
|
||||
// });
|
||||
});
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
//@import "vendor";
|
||||
@import "main";
|
||||
@import "custom";
|
||||
@import "blue/style";
|
||||
|
||||
//= require main
|
||||
//= require blue/style
|
||||
//= require vendor
|
||||
//= require custom
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
|
@ -0,0 +1,113 @@
|
|||
/* tables */
|
||||
table.tablesorter {
|
||||
font-family:arial;
|
||||
margin:10px 0pt 15px;
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
border: 1px solid #DDD;
|
||||
border-bottom: none;
|
||||
}
|
||||
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
|
||||
font-size: 12px;
|
||||
margin: 0px;
|
||||
}
|
||||
table.tablesorter thead tr .header {
|
||||
background-image: image-url("bg-sortable.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center left;
|
||||
cursor: pointer;
|
||||
}
|
||||
table.tablesorter tbody td {
|
||||
color: #3D3D3D;
|
||||
padding: 5px;
|
||||
margin: 0px;
|
||||
background-color: #FFF;
|
||||
vertical-align: top;
|
||||
|
||||
}
|
||||
table.tablesorter tbody tr.odd td {
|
||||
background-color:#F0F0F6;
|
||||
}
|
||||
table.tablesorter thead tr .headerSortUp {
|
||||
background-image: image-url("asc.png");
|
||||
}
|
||||
table.tablesorter thead tr .headerSortDown {
|
||||
background-image: image-url("desc.png");
|
||||
}
|
||||
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
|
||||
|
||||
}
|
||||
|
||||
table.tablesorter thead tr {
|
||||
height: 38px;
|
||||
background: #ededed;
|
||||
-webkit-box-shadow: 0px 3px 3px -1px rgba(18, 86, 135, 0.2);
|
||||
-moz-box-shadow: 0px 3px 3px -1px rgba(18, 86, 135, 0.2);
|
||||
box-shadow: 0px 3px 3px -1px rgba(18, 86, 135, 0.2);
|
||||
position: relative;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
table.tablesorter thead tr th{
|
||||
border-bottom: 1px solid #FFF;
|
||||
}
|
||||
|
||||
table.tablesorter tr {
|
||||
position: relative;
|
||||
z-index: 70;
|
||||
}
|
||||
|
||||
table.tablesorter tbody tr td {
|
||||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
|
||||
table.tablesorter thead th {
|
||||
color: #575756;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table.tablesorter tbody td {
|
||||
color: #58595b;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
table.tablesorter .th1 {
|
||||
width: 180px;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
table.tablesorter .th2 {
|
||||
width: 390px;
|
||||
}
|
||||
|
||||
table.tablesorter .th3 {
|
||||
width: 110px;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
table.tablesorter .td2 {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
table.tablesorter .th4 {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
table.tablesorter .td5 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.tablesorter .td5 img{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.table-sort-left {
|
||||
float: left;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.table-sort-right {
|
||||
float: left;
|
||||
}
|
|
@ -12,3 +12,76 @@ header menu ul li a {
|
|||
padding: 15px 8px 15px 8px;
|
||||
}
|
||||
|
||||
div.description-top div.name {
|
||||
width: 300px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.description-top div.name input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
article div.activity {
|
||||
border: 1px solid #D6D6D6;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
color: #333333;
|
||||
margin-top: 15px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
article div.activity .top div.image {
|
||||
position: absolute;
|
||||
float: left;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-left: 2px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
article div.activity .top div.text {
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
article div.activity .top div.text.imaged {
|
||||
margin-left: 44px;
|
||||
}
|
||||
|
||||
article div.activity .top div.text .name {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
article div.activity .top div.text .date {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
article div.activity .top div.text {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
article div.activity .fulltext {
|
||||
font-size: 12px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
article div.activity .fulltext.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.activity .data-expander {
|
||||
margin-left: 10px;
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
}
|
||||
|
||||
div.activity .data-expander.collapsed {
|
||||
background: #FFF image-url('expand-gray.png') no-repeat;
|
||||
background-position: 0 2px;
|
||||
}
|
||||
|
||||
div.activity .data-expander.expanded {
|
||||
background: #FFF image-url('expand-gray2.png') no-repeat;
|
||||
background-position: 0 2px;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -265,7 +265,7 @@ header div.droplist a:hover{
|
|||
}
|
||||
|
||||
|
||||
.sub-menu nav { /*Äëÿ ïîäìåíþ áåç íàçâàíèÿ*/
|
||||
.sub-menu nav { /*Для подменю без названия*/
|
||||
float: left;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
@ -333,6 +333,31 @@ article div.all.bigpadding {
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
article div.all.verybigpadding {
|
||||
width: 545px;
|
||||
padding: 0px 40px 20px 200px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
article div.all.verybigpadding div.left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
article div.all.verybigpadding div.left img{
|
||||
padding-right: 40px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
article div.all.verybigpadding div.left h3, article div.all.verybigpadding div.left h4, article div.all.verybigpadding div.left p{
|
||||
width: 420px;
|
||||
}
|
||||
|
||||
article div.all.verybigpadding div.left .tmargin5 {
|
||||
padding-top: 5px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
/* Left part of page markup */
|
||||
|
||||
aside div.bordered {
|
||||
|
@ -348,6 +373,33 @@ aside div.block {
|
|||
|
||||
/* Common page parts markups */
|
||||
|
||||
article h4 {
|
||||
font-size: 12px;
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
article p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.expand-gray-down, div.expand-gray-up {
|
||||
height: 10px;
|
||||
width: 12px;
|
||||
float: left;
|
||||
margin: 3px 0px 0px 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.expand-gray-down {
|
||||
background: image-url("expand-gray.png") no-repeat;
|
||||
}
|
||||
|
||||
div.expand-gray-up {
|
||||
background: image-url("expand-gray2.png") no-repeat;
|
||||
}
|
||||
|
||||
article a.button {
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
|
@ -454,14 +506,18 @@ article div.right div.hr.top {
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
article div.right div.leftside {
|
||||
article div.leftside {
|
||||
float: left;
|
||||
}
|
||||
|
||||
article div.right div.rightside {
|
||||
article div.rightside {
|
||||
float: right;
|
||||
}
|
||||
|
||||
article div.all.bigpadding div.rightside {
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.lefter {
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
|
@ -574,7 +630,7 @@ article div.right div.messages p{
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
article div.right div.activity {
|
||||
article div.activity {
|
||||
border: 1px solid #d6d6d6;
|
||||
/*width: 614px;*/
|
||||
border-radius: 5px;
|
||||
|
@ -583,35 +639,39 @@ article div.right div.activity {
|
|||
color: #333;
|
||||
}
|
||||
|
||||
article div.right div.activity div.top div.image {
|
||||
article div.activity div.top div.image {
|
||||
float: left;
|
||||
}
|
||||
|
||||
article div.right div.activity div.top div.text {
|
||||
article div.activity div.top div.text {
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
article div.right div.activity div.top div.text span.name {
|
||||
article div.activity div.top div.text span.name {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
article div.right div.activity div.top div.text span.date {
|
||||
article div.activity div.top div.text span.date {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
article div.right div.activity div.top div.text span.subject img {
|
||||
article div.text span.subject {
|
||||
float: left;
|
||||
}
|
||||
|
||||
article div.activity div.top div.text span.subject img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
article div.right div.activity div.fulltext {
|
||||
article div.activity div.fulltext {
|
||||
font-size: 12px;
|
||||
padding-top: 10px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
article div.right div.activity div.fulltext.view {
|
||||
article div.activity div.fulltext.view {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
@ -668,7 +728,7 @@ article div.right div.activity div.fulltext.view {
|
|||
}
|
||||
div.rightlist textarea {
|
||||
height: 110px;
|
||||
width: 340px;
|
||||
width: 350px;
|
||||
border: 1px solid #dedede;
|
||||
border-radius: 4px;
|
||||
padding: 5px;
|
||||
|
@ -678,7 +738,7 @@ div.rightlist textarea {
|
|||
|
||||
div.rightlist input[type="text"] {
|
||||
height: 15px;
|
||||
width: 340px;
|
||||
width: 350px;
|
||||
border: 1px solid #dedede;
|
||||
border-radius: 4px;
|
||||
padding: 5px;
|
||||
|
@ -731,11 +791,11 @@ div.rightlist input[type="text"] {
|
|||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.right div.admin-search input.gray {
|
||||
article input.gray {
|
||||
color: #cfcfcf;
|
||||
}
|
||||
|
||||
.right div.admin-search input.black {
|
||||
article input.black {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
|
@ -773,6 +833,10 @@ div.rightlist input[type="text"] {
|
|||
padding-bottom: 4px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sel80.aside {
|
||||
width: 185px;
|
||||
}
|
||||
.lineForm,
|
||||
.lineForm3 {
|
||||
margin-bottom: 0px;
|
||||
|
@ -1220,7 +1284,7 @@ h3.bmargin10 {
|
|||
padding-top: 9px;
|
||||
}
|
||||
|
||||
div.desription-top {
|
||||
div.description-top {
|
||||
background: #dcecfa;
|
||||
font-size: 12px;
|
||||
color: #575756;
|
||||
|
@ -1230,13 +1294,13 @@ div.desription-top {
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
div.desription-top div.img {
|
||||
div.description-top div.img {
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
div.desription-top div.name {
|
||||
div.description-top div.name {
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
margin-left: 10px;
|
||||
|
@ -1250,19 +1314,19 @@ div.desription-top div.name {
|
|||
padding-top: 5px;
|
||||
}
|
||||
|
||||
div.desription-top div.role {
|
||||
div.description-top div.role {
|
||||
float: left;
|
||||
margin-top: 11px;
|
||||
margin-left: 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
div.desription-top div.fork {
|
||||
div.description-top div.fork {
|
||||
float: right;
|
||||
margin-top: 5px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
div.desription-top div.fork p {
|
||||
div.description-top div.fork p {
|
||||
float: right;
|
||||
margin-top: 5px;
|
||||
margin-right: 2px;
|
||||
|
@ -1706,3 +1770,165 @@ div.div-label-left div.label {
|
|||
div.div-label-left div.label:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
/* Monitoring */
|
||||
|
||||
aside div.table {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
h3.small {
|
||||
font-size: 12px;
|
||||
margin: 0px;
|
||||
padding: 3px 0px;
|
||||
}
|
||||
|
||||
table.tablesorter th.lpadding16 {
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
div.right.slim {
|
||||
padding: 5px 14px 40px;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
img.delete-row {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
/* Create group */
|
||||
|
||||
div.right-error {
|
||||
float: left;
|
||||
width: 369px;
|
||||
height: 59px;
|
||||
background: image-url("error-groups.png");
|
||||
margin: 0px 0px 5px -3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.right-error p {
|
||||
margin: 0;
|
||||
padding: 27px 0px 0px 0px;
|
||||
}
|
||||
|
||||
div.rightlist.nomargin {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
article div.rightlist input.error {
|
||||
border: 1px solid #bd4d40;
|
||||
-webkit-box-shadow: 0px 0px 2px 0px rgba(189, 77, 64, 1);
|
||||
-moz-box-shadow: 0px 0px 2px 0px rgba(189, 77, 64, 1);
|
||||
box-shadow: 0px 0px 2px 0px rgba(189, 77, 64, 1);
|
||||
}
|
||||
|
||||
/* Group pages */
|
||||
|
||||
article div.groups-profile {
|
||||
float: left;
|
||||
}
|
||||
|
||||
article div.groups-profile a {
|
||||
margin: 0px 0px 0px 5px;
|
||||
}
|
||||
|
||||
article div.groups-profile img {
|
||||
margin: 2px 0px 0px 0px;
|
||||
}
|
||||
|
||||
table.tablesorter.group-list th.th2 {
|
||||
width: 540px;
|
||||
}
|
||||
|
||||
/* Platform */
|
||||
|
||||
table.tablesorter.create-platform th.th1 {
|
||||
padding-left: 17px;
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
div.right div.left {
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
table.tablesorter.platform-products th.th1 {
|
||||
padding-left: 17px;
|
||||
width: 560px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-products td.td2 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-repos th.th1 {
|
||||
padding-left: 17px;
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-repos th.th2 {
|
||||
padding-left: 17px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-repos td.td3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.new-owner div.field {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
div.new-owner div.field input {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
div.new-owner div.search {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.tpadding10 {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
article div.all div.hr {
|
||||
border-bottom: 1px solid #dedede;
|
||||
width: 565px;
|
||||
padding-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-product-main th.th1 {
|
||||
padding-left: 17px;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-product-main th.th2 {
|
||||
padding-left: 17px;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-product-main th.th3 {
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
table.tablesorter.platform-product-main th.th4 {
|
||||
padding-left: 17px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div.right.rpadding0 {
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
article div.loadFile div.btn {
|
||||
float: left;
|
||||
}
|
||||
|
||||
article div.loadFile div.name {
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ class Git::BaseController < ApplicationController
|
|||
|
||||
protected
|
||||
def find_project
|
||||
@project = Project.find(params[:project_id])
|
||||
@project = Project.find(params[:project_id] || params[:id])
|
||||
end
|
||||
|
||||
def find_git_repository
|
||||
|
|
|
@ -2,16 +2,23 @@
|
|||
class Git::TreesController < Git::BaseController
|
||||
|
||||
def show
|
||||
if params[:treeish].present? and @treeish.dup.encode_to_default == @project.default_branch
|
||||
redirect_to project_path(@project) and return
|
||||
end
|
||||
|
||||
@path = params[:path]
|
||||
@path.force_encoding(Encoding::ASCII_8BIT) if @path
|
||||
|
||||
@tree = @git_repository.tree(@treeish)
|
||||
@branch = @project.branch(@treeish)
|
||||
|
||||
# @commit = @git_repository.commits(@treeish, 1).first
|
||||
# Raises Grit::Git::GitTimeout
|
||||
@commit = @git_repository.log(@treeish, @path).first
|
||||
@commit = @branch.present? ? @branch.commit() : @git_repository.log(@treeish, @path, :max_count => 1).first
|
||||
|
||||
@tree = @tree / @path if @path
|
||||
if @path
|
||||
@path.force_encoding(Encoding::ASCII_8BIT)
|
||||
@tree = @tree / @path
|
||||
end
|
||||
|
||||
render :template => "git/repositories/show"
|
||||
end
|
||||
|
|
|
@ -29,6 +29,8 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def show
|
||||
@current_build_lists = @project.build_lists.current.recent.paginate :page => params[:page]
|
||||
@branch = @project.branch(params[:treeish])
|
||||
@commit = @branch.present? ? @branch.commit : @git_repository.log(@treeish).first
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -61,4 +61,14 @@ module GitHelper
|
|||
string.dup.encode_to_default
|
||||
end
|
||||
|
||||
def iterate_path(path, &block)
|
||||
path.split(File::SEPARATOR).inject('') do |a, e|
|
||||
if e != '.' and e != '..'
|
||||
a = File.join(a, e)
|
||||
a = a[1..-1] if a[0] == File::SEPARATOR
|
||||
block.call(a, e) if a.length > 1
|
||||
end
|
||||
a
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -84,6 +84,46 @@ class Project < ActiveRecord::Base
|
|||
self.git_repository.branches
|
||||
end
|
||||
|
||||
def last_active_branch
|
||||
@last_active_branch ||= branches.inject do |r, c|
|
||||
r_last = r.commit.committed_date || r.commit.authored_date unless r.nil?
|
||||
c_last = c.commit.committed_date || c.commit.authored_date
|
||||
if r.nil? or r_last < c_last
|
||||
r = c
|
||||
end
|
||||
r
|
||||
end
|
||||
@last_active_branch
|
||||
end
|
||||
|
||||
def branch(name = nil)
|
||||
name = default_branch if name.blank?
|
||||
branches.select{|b| b.name == name}.first
|
||||
end
|
||||
|
||||
def tree_info(tree, treeish = nil, path = nil)
|
||||
treeish = tree.id unless treeish.present?
|
||||
# initialize result as hash of <tree_entry> => nil
|
||||
res = (tree.trees.sort + tree.blobs.sort).inject({}){|h, e| h.merge!({e => nil})}
|
||||
# fills result vith commits that describes this file
|
||||
res = res.inject(res) do |h, (entry, commit)|
|
||||
# only if commit == nil ...
|
||||
if commit.nil? and entry.respond_to? :name
|
||||
# ... find last commit corresponds to this file ...
|
||||
c = git_repository.log(treeish, File.join([path, entry.name].compact), :max_count => 1).first
|
||||
# ... and add it to result.
|
||||
h[entry] = c
|
||||
# find another files, that linked to this commit and set them their commit
|
||||
c.diffs.map{|diff| diff.b_path.split(File::SEPARATOR, 2).first}.each do |name|
|
||||
h.each_pair do |k, v|
|
||||
h[k] = c if k.name == name and v.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
h
|
||||
end
|
||||
end
|
||||
|
||||
def versions
|
||||
tags.map(&:name) + branches.map{|b| "latest_#{b.name}"}
|
||||
end
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
class ApplicationPresenter
|
||||
include Rails.application.routes.url_helpers
|
||||
include ActionView::Helpers::UrlHelper
|
||||
|
||||
def initialize(item, opts)
|
||||
end
|
||||
|
||||
# TODO it needs to be refactored!
|
||||
class << self
|
||||
def present(item, opts, &block)
|
||||
block.call(self.new(item, opts))
|
||||
end
|
||||
|
||||
def present_collection(collection, &block)
|
||||
res = collection.map {|e| self.new(*e)}
|
||||
if block.present?
|
||||
res = res.inject('') do |akk, presenter|
|
||||
akk << block.call(presenter)
|
||||
akk
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,59 @@
|
|||
class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
|
||||
attr_accessor :commit, :options
|
||||
attr_reader :header, :image, :date, :caption, :content, :expandable
|
||||
|
||||
def initialize(commit, opts = {})
|
||||
@commit = commit
|
||||
@options = opts#[:branch] if opts[:branch]
|
||||
prepare_message
|
||||
end
|
||||
|
||||
def header
|
||||
@header ||= if options[:branch].present?
|
||||
I18n.t("layout.messages.commits.header_with_branch",
|
||||
:committer => committer_link, :commit => '', :branch => options[:branch].name)
|
||||
elsif options[:project].present?
|
||||
I18n.t("layout.messages.commits.header_with_project",
|
||||
:committer => committer_link, :commit => '', :project => options[:project].name)
|
||||
end.html_safe
|
||||
end
|
||||
|
||||
def image
|
||||
@image ||= "https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(committer.email.downcase)}?s=40&r=pg"
|
||||
end
|
||||
|
||||
def date
|
||||
@date ||= I18n.l(@commit.committed_date || @commit.authored_date, :format => :long)
|
||||
end
|
||||
|
||||
def expandable?
|
||||
true
|
||||
end
|
||||
|
||||
def content?
|
||||
!content.blank?
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def committer
|
||||
@committer ||= User.where(:email => @commit.committer.email).first || @commit.committer
|
||||
end
|
||||
|
||||
def committer_link
|
||||
@committer_link ||= if committer.is_a? User
|
||||
link_to committer.uname, user_path(c)
|
||||
else
|
||||
mail_to committer.email.encode_to_default, committer.name.encode_to_default
|
||||
end
|
||||
end
|
||||
|
||||
def prepare_message
|
||||
(@caption, @content) = @commit.message.encode_to_default.split("\n\n", 2)
|
||||
if @caption.length > 72
|
||||
@content = '...' + @caption[69..-1] + @content
|
||||
@caption = @caption[0..68] + '...'
|
||||
end
|
||||
@content = @content.gsub("\n", "<br />").html_safe if @content
|
||||
end
|
||||
end
|
|
@ -1,15 +1,84 @@
|
|||
.block
|
||||
= render :partial => "git/shared/navigation"
|
||||
= render :partial => 'projects/submenu'
|
||||
= render :partial => 'projects/repo_block', :locals => {:project => @project}
|
||||
|
||||
.description
|
||||
%h3= t("layout.projects.about_subheader")
|
||||
%p
|
||||
= @project.description
|
||||
= link_to t('layout.read_more'), '#'
|
||||
|
||||
%h3= t("layout.projects.last_commit")
|
||||
- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch) do |presenter|
|
||||
= render :partial => 'shared/feed_message', :locals => {:presenter => presenter, :item_no => 1}
|
||||
|
||||
%h3= t("layout.projects.files_in_project")
|
||||
.files
|
||||
.l
|
||||
= render :partial => 'git/shared/whereami'
|
||||
|
||||
#fork-and-edit.r
|
||||
%a.button{:href => "#"} Fork and edit
|
||||
.both
|
||||
|
||||
#file1
|
||||
%table#myTable.tablesorter.project{:cellpadding => "0", :cellspacing => "0"}
|
||||
%thead
|
||||
%tr
|
||||
%th.th1.header= t("layout.project.filename")
|
||||
%th.th2.header= t("layout.project.age")
|
||||
%th.th3= t("layout.project.message")
|
||||
%th.th4.header= t("layout.project.author")
|
||||
%tbody
|
||||
- if @path.present?
|
||||
%tr
|
||||
%td
|
||||
.pic
|
||||
%img{:src => "/assets/folder.png"}/
|
||||
.name
|
||||
= link_to "..", tree_path(@project, @treeish, File.join([@path.dup.encode_to_default, ".."].compact).encode_to_default)
|
||||
%td==
|
||||
%td==
|
||||
%td==
|
||||
- @project.tree_info(@tree, @treeish, @path).each_pair do |entry, commit|
|
||||
%tr
|
||||
%td
|
||||
- entry_path = File.join([@path.present? ? @path : nil, entry.name].compact).encode_to_default
|
||||
- if entry.is_a? Grit::Blob
|
||||
.pic
|
||||
%img{:src => "/assets/code.png"}/
|
||||
.name
|
||||
= link_to(entry.name, blob_path(@project, @treeish, entry_path), :class => 'files-see').encode_to_default
|
||||
-#%a.files-see{:href => "#"}= entry.name.encode_to_default
|
||||
- else
|
||||
.pic
|
||||
%img{:src => "/assets/folder.png"}/
|
||||
.name
|
||||
= link_to(entry.name, tree_path(@project, @treeish, entry_path), :class => 'files-see').encode_to_default
|
||||
%td
|
||||
%span{:style => "display: none;"}= commit.committed_date || commit.authored_date#> Dec 31, 2011
|
||||
= l(commit.committed_date || commit.authored_date, :format => :short) #31 декабря 2011
|
||||
%td
|
||||
= commit.short_message.encode_to_default #Redo autostart script to start from user
|
||||
%td
|
||||
= (commit.committer || commit.author).name.encode_to_default #chipiga
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-#.block
|
||||
= render :partial => "git/shared/navigation"
|
||||
= render :partial => "git/shared/info"
|
||||
|
||||
- if @commit
|
||||
-#- if @commit
|
||||
.block
|
||||
.content
|
||||
.inner
|
||||
= render :partial => "git/commits/commits", :object => [@commit]
|
||||
|
||||
.block
|
||||
-#.block
|
||||
.content
|
||||
.inner
|
||||
%h3= render_path
|
||||
|
@ -46,4 +115,4 @@
|
|||
%td==
|
||||
%td.last==
|
||||
|
||||
- content_for :sidebar, render(:partial => 'git/shared/sidebar')
|
||||
-#- content_for :sidebar, render(:partial => 'git/shared/sidebar')
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
%p#file-name1
|
||||
= link_to @project.name, tree_path(@project, :treeish => @treeish.encode_to_default)
|
||||
= File::SEPARATOR
|
||||
- if @path.present?
|
||||
- paths = File.split(@path)
|
||||
- if paths.size > 1 and paths.first != '.'
|
||||
- iterate_path(paths.first) do |path, name|
|
||||
= link_to(name, tree_path(@project, @treeish, path)).encode_to_default
|
||||
= File::SEPARATOR
|
||||
= paths.last.encode_to_default
|
|
@ -9,7 +9,7 @@
|
|||
= csrf_meta_tag
|
||||
|
||||
%body
|
||||
.wrap.columns
|
||||
.wrap{:class => content_for?(:sidebar) ? 'columns' : ''}
|
||||
%header
|
||||
.left
|
||||
.middle
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
.activity
|
||||
.top
|
||||
.image
|
||||
%img{:alt => "avatar", :src => presenter.image}
|
||||
.text.imaged
|
||||
%span.name= presenter.header
|
||||
%br/
|
||||
%span.date= presenter.date
|
||||
%br/
|
||||
%span.subject
|
||||
= presenter.caption
|
||||
- if presenter.expandable? and presenter.content?
|
||||
%span.data-expander.collapsed{:id => "expand#{item_no}"}
|
||||
-#%img#expand1.activity-full{:alt => "expand", :onclick => "showActivity(4)", :src => "/assets/expand-gray.png"}/
|
||||
.both
|
||||
- if presenter.content?
|
||||
.fulltext{:class => presenter.expandable? ? "hidden" : '',
|
||||
:id => presenter.expandable? ? "content-expand#{item_no}" : ''}
|
||||
= presenter.content
|
|
@ -0,0 +1,16 @@
|
|||
.description-top
|
||||
.img
|
||||
%img{:alt => "pic", :src => "/assets/code.png"}/
|
||||
.name
|
||||
= text_field_tag :url, git_repo_url(project.git_repo_name), :class => 'url-field',
|
||||
:type => 'text',:spellcheck => 'false', :disabled => 'disabled'
|
||||
.role
|
||||
чтение и запись
|
||||
.lineForm.fork
|
||||
= form_tag do
|
||||
= select_tag :branch,
|
||||
options_from_collection_for_select(project.branches, :name, :name),
|
||||
:class => 'sel80', :id => 'branch_selector'
|
||||
.fork
|
||||
%p= t('layout.projects.current_branch')+':'
|
||||
.both
|
|
@ -1,4 +1,19 @@
|
|||
.block
|
||||
= render :partial => 'submenu'
|
||||
= render :partial => 'repo_block', :locals => {:project => @project}
|
||||
|
||||
.description
|
||||
%h3= t("layout.projects.about_subheader")
|
||||
%p
|
||||
= @project.description
|
||||
= link_to t('layout.read_more'), '#'
|
||||
|
||||
%h3= t("layout.projects.last_commit")
|
||||
- GitPresenters::CommitAsMessagePresenter.present(@commit,
|
||||
:branch => @branch) do |presenter|
|
||||
= render :partial => 'shared/feed_message', :locals => {:presenter => presenter,
|
||||
:item_no => 1}
|
||||
|
||||
-#.block
|
||||
.secondary-navigation
|
||||
%ul.wat-cf
|
||||
%li.first= link_to t("layout.projects.list"), projects_path
|
||||
|
@ -38,8 +53,8 @@
|
|||
= link_to image_tag("web-app-theme/icons/cross.png", :alt => t("layout.delete")) + " " + t("layout.delete"), project_path(@project), :method => "delete", :class => "button", :confirm => t("layout.projects.confirm_delete") if can? :destroy, @project
|
||||
= link_to "Fork", fork_project_path(@project), :class => "button", :method => "post", :confirm => t("layout.confirm") if can? :fork, @project
|
||||
|
||||
%a{ :name => "build_lists"}
|
||||
.block
|
||||
-#%a{ :name => "build_lists"}
|
||||
-#.block
|
||||
.secondary-navigation
|
||||
%ul.wat-cf
|
||||
%li.first.active= link_to t("layout.build_lists.current"), project_path(@project) + "#build_lists"
|
||||
|
@ -48,4 +63,4 @@
|
|||
.content
|
||||
= render :partial => "build_lists/build_lists", :object => @current_build_lists
|
||||
|
||||
- content_for :sidebar, render('sidebar')
|
||||
-# content_for :sidebar, render('sidebar')
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
.activity
|
||||
.top
|
||||
.image
|
||||
%img{:alt => "avatar", :src => presenter.image}
|
||||
.text.imaged
|
||||
%span.name= presenter.header
|
||||
%br/
|
||||
%span.date= presenter.date
|
||||
%br/
|
||||
%span.subject
|
||||
= presenter.caption
|
||||
- if presenter.expandable? and presenter.content?
|
||||
%span.data-expander.collapsed{:id => "expand#{item_no}"}
|
||||
.both
|
||||
- if presenter.content?
|
||||
.fulltext{:class => presenter.expandable? ? "hidden" : '',
|
||||
:id => presenter.expandable? ? "content-expand#{item_no}" : ''}
|
||||
= presenter.content
|
|
@ -24,6 +24,7 @@ module Rosa
|
|||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
# config.autoload_paths += %W(#{config.root}/extras)
|
||||
config.autoload_paths += %W(#{config.root}/app/presenters)
|
||||
|
||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
||||
|
@ -38,6 +39,7 @@ module Rosa
|
|||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
|
||||
config.i18n.default_locale = :en
|
||||
|
||||
config.action_view.javascript_expansions[:defaults] = %w()
|
||||
|
|
|
@ -21,7 +21,8 @@ Rosa::Application.configure do
|
|||
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
|
||||
|
||||
# Print deprecation notices to the Rails logger
|
||||
config.active_support.deprecation = :log
|
||||
#config.active_support.deprecation = :log
|
||||
config.active_support.deprecation = false
|
||||
|
||||
# Only use best-standards-support built into browsers
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
|
@ -30,7 +31,7 @@ Rosa::Application.configure do
|
|||
config.assets.compress = false
|
||||
|
||||
# Expands the lines which load the assets
|
||||
config.assets.debug = true
|
||||
#config.assets.debug = true
|
||||
|
||||
# Raise exception on mass assignment protection for Active Record models
|
||||
config.active_record.mass_assignment_sanitizer = :strict
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
ru:
|
||||
layout:
|
||||
messages:
|
||||
commits:
|
||||
header_with_branch: "%{committer} добавил коммит %{commit} в ветку %{branch}"
|
|
@ -138,6 +138,7 @@ Rosa::Application.routes.draw do
|
|||
|
||||
member do
|
||||
post :fork
|
||||
get 'show', :controller => 'git/trees', :action => :show, :as => :show
|
||||
end
|
||||
collection do
|
||||
get :auto_build
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
class AddDefaultBranchToProjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :default_branch, :string, :default => 'master'
|
||||
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20120214021626) do
|
||||
ActiveRecord::Schema.define(:version => 20120220131333) do
|
||||
|
||||
create_table "arches", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
|
@ -259,6 +259,7 @@ ActiveRecord::Schema.define(:version => 20120214021626) do
|
|||
t.string "srpm_content_type"
|
||||
t.integer "srpm_file_size"
|
||||
t.datetime "srpm_updated_at"
|
||||
t.string "default_branch", :default => "master"
|
||||
end
|
||||
|
||||
add_index "projects", ["category_id"], :name => "index_projects_on_category_id"
|
||||
|
@ -277,7 +278,6 @@ ActiveRecord::Schema.define(:version => 20120214021626) do
|
|||
end
|
||||
|
||||
add_index "register_requests", ["email"], :name => "index_register_requests_on_email", :unique => true, :case_sensitive => false
|
||||
add_index "register_requests", ["token"], :name => "index_register_requests_on_token", :unique => true, :case_sensitive => false
|
||||
|
||||
create_table "relations", :force => true do |t|
|
||||
t.integer "object_id"
|
||||
|
|
Loading…
Reference in New Issue