Merge branch 'dev'
This commit is contained in:
commit
ae47d69281
147 changed files with 1773 additions and 1631 deletions
5
Gemfile
5
Gemfile
|
@ -5,7 +5,7 @@ gem 'rails', '3.1.0'
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
gem 'devise', "1.4.7"
|
gem 'devise', "1.4.7"
|
||||||
gem 'stamp'
|
gem 'stamp'
|
||||||
gem 'will_paginate', '~> 3.0'
|
gem 'kaminari'
|
||||||
gem 'haml-rails'
|
gem 'haml-rails'
|
||||||
gem 'jquery-rails'
|
gem 'jquery-rails'
|
||||||
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
|
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
|
||||||
|
@ -16,7 +16,6 @@ gem 'faker'
|
||||||
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
|
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
|
||||||
gem "inifile"
|
gem "inifile"
|
||||||
gem "pygments.rb", "0.2.3"
|
gem "pygments.rb", "0.2.3"
|
||||||
gem "kaminari"
|
|
||||||
gem "thin"
|
gem "thin"
|
||||||
gem "git"
|
gem "git"
|
||||||
gem "acts_as_list"
|
gem "acts_as_list"
|
||||||
|
@ -34,7 +33,7 @@ end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
gem 'shoulda'
|
gem "shoulda", "~> 3.0.0.beta2"
|
||||||
gem 'capybara'
|
gem 'capybara'
|
||||||
gem 'autotest'
|
gem 'autotest'
|
||||||
gem 'autotest-rails'
|
gem 'autotest-rails'
|
||||||
|
|
10
Gemfile.lock
10
Gemfile.lock
|
@ -200,7 +200,11 @@ GEM
|
||||||
ffi (>= 1.0.7)
|
ffi (>= 1.0.7)
|
||||||
json_pure
|
json_pure
|
||||||
rubyzip
|
rubyzip
|
||||||
shoulda (2.11.3)
|
shoulda (3.0.0.beta2)
|
||||||
|
shoulda-context (~> 1.0.0.beta1)
|
||||||
|
shoulda-matchers (~> 1.0.0.beta1)
|
||||||
|
shoulda-context (1.0.0.beta1)
|
||||||
|
shoulda-matchers (1.0.0.beta3)
|
||||||
simplecov (0.5.3)
|
simplecov (0.5.3)
|
||||||
multi_json (~> 1.0.3)
|
multi_json (~> 1.0.3)
|
||||||
simplecov-html (~> 0.5.3)
|
simplecov-html (~> 0.5.3)
|
||||||
|
@ -232,7 +236,6 @@ GEM
|
||||||
multi_json (>= 1.0.2)
|
multi_json (>= 1.0.2)
|
||||||
warden (1.0.5)
|
warden (1.0.5)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
will_paginate (3.0.0)
|
|
||||||
xpath (0.1.4)
|
xpath (0.1.4)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
|
|
||||||
|
@ -265,7 +268,7 @@ DEPENDENCIES
|
||||||
ruby-debug19
|
ruby-debug19
|
||||||
sass-rails (~> 3.1.0)
|
sass-rails (~> 3.1.0)
|
||||||
seed-fu!
|
seed-fu!
|
||||||
shoulda
|
shoulda (~> 3.0.0.beta2)
|
||||||
simplecov
|
simplecov
|
||||||
six
|
six
|
||||||
sqlite3
|
sqlite3
|
||||||
|
@ -274,4 +277,3 @@ DEPENDENCIES
|
||||||
thin
|
thin
|
||||||
turn
|
turn
|
||||||
uglifier
|
uglifier
|
||||||
will_paginate (~> 3.0)
|
|
||||||
|
|
|
@ -5,11 +5,14 @@
|
||||||
// the compiled file.
|
// the compiled file.
|
||||||
//
|
//
|
||||||
//= require jquery
|
//= require jquery
|
||||||
|
//= require jquery-ui
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
|
//= require jquery.ui.selectmenu
|
||||||
|
//= require jquery.cookie
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
$(".one_click_select").click(function(){
|
$(".one_click_select").live("click", function(){
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
845
app/assets/javascripts/jquery.ui.selectmenu.js
vendored
845
app/assets/javascripts/jquery.ui.selectmenu.js
vendored
|
@ -1,845 +0,0 @@
|
||||||
/*
|
|
||||||
* jQuery UI selectmenu dev version
|
|
||||||
*
|
|
||||||
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
|
||||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
|
||||||
* and GPL (GPL-LICENSE.txt) licenses.
|
|
||||||
*
|
|
||||||
* http://docs.jquery.com/UI
|
|
||||||
* https://github.com/fnagel/jquery-ui/wiki/Selectmenu
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function($) {
|
|
||||||
|
|
||||||
$.widget("ui.selectmenu", {
|
|
||||||
getter: "value",
|
|
||||||
version: "1.8",
|
|
||||||
eventPrefix: "selectmenu",
|
|
||||||
options: {
|
|
||||||
transferClasses: true,
|
|
||||||
typeAhead: "sequential",
|
|
||||||
style: 'dropdown',
|
|
||||||
positionOptions: {
|
|
||||||
my: "left top",
|
|
||||||
at: "left bottom",
|
|
||||||
offset: null
|
|
||||||
},
|
|
||||||
width: null,
|
|
||||||
menuWidth: null,
|
|
||||||
handleWidth: 26,
|
|
||||||
maxHeight: null,
|
|
||||||
icons: null,
|
|
||||||
format: null,
|
|
||||||
bgImage: function() {},
|
|
||||||
wrapperElement: "<div />"
|
|
||||||
},
|
|
||||||
|
|
||||||
_create: function() {
|
|
||||||
var self = this, o = this.options;
|
|
||||||
|
|
||||||
// set a default id value, generate a new random one if not set by developer
|
|
||||||
var selectmenuId = this.element.attr( 'id' ) || 'ui-selectmenu-' + Math.random().toString( 16 ).slice( 2, 10 );
|
|
||||||
|
|
||||||
// quick array of button and menu id's
|
|
||||||
this.ids = [ selectmenuId + '-button', selectmenuId + '-menu' ];
|
|
||||||
|
|
||||||
// define safe mouseup for future toggling
|
|
||||||
this._safemouseup = true;
|
|
||||||
|
|
||||||
// create menu button wrapper
|
|
||||||
this.newelement = $( '<a />', {
|
|
||||||
'class': this.widgetBaseClass + ' ui-widget ui-state-default ui-corner-all',
|
|
||||||
'id' : this.ids[ 0 ],
|
|
||||||
'role': 'button',
|
|
||||||
'href': '#nogo',
|
|
||||||
'tabindex': this.element.attr( 'disabled' ) ? 1 : 0,
|
|
||||||
'aria-haspopup': true,
|
|
||||||
'aria-owns': this.ids[ 1 ]
|
|
||||||
});
|
|
||||||
this.newelementWrap = $( o.wrapperElement )
|
|
||||||
.append( this.newelement )
|
|
||||||
.insertAfter( this.element );
|
|
||||||
|
|
||||||
// transfer tabindex
|
|
||||||
var tabindex = this.element.attr( 'tabindex' );
|
|
||||||
if ( tabindex ) {
|
|
||||||
this.newelement.attr( 'tabindex', tabindex );
|
|
||||||
}
|
|
||||||
|
|
||||||
// save reference to select in data for ease in calling methods
|
|
||||||
this.newelement.data( 'selectelement', this.element );
|
|
||||||
|
|
||||||
// menu icon
|
|
||||||
this.selectmenuIcon = $( '<span class="' + this.widgetBaseClass + '-icon ui-icon"></span>' )
|
|
||||||
.prependTo( this.newelement );
|
|
||||||
|
|
||||||
// append status span to button
|
|
||||||
this.newelement.prepend( '<span class="' + self.widgetBaseClass + '-status" />' );
|
|
||||||
|
|
||||||
// make associated form label trigger focus
|
|
||||||
$( 'label[for="' + selectmenuId + '"]' )
|
|
||||||
.attr( 'for', this.ids[0] )
|
|
||||||
.bind( 'click.selectmenu', function() {
|
|
||||||
self.newelement[0].focus();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// click toggle for menu visibility
|
|
||||||
this.newelement
|
|
||||||
.bind('mousedown.selectmenu', function(event) {
|
|
||||||
self._toggle(event, true);
|
|
||||||
// make sure a click won't open/close instantly
|
|
||||||
if (o.style == "popup") {
|
|
||||||
self._safemouseup = false;
|
|
||||||
setTimeout(function() { self._safemouseup = true; }, 300);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
.bind('click.selectmenu', function() {
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
.bind("keydown.selectmenu", function(event) {
|
|
||||||
var ret = false;
|
|
||||||
switch (event.keyCode) {
|
|
||||||
case $.ui.keyCode.ENTER:
|
|
||||||
ret = true;
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.SPACE:
|
|
||||||
self._toggle(event);
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.UP:
|
|
||||||
if (event.altKey) {
|
|
||||||
self.open(event);
|
|
||||||
} else {
|
|
||||||
self._moveSelection(-1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.DOWN:
|
|
||||||
if (event.altKey) {
|
|
||||||
self.open(event);
|
|
||||||
} else {
|
|
||||||
self._moveSelection(1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.LEFT:
|
|
||||||
self._moveSelection(-1);
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.RIGHT:
|
|
||||||
self._moveSelection(1);
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.TAB:
|
|
||||||
ret = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
})
|
|
||||||
.bind('keypress.selectmenu', function(event) {
|
|
||||||
self._typeAhead(event.which, 'mouseup');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.bind('mouseover.selectmenu focus.selectmenu', function() {
|
|
||||||
if (!o.disabled) {
|
|
||||||
$(this).addClass(self.widgetBaseClass + '-focus ui-state-hover');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.bind('mouseout.selectmenu blur.selectmenu', function() {
|
|
||||||
if (!o.disabled) {
|
|
||||||
$(this).removeClass(self.widgetBaseClass + '-focus ui-state-hover');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// document click closes menu
|
|
||||||
$(document).bind("mousedown.selectmenu", function(event) {
|
|
||||||
self.close(event);
|
|
||||||
});
|
|
||||||
|
|
||||||
// change event on original selectmenu
|
|
||||||
this.element
|
|
||||||
.bind("click.selectmenu", function() {
|
|
||||||
self._refreshValue();
|
|
||||||
})
|
|
||||||
// FIXME: newelement can be null under unclear circumstances in IE8
|
|
||||||
// TODO not sure if this is still a problem (fnagel 20.03.11)
|
|
||||||
.bind("focus.selectmenu", function() {
|
|
||||||
if (self.newelement) {
|
|
||||||
self.newelement[0].focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// set width when not set via options
|
|
||||||
if (!o.width) {
|
|
||||||
o.width = this.element.outerWidth();
|
|
||||||
}
|
|
||||||
// set menu button width
|
|
||||||
this.newelement.width(o.width);
|
|
||||||
|
|
||||||
// hide original selectmenu element
|
|
||||||
this.element.hide();
|
|
||||||
|
|
||||||
// create menu portion, append to body
|
|
||||||
this.list = $( '<ul />', {
|
|
||||||
'class': 'ui-widget ui-widget-content',
|
|
||||||
'aria-hidden': true,
|
|
||||||
'role': 'listbox',
|
|
||||||
'aria-labelledby': this.ids[0],
|
|
||||||
'id': this.ids[1]
|
|
||||||
});
|
|
||||||
this.listWrap = $( o.wrapperElement )
|
|
||||||
.addClass( self.widgetBaseClass + '-menu' )
|
|
||||||
.append( this.list )
|
|
||||||
.appendTo( 'body' );
|
|
||||||
|
|
||||||
// transfer menu click to menu button
|
|
||||||
this.list
|
|
||||||
.bind("keydown.selectmenu", function(event) {
|
|
||||||
var ret = false;
|
|
||||||
switch (event.keyCode) {
|
|
||||||
case $.ui.keyCode.UP:
|
|
||||||
if (event.altKey) {
|
|
||||||
self.close(event, true);
|
|
||||||
} else {
|
|
||||||
self._moveFocus(-1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.DOWN:
|
|
||||||
if (event.altKey) {
|
|
||||||
self.close(event, true);
|
|
||||||
} else {
|
|
||||||
self._moveFocus(1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.LEFT:
|
|
||||||
self._moveFocus(-1);
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.RIGHT:
|
|
||||||
self._moveFocus(1);
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.HOME:
|
|
||||||
self._moveFocus(':first');
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.PAGE_UP:
|
|
||||||
self._scrollPage('up');
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.PAGE_DOWN:
|
|
||||||
self._scrollPage('down');
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.END:
|
|
||||||
self._moveFocus(':last');
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.ENTER:
|
|
||||||
case $.ui.keyCode.SPACE:
|
|
||||||
self.close(event, true);
|
|
||||||
$(event.target).parents('li:eq(0)').trigger('mouseup');
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.TAB:
|
|
||||||
ret = true;
|
|
||||||
self.close(event, true);
|
|
||||||
$(event.target).parents('li:eq(0)').trigger('mouseup');
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.ESCAPE:
|
|
||||||
self.close(event, true);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
})
|
|
||||||
.bind('keypress.selectmenu', function(event) {
|
|
||||||
self._typeAhead(event.which, 'focus');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
// this allows for using the scrollbar in an overflowed list
|
|
||||||
.bind( 'mousedown.selectmenu mouseup.selectmenu', function() { return false; });
|
|
||||||
|
|
||||||
// needed when window is resized
|
|
||||||
// TODO seems to be useless, but causes errors (fnagel 01.08.11)
|
|
||||||
// see: https://github.com/fnagel/jquery-ui/issues/147
|
|
||||||
// $(window).bind( "resize.selectmenu", $.proxy( self._refreshPosition, this ) );
|
|
||||||
},
|
|
||||||
|
|
||||||
_init: function() {
|
|
||||||
var self = this, o = this.options;
|
|
||||||
|
|
||||||
// serialize selectmenu element options
|
|
||||||
var selectOptionData = [];
|
|
||||||
this.element
|
|
||||||
.find('option')
|
|
||||||
.each(function() {
|
|
||||||
var opt = $(this);
|
|
||||||
selectOptionData.push({
|
|
||||||
value: opt.attr('value'),
|
|
||||||
text: self._formatText(opt.text()),
|
|
||||||
selected: opt.attr('selected'),
|
|
||||||
disabled: opt.attr('disabled'),
|
|
||||||
classes: opt.attr('class'),
|
|
||||||
typeahead: opt.attr('typeahead'),
|
|
||||||
parentOptGroup: opt.parent('optgroup'),
|
|
||||||
bgImage: o.bgImage.call(opt)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// active state class is only used in popup style
|
|
||||||
var activeClass = (self.options.style == "popup") ? " ui-state-active" : "";
|
|
||||||
|
|
||||||
// empty list so we can refresh the selectmenu via selectmenu()
|
|
||||||
this.list.html("");
|
|
||||||
|
|
||||||
// write li's
|
|
||||||
if (selectOptionData.length) {
|
|
||||||
for (var i = 0; i < selectOptionData.length; i++) {
|
|
||||||
var thisLiAttr = { role : 'presentation' };
|
|
||||||
if ( selectOptionData[ i ].disabled ) {
|
|
||||||
thisLiAttr[ 'class' ] = this.namespace + '-state-disabled';
|
|
||||||
}
|
|
||||||
var thisAAttr = {
|
|
||||||
html: selectOptionData[i].text,
|
|
||||||
href : '#nogo',
|
|
||||||
tabindex : -1,
|
|
||||||
role : 'option',
|
|
||||||
'aria-selected' : false
|
|
||||||
};
|
|
||||||
if ( selectOptionData[ i ].disabled ) {
|
|
||||||
thisAAttr[ 'aria-disabled' ] = selectOptionData[ i ].disabled;
|
|
||||||
}
|
|
||||||
if ( selectOptionData[ i ].typeahead ) {
|
|
||||||
thisAAttr[ 'typeahead' ] = selectOptionData[ i ].typeahead;
|
|
||||||
}
|
|
||||||
var thisA = $('<a/>', thisAAttr);
|
|
||||||
var thisLi = $('<li/>', thisLiAttr)
|
|
||||||
.append(thisA)
|
|
||||||
.data('index', i)
|
|
||||||
.addClass(selectOptionData[i].classes)
|
|
||||||
.data('optionClasses', selectOptionData[i].classes || '')
|
|
||||||
.bind("mouseup.selectmenu", function(event) {
|
|
||||||
if (self._safemouseup && !self._disabled(event.currentTarget) && !self._disabled($( event.currentTarget ).parents( "ul>li." + self.widgetBaseClass + "-group " )) ) {
|
|
||||||
var changed = $(this).data('index') != self._selectedIndex();
|
|
||||||
self.index($(this).data('index'));
|
|
||||||
self.select(event);
|
|
||||||
if (changed) {
|
|
||||||
self.change(event);
|
|
||||||
}
|
|
||||||
self.close(event, true);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
.bind("click.selectmenu", function() {
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
.bind('mouseover.selectmenu focus.selectmenu', function(e) {
|
|
||||||
// no hover if diabled
|
|
||||||
if (!$(e.currentTarget).hasClass(self.namespace + '-state-disabled') && !$(e.currentTarget).parent("ul").parent("li").hasClass(self.namespace + '-state-disabled')) {
|
|
||||||
self._selectedOptionLi().addClass(activeClass);
|
|
||||||
self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
|
|
||||||
$(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.bind('mouseout.selectmenu blur.selectmenu', function() {
|
|
||||||
if ($(this).is(self._selectedOptionLi().selector)) {
|
|
||||||
$(this).addClass(activeClass);
|
|
||||||
}
|
|
||||||
$(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
|
|
||||||
});
|
|
||||||
|
|
||||||
// optgroup or not...
|
|
||||||
if ( selectOptionData[i].parentOptGroup.length ) {
|
|
||||||
var optGroupName = self.widgetBaseClass + '-group-' + this.element.find( 'optgroup' ).index( selectOptionData[i].parentOptGroup );
|
|
||||||
if (this.list.find( 'li.' + optGroupName ).length ) {
|
|
||||||
this.list.find( 'li.' + optGroupName + ':last ul' ).append( thisLi );
|
|
||||||
} else {
|
|
||||||
$(' <li role="presentation" class="' + self.widgetBaseClass + '-group ' + optGroupName + (selectOptionData[i].parentOptGroup.attr("disabled") ? ' ' + this.namespace + '-state-disabled" aria-disabled="true"' : '"' ) + '><span class="' + self.widgetBaseClass + '-group-label">' + selectOptionData[i].parentOptGroup.attr('label') + '</span><ul></ul></li> ')
|
|
||||||
.appendTo( this.list )
|
|
||||||
.find( 'ul' )
|
|
||||||
.append( thisLi );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
thisLi.appendTo(this.list);
|
|
||||||
}
|
|
||||||
|
|
||||||
// append icon if option is specified
|
|
||||||
if (o.icons) {
|
|
||||||
for (var j in o.icons) {
|
|
||||||
if (thisLi.is(o.icons[j].find)) {
|
|
||||||
thisLi
|
|
||||||
.data('optionClasses', selectOptionData[i].classes + ' ' + self.widgetBaseClass + '-hasIcon')
|
|
||||||
.addClass(self.widgetBaseClass + '-hasIcon');
|
|
||||||
var iconClass = o.icons[j].icon || "";
|
|
||||||
thisLi
|
|
||||||
.find('a:eq(0)')
|
|
||||||
.prepend('<span class="' + self.widgetBaseClass + '-item-icon ui-icon ' + iconClass + '"></span>');
|
|
||||||
if (selectOptionData[i].bgImage) {
|
|
||||||
thisLi.find('span').css('background-image', selectOptionData[i].bgImage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('<li role="presentation"><a href="#nogo" tabindex="-1" role="option"></a></li>').appendTo(this.list);
|
|
||||||
}
|
|
||||||
// we need to set and unset the CSS classes for dropdown and popup style
|
|
||||||
var isDropDown = ( o.style == 'dropdown' );
|
|
||||||
this.newelement
|
|
||||||
.toggleClass( self.widgetBaseClass + '-dropdown', isDropDown )
|
|
||||||
.toggleClass( self.widgetBaseClass + '-popup', !isDropDown );
|
|
||||||
this.list
|
|
||||||
.toggleClass( self.widgetBaseClass + '-menu-dropdown ui-corner-bottom', isDropDown )
|
|
||||||
.toggleClass( self.widgetBaseClass + '-menu-popup ui-corner-all', !isDropDown )
|
|
||||||
// add corners to top and bottom menu items
|
|
||||||
.find( 'li:first' )
|
|
||||||
.toggleClass( 'ui-corner-top', !isDropDown )
|
|
||||||
.end().find( 'li:last' )
|
|
||||||
.addClass( 'ui-corner-bottom' );
|
|
||||||
this.selectmenuIcon
|
|
||||||
.toggleClass( 'ui-icon-triangle-1-s', isDropDown )
|
|
||||||
.toggleClass( 'ui-icon-triangle-2-n-s', !isDropDown );
|
|
||||||
|
|
||||||
// transfer classes to selectmenu and list
|
|
||||||
if ( o.transferClasses ) {
|
|
||||||
var transferClasses = this.element.attr( 'class' ) || '';
|
|
||||||
this.newelement.add( this.list ).addClass( transferClasses );
|
|
||||||
}
|
|
||||||
|
|
||||||
// set menu width to either menuWidth option value, width option value, or select width
|
|
||||||
if ( o.style == 'dropdown' ) {
|
|
||||||
this.list.width( o.menuWidth ? o.menuWidth : o.width );
|
|
||||||
} else {
|
|
||||||
this.list.width( o.menuWidth ? o.menuWidth : o.width - o.handleWidth );
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset height to auto
|
|
||||||
this.list.css( 'height', 'auto' );
|
|
||||||
var listH = this.listWrap.height();
|
|
||||||
// calculate default max height
|
|
||||||
if ( o.maxHeight && o.maxHeight < listH ) {
|
|
||||||
this.list.height( o.maxHeight );
|
|
||||||
} else {
|
|
||||||
var winH = $( window ).height() / 3;
|
|
||||||
if ( winH < listH ) this.list.height( winH );
|
|
||||||
}
|
|
||||||
|
|
||||||
// save reference to actionable li's (not group label li's)
|
|
||||||
this._optionLis = this.list.find( 'li:not(.' + self.widgetBaseClass + '-group)' );
|
|
||||||
|
|
||||||
// transfer disabled state
|
|
||||||
if ( this.element.attr( 'disabled' ) ) {
|
|
||||||
this.disable();
|
|
||||||
} else {
|
|
||||||
this.enable()
|
|
||||||
}
|
|
||||||
|
|
||||||
// update value
|
|
||||||
this.index( this._selectedIndex() );
|
|
||||||
|
|
||||||
// needed when selectmenu is placed at the very bottom / top of the page
|
|
||||||
window.setTimeout( function() {
|
|
||||||
self._refreshPosition();
|
|
||||||
}, 200 );
|
|
||||||
},
|
|
||||||
|
|
||||||
destroy: function() {
|
|
||||||
this.element.removeData( this.widgetName )
|
|
||||||
.removeClass( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled' )
|
|
||||||
.removeAttr( 'aria-disabled' )
|
|
||||||
.unbind( ".selectmenu" );
|
|
||||||
|
|
||||||
// TODO unneded as event binding has been disabled
|
|
||||||
// $( window ).unbind( ".selectmenu" );
|
|
||||||
$( document ).unbind( ".selectmenu" );
|
|
||||||
|
|
||||||
// unbind click on label, reset its for attr
|
|
||||||
$( 'label[for=' + this.newelement.attr('id') + ']' )
|
|
||||||
.attr( 'for', this.element.attr( 'id' ) )
|
|
||||||
.unbind( '.selectmenu' );
|
|
||||||
|
|
||||||
this.newelementWrap.remove();
|
|
||||||
this.listWrap.remove();
|
|
||||||
|
|
||||||
this.element.show();
|
|
||||||
|
|
||||||
// call widget destroy function
|
|
||||||
$.Widget.prototype.destroy.apply(this, arguments);
|
|
||||||
},
|
|
||||||
|
|
||||||
_typeAhead: function( code, eventType ){
|
|
||||||
var self = this, focusFound = false, C = String.fromCharCode(code).toUpperCase();
|
|
||||||
c = C.toLowerCase();
|
|
||||||
|
|
||||||
if ( self.options.typeAhead == 'sequential' ) {
|
|
||||||
// clear the timeout so we can use _prevChar
|
|
||||||
window.clearTimeout('ui.selectmenu-' + self.selectmenuId);
|
|
||||||
|
|
||||||
// define our find var
|
|
||||||
var find = typeof( self._prevChar ) == 'undefined' ? '' : self._prevChar.join( '' );
|
|
||||||
|
|
||||||
function focusOptSeq( elem, ind, c ){
|
|
||||||
focusFound = true;
|
|
||||||
$( elem ).trigger( eventType );
|
|
||||||
typeof( self._prevChar ) == 'undefined' ? self._prevChar = [ c ] : self._prevChar[ self._prevChar.length ] = c;
|
|
||||||
}
|
|
||||||
this.list.find( 'li a' ).each( function( i ) {
|
|
||||||
if ( !focusFound ) {
|
|
||||||
// allow the typeahead attribute on the option tag for a more specific lookup
|
|
||||||
var thisText = $( this ).attr( 'typeahead' ) || $(this).text();
|
|
||||||
if ( thisText.indexOf( find + C ) === 0 ) {
|
|
||||||
focusOptSeq( this, i, C );
|
|
||||||
} else if (thisText.indexOf(find+c) === 0 ) {
|
|
||||||
focusOptSeq( this, i, c );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// set a 1 second timeout for sequenctial typeahead
|
|
||||||
// keep this set even if we have no matches so it doesnt typeahead somewhere else
|
|
||||||
window.setTimeout( function( el ) {
|
|
||||||
self._prevChar = undefined;
|
|
||||||
}, 1000, self );
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// define self._prevChar if needed
|
|
||||||
if ( !self._prevChar ) { self._prevChar = [ '' , 0 ]; }
|
|
||||||
|
|
||||||
focusFound = false;
|
|
||||||
function focusOpt( elem, ind ){
|
|
||||||
focusFound = true;
|
|
||||||
$( elem ).trigger( eventType );
|
|
||||||
self._prevChar[ 1 ] = ind;
|
|
||||||
}
|
|
||||||
this.list.find( 'li a' ).each(function( i ){
|
|
||||||
if (!focusFound){
|
|
||||||
var thisText = $(this).text();
|
|
||||||
if ( thisText.indexOf( C ) === 0 || thisText.indexOf( c ) === 0 ) {
|
|
||||||
if (self._prevChar[0] == C){
|
|
||||||
if ( self._prevChar[ 1 ] < i ){ focusOpt( this, i ); }
|
|
||||||
} else{
|
|
||||||
focusOpt( this, i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this._prevChar[ 0 ] = C;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// returns some usefull information, called by callbacks only
|
|
||||||
_uiHash: function() {
|
|
||||||
var index = this.index();
|
|
||||||
return {
|
|
||||||
index: index,
|
|
||||||
option: $("option", this.element).get(index),
|
|
||||||
value: this.element[0].value
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
open: function(event) {
|
|
||||||
var self = this, o = this.options;
|
|
||||||
if ( self.newelement.attr("aria-disabled") != 'true' ) {
|
|
||||||
self._closeOthers(event);
|
|
||||||
self.newelement.addClass('ui-state-active');
|
|
||||||
|
|
||||||
self.listWrap.appendTo( o.appendTo );
|
|
||||||
self.list.attr('aria-hidden', false);
|
|
||||||
|
|
||||||
if ( o.style == "dropdown" ) {
|
|
||||||
self.newelement.removeClass('ui-corner-all').addClass('ui-corner-top');
|
|
||||||
}
|
|
||||||
|
|
||||||
self.listWrap.addClass( self.widgetBaseClass + '-open' );
|
|
||||||
// positioning needed for IE7 (tested 01.08.11 on MS VPC Image)
|
|
||||||
// see https://github.com/fnagel/jquery-ui/issues/147
|
|
||||||
if ( $.browser.msie && $.browser.version.substr( 0,1 ) == 7 ) {
|
|
||||||
self._refreshPosition();
|
|
||||||
}
|
|
||||||
var selected = self.list.attr('aria-hidden', false).find('li:not(.' + self.widgetBaseClass + '-group):eq(' + self._selectedIndex() + '):visible a');
|
|
||||||
if (selected.length) selected[0].focus();
|
|
||||||
// positioning needed for FF, Chrome, IE8, IE7, IE6 (tested 01.08.11 on MS VPC Image)
|
|
||||||
self._refreshPosition();
|
|
||||||
|
|
||||||
self._trigger("open", event, self._uiHash());
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
close: function(event, retainFocus) {
|
|
||||||
if ( this.newelement.is('.ui-state-active') ) {
|
|
||||||
this.newelement
|
|
||||||
.removeClass('ui-state-active');
|
|
||||||
this.listWrap.removeClass(this.widgetBaseClass + '-open');
|
|
||||||
this.list.attr('aria-hidden', true);
|
|
||||||
if ( this.options.style == "dropdown" ) {
|
|
||||||
this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all');
|
|
||||||
}
|
|
||||||
if ( retainFocus ) {
|
|
||||||
this.newelement.focus();
|
|
||||||
}
|
|
||||||
this._trigger("close", event, this._uiHash());
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
change: function(event) {
|
|
||||||
this.element.trigger("change");
|
|
||||||
this._trigger("change", event, this._uiHash());
|
|
||||||
},
|
|
||||||
|
|
||||||
select: function(event) {
|
|
||||||
if (this._disabled(event.currentTarget)) { return false; }
|
|
||||||
this._trigger("select", event, this._uiHash());
|
|
||||||
},
|
|
||||||
|
|
||||||
_closeOthers: function(event) {
|
|
||||||
$('.' + this.widgetBaseClass + '.ui-state-active').not(this.newelement).each(function() {
|
|
||||||
$(this).data('selectelement').selectmenu('close', event);
|
|
||||||
});
|
|
||||||
$('.' + this.widgetBaseClass + '.ui-state-hover').trigger('mouseout');
|
|
||||||
},
|
|
||||||
|
|
||||||
_toggle: function(event, retainFocus) {
|
|
||||||
if ( this.list.parent().is('.' + this.widgetBaseClass + '-open') ) {
|
|
||||||
this.close(event, retainFocus);
|
|
||||||
} else {
|
|
||||||
this.open(event);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_formatText: function(text) {
|
|
||||||
return (this.options.format ? this.options.format(text) : text);
|
|
||||||
},
|
|
||||||
|
|
||||||
_selectedIndex: function() {
|
|
||||||
return this.element[0].selectedIndex;
|
|
||||||
},
|
|
||||||
|
|
||||||
_selectedOptionLi: function() {
|
|
||||||
return this._optionLis.eq(this._selectedIndex());
|
|
||||||
},
|
|
||||||
|
|
||||||
_focusedOptionLi: function() {
|
|
||||||
return this.list.find('.' + this.widgetBaseClass + '-item-focus');
|
|
||||||
},
|
|
||||||
|
|
||||||
_moveSelection: function(amt, recIndex) {
|
|
||||||
// do nothing if disabled
|
|
||||||
if (!this.options.disabled) {
|
|
||||||
var currIndex = parseInt(this._selectedOptionLi().data('index') || 0, 10);
|
|
||||||
var newIndex = currIndex + amt;
|
|
||||||
// do not loop when using up key
|
|
||||||
|
|
||||||
if (newIndex < 0) {
|
|
||||||
newIndex = 0;
|
|
||||||
}
|
|
||||||
if (newIndex > this._optionLis.size() - 1) {
|
|
||||||
newIndex = this._optionLis.size() - 1;
|
|
||||||
}
|
|
||||||
// Occurs when a full loop has been made
|
|
||||||
if (newIndex === recIndex) { return false; }
|
|
||||||
|
|
||||||
if (this._optionLis.eq(newIndex).hasClass( this.namespace + '-state-disabled' )) {
|
|
||||||
// if option at newIndex is disabled, call _moveFocus, incrementing amt by one
|
|
||||||
(amt > 0) ? ++amt : --amt;
|
|
||||||
this._moveSelection(amt, newIndex);
|
|
||||||
} else {
|
|
||||||
return this._optionLis.eq(newIndex).trigger('mouseup');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_moveFocus: function(amt, recIndex) {
|
|
||||||
if (!isNaN(amt)) {
|
|
||||||
var currIndex = parseInt(this._focusedOptionLi().data('index') || 0, 10);
|
|
||||||
var newIndex = currIndex + amt;
|
|
||||||
} else {
|
|
||||||
var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newIndex < 0) {
|
|
||||||
newIndex = 0;
|
|
||||||
}
|
|
||||||
if (newIndex > this._optionLis.size() - 1) {
|
|
||||||
newIndex = this._optionLis.size() - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Occurs when a full loop has been made
|
|
||||||
if (newIndex === recIndex) { return false; }
|
|
||||||
|
|
||||||
var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
|
|
||||||
|
|
||||||
this._focusedOptionLi().find('a:eq(0)').attr('id', '');
|
|
||||||
|
|
||||||
if (this._optionLis.eq(newIndex).hasClass( this.namespace + '-state-disabled' )) {
|
|
||||||
// if option at newIndex is disabled, call _moveFocus, incrementing amt by one
|
|
||||||
(amt > 0) ? ++amt : --amt;
|
|
||||||
this._moveFocus(amt, newIndex);
|
|
||||||
} else {
|
|
||||||
this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID).focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.list.attr('aria-activedescendant', activeID);
|
|
||||||
},
|
|
||||||
|
|
||||||
_scrollPage: function(direction) {
|
|
||||||
var numPerPage = Math.floor(this.list.outerHeight() / this.list.find('li:first').outerHeight());
|
|
||||||
numPerPage = (direction == 'up' ? -numPerPage : numPerPage);
|
|
||||||
this._moveFocus(numPerPage);
|
|
||||||
},
|
|
||||||
|
|
||||||
_setOption: function(key, value) {
|
|
||||||
this.options[key] = value;
|
|
||||||
// set
|
|
||||||
if (key == 'disabled') {
|
|
||||||
this.close();
|
|
||||||
this.element
|
|
||||||
.add(this.newelement)
|
|
||||||
.add(this.list)[value ? 'addClass' : 'removeClass'](
|
|
||||||
this.widgetBaseClass + '-disabled' + ' ' +
|
|
||||||
this.namespace + '-state-disabled')
|
|
||||||
.attr("aria-disabled", value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
disable: function(index, type){
|
|
||||||
// if options is not provided, call the parents disable function
|
|
||||||
if ( typeof( index ) == 'undefined' ) {
|
|
||||||
this._setOption( 'disabled', true );
|
|
||||||
} else {
|
|
||||||
if ( type == "optgroup" ) {
|
|
||||||
this._disableOptgroup(index);
|
|
||||||
} else {
|
|
||||||
this._disableOption(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
enable: function(index, type) {
|
|
||||||
// if options is not provided, call the parents enable function
|
|
||||||
if ( typeof( index ) == 'undefined' ) {
|
|
||||||
this._setOption('disabled', false);
|
|
||||||
} else {
|
|
||||||
if ( type == "optgroup" ) {
|
|
||||||
this._enableOptgroup(index);
|
|
||||||
} else {
|
|
||||||
this._enableOption(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_disabled: function(elem) {
|
|
||||||
return $(elem).hasClass( this.namespace + '-state-disabled' );
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
_disableOption: function(index) {
|
|
||||||
var optionElem = this._optionLis.eq(index);
|
|
||||||
if (optionElem) {
|
|
||||||
optionElem.addClass(this.namespace + '-state-disabled')
|
|
||||||
.find("a").attr("aria-disabled", true);
|
|
||||||
this.element.find("option").eq(index).attr("disabled", "disabled");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_enableOption: function(index) {
|
|
||||||
var optionElem = this._optionLis.eq(index);
|
|
||||||
if (optionElem) {
|
|
||||||
optionElem.removeClass( this.namespace + '-state-disabled' )
|
|
||||||
.find("a").attr("aria-disabled", false);
|
|
||||||
this.element.find("option").eq(index).removeAttr("disabled");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_disableOptgroup: function(index) {
|
|
||||||
var optGroupElem = this.list.find( 'li.' + this.widgetBaseClass + '-group-' + index );
|
|
||||||
if (optGroupElem) {
|
|
||||||
optGroupElem.addClass(this.namespace + '-state-disabled')
|
|
||||||
.attr("aria-disabled", true);
|
|
||||||
this.element.find("optgroup").eq(index).attr("disabled", "disabled");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_enableOptgroup: function(index) {
|
|
||||||
var optGroupElem = this.list.find( 'li.' + this.widgetBaseClass + '-group-' + index );
|
|
||||||
if (optGroupElem) {
|
|
||||||
optGroupElem.removeClass(this.namespace + '-state-disabled')
|
|
||||||
.attr("aria-disabled", false);
|
|
||||||
this.element.find("optgroup").eq(index).removeAttr("disabled");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
index: function(newValue) {
|
|
||||||
if (arguments.length) {
|
|
||||||
if (!this._disabled($(this._optionLis[newValue]))) {
|
|
||||||
this.element[0].selectedIndex = newValue;
|
|
||||||
this._refreshValue();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return this._selectedIndex();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
value: function(newValue) {
|
|
||||||
if (arguments.length) {
|
|
||||||
this.element[0].value = newValue;
|
|
||||||
this._refreshValue();
|
|
||||||
} else {
|
|
||||||
return this.element[0].value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_refreshValue: function() {
|
|
||||||
var activeClass = (this.options.style == "popup") ? " ui-state-active" : "";
|
|
||||||
var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
|
|
||||||
// deselect previous
|
|
||||||
this.list
|
|
||||||
.find('.' + this.widgetBaseClass + '-item-selected')
|
|
||||||
.removeClass(this.widgetBaseClass + "-item-selected" + activeClass)
|
|
||||||
.find('a')
|
|
||||||
.attr('aria-selected', 'false')
|
|
||||||
.attr('id', '');
|
|
||||||
// select new
|
|
||||||
this._selectedOptionLi()
|
|
||||||
.addClass(this.widgetBaseClass + "-item-selected" + activeClass)
|
|
||||||
.find('a')
|
|
||||||
.attr('aria-selected', 'true')
|
|
||||||
.attr('id', activeID);
|
|
||||||
|
|
||||||
// toggle any class brought in from option
|
|
||||||
var currentOptionClasses = (this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : "");
|
|
||||||
var newOptionClasses = (this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : "");
|
|
||||||
this.newelement
|
|
||||||
.removeClass(currentOptionClasses)
|
|
||||||
.data('optionClasses', newOptionClasses)
|
|
||||||
.addClass( newOptionClasses )
|
|
||||||
.find('.' + this.widgetBaseClass + '-status')
|
|
||||||
.html(
|
|
||||||
this._selectedOptionLi()
|
|
||||||
.find('a:eq(0)')
|
|
||||||
.html()
|
|
||||||
);
|
|
||||||
|
|
||||||
this.list.attr('aria-activedescendant', activeID);
|
|
||||||
},
|
|
||||||
|
|
||||||
_refreshPosition: function() {
|
|
||||||
var o = this.options;
|
|
||||||
|
|
||||||
// if its a native pop-up we need to calculate the position of the selected li
|
|
||||||
if ( o.style == "popup" && !o.positionOptions.offset ) {
|
|
||||||
var selected = this._selectedOptionLi();
|
|
||||||
var _offset = "0 -" + ( selected.outerHeight() + selected.offset().top - this.list.offset().top );
|
|
||||||
}
|
|
||||||
// update zIndex if jQuery UI is able to process
|
|
||||||
var zIndexElement = this.element.zIndex();
|
|
||||||
if ( zIndexElement ) {
|
|
||||||
this.listWrap.css( 'zIndex', zIndexElement );
|
|
||||||
}
|
|
||||||
this.listWrap.position({
|
|
||||||
// set options for position plugin
|
|
||||||
of: o.positionOptions.of || this.newelement,
|
|
||||||
my: o.positionOptions.my,
|
|
||||||
at: o.positionOptions.at,
|
|
||||||
offset: o.positionOptions.offset || _offset,
|
|
||||||
collision: o.positionOptions.collision || 'flip'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
|
|
@ -8,7 +8,7 @@ $(document).ready(function(){
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
$(this).find("td.tree-item-file-name a").click();
|
$(this).find("td.tree-item-file-name a").click();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#projects-list .project").live('click', function(e){
|
$("#projects-list .project").live('click', function(e){
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
||||||
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
||||||
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
||||||
|
*= require jquery-ui/jquery-ui
|
||||||
|
*= require jquery-ui/jquery.ui.selectmenu
|
||||||
*= require_self
|
*= require_self
|
||||||
*= require_tree .
|
*= require_tree .
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@mixin round-borders-all($radius) {
|
@mixin round-borders-all($radius) {
|
||||||
border: 1px solid #eaeaea;
|
border: 1px solid #eaeaea;
|
||||||
-moz-border-radius: $radius;
|
-moz-border-radius: $radius;
|
||||||
-webkit-border-radius: $radius;
|
-webkit-border-radius: $radius;
|
||||||
|
@ -28,11 +28,11 @@ td.linenos{
|
||||||
.highlight pre{
|
.highlight pre{
|
||||||
}
|
}
|
||||||
|
|
||||||
.linenodiv pre {
|
.linenodiv pre {
|
||||||
white-space:pre-line;
|
white-space:pre-line;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.linenos {
|
td.linenos {
|
||||||
background:#ECECEC;
|
background:#ECECEC;
|
||||||
color:#777;
|
color:#777;
|
||||||
padding:10px 0px 0px 10px;
|
padding:10px 0px 0px 10px;
|
||||||
|
@ -42,7 +42,7 @@ td.linenos {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
td.code .highlight {
|
td.code .highlight {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
table.highlighttable pre{
|
table.highlighttable pre{
|
||||||
|
@ -53,9 +53,8 @@ table.highlighttable pre{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.git-empty .highlight {
|
.git-empty .highlight {
|
||||||
@include round-borders-all(4px);
|
@include round-borders-all(4px);
|
||||||
background:#eee;
|
background:#eee;
|
||||||
padding:5px;
|
padding:5px;
|
||||||
//overflow-x:scroll;
|
//overflow-x:scroll;
|
||||||
|
@ -71,10 +70,9 @@ table.highlighttable pre{
|
||||||
.shadow{
|
.shadow{
|
||||||
-webkit-box-shadow:0 5px 15px #000;
|
-webkit-box-shadow:0 5px 15px #000;
|
||||||
-moz-box-shadow:0 5px 15px #000;
|
-moz-box-shadow:0 5px 15px #000;
|
||||||
box-shadow:0 5px 15px #000;
|
box-shadow:0 5px 15px #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.hll { background-color: #ffffff }
|
.hll { background-color: #ffffff }
|
||||||
.c { color: #888888; font-style: italic } /* Comment */
|
.c { color: #888888; font-style: italic } /* Comment */
|
||||||
.err { color: #a61717; background-color: #e3d2d2 } /* Error */
|
.err { color: #a61717; background-color: #e3d2d2 } /* Error */
|
||||||
|
@ -105,7 +103,7 @@ table.highlighttable pre{
|
||||||
.highlight .nb{color:#0086B3;} /* Name.Builtin */
|
.highlight .nb{color:#0086B3;} /* Name.Builtin */
|
||||||
.highlight .nc{color:#458;font-weight:bold;} /* Name.Class */
|
.highlight .nc{color:#458;font-weight:bold;} /* Name.Class */
|
||||||
.highlight .no{color:#008080;} /* Name.Constant */
|
.highlight .no{color:#008080;} /* Name.Constant */
|
||||||
.highlight .ni{color:#800080;}
|
.highlight .ni{color:#800080;}
|
||||||
.highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */
|
.highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */
|
||||||
.highlight .nf{color:#900;font-weight:bold;} /* Name.Function */
|
.highlight .nf{color:#900;font-weight:bold;} /* Name.Function */
|
||||||
.highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */
|
.highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// They will automatically be included in application.css.
|
// They will automatically be included in application.css.
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
|
|
||||||
@mixin round-borders-bottom($radius) {
|
@mixin round-borders-bottom($radius) {
|
||||||
border-top: 1px solid #eaeaea;
|
border-top: 1px solid #eaeaea;
|
||||||
|
|
||||||
-moz-border-radius-bottomright: $radius;
|
-moz-border-radius-bottomright: $radius;
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
-webkit-border-bottom-right-radius: $radius;
|
-webkit-border-bottom-right-radius: $radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin round-borders-top($radius) {
|
@mixin round-borders-top($radius) {
|
||||||
border-top: 1px solid #eaeaea;
|
border-top: 1px solid #eaeaea;
|
||||||
|
|
||||||
-moz-border-radius-topright: $radius;
|
-moz-border-radius-topright: $radius;
|
||||||
|
@ -28,14 +28,14 @@
|
||||||
-webkit-border-top-right-radius: $radius;
|
-webkit-border-top-right-radius: $radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin round-borders-all($radius) {
|
@mixin round-borders-all($radius) {
|
||||||
border: 1px solid #eaeaea;
|
border: 1px solid #eaeaea;
|
||||||
-moz-border-radius: $radius;
|
-moz-border-radius: $radius;
|
||||||
-webkit-border-radius: $radius;
|
-webkit-border-radius: $radius;
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin hover-color {
|
@mixin hover-color {
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important;
|
background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important;
|
||||||
background: -moz-linear-gradient(top,#fff,#FFF6BF) !important;
|
background: -moz-linear-gradient(top,#fff,#FFF6BF) !important;
|
||||||
|
@ -46,47 +46,47 @@
|
||||||
border:1px solid #CCC;
|
border:1px solid #CCC;
|
||||||
margin-bottom:1em;
|
margin-bottom:1em;
|
||||||
|
|
||||||
.diff_file_header {
|
.diff_file_header {
|
||||||
padding:5px 5px;
|
padding:5px 5px;
|
||||||
border-bottom:1px solid #CCC;
|
border-bottom:1px solid #CCC;
|
||||||
background: #eee;
|
background: #eee;
|
||||||
}
|
}
|
||||||
.diff_file_content {
|
.diff_file_content {
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
background:#fff;
|
background:#fff;
|
||||||
color:#333;
|
color:#333;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: 'Courier New', 'andale mono','lucida console',monospace;
|
font-family: 'Courier New', 'andale mono','lucida console',monospace;
|
||||||
}
|
}
|
||||||
.diff_file_content_image {
|
.diff_file_content_image {
|
||||||
background:#eee;
|
background:#eee;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
img {
|
img {
|
||||||
padding:100px;
|
padding:100px;
|
||||||
max-width:300px;
|
max-width:300px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#logo {
|
#logo {
|
||||||
&:hover {
|
&:hover {
|
||||||
background:none;
|
background:none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.file_stats {
|
.file_stats {
|
||||||
margin-bottom:10px;
|
margin-bottom:10px;
|
||||||
@include round-borders-all(4px);
|
@include round-borders-all(4px);
|
||||||
|
|
||||||
span {
|
span {
|
||||||
border-top: 1px solid #eaeaea;
|
border-top: 1px solid #eaeaea;
|
||||||
padding:5px 5px;
|
padding:5px 5px;
|
||||||
display:block;
|
display:block;
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-top:none;
|
border-top:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width:18px;
|
width:18px;
|
||||||
float:left;
|
float:left;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
|
@ -94,15 +94,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.round-borders {
|
.round-borders {
|
||||||
@include round-borders-all(4px);
|
@include round-borders-all(4px);
|
||||||
padding: 4px 0px;
|
padding: 4px 0px;
|
||||||
}
|
}
|
||||||
table.round-borders {
|
table.round-borders {
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.day-commits-table {
|
.day-commits-table {
|
||||||
@include round-borders-all(4px);
|
@include round-borders-all(4px);
|
||||||
padding: 4px 0px;
|
padding: 4px 0px;
|
||||||
margin-bottom:10px;
|
margin-bottom:10px;
|
||||||
|
@ -110,55 +110,54 @@ table.round-borders {
|
||||||
width:100%;
|
width:100%;
|
||||||
background: #E6F1F6;
|
background: #E6F1F6;
|
||||||
|
|
||||||
.day-header {
|
.day-header {
|
||||||
padding:10px;
|
padding:10px;
|
||||||
h3 {
|
h3 {
|
||||||
margin:0px;
|
margin:0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
display:block;
|
display:block;
|
||||||
list-style:none;
|
list-style:none;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
padding:0px;
|
padding:0px;
|
||||||
|
|
||||||
li.commit {
|
li.commit {
|
||||||
display:list-item;
|
display:list-item;
|
||||||
padding:8px;
|
padding:8px;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
background: #F7FBFC;
|
background: #F7FBFC;
|
||||||
border-top: 1px solid #E2EAEE;
|
border-top: 1px solid #E2EAEE;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-top: 1px solid #E2EAEE;
|
border-top: 1px solid #E2EAEE;
|
||||||
}
|
}
|
||||||
&:nth-child(2n+1) {
|
&:nth-child(2n+1) {
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.button {
|
a.button {
|
||||||
width:85px;
|
width:85px;
|
||||||
padding:10px;
|
padding:10px;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin panel-color {
|
@mixin panel-color {
|
||||||
background: #111 !important;
|
background: #111 !important;
|
||||||
background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important;
|
background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important;
|
||||||
background: -moz-linear-gradient(top,#333,#111) !important;
|
background: -moz-linear-gradient(top,#333,#111) !important;
|
||||||
background: transparent 9 !important;
|
background: transparent 9 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#header-panel {
|
||||||
#header-panel {
|
|
||||||
@include panel-color;
|
@include panel-color;
|
||||||
height:40px;
|
height:40px;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
|
@ -178,23 +177,23 @@ table.round-borders {
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.current {
|
&.current {
|
||||||
border-bottom: 3px solid #EAEAEA !important;
|
border-bottom: 3px solid #EAEAEA !important;
|
||||||
padding: 10px 20px 0;
|
padding: 10px 20px 0;
|
||||||
color: #eaeaea;
|
color: #eaeaea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search-holder {
|
.search-holder {
|
||||||
float:left;
|
float:left;
|
||||||
width:290px;
|
width:290px;
|
||||||
input {
|
input {
|
||||||
@include round-borders-all(4px);
|
@include round-borders-all(4px);
|
||||||
width:290px;
|
width:290px;
|
||||||
border-color:#888;
|
border-color:#888;
|
||||||
padding:5px;
|
padding:5px;
|
||||||
background:#666;
|
background:#666;
|
||||||
color:#222;
|
color:#222;
|
||||||
&:focus {
|
&:focus {
|
||||||
background:#fff;
|
background:#fff;
|
||||||
color:#000;
|
color:#000;
|
||||||
}
|
}
|
||||||
|
@ -211,7 +210,7 @@ table.round-borders {
|
||||||
padding:20px;
|
padding:20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: #eaeaea;
|
background: #eaeaea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +219,7 @@ a {
|
||||||
}
|
}
|
||||||
|
|
||||||
.diff_file_content{
|
.diff_file_content{
|
||||||
.old_line, .new_line {
|
.old_line, .new_line {
|
||||||
background:#ECECEC;
|
background:#ECECEC;
|
||||||
color:#777;
|
color:#777;
|
||||||
width:15px;
|
width:15px;
|
||||||
|
@ -230,9 +229,8 @@ a {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.view_file_content{
|
.view_file_content{
|
||||||
.old_line, .new_line {
|
.old_line, .new_line {
|
||||||
background:#ECECEC;
|
background:#ECECEC;
|
||||||
color:#777;
|
color:#777;
|
||||||
width:15px;
|
width:15px;
|
||||||
|
@ -249,20 +247,20 @@ a {
|
||||||
border:1px solid #CCC;
|
border:1px solid #CCC;
|
||||||
margin-bottom:1em;
|
margin-bottom:1em;
|
||||||
|
|
||||||
.view_file_header {
|
.view_file_header {
|
||||||
padding:5px 5px;
|
padding:5px 5px;
|
||||||
border-bottom:1px solid #CCC;
|
border-bottom:1px solid #CCC;
|
||||||
background: #eee;
|
background: #eee;
|
||||||
}
|
}
|
||||||
.view_file_content {
|
.view_file_content {
|
||||||
background:#fff;
|
background:#fff;
|
||||||
color:#514721;
|
color:#514721;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
.view_file_content_image {
|
.view_file_content_image {
|
||||||
background:#eee;
|
background:#eee;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
img {
|
img {
|
||||||
padding:100px;
|
padding:100px;
|
||||||
max-width:300px;
|
max-width:300px;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +271,7 @@ a {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input.ssh_project_url {
|
input.ssh_project_url {
|
||||||
padding:5px;
|
padding:5px;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
float:right;
|
float:right;
|
||||||
|
@ -281,12 +279,10 @@ input.ssh_project_url {
|
||||||
text-align:center;
|
text-align:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.day-commits-table li.commit {
|
||||||
|
|
||||||
.day-commits-table li.commit {
|
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@include hover-color;
|
@include hover-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,39 +291,39 @@ input.ssh_project_url {
|
||||||
#FFF6BF
|
#FFF6BF
|
||||||
#FFD324
|
#FFD324
|
||||||
*/
|
*/
|
||||||
#tree-slider tr.tree-item {
|
#tree-slider tr.tree-item {
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@include hover-color;
|
@include hover-color;
|
||||||
td {
|
td {
|
||||||
@include hover-color;
|
@include hover-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#projects-list .project {
|
#projects-list .project {
|
||||||
height:50px;
|
height:50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#projects-list .project,
|
#projects-list .project,
|
||||||
#snippets-table .snippet,
|
#snippets-table .snippet,
|
||||||
#issues-table .issue{
|
#issues-table .issue{
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@include hover-color;
|
@include hover-color;
|
||||||
td {
|
td {
|
||||||
@include hover-color;
|
@include hover-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.clear {
|
.clear {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top_project_menu {
|
.top_project_menu {
|
||||||
a {
|
a {
|
||||||
border-right: 1px solid #FFFFFF;
|
border-right: 1px solid #FFFFFF;
|
||||||
box-shadow: -1px 0 #DDDDDD inset;
|
box-shadow: -1px 0 #DDDDDD inset;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
@ -339,7 +335,7 @@ input.ssh_project_url {
|
||||||
text-shadow: 0 1px 0 #FFFFFF;
|
text-shadow: 0 1px 0 #FFFFFF;
|
||||||
float:left;
|
float:left;
|
||||||
|
|
||||||
&.current {
|
&.current {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
}
|
}
|
||||||
|
@ -363,11 +359,11 @@ input.ssh_project_url {
|
||||||
.new_project,
|
.new_project,
|
||||||
.new_snippet,
|
.new_snippet,
|
||||||
.edit_snippet,
|
.edit_snippet,
|
||||||
.edit_project {
|
.edit_project {
|
||||||
input[type='text'],
|
input[type='text'],
|
||||||
input[type='email'],
|
input[type='email'],
|
||||||
input[type='password'],
|
input[type='password'],
|
||||||
textarea {
|
textarea {
|
||||||
width:400px;
|
width:400px;
|
||||||
padding:8px;
|
padding:8px;
|
||||||
font-size:14px;
|
font-size:14px;
|
||||||
|
@ -375,7 +371,7 @@ input.ssh_project_url {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input_button {
|
.input_button {
|
||||||
//@include round-borders-all(4px);
|
//@include round-borders-all(4px);
|
||||||
padding:8px;
|
padding:8px;
|
||||||
font-size:14px;
|
font-size:14px;
|
||||||
|
@ -393,7 +389,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
border-bottom: 1px solid #E2EAEE;
|
border-bottom: 1px solid #E2EAEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top_menu_count {
|
.top_menu_count {
|
||||||
background: none repeat scroll 0 0 #FFF6BF;
|
background: none repeat scroll 0 0 #FFF6BF;
|
||||||
border-color: #FFD324;
|
border-color: #FFD324;
|
||||||
color: #514721;
|
color: #514721;
|
||||||
|
@ -417,7 +413,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
|
|
||||||
/** FALSH **/
|
/** FALSH **/
|
||||||
|
|
||||||
#flash_container {
|
#flash_container {
|
||||||
height:40px;
|
height:40px;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
z-index:1009;
|
z-index:1009;
|
||||||
|
@ -429,7 +425,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
border-bottom:1px solid #777;
|
border-bottom:1px solid #777;
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
color:#444;
|
color:#444;
|
||||||
font-size:22px;
|
font-size:22px;
|
||||||
padding-top:5px;
|
padding-top:5px;
|
||||||
|
@ -460,50 +456,50 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
color: #0099FF;
|
color: #0099FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hm {
|
&.hm {
|
||||||
margin: 0px 0px;
|
margin: 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.vm {
|
&.vm {
|
||||||
margin: 5px 0px;
|
margin: 5px 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Notes **/
|
/** Notes **/
|
||||||
|
|
||||||
#notes-list {
|
#notes-list {
|
||||||
display:block;
|
display:block;
|
||||||
list-style:none;
|
list-style:none;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
padding:0px;
|
padding:0px;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
display:list-item;
|
display:list-item;
|
||||||
padding:8px;
|
padding:8px;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
background: #F7FBFC;
|
background: #F7FBFC;
|
||||||
border-top: 1px solid #E2EAEE;
|
border-top: 1px solid #E2EAEE;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
}
|
}
|
||||||
&:nth-child(2n+1) {
|
&:nth-child(2n+1) {
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color:#111;
|
color:#111;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cite {
|
cite {
|
||||||
&.ago {
|
&.ago {
|
||||||
color:#666;
|
color:#666;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes_count {
|
.notes_count {
|
||||||
background: none repeat scroll 0 0 #FFF6BF;
|
background: none repeat scroll 0 0 #FFF6BF;
|
||||||
border-color: #FFD324;
|
border-color: #FFD324;
|
||||||
color: #514721;
|
color: #514721;
|
||||||
|
@ -515,36 +511,36 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
right: 6px;
|
right: 6px;
|
||||||
top: 6px;
|
top: 6px;
|
||||||
}
|
}
|
||||||
.note_author {
|
.note_author {
|
||||||
float:left;
|
float:left;
|
||||||
width:60px;
|
width:60px;
|
||||||
}
|
}
|
||||||
.note_content {
|
.note_content {
|
||||||
float:left;
|
float:left;
|
||||||
width:650px;
|
width:650px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.issue_notes {
|
.issue_notes {
|
||||||
.note_content {
|
.note_content {
|
||||||
float:left;
|
float:left;
|
||||||
width:400px;
|
width:400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#user_projects_limit{
|
#user_projects_limit{
|
||||||
width: 60px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project_thumb {
|
.project_thumb {
|
||||||
margin:20px 0;
|
margin:20px 0;
|
||||||
width: 250px;
|
width: 250px;
|
||||||
float:left;
|
float:left;
|
||||||
padding:20px;
|
padding:20px;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
p, h4 {
|
p, h4 {
|
||||||
text-align:left;
|
text-align:left;
|
||||||
}
|
}
|
||||||
.lbutton {
|
.lbutton {
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -559,8 +555,8 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recent_message_parent {
|
.recent_message_parent {
|
||||||
img {
|
img {
|
||||||
padding-right:10px;
|
padding-right:10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +567,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
|
|
||||||
&.dash_wall{
|
&.dash_wall{
|
||||||
border-bottom: 2px solid orange;
|
border-bottom: 2px solid orange;
|
||||||
span {
|
span {
|
||||||
background: orange;
|
background: orange;
|
||||||
color:black;
|
color:black;
|
||||||
}
|
}
|
||||||
|
@ -579,14 +575,14 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
|
|
||||||
&.dash_issue{
|
&.dash_issue{
|
||||||
border-bottom: 2px solid #ffbbbb;
|
border-bottom: 2px solid #ffbbbb;
|
||||||
span {
|
span {
|
||||||
background: #ffbbbb;
|
background: #ffbbbb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.dash_commit{
|
&.dash_commit{
|
||||||
border-bottom: 2px solid #bbbbff;
|
border-bottom: 2px solid #bbbbff;
|
||||||
|
|
||||||
span{
|
span{
|
||||||
background: #bbbbff;
|
background: #bbbbff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -594,27 +590,26 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
&.dash_snippet{
|
&.dash_snippet{
|
||||||
border-bottom: 2px solid #bbffbb;
|
border-bottom: 2px solid #bbffbb;
|
||||||
|
|
||||||
span{
|
span{
|
||||||
background: #bbffbb;
|
background: #bbffbb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span{
|
||||||
span{
|
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
color:black;
|
color:black;
|
||||||
padding:1px 4px;
|
padding:1px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
margin-bottom:3px;
|
margin-bottom:3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.commit,
|
.commit,
|
||||||
.message,
|
.message,
|
||||||
#notes-list{
|
#notes-list{
|
||||||
.author {
|
.author {
|
||||||
background: #eaeaea;
|
background: #eaeaea;
|
||||||
color: #333;
|
color: #333;
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
|
@ -624,17 +619,17 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note textare */
|
/* Note textare */
|
||||||
#note_note {
|
#note_note {
|
||||||
height:100px;
|
height:100px;
|
||||||
width:97%;
|
width:97%;
|
||||||
font-size:14px;
|
font-size:14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wall_page {
|
.wall_page {
|
||||||
#note_note {
|
#note_note {
|
||||||
height:25px;
|
height:25px;
|
||||||
}
|
}
|
||||||
.attach_holder {
|
.attach_holder {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -653,31 +648,55 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
|
||||||
padding:2px 4px;
|
padding:2px 4px;
|
||||||
border:none;
|
border:none;
|
||||||
|
|
||||||
&.high {
|
&.high {
|
||||||
background: #D12F19;
|
background: #D12F19;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.today {
|
&.today {
|
||||||
background: #44aa22;
|
background: #44aa22;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.yours {
|
&.yours {
|
||||||
background: #4466cc;
|
background: #4466cc;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
&.normal {
|
||||||
|
background: #2c5ca6;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
&.notes {
|
&.notes {
|
||||||
background: #2c5c66;
|
background: #2c5c66;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#issues-table .issue {
|
#issues-table .issue {
|
||||||
&.critical {
|
&.critical {
|
||||||
td {
|
td {
|
||||||
//background: #D12F19;
|
//background: #D12F19;
|
||||||
//color:#fff;
|
//color:#fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.top_panel_issues{
|
||||||
|
#issue_search_form {
|
||||||
|
margin:5px 0;
|
||||||
|
input {
|
||||||
|
border:1px solid #D3D3D3;
|
||||||
|
padding: 3px;
|
||||||
|
height: 28px;
|
||||||
|
width: 300px;
|
||||||
|
-webkit-appearance:none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color:#c2e1ef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Admin::MailerController < ApplicationController
|
||||||
else
|
else
|
||||||
render :file => 'notify/note_wall_email.html.haml', :layout => 'notify'
|
render :file => 'notify/note_wall_email.html.haml', :layout => 'notify'
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
render :text => "Preview not avaialble"
|
render :text => "Preview not avaialble"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class Admin::MailerController < ApplicationController
|
||||||
@password = "DHasJKDHAS!"
|
@password = "DHasJKDHAS!"
|
||||||
|
|
||||||
render :file => 'notify/new_user_email.html.haml', :layout => 'notify'
|
render :file => 'notify/new_user_email.html.haml', :layout => 'notify'
|
||||||
rescue
|
rescue
|
||||||
render :text => "Preview not avaialble"
|
render :text => "Preview not avaialble"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class Admin::MailerController < ApplicationController
|
||||||
@user = @issue.assignee
|
@user = @issue.assignee
|
||||||
@project = @issue.project
|
@project = @issue.project
|
||||||
render :file => 'notify/new_issue_email.html.haml', :layout => 'notify'
|
render :file => 'notify/new_issue_email.html.haml', :layout => 'notify'
|
||||||
rescue
|
rescue
|
||||||
render :text => "Preview not avaialble"
|
render :text => "Preview not avaialble"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,29 +4,14 @@ class Admin::ProjectsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@admin_projects = Project.page(params[:page])
|
@admin_projects = Project.page(params[:page])
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # index.html.erb
|
|
||||||
format.json { render json: @admin_projects }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@admin_project = Project.find_by_code(params[:id])
|
@admin_project = Project.find_by_code(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.json { render json: @admin_project }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@admin_project = Project.new
|
@admin_project = Project.new
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # new.html.erb
|
|
||||||
format.json { render json: @admin_project }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@ -37,28 +22,20 @@ class Admin::ProjectsController < ApplicationController
|
||||||
@admin_project = Project.new(params[:project])
|
@admin_project = Project.new(params[:project])
|
||||||
@admin_project.owner = current_user
|
@admin_project.owner = current_user
|
||||||
|
|
||||||
respond_to do |format|
|
if @admin_project.save
|
||||||
if @admin_project.save
|
redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
|
||||||
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' }
|
else
|
||||||
format.json { render json: @admin_project, status: :created, location: @admin_project }
|
render :action => "new"
|
||||||
else
|
|
||||||
format.html { render action: "new" }
|
|
||||||
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@admin_project = Project.find_by_code(params[:id])
|
@admin_project = Project.find_by_code(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
if @admin_project.update_attributes(params[:project])
|
||||||
if @admin_project.update_attributes(params[:project])
|
redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
|
||||||
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' }
|
else
|
||||||
format.json { head :ok }
|
render :action => "edit"
|
||||||
else
|
|
||||||
format.html { render action: "edit" }
|
|
||||||
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -66,9 +43,6 @@ class Admin::ProjectsController < ApplicationController
|
||||||
@admin_project = Project.find_by_code(params[:id])
|
@admin_project = Project.find_by_code(params[:id])
|
||||||
@admin_project.destroy
|
@admin_project.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
redirect_to admin_projects_url
|
||||||
format.html { redirect_to admin_projects_url }
|
|
||||||
format.json { head :ok }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,29 +4,14 @@ class Admin::TeamMembersController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC")
|
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC")
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # index.html.erb
|
|
||||||
format.json { render json: @admin_team_members }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@admin_team_member = UsersProject.find(params[:id])
|
@admin_team_member = UsersProject.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.json { render json: @admin_team_member }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@admin_team_member = UsersProject.new(params[:team_member])
|
@admin_team_member = UsersProject.new(params[:team_member])
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # new.html.erb
|
|
||||||
format.json { render json: @admin_team_member }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@ -37,14 +22,10 @@ class Admin::TeamMembersController < ApplicationController
|
||||||
@admin_team_member = UsersProject.new(params[:team_member])
|
@admin_team_member = UsersProject.new(params[:team_member])
|
||||||
@admin_team_member.project_id = params[:team_member][:project_id]
|
@admin_team_member.project_id = params[:team_member][:project_id]
|
||||||
|
|
||||||
respond_to do |format|
|
if @admin_team_member.save
|
||||||
if @admin_team_member.save
|
redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
|
||||||
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' }
|
else
|
||||||
format.json { render json: @admin_team_member, status: :created, location: @team_member }
|
render action: "new"
|
||||||
else
|
|
||||||
format.html { render action: "new" }
|
|
||||||
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,14 +33,10 @@ class Admin::TeamMembersController < ApplicationController
|
||||||
@admin_team_member = UsersProject.find(params[:id])
|
@admin_team_member = UsersProject.find(params[:id])
|
||||||
@admin_team_member.project_id = params[:team_member][:project_id]
|
@admin_team_member.project_id = params[:team_member][:project_id]
|
||||||
|
|
||||||
respond_to do |format|
|
if @admin_team_member.update_attributes(params[:team_member])
|
||||||
if @admin_team_member.update_attributes(params[:team_member])
|
redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
|
||||||
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' }
|
else
|
||||||
format.json { head :ok }
|
render action: "edit"
|
||||||
else
|
|
||||||
format.html { render action: "edit" }
|
|
||||||
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -67,9 +44,6 @@ class Admin::TeamMembersController < ApplicationController
|
||||||
@admin_team_member = UsersProject.find(params[:id])
|
@admin_team_member = UsersProject.find(params[:id])
|
||||||
@admin_team_member.destroy
|
@admin_team_member.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
redirect_to admin_team_members_url
|
||||||
format.html { redirect_to admin_team_members_url }
|
|
||||||
format.json { head :ok }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,29 +4,14 @@ class Admin::UsersController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@admin_users = User.page(params[:page])
|
@admin_users = User.page(params[:page])
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # index.html.erb
|
|
||||||
format.json { render json: @admin_users }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@admin_user = User.find(params[:id])
|
@admin_user = User.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.json { render json: @admin_user }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@admin_user = User.new(:projects_limit => 10)
|
@admin_user = User.new(:projects_limit => 10)
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # new.html.erb
|
|
||||||
format.json { render json: @admin_user }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@ -36,7 +21,7 @@ class Admin::UsersController < ApplicationController
|
||||||
def create
|
def create
|
||||||
admin = params[:user].delete("admin")
|
admin = params[:user].delete("admin")
|
||||||
|
|
||||||
@admin_user = User.new(params[:user])
|
@admin_user = User.new(params[:user])
|
||||||
@admin_user.admin = (admin && admin.to_i > 0)
|
@admin_user.admin = (admin && admin.to_i > 0)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -54,8 +39,8 @@ class Admin::UsersController < ApplicationController
|
||||||
def update
|
def update
|
||||||
admin = params[:user].delete("admin")
|
admin = params[:user].delete("admin")
|
||||||
if params[:user][:password].empty?
|
if params[:user][:password].empty?
|
||||||
params[:user].delete(:password)
|
params[:user].delete(:password)
|
||||||
params[:user].delete(:password_confirmation)
|
params[:user].delete(:password_confirmation)
|
||||||
end
|
end
|
||||||
|
|
||||||
@admin_user = User.find(params[:id])
|
@admin_user = User.find(params[:id])
|
||||||
|
|
|
@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base
|
||||||
render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false
|
render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def abilities
|
def abilities
|
||||||
@abilities ||= Six.new
|
@abilities ||= Six.new
|
||||||
|
@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base
|
||||||
abilities.allowed?(object, action, subject)
|
abilities.allowed?(object, action, subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
def project
|
def project
|
||||||
@project ||= Project.find_by_code(params[:project_id])
|
@project ||= Project.find_by_code(params[:project_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
@tag = unless params[:tag].blank?
|
@tag = unless params[:tag].blank?
|
||||||
params[:tag]
|
params[:tag]
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
class IssuesController < ApplicationController
|
class IssuesController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :project
|
before_filter :project
|
||||||
before_filter :issue, :only => [:edit, :update, :destroy, :show]
|
before_filter :issue, :only => [:edit, :update, :destroy, :show]
|
||||||
|
|
||||||
# Authorize
|
# Authorize
|
||||||
before_filter :add_project_abilities
|
before_filter :add_project_abilities
|
||||||
before_filter :authorize_read_issue!
|
before_filter :authorize_read_issue!
|
||||||
before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort]
|
before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort]
|
||||||
|
|
||||||
respond_to :js
|
respond_to :js
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@notes = @issue.notes
|
@notes = @issue.notes.order("created_at ASC")
|
||||||
@note = @project.notes.new(:noteable => @issue)
|
@note = @project.notes.new(:noteable => @issue)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,14 +57,13 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
return access_denied! unless can?(current_user, :admin_issue, @issue)
|
return access_denied! unless can?(current_user, :admin_issue, @issue)
|
||||||
|
|
||||||
@issue.destroy
|
@issue.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js { render :nothing => true }
|
format.js { render :nothing => true }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -78,7 +77,23 @@ class IssuesController < ApplicationController
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
def search
|
||||||
|
terms = params['terms']
|
||||||
|
|
||||||
|
@project = Project.find(params['project'])
|
||||||
|
@issues = case params[:status].to_i
|
||||||
|
when 1 then @project.issues
|
||||||
|
when 2 then @project.issues.closed
|
||||||
|
when 3 then @project.issues.opened.assigned(current_user)
|
||||||
|
else @project.issues.opened
|
||||||
|
end
|
||||||
|
|
||||||
|
@issues = @issues.where("title LIKE ? OR content LIKE ?", "%#{terms}%", "%#{terms}%") unless terms.blank?
|
||||||
|
|
||||||
|
render :partial => 'issues'
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
def issue
|
def issue
|
||||||
@issue ||= @project.issues.find(params[:id])
|
@issue ||= @project.issues.find(params[:id])
|
||||||
|
|
|
@ -24,7 +24,7 @@ class KeysController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to keys_url }
|
format.html { redirect_to keys_url }
|
||||||
format.js { render :nothing => true }
|
format.js { render :nothing => true }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class NotesController < ApplicationController
|
class NotesController < ApplicationController
|
||||||
before_filter :project
|
before_filter :project
|
||||||
|
|
||||||
# Authorize
|
# Authorize
|
||||||
before_filter :add_project_abilities
|
before_filter :add_project_abilities
|
||||||
before_filter :authorize_write_note!, :only => [:create]
|
before_filter :authorize_write_note!, :only => [:create]
|
||||||
|
|
||||||
respond_to :js
|
respond_to :js
|
||||||
|
|
||||||
|
@ -15,10 +15,9 @@ class NotesController < ApplicationController
|
||||||
notify if params[:notify] == '1'
|
notify if params[:notify] == '1'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {redirect_to :back}
|
format.html {redirect_to :back}
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,11 +29,11 @@ class NotesController < ApplicationController
|
||||||
@note.destroy
|
@note.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js { render :nothing => true }
|
format.js { render :nothing => true }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def notify
|
def notify
|
||||||
@project.users.reject { |u| u.id == current_user.id } .each do |u|
|
@project.users.reject { |u| u.id == current_user.id } .each do |u|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class ProfileController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def password_update
|
def password_update
|
||||||
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
|
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
|
||||||
@user = current_user
|
@user = current_user
|
||||||
|
|
||||||
if @user.update_attributes(params[:user])
|
if @user.update_attributes(params[:user])
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
class ProjectsController < ApplicationController
|
class ProjectsController < ApplicationController
|
||||||
before_filter :project, :except => [:index, :new, :create]
|
before_filter :project, :except => [:index, :new, :create]
|
||||||
|
|
||||||
# Authorize
|
# Authorize
|
||||||
before_filter :add_project_abilities
|
before_filter :add_project_abilities
|
||||||
before_filter :authorize_read_project!, :except => [:index, :new, :create]
|
before_filter :authorize_read_project!, :except => [:index, :new, :create]
|
||||||
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
|
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
|
||||||
|
|
||||||
before_filter :require_non_empty_project, :only => [:blob, :tree]
|
before_filter :require_non_empty_project, :only => [:blob, :tree]
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class ProjectsController < ApplicationController
|
||||||
@project = Project.new(params[:project])
|
@project = Project.new(params[:project])
|
||||||
@project.owner = current_user
|
@project.owner = current_user
|
||||||
|
|
||||||
Project.transaction do
|
Project.transaction do
|
||||||
@project.save!
|
@project.save!
|
||||||
@project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user)
|
@project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user)
|
||||||
end
|
end
|
||||||
|
@ -31,7 +31,7 @@ class ProjectsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @project.valid?
|
if @project.valid?
|
||||||
format.html { redirect_to @project, notice: 'Project was successfully created.' }
|
format.html { redirect_to @project, notice: 'Project was successfully created.' }
|
||||||
format.js
|
format.js
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.js
|
format.js
|
||||||
|
@ -51,10 +51,10 @@ class ProjectsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if project.update_attributes(params[:project])
|
if project.update_attributes(params[:project])
|
||||||
format.html { redirect_to project, :notice => 'Project was successfully updated.' }
|
format.html { redirect_to project, :notice => 'Project was successfully updated.' }
|
||||||
format.js
|
format.js
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -105,7 +105,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
if params[:commit_id]
|
if params[:commit_id]
|
||||||
@commit = @repo.commits(params[:commit_id]).first
|
@commit = @repo.commits(params[:commit_id]).first
|
||||||
else
|
else
|
||||||
@commit = @repo.commits(@ref || "master").first
|
@commit = @repo.commits(@ref || "master").first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.erb
|
format.html # show.html.erb
|
||||||
format.js do
|
format.js do
|
||||||
# disable cache to allow back button works
|
# diasbale cache to allow back button works
|
||||||
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
|
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
|
||||||
response.headers["Pragma"] = "no-cache"
|
response.headers["Pragma"] = "no-cache"
|
||||||
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
|
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
|
||||||
|
@ -132,7 +132,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
if @tree.is_a?(Grit::Blob)
|
if @tree.is_a?(Grit::Blob)
|
||||||
send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name)
|
send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name)
|
||||||
else
|
else
|
||||||
head(404)
|
head(404)
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
|
@ -147,9 +147,9 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def project
|
def project
|
||||||
@project ||= Project.find_by_code(params[:id])
|
@project ||= Project.find_by_code(params[:id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
class SnippetsController < ApplicationController
|
class SnippetsController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :project
|
before_filter :project
|
||||||
|
|
||||||
# Authorize
|
# Authorize
|
||||||
before_filter :add_project_abilities
|
before_filter :add_project_abilities
|
||||||
before_filter :authorize_read_snippet!
|
before_filter :authorize_read_snippet!
|
||||||
before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort]
|
before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort]
|
||||||
|
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class SnippetsController < ApplicationController
|
||||||
@snippets = @project.snippets
|
@snippets = @project.snippets
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@snippet = @project.snippets.new
|
@snippet = @project.snippets.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
class TeamMembersController < ApplicationController
|
class TeamMembersController < ApplicationController
|
||||||
before_filter :project
|
before_filter :project
|
||||||
|
|
||||||
# Authorize
|
# Authorize
|
||||||
before_filter :add_project_abilities
|
before_filter :add_project_abilities
|
||||||
before_filter :authorize_read_project!
|
before_filter :authorize_read_project!
|
||||||
before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update]
|
before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update]
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@team_member = project.users_projects.find(params[:id])
|
@team_member = project.users_projects.find(params[:id])
|
||||||
|
@ -26,7 +26,7 @@ class TeamMembersController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.html do
|
format.html do
|
||||||
unless @team_member.valid?
|
unless @team_member.valid?
|
||||||
flash[:alert] = "User should have at least one role"
|
flash[:alert] = "User should have at least one role"
|
||||||
end
|
end
|
||||||
|
@ -41,7 +41,7 @@ class TeamMembersController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to root_path }
|
format.html { redirect_to root_path }
|
||||||
format.js { render :nothing => true }
|
format.js { render :nothing => true }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,9 +23,9 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_commit(project)
|
def last_commit(project)
|
||||||
if project.repo_exists?
|
if project.repo_exists?
|
||||||
time_ago_in_words(project.commit.committed_date) + " ago"
|
time_ago_in_words(project.commit.committed_date) + " ago"
|
||||||
else
|
else
|
||||||
"Never"
|
"Never"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -33,8 +33,8 @@ module ApplicationHelper
|
||||||
def search_autocomplete_source
|
def search_autocomplete_source
|
||||||
projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
|
projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
|
||||||
default_nav = [
|
default_nav = [
|
||||||
{ :label => "Keys", :url => keys_path },
|
{ :label => "Keys", :url => keys_path },
|
||||||
{ :label => "Projects", :url => projects_path },
|
{ :label => "Projects", :url => projects_path },
|
||||||
{ :label => "Admin", :url => admin_root_path }
|
{ :label => "Admin", :url => admin_root_path }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -42,10 +42,10 @@ module ApplicationHelper
|
||||||
|
|
||||||
if @project && !@project.new_record?
|
if @project && !@project.new_record?
|
||||||
project_nav = [
|
project_nav = [
|
||||||
{ :label => "#{@project.code} / Issues", :url => project_issues_path(@project) },
|
{ :label => "#{@project.code} / Issues", :url => project_issues_path(@project) },
|
||||||
{ :label => "#{@project.code} / Wall", :url => wall_project_path(@project) },
|
{ :label => "#{@project.code} / Wall", :url => wall_project_path(@project) },
|
||||||
{ :label => "#{@project.code} / Tree", :url => tree_project_path(@project) },
|
{ :label => "#{@project.code} / Tree", :url => tree_project_path(@project) },
|
||||||
{ :label => "#{@project.code} / Commits", :url => project_commits_path(@project) },
|
{ :label => "#{@project.code} / Commits", :url => project_commits_path(@project) },
|
||||||
{ :label => "#{@project.code} / Team", :url => team_project_path(@project) }
|
{ :label => "#{@project.code} / Team", :url => team_project_path(@project) }
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
module CommitsHelper
|
module CommitsHelper
|
||||||
def diff_line(line, line_new = 0, line_old = 0)
|
def diff_line(line, line_new = 0, line_old = 0)
|
||||||
full_line = html_escape(line.gsub(/\n/, ''))
|
full_line = html_escape(line.gsub(/\n/, ''))
|
||||||
color = if line[0] == "+"
|
color = if line[0] == "+"
|
||||||
full_line = "<span class=\"old_line\"> </span><span class=\"new_line\">#{line_new}</span> " + full_line
|
full_line = "<span class=\"old_line\"> </span><span class=\"new_line\">#{line_new}</span> " + full_line
|
||||||
"#DFD"
|
"#DFD"
|
||||||
elsif line[0] == "-"
|
elsif line[0] == "-"
|
||||||
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\"> </span> " + full_line
|
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\"> </span> " + full_line
|
||||||
"#FDD"
|
"#FDD"
|
||||||
else
|
else
|
||||||
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line
|
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line
|
||||||
"none"
|
"none"
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ module ProjectsHelper
|
||||||
else
|
else
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,2 +1,11 @@
|
||||||
module SnippetsHelper
|
module SnippetsHelper
|
||||||
|
def lifetime_select_options
|
||||||
|
options = [
|
||||||
|
['forever', nil],
|
||||||
|
['1 day', "#{Date.current + 1.day}"],
|
||||||
|
['1 week', "#{Date.current + 1.week}"],
|
||||||
|
['1 month', "#{Date.current + 1.month}"]
|
||||||
|
]
|
||||||
|
options_for_select(options)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,14 +17,14 @@ class Ability
|
||||||
:read_issue,
|
:read_issue,
|
||||||
:read_snippet,
|
:read_snippet,
|
||||||
:read_team_member,
|
:read_team_member,
|
||||||
:read_note
|
:read_note
|
||||||
] if project.readers.include?(user)
|
] if project.readers.include?(user)
|
||||||
|
|
||||||
rules << [
|
rules << [
|
||||||
:write_project,
|
:write_project,
|
||||||
:write_issue,
|
:write_issue,
|
||||||
:write_snippet,
|
:write_snippet,
|
||||||
:write_note
|
:write_note
|
||||||
] if project.writers.include?(user)
|
] if project.writers.include?(user)
|
||||||
|
|
||||||
rules << [
|
rules << [
|
||||||
|
@ -32,13 +32,13 @@ class Ability
|
||||||
:admin_issue,
|
:admin_issue,
|
||||||
:admin_snippet,
|
:admin_snippet,
|
||||||
:admin_team_member,
|
:admin_team_member,
|
||||||
:admin_note
|
:admin_note
|
||||||
] if project.admins.include?(user)
|
] if project.admins.include?(user)
|
||||||
|
|
||||||
rules.flatten
|
rules.flatten
|
||||||
end
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
[:issue, :note, :snippet].each do |name|
|
[:issue, :note, :snippet].each do |name|
|
||||||
define_method "#{name}_abilities" do |user, subject|
|
define_method "#{name}_abilities" do |user, subject|
|
||||||
if subject.author == user
|
if subject.author == user
|
||||||
|
@ -48,7 +48,7 @@ class Ability
|
||||||
:"admin_#{name}"
|
:"admin_#{name}"
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
subject.respond_to?(:project) ?
|
subject.respond_to?(:project) ?
|
||||||
project_abilities(user, subject.project) : []
|
project_abilities(user, subject.project) : []
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,10 +13,10 @@ class Issue < ActiveRecord::Base
|
||||||
validates :title,
|
validates :title,
|
||||||
:presence => true,
|
:presence => true,
|
||||||
:length => { :within => 0..255 }
|
:length => { :within => 0..255 }
|
||||||
|
|
||||||
validates :content,
|
#validates :content,
|
||||||
:presence => true,
|
#:presence => true,
|
||||||
:length => { :within => 0..2000 }
|
#:length => { :within => 0..2000 }
|
||||||
|
|
||||||
scope :critical, where(:critical => true)
|
scope :critical, where(:critical => true)
|
||||||
scope :non_critical, where(:critical => false)
|
scope :non_critical, where(:critical => false)
|
||||||
|
@ -30,7 +30,7 @@ class Issue < ActiveRecord::Base
|
||||||
def today?
|
def today?
|
||||||
Date.today == created_at.to_date
|
Date.today == created_at.to_date
|
||||||
end
|
end
|
||||||
|
|
||||||
def new?
|
def new?
|
||||||
today? && created_at == updated_at
|
today? && created_at == updated_at
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,11 +17,11 @@ class Key < ActiveRecord::Base
|
||||||
def set_identifier
|
def set_identifier
|
||||||
self.identifier = "#{user.identifier}_#{Time.now.to_i}"
|
self.identifier = "#{user.identifier}_#{Time.now.to_i}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_gitosis
|
def update_gitosis
|
||||||
Gitosis.new.configure do |c|
|
Gitosis.new.configure do |c|
|
||||||
c.update_keys(identifier, key)
|
c.update_keys(identifier, key)
|
||||||
|
|
||||||
projects.each do |project|
|
projects.each do |project|
|
||||||
c.update_project(project.path, project.gitosis_writers)
|
c.update_project(project.path, project.gitosis_writers)
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,18 +7,18 @@ class Note < ActiveRecord::Base
|
||||||
belongs_to :author,
|
belongs_to :author,
|
||||||
:class_name => "User"
|
:class_name => "User"
|
||||||
|
|
||||||
attr_protected :author, :author_id
|
attr_protected :author, :author_id
|
||||||
|
|
||||||
validates_presence_of :project
|
validates_presence_of :project
|
||||||
|
|
||||||
validates :note,
|
validates :note,
|
||||||
:presence => true,
|
:presence => true,
|
||||||
:length => { :within => 0..255 }
|
:length => { :within => 0..5000 }
|
||||||
|
|
||||||
validates :attachment,
|
validates :attachment,
|
||||||
:file_size => {
|
:file_size => {
|
||||||
:maximum => 10.megabytes.to_i
|
:maximum => 10.megabytes.to_i
|
||||||
}
|
}
|
||||||
|
|
||||||
scope :common, where(:noteable_id => nil)
|
scope :common, where(:noteable_id => nil)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Project < ActiveRecord::Base
|
||||||
:format => { :with => /^[a-zA-Z0-9_\-]*$/,
|
:format => { :with => /^[a-zA-Z0-9_\-]*$/,
|
||||||
:message => "only letters, digits & '_' '-' allowed" },
|
:message => "only letters, digits & '_' '-' allowed" },
|
||||||
:length => { :within => 0..255 }
|
:length => { :within => 0..255 }
|
||||||
|
|
||||||
validates :description,
|
validates :description,
|
||||||
:length => { :within => 0..2000 }
|
:length => { :within => 0..2000 }
|
||||||
|
|
||||||
|
@ -57,13 +57,13 @@ class Project < ActiveRecord::Base
|
||||||
c.update_project(path, gitosis_writers)
|
c.update_project(path, gitosis_writers)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_gitosis_project
|
def destroy_gitosis_project
|
||||||
Gitosis.new.configure do |c|
|
Gitosis.new.configure do |c|
|
||||||
c.destroy_project(self)
|
c.destroy_project(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_access(user, *access)
|
def add_access(user, *access)
|
||||||
opts = { :user => user }
|
opts = { :user => user }
|
||||||
access.each { |name| opts.merge!(name => true) }
|
access.each { |name| opts.merge!(name => true) }
|
||||||
|
@ -102,12 +102,12 @@ class Project < ActiveRecord::Base
|
||||||
def url_to_repo
|
def url_to_repo
|
||||||
"#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
|
"#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
|
||||||
end
|
end
|
||||||
|
|
||||||
def path_to_repo
|
def path_to_repo
|
||||||
GITOSIS["base_path"] + path + ".git"
|
GITOSIS["base_path"] + path + ".git"
|
||||||
end
|
end
|
||||||
|
|
||||||
def repo
|
def repo
|
||||||
@repo ||= Grit::Repo.new(path_to_repo)
|
@repo ||= Grit::Repo.new(path_to_repo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -122,17 +122,17 @@ class Project < ActiveRecord::Base
|
||||||
def commit(commit_id = nil)
|
def commit(commit_id = nil)
|
||||||
if commit_id
|
if commit_id
|
||||||
repo.commits(commit_id).first
|
repo.commits(commit_id).first
|
||||||
else
|
else
|
||||||
repo.commits.first
|
repo.commits.first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def heads
|
def heads
|
||||||
@heads ||= repo.heads
|
@heads ||= repo.heads
|
||||||
end
|
end
|
||||||
|
|
||||||
def fresh_commits
|
def fresh_commits
|
||||||
commits = heads.map do |h|
|
commits = heads.map do |h|
|
||||||
repo.commits(h.name, 10)
|
repo.commits(h.name, 10)
|
||||||
end.flatten.uniq { |c| c.id }
|
end.flatten.uniq { |c| c.id }
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def commits_since(date)
|
def commits_since(date)
|
||||||
commits = heads.map do |h|
|
commits = heads.map do |h|
|
||||||
repo.log(h.name, nil, :since => date)
|
repo.log(h.name, nil, :since => date)
|
||||||
end.flatten.uniq { |c| c.id }
|
end.flatten.uniq { |c| c.id }
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ class Project < ActiveRecord::Base
|
||||||
unless owner.can_create_project?
|
unless owner.can_create_project?
|
||||||
errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it")
|
errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it")
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
errors[:base] << ("Cant check your ability to create project")
|
errors[:base] << ("Cant check your ability to create project")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base
|
||||||
validates :title,
|
validates :title,
|
||||||
:presence => true,
|
:presence => true,
|
||||||
:length => { :within => 0..255 }
|
:length => { :within => 0..255 }
|
||||||
|
|
||||||
validates :file_name,
|
validates :file_name,
|
||||||
:presence => true,
|
:presence => true,
|
||||||
:length => { :within => 0..255 }
|
:length => { :within => 0..255 }
|
||||||
|
@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base
|
||||||
:presence => true,
|
:presence => true,
|
||||||
:length => { :within => 0..10000 }
|
:length => { :within => 0..10000 }
|
||||||
|
|
||||||
|
scope :fresh, order("created_at DESC")
|
||||||
|
scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current])
|
||||||
|
|
||||||
def self.content_types
|
def self.content_types
|
||||||
[
|
[
|
||||||
".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
|
".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
|
||||||
".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
|
".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
|
||||||
".js", ".sh", ".coffee", ".yml", ".md"
|
".js", ".sh", ".coffee", ".yml", ".md"
|
||||||
|
@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base
|
||||||
def colorize
|
def colorize
|
||||||
system_colorize(content, file_name)
|
system_colorize(content, file_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def expired?
|
||||||
|
expires_at && expires_at < Time.current
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
|
@ -47,5 +53,6 @@ end
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
# file_name :string(255)
|
# file_name :string(255)
|
||||||
|
# expires_at :datetime
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class User < ActiveRecord::Base
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
:recoverable, :rememberable, :trackable, :validatable
|
||||||
|
|
||||||
# Setup accessible (or protected) attributes for your model
|
# Setup accessible (or protected) attributes for your model
|
||||||
attr_accessible :email, :password, :password_confirmation, :remember_me,
|
attr_accessible :email, :password, :password_confirmation, :remember_me,
|
||||||
:name, :projects_limit, :skype, :linkedin, :twitter
|
:name, :projects_limit, :skype, :linkedin, :twitter
|
||||||
|
|
||||||
has_many :users_projects, :dependent => :destroy
|
has_many :users_projects, :dependent => :destroy
|
||||||
|
|
|
@ -1,29 +1,28 @@
|
||||||
%p This is page with preview for all system emails that are sent to user
|
%p This is page with preview for all system emails that are sent to user
|
||||||
%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system
|
%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system
|
||||||
|
|
||||||
#accordion
|
#accordion
|
||||||
%h3
|
%h3
|
||||||
%a New user
|
%a New user
|
||||||
%div
|
%div
|
||||||
%iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"}
|
%iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"}
|
||||||
%h3
|
%h3
|
||||||
%a New issue
|
%a New issue
|
||||||
%div
|
%div
|
||||||
%iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"}
|
%iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"}
|
||||||
%h3
|
%h3
|
||||||
%a Commit note
|
%a Commit note
|
||||||
%div
|
%div
|
||||||
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"}
|
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"}
|
||||||
%h3
|
%h3
|
||||||
%a Issue note
|
%a Issue note
|
||||||
%div
|
%div
|
||||||
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"}
|
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"}
|
||||||
%h3
|
%h3
|
||||||
%a Wall note
|
%a Wall note
|
||||||
%div
|
%div
|
||||||
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"}
|
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"}
|
||||||
|
|
||||||
|
:javascript
|
||||||
:javascript
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#accordion" ).accordion(); });
|
$( "#accordion" ).accordion(); });
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%p#notice= notice
|
%p#notice= notice
|
||||||
|
|
||||||
.span-8.colborder
|
.span-8.colborder
|
||||||
%h2= @admin_project.name
|
%h2= @admin_project.name
|
||||||
|
|
||||||
%p
|
%p
|
||||||
%b Name:
|
%b Name:
|
||||||
|
@ -22,16 +22,16 @@
|
||||||
|
|
||||||
.span-14
|
.span-14
|
||||||
|
|
||||||
%h2 Team
|
%h2 Team
|
||||||
|
|
||||||
%table.round-borders
|
%table.round-borders
|
||||||
%tr
|
%tr
|
||||||
%th Name
|
%th Name
|
||||||
%th Added
|
%th Added
|
||||||
%th Web
|
%th Web
|
||||||
%th Git
|
%th Git
|
||||||
%th Admin
|
%th Admin
|
||||||
%th
|
%th
|
||||||
|
|
||||||
- @admin_project.users_projects.each do |tm|
|
- @admin_project.users_projects.each do |tm|
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
%th Read
|
%th Read
|
||||||
%th Git
|
%th Git
|
||||||
%th Manage
|
%th Manage
|
||||||
%th Added
|
%th Added
|
||||||
%th
|
%th
|
||||||
%th
|
%th
|
||||||
%th
|
%th
|
||||||
- members.each do |tm|
|
- members.each do |tm|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
%b Since:
|
%b Since:
|
||||||
= @admin_team_member.updated_at
|
= @admin_team_member.updated_at
|
||||||
|
|
||||||
|
|
||||||
.span-10
|
.span-10
|
||||||
.span-6
|
.span-6
|
||||||
%b Access:
|
%b Access:
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
.field
|
.field
|
||||||
= f.label :twitter
|
= f.label :twitter
|
||||||
%br
|
%br
|
||||||
= f.text_field :twitter
|
= f.text_field :twitter
|
||||||
.clear
|
.clear
|
||||||
%br
|
%br
|
||||||
.actions
|
.actions
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
||||||
|
|
||||||
= link_to 'Back', admin_users_path, :class => "right lbutton"
|
= link_to 'Back', admin_users_path, :class => "right lbutton"
|
||||||
|
|
|
@ -19,28 +19,27 @@
|
||||||
= @admin_user.skype
|
= @admin_user.skype
|
||||||
%p
|
%p
|
||||||
%b LinkedIn:
|
%b LinkedIn:
|
||||||
= @admin_user.linkedin
|
= @admin_user.linkedin
|
||||||
%p
|
%p
|
||||||
%b Twitter:
|
%b Twitter:
|
||||||
= @admin_user.twitter
|
= @admin_user.twitter
|
||||||
|
|
||||||
|
|
||||||
.clear
|
.clear
|
||||||
= link_to 'Edit', edit_admin_user_path(@admin_user)
|
= link_to 'Edit', edit_admin_user_path(@admin_user)
|
||||||
\|
|
\|
|
||||||
= link_to 'Back', admin_users_path
|
= link_to 'Back', admin_users_path
|
||||||
|
|
||||||
.span-14
|
.span-14
|
||||||
%h2 Projects
|
%h2 Projects
|
||||||
|
|
||||||
%table.round-borders
|
%table.round-borders
|
||||||
%tr
|
%tr
|
||||||
%th Name
|
%th Name
|
||||||
%th Added
|
%th Added
|
||||||
%th Web
|
%th Web
|
||||||
%th Git
|
%th Git
|
||||||
%th Admin
|
%th Admin
|
||||||
%th
|
%th
|
||||||
|
|
||||||
- @admin_user.users_projects.each do |tm|
|
- @admin_user.users_projects.each do |tm|
|
||||||
- project = tm.project
|
- project = tm.project
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
.diff_file_header
|
.diff_file_header
|
||||||
- if diff.deleted_file
|
- if diff.deleted_file
|
||||||
%strong{:id => "#{diff.b_path}"}= diff.a_path
|
%strong{:id => "#{diff.b_path}"}= diff.a_path
|
||||||
- else
|
- else
|
||||||
= link_to tree_file_project_path(@project, @commit.id, diff.b_path) do
|
= link_to tree_file_project_path(@project, @commit.id, diff.b_path) do
|
||||||
%strong{:id => "#{diff.b_path}"}= diff.b_path
|
%strong{:id => "#{diff.b_path}"}= diff.b_path
|
||||||
%br/
|
%br/
|
||||||
|
@ -19,5 +19,5 @@
|
||||||
.diff_file_content_image
|
.diff_file_content_image
|
||||||
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
||||||
- else
|
- else
|
||||||
%p
|
%p
|
||||||
%center No preview for this file type
|
%center No preview for this file type
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
%h1 Listing commits
|
%h1 Listing commits
|
||||||
%div{:id => dom_id(@project)}
|
%div{:id => dom_id(@project)}
|
||||||
= render "commits"
|
= render "commits"
|
||||||
%br/
|
%br/
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
- line_new = 0
|
- line_new = 0
|
||||||
- lines_arr = diff.diff.lines.to_a
|
- lines_arr = diff.diff.lines.to_a
|
||||||
- lines_arr.each do |line|
|
- lines_arr.each do |line|
|
||||||
|
- next if line.match(/^--- \/dev\/null/)
|
||||||
- next if line.match(/^--- a/)
|
- next if line.match(/^--- a/)
|
||||||
- next if line.match(/^\+\+\+ b/)
|
- next if line.match(/^\+\+\+ b/)
|
||||||
- if line.match(/^@@ -/)
|
- if line.match(/^@@ -/)
|
||||||
|
@ -12,10 +13,10 @@
|
||||||
= diff_line(line, line_new, line_old)
|
= diff_line(line, line_new, line_old)
|
||||||
- if line[0] == "+"
|
- if line[0] == "+"
|
||||||
- line_new += 1
|
- line_new += 1
|
||||||
- elsif
|
- elsif
|
||||||
- line[0] == "-"
|
- line[0] == "-"
|
||||||
- line_old += 1
|
- line_old += 1
|
||||||
- else
|
- else
|
||||||
- line_new += 1
|
- line_new += 1
|
||||||
- line_old += 1
|
- line_old += 1
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
side.html("#{escape_javascript(render "commits/show")}");
|
side.html("#{escape_javascript(render "commits/show")}");
|
||||||
$("##{dom_id(@project)}").parent().append(side);
|
$("##{dom_id(@project)}").parent().append(side);
|
||||||
$("##{dom_id(@project)}").addClass("span-14");
|
$("##{dom_id(@project)}").addClass("span-14");
|
||||||
:plain
|
:plain
|
||||||
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
<div><%= f.submit "Resend confirmation instructions" %></div>
|
<div><%= f.submit "Resend confirmation instructions" %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial => "devise/shared/links" %>
|
<%= render :partial => "devise/shared/links" %>
|
||||||
|
|
|
@ -13,4 +13,4 @@
|
||||||
<div><%= f.submit "Change my password" %></div>
|
<div><%= f.submit "Change my password" %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial => "devise/shared/links" %>
|
<%= render :partial => "devise/shared/links" %>
|
||||||
|
|
|
@ -22,4 +22,4 @@
|
||||||
<%- resource_class.omniauth_providers.each do |provider| %>
|
<%- resource_class.omniauth_providers.each do |provider| %>
|
||||||
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
<div><%= f.submit "Resend unlock instructions" %></div>
|
<div><%= f.submit "Resend unlock instructions" %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial => "devise/shared/links" %>
|
<%= render :partial => "devise/shared/links" %>
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
.span-8
|
.span-8
|
||||||
= f.label :title
|
= f.label :title
|
||||||
= f.text_field :title, :style => "width:450px"
|
= f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255
|
||||||
.span-8
|
-#.span-8
|
||||||
= f.label :content
|
-#= f.label :content
|
||||||
= f.text_area :content, :style => "width:450px; height:130px"
|
-#= f.text_area :content, :style => "width:450px; height:130px"
|
||||||
.span-8.append-bottom
|
.span-8.append-bottom
|
||||||
= f.label :assignee_id
|
= f.label :assignee_id
|
||||||
= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
|
= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%table.round-borders#issues-table
|
%table.round-borders#issues-table
|
||||||
%tr
|
%tr
|
||||||
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
|
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
|
||||||
%th
|
%th
|
||||||
%th Assignee
|
%th Assignee
|
||||||
%th ID
|
%th ID
|
||||||
%th Title
|
%th Title
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) }
|
%tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) }
|
||||||
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
|
- if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0")
|
||||||
%td
|
%td
|
||||||
= image_tag "move.png" , :class => [:handle, :left]
|
= image_tag "move.png" , :class => [:handle, :left]
|
||||||
%td
|
%td
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
= truncate issue.assignee.name, :lenght => 20
|
= truncate issue.assignee.name, :lenght => 20
|
||||||
%td ##{issue.id}
|
%td ##{issue.id}
|
||||||
%td
|
%td
|
||||||
= html_escape issue.title
|
= truncate(html_escape(issue.title), :length => 60)
|
||||||
%br
|
%br
|
||||||
- if issue.critical
|
- if issue.critical
|
||||||
%span.tag.high critical
|
%span.tag.high critical
|
||||||
|
@ -21,10 +21,10 @@
|
||||||
-#notes
|
-#notes
|
||||||
%td
|
%td
|
||||||
- if can? current_user, :write_issue, @project
|
- if can? current_user, :write_issue, @project
|
||||||
= form_for([@project, issue], :remote => true) do |f|
|
= form_for([@project, issue], :remote => true) do |f|
|
||||||
= f.check_box :closed, :onclick => "$(this).parent().submit();"
|
= f.check_box :closed, :onclick => "$(this).parent().submit();"
|
||||||
= hidden_field_tag :status_only, true
|
= hidden_field_tag :status_only, true
|
||||||
- else
|
- else
|
||||||
= check_box_tag "closed", 1, issue.closed, :disabled => true
|
= check_box_tag "closed", 1, issue.closed, :disabled => true
|
||||||
%td
|
%td
|
||||||
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
|
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
|
||||||
|
|
|
@ -1,28 +1,52 @@
|
||||||
%div
|
%div
|
||||||
- if can? current_user, :write_issue, @project
|
.top_panel_issues
|
||||||
.left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
|
- if can? current_user, :write_issue, @project
|
||||||
.right
|
%div{:class => "left", :style => "margin-right: 10px;" }
|
||||||
= form_tag project_issues_path(@project), :method => :get do
|
= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
|
||||||
.span-2
|
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do
|
||||||
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues"
|
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
|
||||||
= label_tag "open_issues","Open"
|
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
|
||||||
.span-2
|
|
||||||
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues"
|
.right
|
||||||
= label_tag "closed_issues","Closed"
|
= form_tag project_issues_path(@project), :method => :get do
|
||||||
.span-2
|
.span-2
|
||||||
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues"
|
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status"
|
||||||
= label_tag "my_issues","To Me"
|
= label_tag "open_issues","Open"
|
||||||
|
.span-2
|
||||||
.span-2
|
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status"
|
||||||
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues"
|
= label_tag "closed_issues","Closed"
|
||||||
= label_tag "all_issues","All"
|
.span-2
|
||||||
|
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status"
|
||||||
|
= label_tag "my_issues","To Me"
|
||||||
|
.span-2
|
||||||
|
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status"
|
||||||
|
= label_tag "all_issues","All"
|
||||||
|
|
||||||
#issues-table-holder= render "issues"
|
#issues-table-holder= render "issues"
|
||||||
%br
|
%br
|
||||||
:javascript
|
:javascript
|
||||||
$('.delete-issue').live('ajax:success', function() {
|
var href = $('.issue_search').parent().attr('action');
|
||||||
$(this).closest('tr').fadeOut(); });
|
var last_terms = '';
|
||||||
|
|
||||||
|
$('.issue_search').keyup(function() {
|
||||||
|
var terms = $(this).val();
|
||||||
|
var project_id = $('#project_id').val();
|
||||||
|
var status = $('.status:checked').val();
|
||||||
|
if (terms != last_terms) {
|
||||||
|
last_terms = terms;
|
||||||
|
|
||||||
|
if (terms.length >= 2 || terms.length == 0) {
|
||||||
|
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
|
||||||
|
$('#issues-table').html(response);
|
||||||
|
setSortable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.delete-issue').live('ajax:success', function() {
|
||||||
|
$(this).closest('tr').fadeOut(); updatePage();});
|
||||||
|
|
||||||
function setSortable(){
|
function setSortable(){
|
||||||
$('#issues-table>tbody').sortable({
|
$('#issues-table>tbody').sortable({
|
||||||
axis: 'y',
|
axis: 'y',
|
||||||
|
|
|
@ -1,44 +1,57 @@
|
||||||
%h2
|
%h2
|
||||||
= "Issue ##{@issue.id} - #{@issue.title}"
|
= "Issue ##{@issue.id} - #{html_escape(@issue.title)}"
|
||||||
|
|
||||||
.span-15
|
.span-15
|
||||||
= simple_format html_escape(@issue.content)
|
-#= simple_format html_escape(@issue.content)
|
||||||
.issue_notes= render "notes/notes"
|
.issue_notes= render "notes/notes"
|
||||||
.span-8.right
|
.span-8.right
|
||||||
.span-8
|
.span-8
|
||||||
- if @issue.closed
|
- if @issue.closed
|
||||||
%center.success Closed
|
%center.success Closed
|
||||||
- else
|
- else
|
||||||
%center.error Open
|
%center.error Open
|
||||||
%table.round-borders
|
%table.round-borders
|
||||||
%tr
|
%tr
|
||||||
%td Title:
|
%td Title:
|
||||||
%td
|
%td
|
||||||
= truncate html_escape(@issue.title)
|
= truncate html_escape(@issue.title)
|
||||||
%tr
|
%tr
|
||||||
%td Project
|
%td Project
|
||||||
%td
|
%td
|
||||||
%strong= @issue.project.name
|
%strong= @issue.project.name
|
||||||
%tr
|
%tr
|
||||||
%td Author:
|
%td Author:
|
||||||
%td
|
%td
|
||||||
= image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
|
= image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
|
||||||
= @issue.author.name
|
= @issue.author.name
|
||||||
%tr
|
%tr
|
||||||
%td Assignee:
|
%td Assignee:
|
||||||
%td
|
%td
|
||||||
= image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
|
= image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
|
||||||
= @issue.assignee.name
|
= @issue.assignee.name
|
||||||
|
%tr
|
||||||
|
%td Tags
|
||||||
|
%td
|
||||||
|
- if @issue.critical
|
||||||
|
%span.tag.high critical
|
||||||
|
- else
|
||||||
|
%span.tag.normal normal
|
||||||
|
|
||||||
|
- if @issue.today?
|
||||||
|
%span.tag.today today
|
||||||
%tr
|
%tr
|
||||||
%td Closed?
|
%td Closed?
|
||||||
%td
|
%td
|
||||||
- if can? current_user, :write_issue, @project
|
- if can? current_user, :write_issue, @project
|
||||||
= form_for([@project, @issue]) do |f|
|
= form_for([@project, @issue]) do |f|
|
||||||
= f.check_box :closed, :onclick => "$(this).parent().submit();"
|
= f.check_box :closed, :onclick => "$(this).parent().submit();"
|
||||||
= hidden_field_tag :status_only, true
|
= hidden_field_tag :status_only, true
|
||||||
- else
|
- else
|
||||||
= check_box_tag "closed", 1, @issue.closed, :disabled => true
|
= check_box_tag "closed", 1, @issue.closed, :disabled => true
|
||||||
|
|
||||||
|
|
||||||
|
- if can?(current_user, :admin_issue, @issue)
|
||||||
|
.clear
|
||||||
|
= link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true
|
||||||
|
.right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}"
|
||||||
.clear
|
.clear
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
:plain
|
:plain
|
||||||
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
- if @issue.valid?
|
- if @issue.valid?
|
||||||
:plain
|
:plain
|
||||||
$("##{dom_id(@issue)}").fadeOut();
|
$("##{dom_id(@issue)}").fadeOut();
|
||||||
- else
|
- else
|
||||||
- if @issue.valid?
|
- if @issue.valid?
|
||||||
:plain
|
:plain
|
||||||
$("#edit_issue_dialog").dialog("close");
|
$("#edit_issue_dialog").dialog("close");
|
||||||
$.ajax({type: "GET", url: location.href, dataType: "script"});
|
updatePage();
|
||||||
- else
|
- else
|
||||||
:plain
|
:plain
|
||||||
$("#edit_issue_dialog").empty();
|
$("#edit_issue_dialog").empty();
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
= render(:partial => 'show', :locals => {:key => key})
|
= render(:partial => 'show', :locals => {:key => key})
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$('.delete-key').live('ajax:success', function() {
|
$('.delete-key').live('ajax:success', function() {
|
||||||
$(this).closest('tr').fadeOut(); });
|
$(this).closest('tr').fadeOut(); });
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
%h4= text
|
%h4= text
|
||||||
:javascript
|
:javascript
|
||||||
$(function(){
|
$(function(){
|
||||||
$("#flash_container").slideDown("slow");
|
$("#flash_container").slideDown("slow");
|
||||||
$("#flash_container").click(function(){
|
$("#flash_container").click(function(){
|
||||||
$(this).slideUp("slow");
|
$(this).slideUp("slow");
|
||||||
});
|
});
|
||||||
setTimeout("hideFlash()",2000);
|
setTimeout("hideFlash()",2000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<% if current_user %>
|
<% if current_user %>
|
||||||
<%= javascript_tag do %>
|
<%= javascript_tag do %>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
= stylesheet_link_tag 'blueprint/print', :media => "print"
|
= stylesheet_link_tag 'blueprint/print', :media => "print"
|
||||||
= stylesheet_link_tag 'blueprint/plugins/buttons/screen', :media => "screen, projection"
|
= stylesheet_link_tag 'blueprint/plugins/buttons/screen', :media => "screen, projection"
|
||||||
= stylesheet_link_tag 'blueprint/plugins/link-icons/screen', :media => "screen, projection"
|
= stylesheet_link_tag 'blueprint/plugins/link-icons/screen', :media => "screen, projection"
|
||||||
= stylesheet_link_tag 'jquery_ui/jquery-ui-1.8.16.custom', :media => "screen, projection"
|
|
||||||
= stylesheet_link_tag "application"
|
= stylesheet_link_tag "application"
|
||||||
= javascript_include_tag "application"
|
= javascript_include_tag "application"
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
%div
|
%div
|
||||||
= f.label :note
|
= f.label :note
|
||||||
%cite (255 symbols only)
|
%cite
|
||||||
%br
|
%br
|
||||||
= f.text_area :note, :size => 255
|
= f.text_area :note, :size => 255
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
= check_box_tag :notify, 1, true
|
= check_box_tag :notify, 1, true
|
||||||
= label_tag :notify, "Notify project team about your note"
|
= label_tag :notify, "Notify project team about your note"
|
||||||
|
|
||||||
.clear
|
.clear
|
||||||
%br
|
%br
|
||||||
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
|
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- if controller.action_name == "wall"
|
- if controller.action_name == "wall"
|
||||||
%ul#notes-list= render "notes/notes_list"
|
%ul#notes-list= render "notes/notes_list"
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%ul#notes-list= render "notes/notes_list"
|
%ul#notes-list= render "notes/notes_list"
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
@ -9,17 +9,16 @@
|
||||||
= render "notes/form"
|
= render "notes/form"
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$('.delete-note').live('ajax:success', function() {
|
$('.delete-note').live('ajax:success', function() {
|
||||||
$(this).closest('li').fadeOut(); });
|
$(this).closest('li').fadeOut(); });
|
||||||
|
|
||||||
$("#new_note").live("ajax:before", function(){
|
$("#new_note").live("ajax:before", function(){
|
||||||
$("#submit_note").attr("disabled", "disabled");
|
$("#submit_note").attr("disabled", "disabled");
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#new_note").live("ajax:complete", function(){
|
$("#new_note").live("ajax:complete", function(){
|
||||||
$("#submit_note").removeAttr("disabled");
|
$("#submit_note").removeAttr("disabled");
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
- if ["issues", "projects"].include?(controller.controller_name)
|
- if ["issues", "projects"].include?(controller.controller_name)
|
||||||
:javascript
|
:javascript
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
:plain
|
:plain
|
||||||
$("#new_note").replaceWith("#{escape_javascript(render('form'))}");
|
$("#new_note").replaceWith("#{escape_javascript(render('form'))}");
|
||||||
|
|
||||||
:plain
|
:plain
|
||||||
$("#submit_note").removeAttr("disabled");
|
$("#submit_note").removeAttr("disabled");
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
||||||
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= link_to project_issue_url(@project, @issue) do
|
= link_to project_issue_url(@project, @issue) do
|
||||||
= "Issue ##{@issue.id.to_s}"
|
= "Issue ##{@issue.id.to_s}"
|
||||||
= truncate(@issue.title, :length => 45)
|
= truncate(@issue.title, :length => 45)
|
||||||
%br
|
%br
|
||||||
%cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
|
%cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= @issue.content
|
= @issue.content
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
||||||
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
Hi #{@user.name}!
|
Hi #{@user.name}!
|
||||||
%p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
|
%p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
|
||||||
Administrator created account for you. Now you are a member of company gitlab application.
|
Administrator created account for you. Now you are a member of company gitlab application.
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
||||||
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
New comment -
|
New comment -
|
||||||
= link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do
|
= link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do
|
||||||
= "Issue ##{@issue.id.to_s}"
|
= "Issue ##{@issue.id.to_s}"
|
||||||
= truncate(@issue.title, :length => 35)
|
= truncate(@issue.title, :length => 35)
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%tr
|
%tr
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
%td{:align => "left", :style => "padding: 20px 0 0;"}
|
||||||
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
New message on
|
New message on
|
||||||
= link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}")
|
= link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}")
|
||||||
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
%td
|
%td
|
||||||
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
|
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
.left= f.label :code
|
.left= f.label :code
|
||||||
%cite.right http://yourserver/
|
%cite.right http://yourserver/
|
||||||
%td= f.text_field :code, :placeholder => "example"
|
%td= f.text_field :code, :placeholder => "example"
|
||||||
|
@ -39,10 +39,10 @@
|
||||||
= image_tag "ajax-loader.gif", :class => "append-bottom"
|
= image_tag "ajax-loader.gif", :class => "append-bottom"
|
||||||
- if @project.new_record?
|
- if @project.new_record?
|
||||||
%h3.prepend-top Creating project & repository. Please wait for few minutes
|
%h3.prepend-top Creating project & repository. Please wait for few minutes
|
||||||
- else
|
- else
|
||||||
%h3.prepend-top Updating project & repository. Please wait for few minutes
|
%h3.prepend-top Updating project & repository. Please wait for few minutes
|
||||||
:javascript
|
:javascript
|
||||||
$('.new_project, .edit_project').bind('ajax:before', function() {
|
$('.new_project, .edit_project').bind('ajax:before', function() {
|
||||||
$(this).find(".form_content").hide();
|
$(this).find(".form_content").hide();
|
||||||
$('.ajax_loader').show();
|
$('.ajax_loader').show();
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
|
%td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
|
||||||
%td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled
|
%td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled
|
||||||
%td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled
|
%td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled
|
||||||
%td
|
%td
|
||||||
-if can? current_user, :admin_project, project
|
-if can? current_user, :admin_project, project
|
||||||
= link_to 'Edit', edit_project_path(project), :class => "lbutton positive"
|
= link_to 'Edit', edit_project_path(project), :class => "lbutton positive"
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
$(".list").toggle();
|
$(".list").toggle();
|
||||||
if($(".tile").is(":visible")){
|
if($(".tile").is(":visible")){
|
||||||
$.cookie('project_view', 'tile', { expires: 14 });
|
$.cookie('project_view', 'tile', { expires: 14 });
|
||||||
} else {
|
} else {
|
||||||
$.cookie('project_view', 'list', { expires: 14 });
|
$.cookie('project_view', 'list', { expires: 14 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
|
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
|
||||||
%p{:style => "margin-bottom: 3px;"}
|
%p{:style => "margin-bottom: 3px;"}
|
||||||
%strong
|
%strong
|
||||||
= link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id)
|
= link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id)
|
||||||
|
|
||||||
%span
|
%span
|
||||||
%span.author
|
%span.author
|
||||||
= commit.author.name.force_encoding("UTF-8")
|
= commit.author.name.force_encoding("UTF-8")
|
||||||
|
|
|
@ -14,5 +14,5 @@
|
||||||
= render(:partial => 'team_members/show', :locals => {:member => up})
|
= render(:partial => 'team_members/show', :locals => {:member => up})
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$('.delete-team-member').live('ajax:success', function() {
|
$('.delete-team-member').live('ajax:success', function() {
|
||||||
$(this).closest('tr').fadeOut(); });
|
$(this).closest('tr').fadeOut(); });
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
|
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
|
||||||
Snippets
|
Snippets
|
||||||
- if @project.snippets.count > 0
|
- if @project.snippets.count > 0
|
||||||
%span{ :class => "top_menu_count" }= @project.snippets.count
|
%span{ :class => "top_menu_count" }= @project.snippets.non_expired.count
|
||||||
|
|
||||||
- if @commit
|
- if @commit
|
||||||
%span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil
|
%span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil
|
||||||
|
|
|
@ -40,7 +40,7 @@ eos
|
||||||
<p>
|
<p>
|
||||||
Be careful! <br/>
|
Be careful! <br/>
|
||||||
Project cant be recovered after destroy.</p>
|
Project cant be recovered after destroy.</p>
|
||||||
<%= link_to 'Destroy', @project,
|
<%= link_to 'Destroy', @project,
|
||||||
:confirm => 'Are you sure?', :method => :delete,
|
:confirm => 'Are you sure?', :method => :delete,
|
||||||
:class => "left button negative span-6", :style => "text-align:center" %>
|
:class => "left button negative span-6", :style => "text-align:center" %>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
= render "tile"
|
= render "tile"
|
||||||
%div{:class => "list", :style => view_mode_style("list")}
|
%div{:class => "list", :style => view_mode_style("list")}
|
||||||
= render "list"
|
= render "list"
|
||||||
- else
|
- else
|
||||||
%center.prepend-top
|
%center.prepend-top
|
||||||
%h2
|
%h2
|
||||||
%cite Nothing here
|
%cite Nothing here
|
||||||
|
|
|
@ -21,3 +21,8 @@
|
||||||
%h3 Talk
|
%h3 Talk
|
||||||
=render "projects/recent_messages"
|
=render "projects/recent_messages"
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
function updateDashboard(){
|
||||||
|
$('#content-container').load("#{escape_javascript(project_path(@project))} #content-container>*");
|
||||||
|
}
|
||||||
|
setInterval("updateDashboard()", 300000);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
:plain
|
:plain
|
||||||
$("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){
|
$("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){
|
||||||
$("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
|
$("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
|
||||||
$("#tree-holder table").show("slide", { direction: "right" }, 150);
|
$("#tree-holder table").show("slide", { direction: "right" }, 150);
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
%hr
|
%hr
|
||||||
= render "notes/notes"
|
= render "notes/notes"
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(function(){
|
$(function(){
|
||||||
$("#note_note").live("click", function(){
|
$("#note_note").live("click", function(){
|
||||||
$(this).css("height", "100px");
|
$(this).css("height", "100px");
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
:plain
|
:plain
|
||||||
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
|
||||||
|
|
|
@ -12,11 +12,14 @@
|
||||||
%tr
|
%tr
|
||||||
%td= f.label :file_name
|
%td= f.label :file_name
|
||||||
%td= f.text_field :file_name, :placeholder => "example.rb"
|
%td= f.text_field :file_name, :placeholder => "example.rb"
|
||||||
|
%tr
|
||||||
|
%td= f.label "Lifetime"
|
||||||
|
%td= f.select :expires_at, lifetime_select_options
|
||||||
%tr
|
%tr
|
||||||
%td{:colspan => 2}
|
%td{:colspan => 2}
|
||||||
= f.label :content, "Code"
|
= f.label :content, "Code"
|
||||||
%br
|
%br
|
||||||
= f.text_area :content, :style => "height:240px;width:932px;"
|
= f.text_area :content, :style => "height:240px;width:932px;"
|
||||||
|
|
||||||
.actions.prepend-top
|
.actions.prepend-top
|
||||||
= f.submit 'Save', :class => "lbutton vm"
|
= f.submit 'Save', :class => "lbutton vm"
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
%tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) }
|
- unless snippet.expired?
|
||||||
%td
|
%tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) }
|
||||||
= image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
|
%td
|
||||||
= truncate snippet.author.name, :lenght => 20
|
= image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
|
||||||
%td= html_escape snippet.title
|
= truncate snippet.author.name, :lenght => 20
|
||||||
%td= html_escape snippet.file_name
|
%td= html_escape snippet.title
|
||||||
%td
|
%td= html_escape snippet.file_name
|
||||||
- if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
|
%td
|
||||||
= link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive"
|
- if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
|
||||||
- if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
|
= link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive"
|
||||||
= link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}"
|
- if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
|
||||||
|
= link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
%th Title
|
%th Title
|
||||||
%th File name
|
%th File name
|
||||||
%th
|
%th
|
||||||
= render @snippets
|
= render @snippets.fresh
|
||||||
:javascript
|
:javascript
|
||||||
$('.delete-snippet').live('ajax:success', function() {
|
$('.delete-snippet').live('ajax:success', function() {
|
||||||
$(this).closest('tr').fadeOut(); });
|
$(this).closest('tr').fadeOut(); });
|
||||||
|
|
|
@ -1,22 +1,26 @@
|
||||||
%h2
|
- if !@snippet.expired?
|
||||||
= "Snippet ##{@snippet.id} - #{@snippet.title}"
|
%h2
|
||||||
|
= "Snippet ##{@snippet.id} - #{@snippet.title}"
|
||||||
|
|
||||||
.view_file
|
.view_file
|
||||||
.view_file_header
|
.view_file_header
|
||||||
%strong
|
%strong
|
||||||
= @snippet.file_name
|
= @snippet.file_name
|
||||||
%br/
|
%br/
|
||||||
.view_file_content
|
.view_file_content
|
||||||
:erb
|
:erb
|
||||||
<%= raw @snippet.colorize %>
|
<%= raw @snippet.colorize %>
|
||||||
|
|
||||||
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
||||||
= link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
|
= link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
|
||||||
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
||||||
= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
|
= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
|
||||||
.clear
|
.clear
|
||||||
%br
|
%br
|
||||||
.snippet_notes= render "notes/notes"
|
.snippet_notes= render "notes/notes"
|
||||||
|
|
||||||
.clear
|
.clear
|
||||||
|
|
||||||
|
- else
|
||||||
|
%h2
|
||||||
|
Sorry, this snippet is no longer exists
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
|
|
||||||
%td= truncate user.email, :lenght => 16
|
%td= truncate user.email, :lenght => 16
|
||||||
- if can? current_user, :admin_project, @project
|
- if can? current_user, :admin_project, @project
|
||||||
= form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
|
= form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
|
||||||
%td= f.check_box :read, :onclick => "$(this.form).submit();"
|
%td= f.check_box :read, :onclick => "$(this.form).submit();"
|
||||||
%td= f.check_box :write, :onclick => "$(this.form).submit();"
|
%td= f.check_box :write, :onclick => "$(this.form).submit();"
|
||||||
%td= f.check_box :admin, :onclick => "$(this.form).submit();"
|
%td= f.check_box :admin, :onclick => "$(this.form).submit();"
|
||||||
- else
|
- else
|
||||||
%td= check_box_tag "read", 1, member.read, :disabled => :disabled
|
%td= check_box_tag "read", 1, member.read, :disabled => :disabled
|
||||||
%td= check_box_tag "commit", 1, member.write, :disabled => :disabled
|
%td= check_box_tag "commit", 1, member.write, :disabled => :disabled
|
||||||
%td= check_box_tag "admin", 1, member.admin, :disabled => :disabled
|
%td= check_box_tag "admin", 1, member.admin, :disabled => :disabled
|
||||||
|
|
|
@ -25,4 +25,3 @@
|
||||||
%b Twitter:
|
%b Twitter:
|
||||||
= user.twitter
|
= user.twitter
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,5 +44,8 @@ module Gitlab
|
||||||
|
|
||||||
# Version of your assets, change this if you want to expire all your assets
|
# Version of your assets, change this if you want to expire all your assets
|
||||||
config.assets.version = '1.0'
|
config.assets.version = '1.0'
|
||||||
|
|
||||||
|
# Extend assets path
|
||||||
|
config.assets.paths << Rails.root.join('vendor', 'assets', 'images', 'jquery-ui')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -58,7 +58,6 @@ Gitlab::Application.configure do
|
||||||
# Send deprecation notices to registered listeners
|
# Send deprecation notices to registered listeners
|
||||||
config.active_support.deprecation = :notify
|
config.active_support.deprecation = :notify
|
||||||
|
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :sendmail
|
config.action_mailer.delivery_method = :sendmail
|
||||||
# Defaults to:
|
# Defaults to:
|
||||||
# # config.action_mailer.sendmail_settings = {
|
# # config.action_mailer.sendmail_settings = {
|
||||||
|
|
|
@ -7,6 +7,6 @@ Grit::Blob.class_eval do
|
||||||
include Utils::Colorize
|
include Utils::Colorize
|
||||||
end
|
end
|
||||||
|
|
||||||
Grit::Commit.class_eval do
|
Grit::Commit.class_eval do
|
||||||
include CommitExt
|
include CommitExt
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Gitlab::Application.routes.draw do
|
Gitlab::Application.routes.draw do
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :users
|
resources :users
|
||||||
resources :projects
|
resources :projects
|
||||||
resources :team_members
|
resources :team_members
|
||||||
|
@ -10,7 +10,7 @@ Gitlab::Application.routes.draw do
|
||||||
root :to => "users#index"
|
root :to => "users#index"
|
||||||
end
|
end
|
||||||
|
|
||||||
get "errors/gitosis"
|
get "errors/gitosis"
|
||||||
get "profile/password", :to => "profile#password"
|
get "profile/password", :to => "profile#password"
|
||||||
put "profile/password", :to => "profile#password_update"
|
put "profile/password", :to => "profile#password_update"
|
||||||
put "profile/edit", :to => "profile#social_update"
|
put "profile/edit", :to => "profile#social_update"
|
||||||
|
@ -21,8 +21,8 @@ Gitlab::Application.routes.draw do
|
||||||
resources :keys
|
resources :keys
|
||||||
devise_for :users
|
devise_for :users
|
||||||
|
|
||||||
resources :projects, :except => [:new, :create, :index], :path => "/" do
|
resources :projects, :except => [:new, :create, :index], :path => "/" do
|
||||||
member do
|
member do
|
||||||
get "tree"
|
get "tree"
|
||||||
get "blob"
|
get "blob"
|
||||||
get "team"
|
get "team"
|
||||||
|
@ -32,7 +32,7 @@ Gitlab::Application.routes.draw do
|
||||||
get "tree/:commit_id" => "projects#tree"
|
get "tree/:commit_id" => "projects#tree"
|
||||||
get "tree/:commit_id/:path" => "projects#tree",
|
get "tree/:commit_id/:path" => "projects#tree",
|
||||||
:as => :tree_file,
|
:as => :tree_file,
|
||||||
:constraints => {
|
:constraints => {
|
||||||
:id => /[a-zA-Z0-9_\-]+/,
|
:id => /[a-zA-Z0-9_\-]+/,
|
||||||
:commit_id => /[a-zA-Z0-9]+/,
|
:commit_id => /[a-zA-Z0-9]+/,
|
||||||
:path => /.*/
|
:path => /.*/
|
||||||
|
@ -47,6 +47,9 @@ Gitlab::Application.routes.draw do
|
||||||
collection do
|
collection do
|
||||||
post :sort
|
post :sort
|
||||||
end
|
end
|
||||||
|
collection do
|
||||||
|
get :search
|
||||||
|
end
|
||||||
end
|
end
|
||||||
resources :notes, :only => [:create, :destroy]
|
resources :notes, :only => [:create, :destroy]
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,6 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
||||||
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
|
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
|
||||||
# t.token_authenticatable
|
# t.token_authenticatable
|
||||||
|
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
5
db/migrate/20111027051828_add_expires_at_to_snippets.rb
Normal file
5
db/migrate/20111027051828_add_expires_at_to_snippets.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class AddExpiresAtToSnippets < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :snippets, :expires_at, :datetime
|
||||||
|
end
|
||||||
|
end
|
8
db/migrate/20111027142641_change_note_note_to_text.rb
Normal file
8
db/migrate/20111027142641_change_note_note_to_text.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
class ChangeNoteNoteToText < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
change_column :notes, :note, :text, :limit => false
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
34
db/migrate/20111027152724_issue_conten_to_note.rb
Normal file
34
db/migrate/20111027152724_issue_conten_to_note.rb
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
class IssueContenToNote < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
puts "Issue content is deprecated -> move to notes"
|
||||||
|
Issue.find_each(:batch_size => 100) do |issue|
|
||||||
|
next if issue.content.blank?
|
||||||
|
note = Note.new(
|
||||||
|
:note => issue.content,
|
||||||
|
:project_id => issue.project_id,
|
||||||
|
:noteable => issue,
|
||||||
|
:created_at => issue.created_at,
|
||||||
|
:updated_at => issue.created_at
|
||||||
|
)
|
||||||
|
note.author_id = issue.author_id
|
||||||
|
|
||||||
|
if note.save
|
||||||
|
issue.update_attributes(:content => nil)
|
||||||
|
print "."
|
||||||
|
else
|
||||||
|
print "F"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
total = Issue.where("content is not null").count
|
||||||
|
|
||||||
|
if total > 0
|
||||||
|
puts "content of #{total} issues were not migrated"
|
||||||
|
else
|
||||||
|
puts "Done"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20111025134235) do
|
ActiveRecord::Schema.define(:version => 20111027152724) do
|
||||||
|
|
||||||
create_table "issues", :force => true do |t|
|
create_table "issues", :force => true do |t|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
|
@ -36,7 +36,7 @@ ActiveRecord::Schema.define(:version => 20111025134235) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "notes", :force => true do |t|
|
create_table "notes", :force => true do |t|
|
||||||
t.string "note"
|
t.text "note"
|
||||||
t.string "noteable_id"
|
t.string "noteable_id"
|
||||||
t.string "noteable_type"
|
t.string "noteable_type"
|
||||||
t.integer "author_id"
|
t.integer "author_id"
|
||||||
|
@ -65,6 +65,7 @@ ActiveRecord::Schema.define(:version => 20111025134235) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "file_name"
|
t.string "file_name"
|
||||||
|
t.datetime "expires_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "users", :force => true do |t|
|
create_table "users", :force => true do |t|
|
||||||
|
|
|
@ -17,7 +17,7 @@ module Color
|
||||||
|
|
||||||
def command(string)
|
def command(string)
|
||||||
`#{string}`
|
`#{string}`
|
||||||
if $?.to_i > 0
|
if $?.to_i > 0
|
||||||
puts red " == #{string} - FAIL"
|
puts red " == #{string} - FAIL"
|
||||||
puts red " == Error during configure"
|
puts red " == Error during configure"
|
||||||
exit
|
exit
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module CommitExt
|
module CommitExt
|
||||||
def safe_message
|
def safe_message
|
||||||
message.encode("UTF-8",
|
message.encode("UTF-8",
|
||||||
:invalid => :replace,
|
:invalid => :replace,
|
||||||
:undef => :replace,
|
:undef => :replace,
|
||||||
:universal_newline => true,
|
:universal_newline => true,
|
||||||
:replace => "")
|
:replace => "")
|
||||||
rescue
|
rescue
|
||||||
"-- invalid encoding for commit message"
|
"-- invalid encoding for commit message"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ class FileSizeValidator < ActiveModel::EachValidator
|
||||||
|
|
||||||
def validate_each(record, attribute, value)
|
def validate_each(record, attribute, value)
|
||||||
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
|
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
|
||||||
|
|
||||||
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
|
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
|
||||||
|
|
||||||
CHECKS.each do |key, validity_check|
|
CHECKS.each do |key, validity_check|
|
||||||
|
@ -53,7 +53,7 @@ class FileSizeValidator < ActiveModel::EachValidator
|
||||||
record.errors.add(attribute, MESSAGES[key], errors_options)
|
record.errors.add(attribute, MESSAGES[key], errors_options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def help
|
def help
|
||||||
Helper.instance
|
Helper.instance
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module Utils
|
module Utils
|
||||||
module FileHelper
|
module FileHelper
|
||||||
def binary?(string)
|
def binary?(string)
|
||||||
string.each_byte do |x|
|
string.each_byte do |x|
|
||||||
x.nonzero? or return true
|
x.nonzero? or return true
|
||||||
end
|
end
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
width: 750px;
|
width: 750px;
|
||||||
|
@ -57,7 +56,6 @@
|
||||||
padding-right: 30px;
|
padding-right: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
background-image: url("/assets/rails.png");
|
background-image: url("/assets/rails.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
@ -71,7 +69,6 @@
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#about h3 {
|
#about h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
@ -112,7 +109,6 @@
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#getting-started {
|
#getting-started {
|
||||||
border-top: 1px solid #ccc;
|
border-top: 1px solid #ccc;
|
||||||
margin-top: 25px;
|
margin-top: 25px;
|
||||||
|
@ -149,7 +145,6 @@
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#sidebar ul {
|
#sidebar ul {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
|
@ -32,7 +32,6 @@ end
|
||||||
|
|
||||||
Factory.add(:issue, Issue) do |obj|
|
Factory.add(:issue, Issue) do |obj|
|
||||||
obj.title = Faker::Lorem.sentence
|
obj.title = Faker::Lorem.sentence
|
||||||
obj.content = Faker::Lorem.sentences
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Factory.add(:snippet, Snippet) do |obj|
|
Factory.add(:snippet, Snippet) do |obj|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Factory
|
class Factory
|
||||||
@factories = {}
|
@factories = {}
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def add(name, klass, &block)
|
def add(name, klass, &block)
|
||||||
@factories[name] = [klass, block]
|
@factories[name] = [klass, block]
|
||||||
end
|
end
|
||||||
|
@ -13,10 +13,10 @@ class Factory
|
||||||
def new(name, opts)
|
def new(name, opts)
|
||||||
factory = @factories[name]
|
factory = @factories[name]
|
||||||
factory[0].new.tap do |obj|
|
factory[0].new.tap do |obj|
|
||||||
factory[1].call(obj)
|
factory[1].call(obj)
|
||||||
end.tap do |obj|
|
end.tap do |obj|
|
||||||
opts.each do |k, opt|
|
opts.each do |k, opt|
|
||||||
obj.send("#{k}=", opt)
|
obj.send("#{k}=", opt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe Issue do
|
||||||
it { should validate_presence_of(:assignee_id) }
|
it { should validate_presence_of(:assignee_id) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Scope" do
|
describe "Scope" do
|
||||||
it { Issue.should respond_to :closed }
|
it { Issue.should respond_to :closed }
|
||||||
it { Issue.should respond_to :opened }
|
it { Issue.should respond_to :opened }
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe Key do
|
||||||
it { should validate_presence_of(:key) }
|
it { should validate_presence_of(:key) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Methods" do
|
describe "Methods" do
|
||||||
it { should respond_to :projects }
|
it { should respond_to :projects }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue