Merge branch 'dev'

Conflicts:
	app/assets/images/ajax-loader.gif
	public/favicon.ico
This commit is contained in:
Dmitriy Zaporozhets 2011-11-06 21:07:56 +02:00
commit b8ca1d62c4
195 changed files with 6402 additions and 1158 deletions

11
Gemfile
View file

@ -5,7 +5,7 @@ gem 'rails', '3.1.0'
gem 'sqlite3'
gem 'devise', "1.4.7"
gem 'stamp'
gem 'will_paginate', '~> 3.0'
gem 'kaminari'
gem 'haml-rails'
gem 'jquery-rails'
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
@ -16,10 +16,12 @@ gem 'faker'
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
gem "inifile"
gem "pygments.rb", "0.2.3"
gem "kaminari"
gem "thin"
gem "git"
gem "acts_as_list"
gem 'rdiscount'
gem 'acts-as-taggable-on', '~>2.1.0'
group :assets do
gem 'sass-rails', " ~> 3.1.0"
@ -27,14 +29,15 @@ group :assets do
gem 'uglifier'
end
group :development do
group :development do
gem 'letter_opener'
gem 'rails-footnotes', '>= 3.7.5.rc4'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
end
group :development, :test do
gem 'rspec-rails'
gem 'shoulda'
gem "shoulda", "~> 3.0.0.beta2"
gem 'capybara'
gem 'autotest'
gem 'autotest-rails'

View file

@ -54,6 +54,8 @@ GEM
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
acts-as-taggable-on (2.1.1)
rails
acts_as_list (0.1.4)
addressable (2.2.6)
ansi (1.3.0)
@ -119,6 +121,8 @@ GEM
rails (>= 3.0.0)
launchy (2.0.5)
addressable (~> 2.2.6)
letter_opener (0.0.2)
launchy
libv8 (3.3.10.2)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
@ -161,6 +165,7 @@ GEM
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdiscount (1.6.8)
rdoc (3.9.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
@ -200,7 +205,11 @@ GEM
ffi (>= 1.0.7)
json_pure
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)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
@ -232,7 +241,6 @@ GEM
multi_json (>= 1.0.2)
warden (1.0.5)
rack (>= 1.0)
will_paginate (3.0.0)
xpath (0.1.4)
nokogiri (~> 1.3)
@ -240,6 +248,7 @@ PLATFORMS
ruby
DEPENDENCIES
acts-as-taggable-on (~> 2.1.0)
acts_as_list
annotate!
autotest
@ -258,14 +267,16 @@ DEPENDENCIES
jquery-rails
kaminari
launchy
letter_opener
pygments.rb (= 0.2.3)
rails (= 3.1.0)
rails-footnotes (>= 3.7.5.rc4)
rdiscount
rspec-rails
ruby-debug19
sass-rails (~> 3.1.0)
seed-fu!
shoulda
shoulda (~> 3.0.0.beta2)
simplecov
six
sqlite3
@ -274,4 +285,3 @@ DEPENDENCIES
thin
turn
uglifier
will_paginate (~> 3.0)

View file

@ -1,4 +1,4 @@
[Dolphin]
ShowPreview=true
Timestamp=2011,9,14,20,34,18
Timestamp=2011,10,28,13,16,25
Version=2

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -5,11 +5,15 @@
// the compiled file.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require jquery.ui.selectmenu
//= require jquery.tagify
//= require jquery.cookie
//= require_tree .
$(function(){
$(".one_click_select").click(function(){
$(".one_click_select").live("click", function(){
$(this).select();
});
@ -17,6 +21,6 @@ $(function(){
$('select#tag').selectmenu({style:'popup', width:200});
});
function updatePage(){
$.ajax({type: "GET", url: location.href, dataType: "script"});
function updatePage(data){
$.ajax({type: "GET", url: location.href, data: data, dataType: "script"});
}

View file

@ -0,0 +1,901 @@
// Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com
//
// Version 0.9.5
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
// This file is generated by `cake build`, do not edit it by hand.
(function() {
var SelectParser;
SelectParser = (function() {
function SelectParser() {
this.options_index = 0;
this.parsed = [];
}
SelectParser.prototype.add_node = function(child) {
if (child.nodeName === "OPTGROUP") {
return this.add_group(child);
} else {
return this.add_option(child);
}
};
SelectParser.prototype.add_group = function(group) {
var group_position, option, _i, _len, _ref, _results;
group_position = this.parsed.length;
this.parsed.push({
array_index: group_position,
group: true,
label: group.label,
children: 0,
disabled: group.disabled
});
_ref = group.childNodes;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
option = _ref[_i];
_results.push(this.add_option(option, group_position, group.disabled));
}
return _results;
};
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
if (option.nodeName === "OPTION") {
if (option.text !== "") {
if (group_position != null) {
this.parsed[group_position].children += 1;
}
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
value: option.value,
text: option.text,
html: option.innerHTML,
selected: option.selected,
disabled: group_disabled === true ? group_disabled : option.disabled,
group_array_index: group_position,
classes: option.className,
style: option.style.cssText
});
} else {
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
empty: true
});
}
return this.options_index += 1;
}
};
return SelectParser;
})();
SelectParser.select_to_array = function(select) {
var child, parser, _i, _len, _ref;
parser = new SelectParser();
_ref = select.childNodes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
child = _ref[_i];
parser.add_node(child);
}
return parser.parsed;
};
this.SelectParser = SelectParser;
}).call(this);
(function() {
/*
Chosen source: generate output using 'cake build'
Copyright (c) 2011 by Harvest
*/
var AbstractChosen, root;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
root = this;
AbstractChosen = (function() {
function AbstractChosen(form_field, options) {
this.form_field = form_field;
this.options = options != null ? options : {};
this.set_default_values();
this.is_multiple = this.form_field.multiple;
this.default_text_default = this.is_multiple ? "Select Some Options" : "Select an Option";
this.setup();
this.set_up_html();
this.register_observers();
this.finish_setup();
}
AbstractChosen.prototype.set_default_values = function() {
this.click_test_action = __bind(function(evt) {
return this.test_active_click(evt);
}, this);
this.activate_action = __bind(function(evt) {
return this.activate_field(evt);
}, this);
this.active_field = false;
this.mouse_on_container = false;
this.results_showing = false;
this.result_highlighted = null;
this.result_single_selected = null;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.disable_search_threshold = this.options.disable_search_threshold || 0;
this.choices = 0;
return this.results_none_found = this.options.no_results_text || "No results match";
};
AbstractChosen.prototype.mouse_enter = function() {
return this.mouse_on_container = true;
};
AbstractChosen.prototype.mouse_leave = function() {
return this.mouse_on_container = false;
};
AbstractChosen.prototype.input_focus = function(evt) {
if (!this.active_field) {
return setTimeout((__bind(function() {
return this.container_mousedown();
}, this)), 50);
}
};
AbstractChosen.prototype.input_blur = function(evt) {
if (!this.mouse_on_container) {
this.active_field = false;
return setTimeout((__bind(function() {
return this.blur_test();
}, this)), 100);
}
};
AbstractChosen.prototype.result_add_option = function(option) {
var classes, style;
if (!option.disabled) {
option.dom_id = this.container_id + "_o_" + option.array_index;
classes = option.selected && this.is_multiple ? [] : ["active-result"];
if (option.selected) {
classes.push("result-selected");
}
if (option.group_array_index != null) {
classes.push("group-option");
}
if (option.classes !== "") {
classes.push(option.classes);
}
style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
} else {
return "";
}
};
AbstractChosen.prototype.results_update_field = function() {
this.result_clear_highlight();
this.result_single_selected = null;
return this.results_build();
};
AbstractChosen.prototype.results_toggle = function() {
if (this.results_showing) {
return this.results_hide();
} else {
return this.results_show();
}
};
AbstractChosen.prototype.results_search = function(evt) {
if (this.results_showing) {
return this.winnow_results();
} else {
return this.results_show();
}
};
AbstractChosen.prototype.keyup_checker = function(evt) {
var stroke, _ref;
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
this.search_field_scale();
switch (stroke) {
case 8:
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
return this.keydown_backstroke();
} else if (!this.pending_backstroke) {
this.result_clear_highlight();
return this.results_search();
}
break;
case 13:
evt.preventDefault();
if (this.results_showing) {
return this.result_select(evt);
}
break;
case 27:
if (this.results_showing) {
return this.results_hide();
}
break;
case 9:
case 38:
case 40:
case 16:
case 91:
case 17:
break;
default:
return this.results_search();
}
};
AbstractChosen.prototype.generate_field_id = function() {
var new_id;
new_id = this.generate_random_id();
this.form_field.id = new_id;
return new_id;
};
AbstractChosen.prototype.generate_random_char = function() {
var chars, newchar, rand;
chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";
rand = Math.floor(Math.random() * chars.length);
return newchar = chars.substring(rand, rand + 1);
};
return AbstractChosen;
})();
root.AbstractChosen = AbstractChosen;
}).call(this);
(function() {
/*
Chosen source: generate output using 'cake build'
Copyright (c) 2011 by Harvest
*/
var $, Chosen, get_side_border_padding, root;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
root = this;
$ = jQuery;
$.fn.extend({
chosen: function(options) {
if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) {
return this;
}
return $(this).each(function(input_field) {
if (!($(this)).hasClass("chzn-done")) {
return new Chosen(this, options);
}
});
}
});
Chosen = (function() {
__extends(Chosen, AbstractChosen);
function Chosen() {
Chosen.__super__.constructor.apply(this, arguments);
}
Chosen.prototype.setup = function() {
this.form_field_jq = $(this.form_field);
return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
};
Chosen.prototype.finish_setup = function() {
return this.form_field_jq.addClass("chzn-done");
};
Chosen.prototype.set_up_html = function() {
var container_div, dd_top, dd_width, sf_width;
this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id();
this.container_id += "_chzn";
this.f_width = this.form_field_jq.outerWidth();
this.default_text = this.form_field_jq.data('placeholder') ? this.form_field_jq.data('placeholder') : this.default_text_default;
container_div = $("<div />", {
id: this.container_id,
"class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''),
style: 'width: ' + this.f_width + 'px;'
});
if (this.is_multiple) {
container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
} else {
container_div.html('<a href="javascript:void(0)" class="chzn-single"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
}
this.form_field_jq.hide().after(container_div);
this.container = $('#' + this.container_id);
this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
this.dropdown = this.container.find('div.chzn-drop').first();
dd_top = this.container.height();
dd_width = this.f_width - get_side_border_padding(this.dropdown);
this.dropdown.css({
"width": dd_width + "px",
"top": dd_top + "px"
});
this.search_field = this.container.find('input').first();
this.search_results = this.container.find('ul.chzn-results').first();
this.search_field_scale();
this.search_no_results = this.container.find('li.no-results').first();
if (this.is_multiple) {
this.search_choices = this.container.find('ul.chzn-choices').first();
this.search_container = this.container.find('li.search-field').first();
} else {
this.search_container = this.container.find('div.chzn-search').first();
this.selected_item = this.container.find('.chzn-single').first();
sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
this.search_field.css({
"width": sf_width + "px"
});
}
this.results_build();
this.set_tab_index();
return this.form_field_jq.trigger("liszt:ready", {
chosen: this
});
};
Chosen.prototype.register_observers = function() {
this.container.mousedown(__bind(function(evt) {
return this.container_mousedown(evt);
}, this));
this.container.mouseup(__bind(function(evt) {
return this.container_mouseup(evt);
}, this));
this.container.mouseenter(__bind(function(evt) {
return this.mouse_enter(evt);
}, this));
this.container.mouseleave(__bind(function(evt) {
return this.mouse_leave(evt);
}, this));
this.search_results.mouseup(__bind(function(evt) {
return this.search_results_mouseup(evt);
}, this));
this.search_results.mouseover(__bind(function(evt) {
return this.search_results_mouseover(evt);
}, this));
this.search_results.mouseout(__bind(function(evt) {
return this.search_results_mouseout(evt);
}, this));
this.form_field_jq.bind("liszt:updated", __bind(function(evt) {
return this.results_update_field(evt);
}, this));
this.search_field.blur(__bind(function(evt) {
return this.input_blur(evt);
}, this));
this.search_field.keyup(__bind(function(evt) {
return this.keyup_checker(evt);
}, this));
this.search_field.keydown(__bind(function(evt) {
return this.keydown_checker(evt);
}, this));
if (this.is_multiple) {
this.search_choices.click(__bind(function(evt) {
return this.choices_click(evt);
}, this));
return this.search_field.focus(__bind(function(evt) {
return this.input_focus(evt);
}, this));
}
};
Chosen.prototype.search_field_disabled = function() {
this.is_disabled = this.form_field_jq[0].disabled;
if (this.is_disabled) {
this.container.addClass('chzn-disabled');
this.search_field[0].disabled = true;
if (!this.is_multiple) {
this.selected_item.unbind("focus", this.activate_action);
}
return this.close_field();
} else {
this.container.removeClass('chzn-disabled');
this.search_field[0].disabled = false;
if (!this.is_multiple) {
return this.selected_item.bind("focus", this.activate_action);
}
}
};
Chosen.prototype.container_mousedown = function(evt) {
var target_closelink;
if (!this.is_disabled) {
target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
if (evt && evt.type === "mousedown") {
evt.stopPropagation();
}
if (!this.pending_destroy_click && !target_closelink) {
if (!this.active_field) {
if (this.is_multiple) {
this.search_field.val("");
}
$(document).click(this.click_test_action);
this.results_show();
} else if (!this.is_multiple && evt && ($(evt.target) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) {
evt.preventDefault();
this.results_toggle();
}
return this.activate_field();
} else {
return this.pending_destroy_click = false;
}
}
};
Chosen.prototype.container_mouseup = function(evt) {
if (evt.target.nodeName === "ABBR") {
return this.results_reset(evt);
}
};
Chosen.prototype.blur_test = function(evt) {
if (!this.active_field && this.container.hasClass("chzn-container-active")) {
return this.close_field();
}
};
Chosen.prototype.close_field = function() {
$(document).unbind("click", this.click_test_action);
if (!this.is_multiple) {
this.selected_item.attr("tabindex", this.search_field.attr("tabindex"));
this.search_field.attr("tabindex", -1);
}
this.active_field = false;
this.results_hide();
this.container.removeClass("chzn-container-active");
this.winnow_results_clear();
this.clear_backstroke();
this.show_search_field_default();
return this.search_field_scale();
};
Chosen.prototype.activate_field = function() {
if (!this.is_multiple && !this.active_field) {
this.search_field.attr("tabindex", this.selected_item.attr("tabindex"));
this.selected_item.attr("tabindex", -1);
}
this.container.addClass("chzn-container-active");
this.active_field = true;
this.search_field.val(this.search_field.val());
return this.search_field.focus();
};
Chosen.prototype.test_active_click = function(evt) {
if ($(evt.target).parents('#' + this.container_id).length) {
return this.active_field = true;
} else {
return this.close_field();
}
};
Chosen.prototype.results_build = function() {
var content, data, startTime, _i, _len, _ref;
startTime = new Date();
this.parsing = true;
this.results_data = root.SelectParser.select_to_array(this.form_field);
if (this.is_multiple && this.choices > 0) {
this.search_choices.find("li.search-choice").remove();
this.choices = 0;
} else if (!this.is_multiple) {
this.selected_item.find("span").text(this.default_text);
if (this.form_field.options.length <= this.disable_search_threshold) {
this.container.addClass("chzn-container-single-nosearch");
} else {
this.container.removeClass("chzn-container-single-nosearch");
}
}
content = '';
_ref = this.results_data;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
data = _ref[_i];
if (data.group) {
content += this.result_add_group(data);
} else if (!data.empty) {
content += this.result_add_option(data);
if (data.selected && this.is_multiple) {
this.choice_build(data);
} else if (data.selected && !this.is_multiple) {
this.selected_item.find("span").text(data.text);
if (this.allow_single_deselect) {
this.single_deselect_control_build();
}
}
}
}
this.search_field_disabled();
this.show_search_field_default();
this.search_field_scale();
this.search_results.html(content);
return this.parsing = false;
};
Chosen.prototype.result_add_group = function(group) {
if (!group.disabled) {
group.dom_id = this.container_id + "_g_" + group.array_index;
return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
} else {
return "";
}
};
Chosen.prototype.result_do_highlight = function(el) {
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
if (el.length) {
this.result_clear_highlight();
this.result_highlight = el;
this.result_highlight.addClass("highlighted");
maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
visible_top = this.search_results.scrollTop();
visible_bottom = maxHeight + visible_top;
high_top = this.result_highlight.position().top + this.search_results.scrollTop();
high_bottom = high_top + this.result_highlight.outerHeight();
if (high_bottom >= visible_bottom) {
return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
} else if (high_top < visible_top) {
return this.search_results.scrollTop(high_top);
}
}
};
Chosen.prototype.result_clear_highlight = function() {
if (this.result_highlight) {
this.result_highlight.removeClass("highlighted");
}
return this.result_highlight = null;
};
Chosen.prototype.results_show = function() {
var dd_top;
if (!this.is_multiple) {
this.selected_item.addClass("chzn-single-with-drop");
if (this.result_single_selected) {
this.result_do_highlight(this.result_single_selected);
}
}
dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
this.dropdown.css({
"top": dd_top + "px",
"left": 0
});
this.results_showing = true;
this.search_field.focus();
this.search_field.val(this.search_field.val());
return this.winnow_results();
};
Chosen.prototype.results_hide = function() {
if (!this.is_multiple) {
this.selected_item.removeClass("chzn-single-with-drop");
}
this.result_clear_highlight();
this.dropdown.css({
"left": "-9000px"
});
return this.results_showing = false;
};
Chosen.prototype.set_tab_index = function(el) {
var ti;
if (this.form_field_jq.attr("tabindex")) {
ti = this.form_field_jq.attr("tabindex");
this.form_field_jq.attr("tabindex", -1);
if (this.is_multiple) {
return this.search_field.attr("tabindex", ti);
} else {
this.selected_item.attr("tabindex", ti);
return this.search_field.attr("tabindex", -1);
}
}
};
Chosen.prototype.show_search_field_default = function() {
if (this.is_multiple && this.choices < 1 && !this.active_field) {
this.search_field.val(this.default_text);
return this.search_field.addClass("default");
} else {
this.search_field.val("");
return this.search_field.removeClass("default");
}
};
Chosen.prototype.search_results_mouseup = function(evt) {
var target;
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
if (target.length) {
this.result_highlight = target;
return this.result_select(evt);
}
};
Chosen.prototype.search_results_mouseover = function(evt) {
var target;
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
if (target) {
return this.result_do_highlight(target);
}
};
Chosen.prototype.search_results_mouseout = function(evt) {
if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
return this.result_clear_highlight();
}
};
Chosen.prototype.choices_click = function(evt) {
evt.preventDefault();
if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
return this.results_show();
}
};
Chosen.prototype.choice_build = function(item) {
var choice_id, link;
choice_id = this.container_id + "_c_" + item.array_index;
this.choices += 1;
this.search_container.before('<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>');
link = $('#' + choice_id).find("a").first();
return link.click(__bind(function(evt) {
return this.choice_destroy_link_click(evt);
}, this));
};
Chosen.prototype.choice_destroy_link_click = function(evt) {
evt.preventDefault();
if (!this.is_disabled) {
this.pending_destroy_click = true;
return this.choice_destroy($(evt.target));
} else {
return evt.stopPropagation;
}
};
Chosen.prototype.choice_destroy = function(link) {
this.choices -= 1;
this.show_search_field_default();
if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
this.results_hide();
}
this.result_deselect(link.attr("rel"));
return link.parents('li').first().remove();
};
Chosen.prototype.results_reset = function(evt) {
this.form_field.options[0].selected = true;
this.selected_item.find("span").text(this.default_text);
this.show_search_field_default();
$(evt.target).remove();
this.form_field_jq.trigger("change");
if (this.active_field) {
return this.results_hide();
}
};
Chosen.prototype.result_select = function(evt) {
var high, high_id, item, position;
if (this.result_highlight) {
high = this.result_highlight;
high_id = high.attr("id");
this.result_clear_highlight();
if (this.is_multiple) {
this.result_deactivate(high);
} else {
this.search_results.find(".result-selected").removeClass("result-selected");
this.result_single_selected = high;
}
high.addClass("result-selected");
position = high_id.substr(high_id.lastIndexOf("_") + 1);
item = this.results_data[position];
item.selected = true;
this.form_field.options[item.options_index].selected = true;
if (this.is_multiple) {
this.choice_build(item);
} else {
this.selected_item.find("span").first().text(item.text);
if (this.allow_single_deselect) {
this.single_deselect_control_build();
}
}
if (!(evt.metaKey && this.is_multiple)) {
this.results_hide();
}
this.search_field.val("");
this.form_field_jq.trigger("change");
return this.search_field_scale();
}
};
Chosen.prototype.result_activate = function(el) {
return el.addClass("active-result");
};
Chosen.prototype.result_deactivate = function(el) {
return el.removeClass("active-result");
};
Chosen.prototype.result_deselect = function(pos) {
var result, result_data;
result_data = this.results_data[pos];
result_data.selected = false;
this.form_field.options[result_data.options_index].selected = false;
result = $("#" + this.container_id + "_o_" + pos);
result.removeClass("result-selected").addClass("active-result").show();
this.result_clear_highlight();
this.winnow_results();
this.form_field_jq.trigger("change");
return this.search_field_scale();
};
Chosen.prototype.single_deselect_control_build = function() {
if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
}
};
Chosen.prototype.winnow_results = function() {
var found, option, part, parts, regex, result_id, results, searchText, startTime, startpos, text, zregex, _i, _j, _len, _len2, _ref;
startTime = new Date();
this.no_results_clear();
results = 0;
searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
_ref = this.results_data;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
option = _ref[_i];
if (!option.disabled && !option.empty) {
if (option.group) {
$('#' + option.dom_id).hide();
} else if (!(this.is_multiple && option.selected)) {
found = false;
result_id = option.dom_id;
if (regex.test(option.html)) {
found = true;
results += 1;
} else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
parts = option.html.replace(/\[|\]/g, "").split(" ");
if (parts.length) {
for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
part = parts[_j];
if (regex.test(part)) {
found = true;
results += 1;
}
}
}
}
if (found) {
if (searchText.length) {
startpos = option.html.search(zregex);
text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
} else {
text = option.html;
}
if ($("#" + result_id).html !== text) {
$("#" + result_id).html(text);
}
this.result_activate($("#" + result_id));
if (option.group_array_index != null) {
$("#" + this.results_data[option.group_array_index].dom_id).show();
}
} else {
if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
this.result_clear_highlight();
}
this.result_deactivate($("#" + result_id));
}
}
}
}
if (results < 1 && searchText.length) {
return this.no_results(searchText);
} else {
return this.winnow_results_set_highlight();
}
};
Chosen.prototype.winnow_results_clear = function() {
var li, lis, _i, _len, _results;
this.search_field.val("");
lis = this.search_results.find("li");
_results = [];
for (_i = 0, _len = lis.length; _i < _len; _i++) {
li = lis[_i];
li = $(li);
_results.push(li.hasClass("group-result") ? li.show() : !this.is_multiple || !li.hasClass("result-selected") ? this.result_activate(li) : void 0);
}
return _results;
};
Chosen.prototype.winnow_results_set_highlight = function() {
var do_high, selected_results;
if (!this.result_highlight) {
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
if (do_high != null) {
return this.result_do_highlight(do_high);
}
}
};
Chosen.prototype.no_results = function(terms) {
var no_results_html;
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
no_results_html.find("span").first().html(terms);
return this.search_results.append(no_results_html);
};
Chosen.prototype.no_results_clear = function() {
return this.search_results.find(".no-results").remove();
};
Chosen.prototype.keydown_arrow = function() {
var first_active, next_sib;
if (!this.result_highlight) {
first_active = this.search_results.find("li.active-result").first();
if (first_active) {
this.result_do_highlight($(first_active));
}
} else if (this.results_showing) {
next_sib = this.result_highlight.nextAll("li.active-result").first();
if (next_sib) {
this.result_do_highlight(next_sib);
}
}
if (!this.results_showing) {
return this.results_show();
}
};
Chosen.prototype.keyup_arrow = function() {
var prev_sibs;
if (!this.results_showing && !this.is_multiple) {
return this.results_show();
} else if (this.result_highlight) {
prev_sibs = this.result_highlight.prevAll("li.active-result");
if (prev_sibs.length) {
return this.result_do_highlight(prev_sibs.first());
} else {
if (this.choices > 0) {
this.results_hide();
}
return this.result_clear_highlight();
}
}
};
Chosen.prototype.keydown_backstroke = function() {
if (this.pending_backstroke) {
this.choice_destroy(this.pending_backstroke.find("a").first());
return this.clear_backstroke();
} else {
this.pending_backstroke = this.search_container.siblings("li.search-choice").last();
return this.pending_backstroke.addClass("search-choice-focus");
}
};
Chosen.prototype.clear_backstroke = function() {
if (this.pending_backstroke) {
this.pending_backstroke.removeClass("search-choice-focus");
}
return this.pending_backstroke = null;
};
Chosen.prototype.keydown_checker = function(evt) {
var stroke, _ref;
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
this.search_field_scale();
if (stroke !== 8 && this.pending_backstroke) {
this.clear_backstroke();
}
switch (stroke) {
case 8:
this.backstroke_length = this.search_field.val().length;
break;
case 9:
if (this.results_showing && !this.is_multiple) {
this.result_select(evt);
}
this.mouse_on_container = false;
break;
case 13:
evt.preventDefault();
break;
case 38:
evt.preventDefault();
this.keyup_arrow();
break;
case 40:
this.keydown_arrow();
break;
}
};
Chosen.prototype.search_field_scale = function() {
var dd_top, div, h, style, style_block, styles, w, _i, _len;
if (this.is_multiple) {
h = 0;
w = 0;
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
for (_i = 0, _len = styles.length; _i < _len; _i++) {
style = styles[_i];
style_block += style + ":" + this.search_field.css(style) + ";";
}
div = $('<div />', {
'style': style_block
});
div.text(this.search_field.val());
$('body').append(div);
w = div.width() + 25;
div.remove();
if (w > this.f_width - 10) {
w = this.f_width - 10;
}
this.search_field.css({
'width': w + 'px'
});
dd_top = this.container.height();
return this.dropdown.css({
"top": dd_top + "px"
});
}
};
Chosen.prototype.generate_random_id = function() {
var string;
string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
while ($("#" + string).length > 0) {
string += this.generate_random_char();
}
return string;
};
return Chosen;
})();
get_side_border_padding = function(elmt) {
var side_border_padding;
return side_border_padding = elmt.outerWidth() - elmt.width();
};
root.get_side_border_padding = get_side_border_padding;
}).call(this);

View file

@ -7,3 +7,51 @@ $(document).ready(function(){
}
});
});
var CommitsList = {
ref:null,
limit:0,
offset:0,
init:
function(ref, limit) {
this.ref=ref;
this.limit=limit;
this.offset=limit;
this.initLoadMore();
$('.loading').show();
},
getOld:
function() {
$('.loading').show();
$.ajax({
type: "GET",
url: location.href,
data: "limit=" + this.limit + "&offset=" + this.offset + "&ref=" + this.ref,
complete: function(){ $('.loading').hide()},
dataType: "script"});
},
append:
function(count, html) {
$("#commits_list").append(html);
if(count > 0) {
this.offset += count;
this.initLoadMore();
}
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
CommitsList.getOld();
}
});
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,87 @@
var NoteList = {
first_id: 0,
last_id: 0,
resource_name: null,
init:
function(resource_name, first_id, last_id) {
this.resource_name = resource_name;
this.first_id = first_id;
this.last_id = last_id;
this.initRefresh();
this.initLoadMore();
},
getOld:
function() {
$('.loading').show();
$.ajax({
type: "GET",
url: location.href,
data: "first_id=" + this.first_id,
complete: function(){ $('.loading').hide()},
dataType: "script"});
},
append:
function(id, html) {
this.first_id = id;
$("#notes-list").append(html);
this.initLoadMore();
},
replace:
function(fid, lid, html) {
this.first_id = fid;
this.last_id = lid;
$("#notes-list").html(html);
this.initLoadMore();
},
prepend:
function(id, html) {
this.last_id = id;
$("#notes-list").prepend(html);
},
getNew:
function() {
// refersh notes list
$.ajax({
type: "GET",
url: location.href,
data: "last_id=" + this.last_id,
dataType: "script"});
},
refresh:
function() {
// refersh notes list
$.ajax({
type: "GET",
url: location.href,
data: "first_id=" + this.first_id + "&last_id=" + this.last_id,
dataType: "script"});
},
initRefresh:
function() {
// init timer
var intNew = setInterval("NoteList.getNew()", 15000);
var intRefresh = setInterval("NoteList.refresh()", 90000);
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
NoteList.getOld();
}
});
}
}

View file

@ -8,7 +8,7 @@ $(document).ready(function(){
e.stopPropagation();
$(this).find("td.tree-item-file-name a").click();
return false;
}
}
});
$("#projects-list .project").live('click', function(e){

View file

@ -2,6 +2,9 @@
* 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
* 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 jquery-ui/jquery.tagify
*= require_self
*= require_tree .
*= require_tree .
*/

View file

@ -0,0 +1,367 @@
/* @group Base */
.chzn-container {
font-size: 13px;
position: relative;
display: inline-block;
zoom: 1;
*display: inline;
}
.chzn-container .chzn-drop {
background: #fff;
border: 1px solid #aaa;
border-top: 0;
position: absolute;
top: 29px;
left: 0;
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
-moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
-o-box-shadow : 0 4px 5px rgba(0,0,0,.15);
box-shadow : 0 4px 5px rgba(0,0,0,.15);
z-index: 999;
}
/* @end */
/* @group Single Chosen */
.chzn-container-single .chzn-single {
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%);
-webkit-border-radius: 4px;
-moz-border-radius : 4px;
border-radius : 4px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
border: 1px solid #aaa;
display: block;
overflow: hidden;
white-space: nowrap;
position: relative;
height: 26px;
line-height: 26px;
padding: 0 0 0 8px;
color: #444;
text-decoration: none;
}
.chzn-container-single .chzn-single span {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.chzn-container-single .chzn-single abbr {
display: block;
position: absolute;
right: 26px;
top: 8px;
width: 12px;
height: 13px;
font-size: 1px;
background: url(chosen-sprite.png) right top no-repeat;
}
.chzn-container-single .chzn-single abbr:hover {
background-position: right -11px;
}
.chzn-container-single .chzn-single div {
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius : 0 4px 4px 0;
border-radius : 0 4px 4px 0;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%);
border-left: 1px solid #aaa;
position: absolute;
right: 0;
top: 0;
display: block;
height: 100%;
width: 18px;
}
.chzn-container-single .chzn-single div b {
background: url('chosen-sprite.png') no-repeat 0 1px;
display: block;
width: 100%;
height: 100%;
}
.chzn-container-single .chzn-search {
padding: 3px 4px;
position: relative;
margin: 0;
white-space: nowrap;
z-index: 1010;
}
.chzn-container-single .chzn-search input {
background: #fff url('chosen-sprite.png') no-repeat 100% -22px;
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
margin: 1px 0;
padding: 4px 20px 4px 5px;
outline: 0;
border: 1px solid #aaa;
font-family: sans-serif;
font-size: 1em;
}
.chzn-container-single .chzn-drop {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius : 0 0 4px 4px;
border-radius : 0 0 4px 4px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
}
/* @end */
.chzn-container-single-nosearch .chzn-search input {
position: absolute;
left: -9000px;
}
/* @group Multi Chosen */
.chzn-container-multi .chzn-choices {
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%);
border: 1px solid #aaa;
margin: 0;
padding: 0;
cursor: text;
overflow: hidden;
height: auto !important;
height: 1%;
position: relative;
}
.chzn-container-multi .chzn-choices li {
float: left;
list-style: none;
}
.chzn-container-multi .chzn-choices .search-field {
white-space: nowrap;
margin: 0;
padding: 0;
}
.chzn-container-multi .chzn-choices .search-field input {
color: #666;
background: transparent !important;
border: 0 !important;
padding: 5px;
margin: 1px 0;
outline: 0;
-webkit-box-shadow: none;
-moz-box-shadow : none;
-o-box-shadow : none;
box-shadow : none;
}
.chzn-container-multi .chzn-choices .search-field .default {
color: #999;
}
.chzn-container-multi .chzn-choices .search-choice {
-webkit-border-radius: 3px;
-moz-border-radius : 3px;
border-radius : 3px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
background-color: #e4e4e4;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee));
background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%);
background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%);
background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%);
background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%);
color: #333;
border: 1px solid #b4b4b4;
line-height: 13px;
padding: 3px 19px 3px 6px;
margin: 3px 0 3px 5px;
position: relative;
}
.chzn-container-multi .chzn-choices .search-choice span {
cursor: default;
}
.chzn-container-multi .chzn-choices .search-choice-focus {
background: #d4d4d4;
}
.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
display: block;
position: absolute;
right: 3px;
top: 4px;
width: 12px;
height: 13px;
font-size: 1px;
background: url(chosen-sprite.png) right top no-repeat;
}
.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
background-position: right -11px;
}
.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
background-position: right -11px;
}
/* @end */
/* @group Results */
.chzn-container .chzn-results {
margin: 0 4px 4px 0;
max-height: 190px;
padding: 0 0 0 4px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
}
.chzn-container-multi .chzn-results {
margin: -1px 0 0;
padding: 0;
}
.chzn-container .chzn-results li {
display: none;
line-height: 80%;
padding: 7px 7px 8px;
margin: 0;
list-style: none;
}
.chzn-container .chzn-results .active-result {
cursor: pointer;
display: list-item;
}
.chzn-container .chzn-results .highlighted {
background: #3875d7;
color: #fff;
}
.chzn-container .chzn-results li em {
background: #feffde;
font-style: normal;
}
.chzn-container .chzn-results .highlighted em {
background: transparent;
}
.chzn-container .chzn-results .no-results {
background: #f4f4f4;
display: list-item;
}
.chzn-container .chzn-results .group-result {
cursor: default;
color: #999;
font-weight: bold;
}
.chzn-container .chzn-results .group-option {
padding-left: 20px;
}
.chzn-container-multi .chzn-drop .result-selected {
display: none;
}
/* @end */
/* @group Active */
.chzn-container-active .chzn-single {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
box-shadow : 0 0 5px rgba(0,0,0,.3);
border: 1px solid #5897fb;
}
.chzn-container-active .chzn-single-with-drop {
border: 1px solid #aaa;
-webkit-box-shadow: 0 1px 0 #fff inset;
-moz-box-shadow : 0 1px 0 #fff inset;
-o-box-shadow : 0 1px 0 #fff inset;
box-shadow : 0 1px 0 #fff inset;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
-webkit-border-bottom-left-radius : 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomleft : 0;
-moz-border-radius-bottomright: 0;
border-bottom-left-radius : 0;
border-bottom-right-radius: 0;
}
.chzn-container-active .chzn-single-with-drop div {
background: transparent;
border-left: none;
}
.chzn-container-active .chzn-single-with-drop div b {
background-position: -18px 1px;
}
.chzn-container-active .chzn-choices {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
box-shadow : 0 0 5px rgba(0,0,0,.3);
border: 1px solid #5897fb;
}
.chzn-container-active .chzn-choices .search-field input {
color: #111 !important;
}
/* @end */
/* @group Disabled Support */
.chzn-disabled {
cursor: default;
opacity:0.5 !important;
}
.chzn-disabled .chzn-single {
cursor: default;
}
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
cursor: default;
}
/* @group Right to Left */
.chzn-rtl { direction:rtl;text-align: right; }
.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; }
.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; }
.chzn-rtl .chzn-single div {
left: 0; right: auto;
border-left: none; border-right: 1px solid #aaaaaa;
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius : 4px 0 0 4px;
border-radius : 4px 0 0 4px;
}
.chzn-rtl .chzn-choices li { float: right; }
.chzn-rtl .chzn-choices .search-choice { padding: 3px 6px 3px 19px; margin: 3px 5px 3px 0; }
.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;}
.chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; }
.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; }
.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
.chzn-rtl .chzn-search input {
background: url('chosen-sprite.png') no-repeat -38px -22px, #ffffff;
background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
padding: 4px 5px 4px 20px;
}
/* @end */

View file

@ -1,4 +1,4 @@
@mixin round-borders-all($radius) {
@mixin round-borders-all($radius) {
border: 1px solid #eaeaea;
-moz-border-radius: $radius;
-webkit-border-radius: $radius;
@ -28,11 +28,11 @@ td.linenos{
.highlight pre{
}
.linenodiv pre {
.linenodiv pre {
white-space:pre-line;
}
td.linenos {
td.linenos {
background:#ECECEC;
color:#777;
padding:10px 0px 0px 10px;
@ -42,7 +42,7 @@ td.linenos {
}
td.code .highlight {
td.code .highlight {
overflow: auto;
}
table.highlighttable pre{
@ -53,9 +53,8 @@ table.highlighttable pre{
text-align:left;
}
.git-empty .highlight {
@include round-borders-all(4px);
@include round-borders-all(4px);
background:#eee;
padding:5px;
//overflow-x:scroll;
@ -71,10 +70,9 @@ table.highlighttable pre{
.shadow{
-webkit-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 }
.c { color: #888888; font-style: italic } /* Comment */
.err { color: #a61717; background-color: #e3d2d2 } /* Error */
@ -105,7 +103,7 @@ table.highlighttable pre{
.highlight .nb{color:#0086B3;} /* Name.Builtin */
.highlight .nc{color:#458;font-weight:bold;} /* Name.Class */
.highlight .no{color:#008080;} /* Name.Constant */
.highlight .ni{color:#800080;}
.highlight .ni{color:#800080;}
.highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */
.highlight .nf{color:#900;font-weight:bold;} /* Name.Function */
.highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */

View file

@ -2,7 +2,7 @@
// They will automatically be included in application.css.
// 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;
-moz-border-radius-bottomright: $radius;
@ -15,7 +15,7 @@
-webkit-border-bottom-right-radius: $radius;
}
@mixin round-borders-top($radius) {
@mixin round-borders-top($radius) {
border-top: 1px solid #eaeaea;
-moz-border-radius-topright: $radius;
@ -28,14 +28,14 @@
-webkit-border-top-right-radius: $radius;
}
@mixin round-borders-all($radius) {
@mixin round-borders-all($radius) {
border: 1px solid #eaeaea;
-moz-border-radius: $radius;
-webkit-border-radius: $radius;
border-radius: $radius;
}
@mixin hover-color {
@mixin hover-color {
background: #fff !important;
background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important;
background: -moz-linear-gradient(top,#fff,#FFF6BF) !important;
@ -46,47 +46,48 @@
border:1px solid #CCC;
margin-bottom:1em;
.diff_file_header {
.diff_file_header {
padding:5px 5px;
border-bottom:1px solid #CCC;
background: #eee;
}
.diff_file_content {
overflow-x: scroll;
.diff_file_content {
overflow:auto;
overflow-y:hidden;
background:#fff;
color:#333;
font-size: 12px;
font-family: 'Courier New', 'andale mono','lucida console',monospace;
}
.diff_file_content_image {
.diff_file_content_image {
background:#eee;
text-align:center;
img {
img {
padding:100px;
max-width:300px;
}
}
}
#logo {
&:hover {
#logo {
&:hover {
background:none;
}
}
.file_stats {
.file_stats {
margin-bottom:10px;
@include round-borders-all(4px);
span {
span {
border-top: 1px solid #eaeaea;
padding:5px 5px;
display:block;
&:first-child {
&:first-child {
border-top:none;
}
img {
img {
width:18px;
float:left;
margin-right: 6px;
@ -94,71 +95,22 @@
}
}
.round-borders {
.round-borders {
@include round-borders-all(4px);
padding: 4px 0px;
}
table.round-borders {
table.round-borders {
float:left;
}
.day-commits-table {
@include round-borders-all(4px);
padding: 4px 0px;
margin-bottom:10px;
display:block;
width:100%;
background: #E6F1F6;
.day-header {
padding:10px;
h3 {
margin:0px;
}
}
ul {
display:block;
list-style:none;
margin:0px;
padding:0px;
li.commit {
display:list-item;
padding:8px;
margin:0px;
background: #F7FBFC;
border-top: 1px solid #E2EAEE;
&:first-child {
border-top: 1px solid #E2EAEE;
}
&:nth-child(2n+1) {
background: white;
}
a.button {
width:85px;
padding:10px;
margin:0px;
float:right;
}
p {
margin-bottom: 3px;
font-size: 13px;
}
}
}
}
@mixin panel-color {
@mixin panel-color {
background: #111 !important;
background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important;
background: -moz-linear-gradient(top,#333,#111) !important;
background: transparent 9 !important;
}
#header-panel {
#header-panel {
@include panel-color;
height:40px;
position:fixed;
@ -178,23 +130,23 @@ table.round-borders {
color:white;
}
&.current {
&.current {
border-bottom: 3px solid #EAEAEA !important;
padding: 10px 20px 0;
color: #eaeaea;
}
}
.search-holder {
.search-holder {
float:left;
width:290px;
width:290px;
input {
@include round-borders-all(4px);
width:290px;
width:290px;
border-color:#888;
padding:5px;
background:#666;
color:#222;
&:focus {
&:focus {
background:#fff;
color:#000;
}
@ -211,28 +163,23 @@ table.round-borders {
padding:20px;
}
body {
background: #eaeaea;
}
a {
color: #111;
}
.diff_file_content{
.old_line, .new_line {
.old_line, .new_line {
background:#ECECEC;
color:#777;
width:15px;
width:30px;
float:left;
padding: 0px 10px;
padding: 0px 5px;
border-right: 1px solid #ccc;
}
}
.view_file_content{
.old_line, .new_line {
.old_line, .new_line {
background:#ECECEC;
color:#777;
width:15px;
@ -249,20 +196,20 @@ a {
border:1px solid #CCC;
margin-bottom:1em;
.view_file_header {
.view_file_header {
padding:5px 5px;
border-bottom:1px solid #CCC;
background: #eee;
}
.view_file_content {
.view_file_content {
background:#fff;
color:#514721;
font-size: 11px;
}
.view_file_content_image {
.view_file_content_image {
background:#eee;
text-align:center;
img {
img {
padding:100px;
max-width:300px;
}
@ -273,7 +220,7 @@ a {
}
input.ssh_project_url {
input.ssh_project_url {
padding:5px;
margin:0px;
float:right;
@ -281,53 +228,23 @@ input.ssh_project_url {
text-align:center;
}
.day-commits-table li.commit {
cursor:pointer;
&:hover {
@include hover-color;
}
}
/*
#FFF6BF
#FFD324
*/
#tree-slider tr.tree-item {
cursor:pointer;
&:hover {
@include hover-color;
td {
@include hover-color;
}
}
}
#projects-list .project {
#projects-list .project {
height:50px;
}
#tree-slider .tree-item,
#projects-list .project,
#snippets-table .snippet,
#issues-table .issue{
#issues-table .issue{
cursor:pointer;
&:hover {
@include hover-color;
td {
@include hover-color;
}
}
}
.clear {
.clear {
clear: both;
}
.top_project_menu {
a {
.top_project_menu {
a {
border-right: 1px solid #FFFFFF;
box-shadow: -1px 0 #DDDDDD inset;
color: #666;
@ -339,7 +256,7 @@ input.ssh_project_url {
text-shadow: 0 1px 0 #FFFFFF;
float:left;
&.current {
&.current {
background-color: #FFFFFF;
color: #222222;
}
@ -363,11 +280,11 @@ input.ssh_project_url {
.new_project,
.new_snippet,
.edit_snippet,
.edit_project {
.edit_project {
input[type='text'],
input[type='email'],
input[type='password'],
textarea {
textarea {
width:400px;
padding:8px;
font-size:14px;
@ -375,7 +292,7 @@ input.ssh_project_url {
}
}
.input_button {
.input_button {
//@include round-borders-all(4px);
padding:8px;
font-size:14px;
@ -387,23 +304,19 @@ input.ssh_project_url {
border-width: 1px;
}
tbody tr:nth-child(2n) td, tbody tr.even td {
background: none repeat scroll 0 0 #F7FBFC;
border-top: 1px solid #E2EAEE;
border-bottom: 1px solid #E2EAEE;
}
.top_menu_count {
background: none repeat scroll 0 0 #FFF6BF;
border-color: #FFD324;
color: #514721;
border: 1px solid #DDDDDD;
.top_menu_count {
background: none repeat scroll 0 0 white;
color: #333;
border-color: #4BB8D2;
padding: 2px;
font-size:12px;
position:relative;
top:-14px;
left:10px;
font-size:10px;
border-top:none;
text-align:center;
float:right;
width:25px;
}
#logo {
@ -415,9 +328,9 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
text-shadow: #555 1px 1px;
}
/** FALSH **/
/** FLASH **/
#flash_container {
#flash_container {
height:40px;
position:fixed;
z-index:1009;
@ -429,10 +342,11 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
cursor:pointer;
border-bottom:1px solid #777;
h4 {
h4 {
color:#444;
font-size:22px;
padding-top:5px;
margin:2px;
}
}
@ -460,50 +374,25 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
color: #0099FF;
}
&.hm {
&.hm {
margin: 0px 0px;
}
&.vm {
&.vm {
margin: 5px 0px;
}
}
/** Notes **/
#notes-list {
#notes-list {
display:block;
list-style:none;
margin:0px;
padding:0px;
li {
display:list-item;
padding:8px;
margin:0px;
background: #F7FBFC;
border-top: 1px solid #E2EAEE;
&:first-child {
border-top: none;
}
&:nth-child(2n+1) {
background: white;
}
p {
margin-bottom: 4px;
font-size: 13px;
color:#111;
}
}
cite {
&.ago {
color:#666;
}
}
}
.notes_count {
.notes_count {
background: none repeat scroll 0 0 #FFF6BF;
border-color: #FFD324;
color: #514721;
@ -515,36 +404,28 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
right: 6px;
top: 6px;
}
.note_author {
float:left;
width:60px;
}
.note_content {
float:left;
width:650px;
}
.issue_notes {
.note_content {
.issue_notes {
.note_content {
float:left;
width:400px;
}
}
#user_projects_limit{
width: 60px;
width: 60px;
}
.project_thumb {
.project_thumb {
margin:20px 0;
width: 250px;
float:left;
padding:20px;
text-align:center;
p, h4 {
p, h4 {
text-align:left;
}
.lbutton {
.lbutton {
float:left;
}
}
@ -559,8 +440,8 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
padding: 10px;
}
.recent_message_parent {
img {
.recent_message_parent {
img {
padding-right:10px;
}
@ -571,7 +452,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
&.dash_wall{
border-bottom: 2px solid orange;
span {
span {
background: orange;
color:black;
}
@ -579,14 +460,14 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
&.dash_issue{
border-bottom: 2px solid #ffbbbb;
span {
span {
background: #ffbbbb;
}
}
&.dash_commit{
border-bottom: 2px solid #bbbbff;
span{
span{
background: #bbbbff;
}
}
@ -594,27 +475,25 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
&.dash_snippet{
border-bottom: 2px solid #bbffbb;
span{
span{
background: #bbffbb;
}
}
span{
span{
border: 1px solid #aaa;
color:black;
padding:1px 4px;
}
h4 {
h4 {
margin-bottom:3px;
}
}
.commit,
.message,
#notes-list{
.author {
.message{
.author {
background: #eaeaea;
color: #333;
border: 1px solid #aaa;
@ -624,17 +503,17 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
}
/* Note textare */
#note_note {
#note_note {
height:100px;
width:97%;
font-size:14px;
}
.wall_page {
#note_note {
#new_note {
#note_note {
height:25px;
}
.attach_holder {
.attach_holder {
display:none;
}
}
@ -652,32 +531,146 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
@include round-borders-all(4px);
padding:2px 4px;
border:none;
text-shadow:none;
&.high {
&.high {
background: #D12F19;
color:white;
}
&.today {
&.today {
background: #44aa22;
color:white;
}
&.yours {
&.yours {
background: #4466cc;
color:white;
}
&.normal {
background: #2c5ca6;
color:white;
}
&.notes {
background: #2c5c66;
color:white;
}
}
#issues-table .issue {
&.critical {
#issues-table .issue {
&.critical {
td {
//background: #D12F19;
//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;
}
}
}
}
.left {
float:left;
}
.right {
float:right;
}
.width-50p{
width:50%;
}
.width-49p{
width:49%;
}
.width-30p{
width:30%;
}
.width-65p{
width:65%;
}
pre.commit_message {
white-space: pre-wrap;
}
#container {
min-height:100%;
}
.ui-selectmenu{
@include round-borders-all(4px);
margin-right:10px;
font-size:1.5em;
height:auto;
font-weight:bold;
.ui-selectmenu-status {
padding:3px 10px;
}
}
td.code {
width: 100%;
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
}
}
.highlight pre {
white-space: pre;
word-wrap:normal;
}
.highlighttable tr:hover {
background:white;
}
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
.project-refs-form {
span {
background: none !important;
position:static !important;
width:auto !important;
height: auto !important;
}
}
.project-refs-select {
width:200px;
}
.issues_filter {
margin-top:10px;
.left {
margin-right:15px;
}
}
.cgray { color:gray; }
.cred { color:#D12F19; }
.cgreen { color:#44aa22; }
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note img{float: left; margin-right: 10px;}
body.project-page #notes-list .note span.note-title{display: block;}
body.project-page #notes-list .note span.note-title{margin-bottom: 10px}
body.project-page #notes-list .note span.note-author{color: #999; font-weight: normal; font-style: italic;}
body.project-page #notes-list .note span.note-author strong{font-weight: bold; font-style: normal;}

661
app/assets/stylesheets/style.scss Executable file
View file

@ -0,0 +1,661 @@
/* HTML5 Boilerplate
* ==|== normalize ==========================================================
*/
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }
html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { margin: 0; font-size: 13px; line-height: 1.231; }
body, button, input, select, textarea { font-family: sans-serif; color: #222; }
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
a { color: #00e; }
a:hover { color: #06e; }
a:focus { outline: thin dotted; }
a:hover, a:active { outline: 0; }
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
ins { background: #ff9; color: #000; text-decoration: none; }
mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
pre, code, kbd, samp { font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 1em; }
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
q { quotes: none; }
q:before, q:after { content: ""; content: none; }
small { font-size: 85%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
dd { margin: 0 0 0 40px; }
nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; }
img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
svg:not(:root) { overflow: hidden; }
figure { margin: 0; }
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
label { cursor: pointer; }
legend { border: 0; *margin-left: -7px; padding: 0; }
button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
button, input { line-height: normal; *overflow: visible; }
table button, table input { *overflow: auto; }
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; }
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; }
input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
textarea { overflow: auto; vertical-align: top; resize: vertical; }
input:valid, textarea:valid { }
input:invalid, textarea:invalid { background-color: #f0dddd; }
table { border-collapse: collapse; border-spacing: 0; }
td { vertical-align: top; }
/* ==|== primary styles =====================================================
Author: Ricardo Rauch
========================================================================== */
/* 960gs */
.container_4{width:98%;margin-left:1%;margin-right:1%}.grid_1,.grid_2,.grid_3,.grid_4{display:inline;float:left;position:relative;margin-left:1%;margin-right:1%}.alpha{margin-left:0}.omega{margin-right:0}.container_4 .grid_1{width:23.0%}.container_4 .grid_2{width:48.0%}.container_4 .grid_3{width:73.0%}.container_4 .grid_4{width:98.0%}.container_4 .prefix_1{padding-left:25.0%}.container_4 .prefix_2{padding-left:50.0%}.container_4 .prefix_3{padding-left:75.0%}.container_4 .suffix_1{padding-right:25.0%}.container_4 .suffix_2{padding-right:50.0%}.container_4 .suffix_3{padding-right:75.0%}.container_4 .push_1{left:25.0%}.container_4 .push_2{left:50.0%}.container_4 .push_3{left:75.0%}.container_4 .pull_1{left:-25.0%}.container_4 .pull_2{left:-50.0%}.container_4 .pull_3{left:-75.0%}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0}.clearfix{display:inline-block}* html .clearfix{height:1%}.clearfix{display:block}
/* eo 960gs*/
/* Vars */
$color: "#4BB8D2";
$blue_link: "#2fa0bb";
/* eo Vars */
html{ -webkit-font-smoothing:antialiased; }
*{text-shadow: 0 1px 0 white}
body{font-size: 12px; background-color: #eee;}
a{text-decoration: none; font-weight: bold; color: #666}
a:hover{color: #333}
/* Typography */
h1,h2,h3,h4,h5{font-weight: normal; color: #666}
h2{margin: 1.5em 0}
/* eo Typography */
/* Forms */
input[type="text"]:focus, input[type="password"]:focus { outline: none; }
input.text{border: 1px solid #ccc; border-radius: 4px; display: block; padding: 10px}
/* eo Forms */
/* Tables */
table {width:100%; border: 1px solid #DEE2E3}
table thead{
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
table thead th{
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8));
background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8);
margin: 0;
font-weight: normal;
font-weight: bold;
text-align: left;
color: #97A0A5;
}
td, th{ padding: .9em 1em; vertical-align: middle; }
table thead .image{width:100px}
table tr:hover, .listed_items tr.odd:hover{background-color:#FFFFCF}
/* eo Tables */
/* Buttons */
.grey-button{
border-radius: 5px;
font-size: 12px;
font-weight: bold;
padding: 6px 20px;
border: 1px solid #999;
color: #666;
display: inline-block;
box-shadow: 0 1px 2px rgba(0,0,0,.3);
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #f7f7f7), to(#d5d5d5));
background-image: -webkit-linear-gradient(#f7f7f7 7.6%, #d5d5d5);
background-image: -moz-linear-gradient(#f7f7f7 7.6%, #d5d5d5);
background-image: -o-linear-gradient(#f7f7f7 7.6%, #d5d5d5);
}
.button{
padding: 10px 20px;
text-align: center;
display: inline-block;
border-radius: 5px;
color: #578E91;
font-size: 12px;
text-transform: uppercase;
border: 1px solid #8CE2E6;
background-image: -webkit-gradient(linear, 0 0, 0 34, color-stop(0.794, #dbf5f6), to(#c5eef0));
background-image: -webkit-linear-gradient(#dbf5f6 79.4%, #c5eef0);
background-image: -moz-linear-gradient(#dbf5f6 79.4%, #c5eef0);
background-image: -o-linear-gradient(#dbf5f6 79.4%, #c5eef0);
}
.button:hover {color: rgba(0,0,0,.8)}
.button.green {margin-right: 0; }
.button.yellow{
color: #908054;
border-color: #DDCDA1;
background-image: -webkit-gradient(linear, 0 0, 0 34, color-stop(0.794, #FFEFC3), to(#F3E3B7));
background-image: -webkit-linear-gradient(#FFEFC3 79.4%, #F3E3B7);
background-image: -moz-linear-gradient(#FFEFC3 79.4%, #F3E3B7);
background-image: -o-linear-gradient(#FFEFC3 79.4%, #F3E3B7);
}
.button.blue{
color: #417E97;
border-color: #b2cdec;
background-image: -webkit-gradient(linear, 0 0, 0 34, color-stop(0.794, #dbe8f6), to(#c7daf1));
background-image: -webkit-linear-gradient(#dbe8f6 79.4%, #c7daf1);
background-image: -moz-linear-gradient(#dbe8f6 79.4%, #c7daf1);
background-image: -o-linear-gradient(#dbe8f6 79.4%, #c7daf1);
}
.button-small{ text-shadow: none; padding: 4px 10px; }
.button-green{background: #A6B807; color: white}
/* eo Buttons */
/* UI Box */
.ui-box{border: 1px solid #DEDFE1; float: left; border-radius: 5px}
.ui-box h3{
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8));
background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8);
margin: 0;
padding: 1em;
font-size: 12px;
font-weight: normal;
font-weight: bold;
font-size: 16px;
border-bottom: 1px solid #DEDFE1;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.ui-box.ui-box-small h3{
padding: 8px 10px;
font-size: 12px;
}
.ui-box .data{padding: .5em 1em}
.ui-box .buttons{background-color: #f7f8f9; padding: 1em;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
.ui-box .buttons .button{padding: 8px 9px; font-size: 11px}
.ui-box.hover:hover{box-shadow: 0 0 10px rgba(0,0,0,.1); border: 1px solid #ccc;
-webkit-transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715);
-moz-transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715);
-o-transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715);
transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715);
}
/* eo UI Box */
/* Login Page */
body.login-page{background-color: #f1f1f1; padding-top: 10%}
.login-box{
width: 304px;
position: relative;
border-radius: 5px;
margin: auto;
padding: 20px;
background: white;
box-shadow: rgba(0, 0, 0, 0.07) 0 1px 0,white 0 2px 0,rgba(0, 0, 0, 0.07) 0 3px 0,white 0 4px 0, rgba(0, 0, 0, 0.07) 0 5px 0;
}
.login-box .login-logo{
margin: 10px 0 30px 0;
display: block;
}
.login-box input.text{background-color: #f1f1f1; font-size: 16px; border-radius: 0; padding: 14px 10px; width: 280px}
.login-box input.text.top{
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.login-box input.text.bottom{
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-top: 0;
margin-bottom: 20px;
}
.login-box a.forgot{float: right; padding-top: 6px}
/* Icons */
.directory, .file{
display: inline-block;
margin-right: 10px;
width: 14px;
}
.directory{
background: url('images.png') no-repeat -73px -26px;
height: 11px;
margin-bottom: -1px;
}
.file{
background: url('images.png') no-repeat -114px -24px;
height: 16px;
margin-bottom: -3px;
}
/* eo Icons*/
/* General */
#container{background-color: white; overflow: hidden;}
body.collapsed #container{margin: auto; width: 980px; border: 1px solid rgba(0,0,0,.22); border-top: 0; box-shadow: 0 0 0px 4px rgba(0,0,0,.04)}
/* Header */
header{background: #474D57 url('bg-header.png') repeat-x bottom; z-index: 10000; height: 44px; padding: 10px 2% 6px 2%}
header a{color: white; text-shadow: 0 -1px 0 black}
header a:hover{color: #f1f1f1}
header h1{
width: 65px;
}
header h1.logo{margin: 0; padding: 0}
header h1.logo a{
background: url('images.png') no-repeat -3px -7px;
width: 65px;
height: 26px;
margin: 5px 0;
padding: 0;
display: block;
float: left;
text-indent: -1000em;
}
header nav{border-radius: 4px; box-shadow: 0 1px 2px black; width: 294px; margin: auto;
background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595d63), to(#31363e));
background-image: -webkit-linear-gradient(#595d63 6.6%, #31363e);
background-image: -moz-linear-gradient(#595d63 6.6%, #31363e);
background-image: -o-linear-gradient(#595d63 6.6%, #31363e);
margin-top: 2px;
height:30px
}
header nav a{padding: 8px 12px 8px 34px; display: inline-block; color: #D6DADF; border-right: 1px solid #31363E; position: relative; box-shadow: 1px 0 0 rgba(255,255,255,.1); margin: 0}
header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 6px;}
header nav a:last-child {border: 0; box-shadow: none}
header nav a:hover, header nav a.current{
background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595d63), to(#2c2f35));
background-image: -webkit-linear-gradient(#595d63 6.6%, #2c2f35);
background-image: -moz-linear-gradient(#595d63 6.6%, #202227);
background-image: -o-linear-gradient(#595d63 6.6%, #202227);
}
header nav a:active{
box-shadow: 0 1px 4px rgba(0,0,0,.8) inset;
}
header nav a.dashboard {
-webkit-border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-bottomleft: 4px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
header nav a.admin{
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
header .search{ display: inline-block; float: right; margin-right: 10px}
header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 6px;}
header nav a.dashboard span{background: url('images.png') no-repeat -161px 0;}
header nav a.admin span{background: url('images.png') no-repeat -184px 0;}
header nav a.project span{background: url('images.png') no-repeat -209px -1px; top: 7px}
/*
header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 14px;}
header nav a.dashboard.current span{ background-position: -163px -22px; }
header nav a.admin.current span{ background-position: -186px -22px;}
header nav a.project.current span{ background-position: -211px -23px;}
header nav a.project span{background: url('images.png') no-repeat -209px -1px; top: 15px}
header nav a span.current{top: 18px}
header nav {margin-left: 180px; display: inline-block; float: left;}
header nav a{float: left; background: #31363e; padding: 16px 20px 20px 34px; margin-right: 10px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
position: relative;
}
header nav a.current{background: white; color: #333; text-shadow: none;}
*/
header .login-top{float: right; width: 180px;
background-image: -webkit-gradient(linear, 0 0, 0 62, color-stop(0.032, #464c56), to(#363c45));
background-image: -webkit-linear-gradient(#464c56 3.2%, #363c45);
background-image: -moz-linear-gradient(#464c56 3.2%, #363c45);
background-image: -o-linear-gradient(#464c56 3.2%, #363c45);
padding: 0 10px;
height: 44px;
}
header .login-top a{display: block;}
header .login-top a.pic{float: left; margin-right: 10px;
img{ height: 36px; width: 36px; border: 1px solid black}
}
header .login-top a.username{margin-bottom: 5px}
header .login-top a.logout{color: #ccc}
header{margin-bottom: 0; clear: both; }
.page-title{background-color: #f1f1f1;display: block; float: left; clear: both; width: 98%; padding: 1% 1%; border-bottom: 1px solid #ccc; box-shadow: 0 -1px 0 white inset; margin-bottom: 1.5em}
.page-title h1{font-size: 20px; width: 400px; margin: 0; padding-top: 8px }
.page-title a.grey-button{float: right;}
.right{float: right;}
/* Account box */
header .account-box{position: relative;z-index: 10000; top: -3px; width: 38px; height: 38px; font-size: 11px; float: right; display: block; cursor: pointer; }
header .account-box img{ border-radius: 4px; width: 38px; height: 38px; display: block; box-shadow: 0 1px 2px black}
header .account-box:after{
content: " ";
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
float: right;
border-radius: 5px;
border: 1px solid rgba(255, 255, 255, .1);
border-bottom: 0;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255, 255, 255, .15)), to(rgba(0, 0, 0, .25))), -webkit-gradient(linear, left top, right bottom, color-stop(0, rgba(255, 255, 255, 0)), color-stop(0.5, rgba(255, 255, 255, .1)), color-stop(0.501, rgba(255, 255, 255, 0)), color-stop(1, rgba(255, 255, 255, 0)));
background: -moz-linear-gradient(top, rgba(255, 255, 255, .15), rgba(0, 0, 0, .25)), -moz-linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
background: linear-gradient(top, rgba(255, 255, 255, .15), rgba(0, 0, 0, .25)), linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
-webkit-background-origin: border-box;
-moz-background-origin: border;
background-origin: border-box;
}
.account-box:hover > .account-links, .account-box:hover > .arrow-up{display: block;}
header .account-links{background: white; display: none; border-radius: 5px; width: 100px; margin-top: 0; float: right; box-shadow: 0 1px 1px rgba(0,0,0,.2); }
header .account-links a{color: #666; padding: 6px 10px; display: block; text-shadow: none; border-bottom: 1px solid #eee}
header .account-links a:hover{background-color: #f1f1f1; text-shadow: none; color: #333}
header .account-links a:first-child{
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
header .account-links a:last-child{
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom: 0;
}
header a.arrow-up{
display: none;
width: 0;
height: 0;
float: right;
margin-right: 26px;
margin-bottom: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid white;
}
/* eo Account Box */
input.search-input{float: left; text-shadow: none; width: 116px; background-image: url('icon-search.png') ; background-repeat: no-repeat; background-position: 10px; border-radius: 100px; border: 1px solid rgba(0,0,0,.7); box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 2px rgba(0,0,0,.4) inset ; background-color: #D2D5DA; background-color: rgba(255,255,255,.5); padding: 5px; padding-left: 26px; margin-top: 4px; margin-right: 10px }
input.search-input:focus{ background-color: white; width: 216px;}
input.search-input::-webkit-input-placeholder {color: #666}
/* eo Header */
h2.icon{position: relative; padding-left: 40px; float: left; }
/*h2 a{font-weight: normal;}*/
h2.icon span{background: #E3E5EA url('images.png'); height: 32px; width: 32px; left: 0; top: -5px; border-radius: 4px; display: inline-block; position: absolute}
/* Dashboard Page */
html, body { height: 100%; }
body.dashboard-page h2.icon span{ background-position: 9px -69px; }
body.dashboard-page header{margin-bottom: 0}
body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; margin-left: 1%}
body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; }
body.dashboard-page .news-feed h2{float: left;}
body.dashboard-page aside{ width: 420px; float: right; right: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; border-left: 1px solid #ccc }
body.dashboard-page aside h4{margin: 0; border-bottom: 1px solid #ccc; padding: 10px 10px; font-size: 11px; font-weight: bold; text-transform: uppercase;}
body.dashboard-page aside h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 4%; margin-top: -4px; display: block;}
body.dashboard-page aside .project-list {list-style: none; margin: 0; padding: 0;}
body.dashboard-page aside .project-list li a {background: white; color: #{$blue_link}; display: block; border-bottom: 1px solid #eee; padding: 14px 6% 14px 14px;}
body.dashboard-page aside .project-list li a:hover {background: #f1f1f1}
body.dashboard-page aside .project-list li a:hover span.arrow{background-color: #E3E5EA;}
body.dashboard-page aside .project-list li a span.project-name{font-size: 14px; display: block; margin-bottom: 8px}
body.dashboard-page aside .project-list li a span.time{color: #666; font-weight: normal; font-size: 11px}
body.dashboard-page aside .project-list li a span.arrow{float: right; background: #E3E5EA; padding: 10px; border-radius: 5px; margin-top: 2px; text-shadow: none; color: #999}
body.dashboard-page .news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;}
body.dashboard-page .news-feed .project-updates .data{ padding: 0}
body.dashboard-page .news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.dashboard-page .news-feed .project-updates a.project-update:last-child{border-bottom: 0}
body.dashboard-page .news-feed .project-updates a.project-update img{float: left; margin-right: 10px;}
body.dashboard-page .news-feed .project-updates a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;}
body.dashboard-page .news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px}
body.dashboard-page .news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;}
body.dashboard-page .news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;}
/* eo Dashboard Page */
.grey-button.right{margin-top: 20px}
/* Project Page */
body.project-page h2.icon .project-name, body.project-page h2.icon d{border: 1px solid #eee; padding: 5px 30px 5px 10px; border-radius: 5px; position: relative;}
body.project-page h2.icon .project-name i.arrow{float: right;
position: absolute;
right: 10px;
top: 13px;
display: block;
background: url('images.png') no-repeat -97px -29px;
width: 4px;
height: 5px;
}
body.project-page h2.icon span{ background-position: -78px -68px; }
body.project-page .project-container{ position: relative; float: left; width: 100%; height: 100%; }
body.project-page .page-title{margin-bottom: 0}
body.project-page .project-sidebar {width: 220px; left: 0; top: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; border-left: 1px solid #ccc; float: left; display: inline-block; background: #f7f7f7; padding: 20px 0 20px 2%; margin: 0; }
body.project-page .project-sidebar input.text.git-url{ font-size: 12px; border-radius: 5px; color: #666; box-shadow: 0 1px 2px rgba(0,0,0,.2) inset; padding: 8px 14px 8px 30px; margin-bottom: 20px; background: white url('images.png') no-repeat 8px -40px;}
body.project-page .project-sidebar aside{width: 219px}
body.project-page .project-sidebar aside a{display: block; position: relative; background: white; padding: 15px 10px; border-bottom: 1px solid #eee}
body.project-page .project-sidebar aside a:first-child{
-webkit-border-top-left-radius: 5px;
-moz-border-radius-topleft: 5px;
border-top-left-radius: 5px;
}
.project-page .project-sidebar aside a:last-child{
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-left-radius: 5px;
}
body.project-page .project-sidebar aside a:hover{background-color: #eee;}
body.project-page .project-sidebar aside a span.number{float: right; border-radius: 5px; text-shadow: none; background: rgba(0,0,0,.12); text-align: center; padding: 5px 8px; position: absolute; top: 10px; right: 10px}
body.project-page .project-sidebar aside a.current{background-color: #79c3e0; color: white; text-shadow: none; border-color: transparent}
body.project-page .project-content{ padding: 20px; display: block; margin-left: 250px }
body.project-page .project-content h2{ margin-top: 6px}
body.project-page .project-content .button.right{margin-left: 20px}
body.project-page table .commit a{color: #{$blue_link}}
body.project-page table th, body.project-page table td{ border-bottom: 1px solid #DEE2E3;}
body.project-page .fixed{position: fixed; }
/* Commit Page */
body.project-page.commits-page .commit-info{float: right;}
body.project-page.commits-page .commit-info data{
padding: 4px 10px;
font-size: 11px;
}
body.project-page.commits-page .commit-info data.commit-button{
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4));
background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4);
background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4);
background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4);
box-shadow: 0 -1px 0 white inset;
display: block;
border: 1px solid #eee;
border-radius: 5px;
margin-bottom: 2px;
position: relative;
padding-right: 20px;
}
body.project-page.commits-page .commit-button i{
background: url('images.png') no-repeat -138px -27px;
width: 6px;
height: 9px;
float: right;
position: absolute;
top: 6px;
right: 5px;
}
body.project-page.commits-page .commits-date {display: block; width: 100%; margin-bottom: 20px}
body.project-page.commits-page .commits-date .data {padding: 0}
body.project-page.commits-page a.commit{padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page.commits-page .commits-date a.commit {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page.commits-page .commits-date a.commit:last-child{border-bottom: 0}
body.project-page.commits-page .commits-date a.commit img{float: left; margin-right: 10px;}
body.project-page.commits-page .commits-date a.commit span.commit-title{display: block;}
body.project-page.commits-page .commits-date a.commit span.commit-title{margin-bottom: 10px}
body.project-page.commits-page .commits-date a.commit span.commit-author{color: #999; font-weight: normal; font-style: italic;}
body.project-page.commits-page .commits-date a.commit span.commit-author strong{font-weight: bold; font-style: normal;}
/* eo Commit Page */
/* eo Project Page */
/* Projects Page */
body.projects-page h2.icon span{background-position: -31px -70px;}
body.projects-page .project-box.ui-box .data .repository {margin-bottom: 20px}
body.projects-page .project-box.ui-box .data .title span{ font-weight: bold;}
body.projects-page .project-box{width: 100%; margin-bottom: 3em}
body.projects-page .browse-code{margin-right: 10px}
/* eo Projects Page */
/* ==|== non-semantic helper classes ======================================== */
.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; }
.ir br { display: none; }
.hidden { display: none !important; visibility: hidden; }
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
.invisible { visibility: hidden; }
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
/* ==|== media queries ====================================================== */
@media only screen and (min-width: 480px) {
}
@media only screen and (min-width: 768px) {
}
/* ==|== print styles ======================================================= */
@media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; }
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}

View file

@ -0,0 +1,30 @@
.tags-list {
padding : 0px 10px 10px 10px;
}
.tags-list a {
display: inline-block;
padding: 8px 11px 8px 11px;
margin: 1px 5px 0px 0px;
border-radius: 4px;
border: 1px solid #72bbdf;
background-color: #72bbdf;
color: #0f326d;
font-weight: bold;
font-size: 14px;
}
.small-tags a{
font-size: 9px;
display: inline-block;
padding: 2px 3px 1px 3px;
margin: 0px 3px 0px 0px;
border-radius: 2px;
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
}

View file

@ -1,4 +1,5 @@
class Admin::MailerController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
@ -20,7 +21,7 @@ class Admin::MailerController < ApplicationController
else
render :file => 'notify/note_wall_email.html.haml', :layout => 'notify'
end
rescue
rescue
render :text => "Preview not avaialble"
end
@ -29,7 +30,7 @@ class Admin::MailerController < ApplicationController
@password = "DHasJKDHAS!"
render :file => 'notify/new_user_email.html.haml', :layout => 'notify'
rescue
rescue
render :text => "Preview not avaialble"
end
@ -38,7 +39,7 @@ class Admin::MailerController < ApplicationController
@user = @issue.assignee
@project = @issue.project
render :file => 'notify/new_issue_email.html.haml', :layout => 'notify'
rescue
rescue
render :text => "Preview not avaialble"
end
end

View file

@ -1,32 +1,18 @@
class Admin::ProjectsController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
def index
@admin_projects = Project.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_projects }
end
end
def show
@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
def new
@admin_project = Project.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_project }
end
end
def edit
@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.new(params[:project])
@admin_project.owner = current_user
respond_to do |format|
if @admin_project.save
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' }
format.json { render json: @admin_project, status: :created, location: @admin_project }
else
format.html { render action: "new" }
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
if @admin_project.save
redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
else
render :action => "new"
end
end
def update
@admin_project = Project.find_by_code(params[:id])
respond_to do |format|
if @admin_project.update_attributes(params[:project])
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
if @admin_project.update_attributes(params[:project])
redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
else
render :action => "edit"
end
end
@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.find_by_code(params[:id])
@admin_project.destroy
respond_to do |format|
format.html { redirect_to admin_projects_url }
format.json { head :ok }
end
redirect_to admin_projects_url
end
end

View file

@ -1,32 +1,18 @@
class Admin::TeamMembersController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
def index
@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
def show
@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
def new
@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
def edit
@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.new(params[:team_member])
@admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format|
if @admin_team_member.save
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' }
format.json { render json: @admin_team_member, status: :created, location: @team_member }
else
format.html { render action: "new" }
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
if @admin_team_member.save
redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
else
render action: "new"
end
end
@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id])
@admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format|
if @admin_team_member.update_attributes(params[:team_member])
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
if @admin_team_member.update_attributes(params[:team_member])
redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
else
render action: "edit"
end
end
@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id])
@admin_team_member.destroy
respond_to do |format|
format.html { redirect_to admin_team_members_url }
format.json { head :ok }
end
redirect_to admin_team_members_url
end
end

View file

@ -1,32 +1,18 @@
class Admin::UsersController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
def index
@admin_users = User.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_users }
end
end
def show
@admin_user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_user }
end
end
def new
@admin_user = User.new(:projects_limit => 10)
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_user }
end
end
def edit
@ -36,7 +22,7 @@ class Admin::UsersController < ApplicationController
def create
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)
respond_to do |format|
@ -54,8 +40,8 @@ class Admin::UsersController < ApplicationController
def update
admin = params[:user].delete("admin")
if params[:user][:password].empty?
params[:user].delete(:password)
params[:user].delete(:password_confirmation)
params[:user].delete(:password)
params[:user].delete(:password_confirmation)
end
@admin_user = User.find(params[:id])

View file

@ -1,5 +1,7 @@
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
before_filter :view_style
protect_from_forgery
helper_method :abilities, :can?
@ -8,7 +10,17 @@ class ApplicationController < ActionController::Base
render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false
end
protected
layout :layout_by_resource
protected
def layout_by_resource
if devise_controller?
"devise"
else
"application"
end
end
def abilities
@abilities ||= Six.new
@ -18,7 +30,7 @@ class ApplicationController < ActionController::Base
abilities.allowed?(object, action, subject)
end
def project
def project
@project ||= Project.find_by_code(params[:project_id])
end
@ -47,19 +59,13 @@ class ApplicationController < ActionController::Base
end
def load_refs
@branch = unless params[:branch].blank?
params[:branch]
else
nil
end
@tag = unless params[:tag].blank?
params[:tag]
else
nil
end
@ref = @branch || @tag || "master"
unless params[:ref].blank?
@ref = params[:ref]
else
@branch = params[:branch].blank? ? nil : params[:branch]
@tag = params[:tag].blank? ? nil : params[:tag]
@ref = @branch || @tag || "master"
end
end
def render_404
@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base
def require_non_empty_project
redirect_to @project unless @project.repo_exists?
end
def view_style
if params[:view_style] == "collapsed"
cookies[:view_style] = "collapsed"
elsif params[:view_style] == "fluid"
cookies[:view_style] = ""
end
@view_mode = if cookies[:view_style] == "collapsed"
:fixed
else
:fluid
end
end
def respond_with_notes
if params[:last_id] && params[:first_id]
@notes = @notes.where("id >= ?", params[:first_id])
elsif params[:last_id]
@notes = @notes.where("id > ?", params[:last_id])
elsif params[:first_id]
@notes = @notes.where("id < ?", params[:first_id])
else
nil
end
end
end

View file

@ -2,6 +2,7 @@ require "base64"
class CommitsController < ApplicationController
before_filter :project
layout "project"
# Authorize
before_filter :add_project_abilities
@ -12,11 +13,12 @@ class CommitsController < ApplicationController
load_refs # load @branch, @tag & @ref
@repo = project.repo
limit, offset = (params[:limit] || 20), (params[:offset] || 0)
if params[:path]
@commits = @repo.log(@ref, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0)
@commits = @repo.log(@ref, params[:path], :max_count => limit, :skip => offset)
else
@commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0)
@commits = @repo.commits(@ref, limit, offset)
end
respond_to do |format|
@ -27,12 +29,12 @@ class CommitsController < ApplicationController
def show
@commit = project.repo.commits(params[:id]).first
@notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit")
@notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit").order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit")
respond_to do |format|
format.html # show.html.erb
format.js
respond_to do |format|
format.html
format.js { respond_with_notes }
end
end
end

View file

@ -1,5 +1,6 @@
class DashboardController < ApplicationController
def index
@projects = current_user.projects.all
@active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
end
end

View file

@ -1,12 +1,13 @@
class IssuesController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :project
before_filter :issue, :only => [:edit, :update, :destroy, :show]
layout "project"
# Authorize
before_filter :add_project_abilities
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
@ -34,14 +35,19 @@ class IssuesController < ApplicationController
end
def show
@notes = @issue.notes
@notes = @issue.notes.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @issue)
respond_to do |format|
format.html
format.js { respond_with_notes }
end
end
def create
@issue = @project.issues.new(params[:issue])
@issue.author = current_user
if @issue.save
if @issue.save && @issue.assignee != current_user
Notify.new_issue_email(@issue).deliver
end
@ -57,14 +63,13 @@ class IssuesController < ApplicationController
end
end
def destroy
return access_denied! unless can?(current_user, :admin_issue, @issue)
@issue.destroy
respond_to do |format|
format.js { render :nothing => true }
format.js { render :nothing => true }
end
end
@ -78,7 +83,23 @@ class IssuesController < ApplicationController
render :nothing => true
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
@issue ||= @project.issues.find(params[:id])

View file

@ -1,4 +1,5 @@
class KeysController < ApplicationController
layout "profile"
respond_to :js
def index
@ -24,7 +25,7 @@ class KeysController < ApplicationController
respond_to do |format|
format.html { redirect_to keys_url }
format.js { render :nothing => true }
format.js { render :nothing => true }
end
end
end

View file

@ -1,9 +1,9 @@
class NotesController < ApplicationController
before_filter :project
before_filter :project
# Authorize
before_filter :add_project_abilities
before_filter :authorize_write_note!, :only => [:create]
before_filter :authorize_write_note!, :only => [:create]
respond_to :js
@ -15,10 +15,9 @@ class NotesController < ApplicationController
notify if params[:notify] == '1'
end
respond_to do |format|
format.html {redirect_to :back}
format.js
format.js
end
end
@ -30,11 +29,11 @@ class NotesController < ApplicationController
@note.destroy
respond_to do |format|
format.js { render :nothing => true }
format.js { render :nothing => true }
end
end
protected
protected
def notify
@project.users.reject { |u| u.id == current_user.id } .each do |u|

View file

@ -1,4 +1,5 @@
class ProfileController < ApplicationController
layout "profile"
def show
@user = current_user
end
@ -14,7 +15,7 @@ class ProfileController < ApplicationController
end
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
if @user.update_attributes(params[:user])

View file

@ -1,15 +1,18 @@
class ProjectsController < ApplicationController
before_filter :project, :except => [:index, :new, :create]
before_filter :project, :except => [:index, :new, :create]
layout :determine_layout
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!, :except => [:index, :new, :create]
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
before_filter :authorize_read_project!, :except => [:index, :new, :create]
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
before_filter :require_non_empty_project, :only => [:blob, :tree]
def index
@projects = current_user.projects.all
source = current_user.projects
source = source.tagged_with(params[:tag]) unless params[:tag].blank?
@projects = source.all
end
def new
@ -23,7 +26,7 @@ class ProjectsController < ApplicationController
@project = Project.new(params[:project])
@project.owner = current_user
Project.transaction do
Project.transaction do
@project.save!
@project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user)
end
@ -31,7 +34,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
if @project.valid?
format.html { redirect_to @project, notice: 'Project was successfully created.' }
format.js
format.js
else
format.html { render action: "new" }
format.js
@ -51,10 +54,10 @@ class ProjectsController < ApplicationController
respond_to do |format|
if project.update_attributes(params[:project])
format.html { redirect_to project, :notice => 'Project was successfully updated.' }
format.js
format.js
else
format.html { render action: "edit" }
format.js
format.js
end
end
end
@ -85,13 +88,12 @@ class ProjectsController < ApplicationController
def wall
@note = Note.new
@notes = @project.common_notes.order("created_at DESC")
@notes = @notes.fresh.limit(20)
@notes = case params[:view]
when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day)
when "all" then @notes.all
when "day" then @notes.since(Date.today.at_beginning_of_day)
else @notes.fresh.limit(10)
end
respond_to do |format|
format.html
format.js { respond_with_notes }
end
end
#
@ -105,7 +107,7 @@ class ProjectsController < ApplicationController
if params[:commit_id]
@commit = @repo.commits(params[:commit_id]).first
else
else
@commit = @repo.commits(@ref || "master").first
end
@ -114,7 +116,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html # show.html.erb
format.js do
format.js do
# diasbale cache to allow back button works
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
@ -132,7 +134,7 @@ class ProjectsController < ApplicationController
if @tree.is_a?(Grit::Blob)
send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name)
else
else
head(404)
end
rescue
@ -147,9 +149,17 @@ class ProjectsController < ApplicationController
end
end
protected
protected
def project
def project
@project ||= Project.find_by_code(params[:id])
end
def determine_layout
if @project && !@project.new_record?
"project"
else
"application"
end
end
end

View file

@ -1,11 +1,12 @@
class SnippetsController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :project
layout "project"
# Authorize
before_filter :add_project_abilities
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
@ -13,7 +14,7 @@ class SnippetsController < ApplicationController
@snippets = @project.snippets
end
def new
def new
@snippet = @project.snippets.new
end

View file

@ -0,0 +1,11 @@
class TagsController < ApplicationController
def index
@tags = Project.tag_counts.order('count DESC')
@tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank?
respond_to do |format|
format.html
format.json { render json: @tags.limit(8).map {|t| t.name}}
end
end
end

View file

@ -1,10 +1,11 @@
class TeamMembersController < ApplicationController
before_filter :project
before_filter :project
layout "project"
# Authorize
before_filter :add_project_abilities
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
@team_member = project.users_projects.find(params[:id])
@ -26,7 +27,7 @@ class TeamMembersController < ApplicationController
respond_to do |format|
format.js
format.html do
format.html do
unless @team_member.valid?
flash[:alert] = "User should have at least one role"
end
@ -41,7 +42,7 @@ class TeamMembersController < ApplicationController
respond_to do |format|
format.html { redirect_to root_path }
format.js { render :nothing => true }
format.js { render :nothing => true }
end
end
end

View file

@ -4,6 +4,14 @@ module ApplicationHelper
"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon"
end
def body_class(default_class = nil)
main = content_for(:body_class).blank? ?
default_class :
content_for(:body_class)
[main, cookies[:view_style]].join(" ")
end
def commit_name(project, commit)
if project.commit.id == commit.id
"master"
@ -23,18 +31,33 @@ module ApplicationHelper
end
def last_commit(project)
if project.repo_exists?
if project.repo_exists?
time_ago_in_words(project.commit.committed_date) + " ago"
else
else
"Never"
end
rescue
"Never"
end
def grouped_options_refs
options = [
["Branch", @repo.heads.map(&:name) ],
[ "Tag", @project.tags ]
]
grouped_options_for_select(options, @ref)
end
def markdown(text)
RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe
end
def search_autocomplete_source
projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
default_nav = [
{ :label => "Keys", :url => keys_path },
{ :label => "Projects", :url => projects_path },
{ :label => "Keys", :url => keys_path },
{ :label => "Projects", :url => projects_path },
{ :label => "Admin", :url => admin_root_path }
]
@ -42,10 +65,10 @@ module ApplicationHelper
if @project && !@project.new_record?
project_nav = [
{ :label => "#{@project.code} / Issues", :url => project_issues_path(@project) },
{ :label => "#{@project.code} / Wall", :url => wall_project_path(@project) },
{ :label => "#{@project.code} / Tree", :url => tree_project_path(@project) },
{ :label => "#{@project.code} / Commits", :url => project_commits_path(@project) },
{ :label => "#{@project.code} / Issues", :url => project_issues_path(@project) },
{ :label => "#{@project.code} / Wall", :url => wall_project_path(@project) },
{ :label => "#{@project.code} / Tree", :url => tree_project_path(@project) },
{ :label => "#{@project.code} / Commits", :url => project_commits_path(@project) },
{ :label => "#{@project.code} / Team", :url => team_project_path(@project) }
]
end

View file

@ -1,13 +1,13 @@
module CommitsHelper
def diff_line(line, line_new = 0, line_old = 0)
full_line = html_escape(line.gsub(/\n/, ''))
color = if line[0] == "+"
color = if line[0] == "+"
full_line = "<span class=\"old_line\">&nbsp;</span><span class=\"new_line\">#{line_new}</span> " + full_line
"#DFD"
elsif line[0] == "-"
elsif line[0] == "-"
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">&nbsp;</span> " + full_line
"#FDD"
else
else
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line
"none"
end

View file

@ -1,2 +1,30 @@
module DashboardHelper
def dashboard_feed_path(project, object)
case object.class.name.to_s
when "Issue" then project_issues_path(project, project.issues.find(object.id))
when "Grit::Commit" then project_commit_path(project, project.repo.commits(object.id).first)
when "Note"
then
note = object
case note.noteable_type
when "Issue" then project_issue_path(project, note.noteable_id)
when "Snippet" then project_snippet_path(project, note.noteable_id)
when "Commit" then project_commit_path(project, :id => note.noteable_id)
else wall_project_path(project)
end
else "#"
end
rescue
"#"
end
def dashboard_feed_title(object)
title = case object.class.name.to_s
when "Note" then markdown(object.note)
when "Issue" then object.title
when "Grit::Commit" then object.safe_message
else ""
end
"[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} "
end
end

View file

@ -12,7 +12,7 @@ module ProjectsHelper
else
true
end
rescue
rescue
nil
end
end

View file

@ -1,2 +1,11 @@
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

View file

@ -17,14 +17,14 @@ class Ability
:read_issue,
:read_snippet,
:read_team_member,
:read_note
:read_note
] if project.readers.include?(user)
rules << [
:write_project,
:write_issue,
:write_snippet,
:write_note
:write_note
] if project.writers.include?(user)
rules << [
@ -32,13 +32,13 @@ class Ability
:admin_issue,
:admin_snippet,
:admin_team_member,
:admin_note
:admin_note
] if project.admins.include?(user)
rules.flatten
end
class << self
class << self
[:issue, :note, :snippet].each do |name|
define_method "#{name}_abilities" do |user, subject|
if subject.author == user
@ -48,7 +48,7 @@ class Ability
:"admin_#{name}"
]
else
subject.respond_to?(:project) ?
subject.respond_to?(:project) ?
project_abilities(user, subject.project) : []
end
end

View file

@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base
validates_presence_of :assignee_id
validates_presence_of :author_id
delegate :name,
:email,
:to => :author,
:prefix => true
validates :title,
:presence => true,
:length => { :within => 0..255 }
validates :content,
:presence => true,
:length => { :within => 0..2000 }
#validates :content,
#:presence => true,
#:length => { :within => 0..2000 }
scope :critical, where(:critical => true)
scope :non_critical, where(:critical => false)
@ -30,7 +35,7 @@ class Issue < ActiveRecord::Base
def today?
Date.today == created_at.to_date
end
def new?
today? && created_at == updated_at
end

View file

@ -8,7 +8,7 @@ class Key < ActiveRecord::Base
validates :key,
:presence => true,
:uniqueness => true,
:length => { :within => 0..1024 }
:length => { :within => 0..1600 }
before_save :set_identifier
after_save :update_gitosis
@ -17,11 +17,11 @@ class Key < ActiveRecord::Base
def set_identifier
self.identifier = "#{user.identifier}_#{Time.now.to_i}"
end
def update_gitosis
Gitosis.new.configure do |c|
c.update_keys(identifier, key)
projects.each do |project|
c.update_project(project.path, project.gitosis_writers)
end

View file

@ -7,18 +7,23 @@ class Note < ActiveRecord::Base
belongs_to :author,
:class_name => "User"
attr_protected :author, :author_id
delegate :name,
:email,
:to => :author,
:prefix => true
attr_protected :author, :author_id
validates_presence_of :project
validates :note,
:presence => true,
:length => { :within => 0..255 }
:length => { :within => 0..5000 }
validates :attachment,
:file_size => {
:maximum => 10.megabytes.to_i
}
validates :attachment,
:file_size => {
:maximum => 10.megabytes.to_i
}
scope :common, where(:noteable_id => nil)

View file

@ -9,6 +9,8 @@ class Project < ActiveRecord::Base
has_many :notes, :dependent => :destroy
has_many :snippets, :dependent => :destroy
acts_as_taggable
validates :name,
:uniqueness => true,
:presence => true,
@ -20,7 +22,7 @@ class Project < ActiveRecord::Base
:format => { :with => /^[a-zA-Z0-9_\-]*$/,
:message => "only letters, digits & '_' '-' allowed" },
:length => { :within => 0..255 }
validates :description,
:length => { :within => 0..2000 }
@ -57,13 +59,13 @@ class Project < ActiveRecord::Base
c.update_project(path, gitosis_writers)
end
end
def destroy_gitosis_project
Gitosis.new.configure do |c|
c.destroy_project(self)
end
end
def add_access(user, *access)
opts = { :user => user }
access.each { |name| opts.merge!(name => true) }
@ -102,12 +104,12 @@ class Project < ActiveRecord::Base
def url_to_repo
"#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
end
def path_to_repo
GITOSIS["base_path"] + path + ".git"
end
def repo
def repo
@repo ||= Grit::Repo.new(path_to_repo)
end
@ -119,32 +121,52 @@ class Project < ActiveRecord::Base
repo rescue false
end
def last_activity
updates(1).first
rescue
nil
end
def last_activity_date
last_activity.try(:created_at)
end
def updates(n = 3)
[
fresh_commits(n),
issues.last(n),
notes.fresh.limit(n)
].compact.flatten.sort do |x, y|
y.created_at <=> x.created_at
end[0...n]
end
def commit(commit_id = nil)
if commit_id
repo.commits(commit_id).first
else
else
repo.commits.first
end
end
def heads
def heads
@heads ||= repo.heads
end
def fresh_commits
commits = heads.map do |h|
repo.commits(h.name, 10)
def fresh_commits(n = 10)
commits = heads.map do |h|
repo.commits(h.name, n)
end.flatten.uniq { |c| c.id }
commits.sort! do |x, y|
y.committed_date <=> x.committed_date
end
commits[0..10]
commits[0...n]
end
def commits_since(date)
commits = heads.map do |h|
commits = heads.map do |h|
repo.log(h.name, nil, :since => date)
end.flatten.uniq { |c| c.id }
@ -165,7 +187,7 @@ class Project < ActiveRecord::Base
unless owner.can_create_project?
errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it")
end
rescue
rescue
errors[:base] << ("Cant check your ability to create project")
end

View file

@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base
validates :title,
:presence => true,
:length => { :within => 0..255 }
validates :file_name,
:presence => true,
:length => { :within => 0..255 }
@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base
:presence => true,
: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
[
[
".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
".js", ".sh", ".coffee", ".yml", ".md"
@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base
def colorize
system_colorize(content, file_name)
end
def expired?
expires_at && expires_at < Time.current
end
end
# == Schema Information
#
@ -47,5 +53,6 @@ end
# created_at :datetime
# updated_at :datetime
# file_name :string(255)
# expires_at :datetime
#

View file

@ -5,7 +5,7 @@ class User < ActiveRecord::Base
:recoverable, :rememberable, :trackable, :validatable
# 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
has_many :users_projects, :dependent => :destroy

View file

@ -1,29 +1,28 @@
%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
%h3
%a New user
%div
%div
%iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"}
%h3
%a New issue
%div
%div
%iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"}
%h3
%h3
%a Commit note
%div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"}
%h3
%a Issue note
%div
%div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"}
%h3
%a Wall note
%div
%div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"}
:javascript
:javascript
$(function() {
$( "#accordion" ).accordion(); });

View file

@ -1,5 +1,5 @@
%table
%tr
%thead
%th Name
%th Code
%th Path

View file

@ -1,7 +1,7 @@
%p#notice= notice
.span-8.colborder
%h2= @admin_project.name
%h2= @admin_project.name
%p
%b Name:
@ -22,16 +22,16 @@
.span-14
%h2 Team
%h2 Team
%table.round-borders
%tr
%th Name
%th Added
%th Added
%th Web
%th Git
%th Admin
%th
%th
- @admin_project.users_projects.each do |tm|
%tr

View file

@ -1,14 +1,14 @@
- @admin_team_members.group_by(&:project).sort.each do |project, members|
%h3= link_to project.name, [:admin, project]
%table
%tr
%thead
%th Name
%th Email
%th Read
%th Git
%th Manage
%th Added
%th
%th Added
%th
%th
%th
- members.each do |tm|

View file

@ -11,7 +11,6 @@
%b Since:
= @admin_team_member.updated_at
.span-10
.span-6
%b Access:

View file

@ -44,7 +44,7 @@
.field
= f.label :twitter
%br
= f.text_field :twitter
= f.text_field :twitter
.clear
%br
.actions

View file

@ -1,5 +1,5 @@
%table
%tr
%thead
%th Admin
%th Name
%th Email

View file

@ -2,5 +2,4 @@
= render 'form'
= link_to 'Back', admin_users_path, :class => "right lbutton"

View file

@ -19,28 +19,27 @@
= @admin_user.skype
%p
%b LinkedIn:
= @admin_user.linkedin
= @admin_user.linkedin
%p
%b Twitter:
= @admin_user.twitter
.clear
= link_to 'Edit', edit_admin_user_path(@admin_user)
\|
= link_to 'Back', admin_users_path
.span-14
%h2 Projects
%h2 Projects
%table.round-borders
%tr
%th Name
%th Added
%th Added
%th Web
%th Git
%th Admin
%th
%th
- @admin_user.users_projects.each do |tm|
- project = tm.project

View file

@ -1,22 +1,24 @@
- @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits|
.day-commits-table
.day-header
%div{ :class => "commits-date ui-box ui-box-small ui-box-big" }
.day-commits-table
%h3= day.stamp("28 Aug, 2010")
%ul
- commits.each do |commit|
%li{ :class => "commit", :url => project_commit_path(@project, :id => commit.id) }
- if commit.author.email
= image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%p
%strong
= truncate(commit.safe_message, :length => 60)
= link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right"
= link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right"
%span
%span.author
= commit.author
= time_ago_in_words(commit.committed_date)
ago
= more_commits_link if @commits.size > 99
.data
- commits.each do |commit|
%a{ :class => "commit", :href => project_commit_path(@project, :id => commit.id) }
%span.commit-info
%data.commit-button
= truncate(commit.id.to_s, :length => 16)
%i
%data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"}
Browse Code
- if commit.author_email
= image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title
%strong
= truncate(commit.safe_message, :length => 60)
%span.commit-author
%strong= commit.author_name
= time_ago_in_words(commit.committed_date)
ago

View file

@ -8,7 +8,7 @@
.diff_file_header
- if diff.deleted_file
%strong{:id => "#{diff.b_path}"}= diff.a_path
- else
- else
= link_to tree_file_project_path(@project, @commit.id, diff.b_path) do
%strong{:id => "#{diff.b_path}"}= diff.b_path
%br/
@ -19,5 +19,5 @@
.diff_file_content_image
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
%p
%p
%center No preview for this file type

View file

@ -6,4 +6,4 @@
%h1 Listing commits
%div{:id => dom_id(@project)}
= render "commits"
%br/
%br/

View file

@ -2,6 +2,7 @@
- line_new = 0
- lines_arr = diff.diff.lines.to_a
- lines_arr.each do |line|
- next if line.match(/^--- \/dev\/null/)
- next if line.match(/^--- a/)
- next if line.match(/^\+\+\+ b/)
- if line.match(/^@@ -/)
@ -12,10 +13,10 @@
= diff_line(line, line_new, line_old)
- if line[0] == "+"
- line_new += 1
- elsif
- elsif
- line[0] == "-"
- line_old += 1
- else
- else
- line_new += 1
- line_old += 1

View file

@ -1,15 +1,28 @@
%div
%h3
.left
= form_tag project_commits_path(@project), :method => :get do
= select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches"
&nbsp;
.left.prepend-1
= form_tag project_commits_path(@project), :method => :get do
= select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags"
= text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"]
.clear
- if params[:path]
%h3{:style => "color:#555"} /#{params[:path]}
%div{:id => dom_id(@project)}
= render "commits"
- content_for(:body_class, "project-page commits-page")
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT
%h2.icon
%span
%d
= link_to project_commits_path(@project) do
= @project.name
- if params[:path]
\/
%a{:href => "#"}= params[:path].split("/").join(" / ")
.right= render :partial => "projects/refs", :locals => { :destination => project_commits_path(@project) }
%div{:id => dom_id(@project)}
#commits_list= render "commits"
.clear
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
:javascript
$(function(){
CommitsList.init("#{@ref}", 20);
});

View file

@ -0,0 +1,3 @@
:plain
CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}");

View file

@ -1,5 +1,5 @@
%h3
= "[ #{@commit.committer} ] #{truncate(@commit.safe_message)}"
= "[ #{@commit.author_name} ] #{truncate(@commit.safe_message, :length => 70)}"
-#= link_to 'Back', project_commits_path(@project), :class => "button"
%table.round-borders
%tr
@ -7,33 +7,21 @@
%td= @commit.id
%tr
%td Author
%td= @commit.author
%tr
%td Commiter
%td= @commit.committer
%td= @commit.author_name
%tr
%td Commited Date
%td= @commit.committed_date
%td= @commit.committed_date.stamp("21 Aug 2011, 11:15pm")
%tr
%td Message
%td= @commit.safe_message
%td
%pre.commit_message
= preserve @commit.safe_message
%tr
%td Tree
%td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id)
.clear
#tabs
%ul
%li
%a{ :href => "#tabs-1" } Diff
%li
%a{ :href => "#tabs-2" } Comments
%span{ :class => "notes_count" }= @notes.count
%hr
#tabs-1
= render "commits/diff"
#tabs-2
= render "notes/notes"
%br
:javascript
$(function() { $( "#tabs" ).tabs(); });
= render "commits/diff"
= render "notes/notes"

View file

@ -1,8 +1 @@
-#:plain
$("#side-commit-preview").remove();
var side = $("<div id='side-commit-preview'></div>");
side.html("#{escape_javascript(render "commits/show")}");
$("##{dom_id(@project)}").parent().append(side);
$("##{dom_id(@project)}").addClass("span-14");
:plain
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
= render "notes/load"

View file

@ -1 +1,40 @@
timeline
- content_for(:body_class, "dashboard-page")
#dashboard-content.dashboard-content.content
%aside
%h4
- if current_user.can_create_project?
%a.button-small.button-green{:href => new_project_path} New Repository
Your Repositories
%ol.project-list
- @projects.each do |project|
%li
%a{:href => project_path(project)}
%span.arrow →
%span.project-name= project.name
%span.time
%strong Last activity:
= project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"
#news-feed.news-feed
%h2.icon
%span>
Dashboard
- @active_projects.first(3).each do |project|
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
%h3= project.name
.data
- project.updates.each do |update|
%a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
%br
/ .project-update
/ .project-updates
/ #news-feed
/ #dashboard-content

View file

@ -9,4 +9,4 @@
<div><%= f.submit "Resend confirmation instructions" %></div>
<% end %>
<%= render :partial => "devise/shared/links" %>
<%= render :partial => "devise/shared/links" %>

View file

@ -13,4 +13,4 @@
<div><%= f.submit "Change my password" %></div>
<% end %>
<%= render :partial => "devise/shared/links" %>
<%= render :partial => "devise/shared/links" %>

View file

@ -1,15 +1,8 @@
<h2>Forgot your password?</h2>
<div class="span-12 colborder">
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email %></div>
<div><%= f.submit "Send me reset password instructions", :class => "lbutton vm" %></div>
<% end %>
</div>
<div>
<%= render :partial => "devise/shared/links" %>
</div>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :class => "login-box", :method => :post }) do |f| %>
<%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %>
<%= devise_error_messages! %>
<%= f.email_field :email, :placeholder => "Email", :class => "text top" %>
<br/>
<%= f.submit "Reset password", :class => "grey-button" %>
<div class="right"> <%= render :partial => "devise/shared/links" %></div>
<% end %>

View file

@ -1,20 +1,12 @@
<h2>Sign in</h2>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %>
<%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %>
<%= f.text_field :email, :class => "text top", :placeholder => "Email" %>
<%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %>
<div class="span-12 colborder">
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div><%= f.label :email %><br />
<%= f.text_field :email %></div>
<div><%= f.label :password %><br />
<%= f.password_field :password %></div>
<% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<% end -%>
<br/>
<div><%= f.submit "Sign in", :class => "lbutton vm" %></div>
<% end %>
</div>
<div>
<%= render :partial => "devise/shared/links" %>
</div>
<% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<% end -%>
<br/>
<%= f.submit "Sign in", :class => "grey-button" %>
<div class="right"> <%= render :partial => "devise/shared/links" %></div>
<% end %>

View file

@ -22,4 +22,4 @@
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>
<% end -%>

View file

@ -9,4 +9,4 @@
<div><%= f.submit "Resend unlock instructions" %></div>
<% end %>
<%= render :partial => "devise/shared/links" %>
<%= render :partial => "devise/shared/links" %>

View file

@ -7,10 +7,10 @@
.span-8
= f.label :title
= f.text_field :title, :style => "width:450px"
.span-8
= f.label :content
= f.text_area :content, :style => "width:450px; height:130px"
= f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255
-#.span-8
-#= f.label :content
-#= f.text_area :content, :style => "width:450px; height:130px"
.span-8.append-bottom
= f.label :assignee_id
= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })

View file

@ -1,12 +1,11 @@
%table.round-borders#issues-table
%tr
%thead
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
%th
%th
%th Assignee
%th ID
%th Title
%th Closed?
%th
- @issues.critical.each do |issue|
= render(:partial => 'show', :locals => {:issue => issue})

View file

@ -1,18 +1,27 @@
%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
= image_tag "move.png" , :class => [:handle, :left]
%td
= image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= truncate issue.assignee.name, :lenght => 20
= issue.assignee.name
%td ##{issue.id}
%td
= html_escape issue.title
= truncate(html_escape(issue.title), :length => 200)
%br
%br
- if issue.critical
%span.tag.high critical
- if issue.today?
%span.tag.today today
.right
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
&nbsp;
= link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}"
-#- if issue.author == current_user
-#%span.tag.yours yours
-#- if issue.notes.count > 0
@ -21,13 +30,8 @@
-#notes
%td
- 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();"
= hidden_field_tag :status_only, true
- else
- else
= check_box_tag "closed", 1, issue.closed, :disabled => true
%td
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "lbutton positive", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{issue.id}"

View file

@ -1,28 +1,52 @@
%div
- if can? current_user, :write_issue, @project
.left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
.right
= form_tag project_issues_path(@project), :method => :get do
.span-2
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues"
= label_tag "open_issues","Open"
.span-2
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues"
= label_tag "closed_issues","Closed"
.span-2
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues"
= label_tag "my_issues","To Me"
.span-2
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues"
= label_tag "all_issues","All"
.top_panel_issues
- if can? current_user, :write_issue, @project
%div{:class => "left", :style => "margin-right: 10px;" }
= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
.right.issues_filter
= form_tag project_issues_path(@project), :method => :get do
.left
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status"
= label_tag "open_issues","Open"
.left
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status"
= label_tag "closed_issues","Closed"
.left
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status"
= label_tag "my_issues","To Me"
.left
= 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"
%br
:javascript
$('.delete-issue').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); });
var href = $('.issue_search').parent().attr('action');
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(){
$('#issues-table>tbody').sortable({
axis: 'y',

View file

@ -1,44 +1,51 @@
%h2
= "Issue ##{@issue.id} - #{@issue.title}"
.span-15
= simple_format html_escape(@issue.content)
%strong
Issue
= "##{@issue.id}"
&ndash;
= html_escape(@issue.title)
.left.width-65p
.issue_notes= render "notes/notes"
.span-8.right
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
.right.width-30p
.span-8
- if @issue.closed
%center.success Closed
- else
%center.error Open
%table.round-borders
%tr
%td Title:
%td
= truncate html_escape(@issue.title)
%tr
%td Project
%td
%strong= @issue.project.name
%tr
%td Author:
%td Author:
%td
= image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= @issue.author.name
%tr
%td Assignee:
%td Assignee:
%td
= image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= @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
%td Closed?
%td
- if can? current_user, :write_issue, @project
= form_for([@project, @issue]) do |f|
- if can? current_user, :write_issue, @issue
= form_for([@project, @issue]) do |f|
= f.check_box :closed, :onclick => "$(this).parent().submit();"
= hidden_field_tag :status_only, true
- else
- else
= check_box_tag "closed", 1, @issue.closed, :disabled => true
- if can?(current_user, :write_issue, @issue)
.clear
%br
= 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

View file

@ -1,2 +1 @@
:plain
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
= render "notes/load"

View file

@ -2,11 +2,11 @@
- if @issue.valid?
:plain
$("##{dom_id(@issue)}").fadeOut();
- else
- else
- if @issue.valid?
:plain
$("#edit_issue_dialog").dialog("close");
$.ajax({type: "GET", url: location.href, dataType: "script"});
updatePage();
- else
:plain
$("#edit_issue_dialog").empty();

View file

@ -10,6 +10,6 @@
= render(:partial => 'show', :locals => {:key => key})
:javascript
$('.delete-key').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); });
$('.delete-key').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); });

View file

@ -6,9 +6,9 @@
%h4= text
:javascript
$(function(){
$("#flash_container").slideDown("slow");
$("#flash_container").click(function(){
$(this).slideUp("slow");
$("#flash_container").slideDown("slow");
$("#flash_container").click(function(){
$(this).slideUp("slow");
});
setTimeout("hideFlash()",2000);
});

View file

@ -1,27 +1,44 @@
<div id="header-panel">
<div class="container">
<div class="span-24">
<div class="span-10">
<%#= image_tag "git.png", :height => 40, :class => "left" %>
<%#= link_to "gitlab", root_path, :id => "logo" %>
<span class="search-holder">
<%= text_field_tag "search", nil, :placeholder => "Search" %>
</span>
</div>
<div class="right">
<%= link_to truncate(@project.name, :length => 20), project_path(@project), :class => "current button" if @project && !@project.new_record? %>
<%= link_to 'Projects', projects_path, :class => current_page?(projects_path) ? "current button" : "button" %>
<%= link_to('Admin', admin_root_path, :class => admin_namespace? ? "current button" : "button" ) if current_user.is_admin? %>
<%= link_to profile_path, :class => ((controller.controller_name == "keys" || controller.controller_name == "profile") ? "current button" : "button") do %>
<%= image_tag gravatar_icon(current_user.email) %>
<%= current_user.name.split(" ").first %>
<% end %>
<%= link_to 'Logout', destroy_user_session_path, :style => "border-left: 1px solid #666;", :class => "button", :method => :delete %>
</div>
</div>
</div>
</div>
<!-- Page Header -->
<header>
<h1 class="logo">
<a href="/">GITLAB</a>
</h1>
<div class="account-box">
<%= link_to profile_path, :class => "pic" do %>
<%= image_tag gravatar_icon(current_user.email) %>
<% end %>
<a href="#" class="arrow-up"></a>
<div class="account-links">
<%= link_to profile_path, :class => "username" do %>
<%#= current_user.name %>
Your profile
<% end %>
<%= link_to "Fluid layout", url_for( :view_style => 'fluid' ) if cookies[:view_style] == "collapsed"%>
<%= link_to "Fixed layout", url_for( :view_style => 'collapsed' ) unless cookies[:view_style] == "collapsed"%>
<%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %>
</div>
</div><!-- .account-box -->
<div class="search">
<%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %>
</div>
<!-- .login-top -->
<nav>
<%= link_to dashboard_path, :class => current_page?(root_path) ? "current dashboard" : "dashboard" do %>
<span></span>Dashboard
<% end %>
<%= link_to projects_path, :class => current_page?(projects_path) ? "current project" : "project" do %>
<span></span>Projects
<% end %>
<%= link_to((current_user.is_admin? ? admin_root_path : "#"), :class => (admin_namespace? ? "current admin" : "admin")) do %>
<span></span>Admin
<% end %>
</nav>
</header>
<!-- eo Page Header -->
<% if current_user %>
<%= javascript_tag do %>

View file

@ -0,0 +1,2 @@
- if content_for?(:page_title)
= yield :page_title

View file

@ -0,0 +1,26 @@
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
= link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil
= link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil
= link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil
= link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil
.project-content
= yield

View file

@ -2,28 +2,16 @@
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag 'blueprint/screen', :media => "screen, projection"
= stylesheet_link_tag 'blueprint/print', :media => "print"
= stylesheet_link_tag 'blueprint/plugins/buttons/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"
GitLab
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body#thebody
= render :partial => "layouts/flash"
- if user_signed_in?
%body{ :class => body_class, :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.top_bar.container
= render :partial => "projects/top_menu" if @project && !@project.new_record?
= render :partial => "projects/projects_top_menu" if (controller.controller_name == "projects" && ["index", "new", "create"].include?(controller.action_name)) && !admin_namespace?
= render :partial => "profile/top_menu" if ["keys", "profile"].include?(controller.controller_name)
= render :partial => "admin/top_menu" if admin_namespace?
#content-container.container
.span-24
= yield
= render :partial => "layouts/page_title"
= yield

View file

@ -0,0 +1,14 @@
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body.login-page
= render :partial => "layouts/flash"
= yield

View file

@ -0,0 +1,28 @@
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
= link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil
= link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
= link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
Keys
- unless current_user.keys.empty?
%span{ :class => "number" }= current_user.keys.count
.project-content
= yield

View file

@ -0,0 +1,44 @@
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo}
%aside
= link_to "History", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil
= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil
= link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do
Team
- if @project.users_projects.count > 0
%span{ :class => "number" }= @project.users_projects.count
= link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do
Issues
- if @project.issues.opened.count > 0
%span{ :class => "number" }= @project.issues.opened.count
= link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do
Wall
- if @project.common_notes.count > 0
%span{ :class => "number" }= @project.common_notes.count
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
Snippets
- if @project.snippets.count > 0
%span{ :class => "number" }= @project.snippets.non_expired.count
- if @commit
= 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
.project-content
= yield

View file

@ -10,7 +10,7 @@
%div
= f.label :note
%cite (255 symbols only)
%cite
%br
= f.text_area :note, :size => 255
@ -22,7 +22,7 @@
= check_box_tag :notify, 1, true
= label_tag :notify, "Notify project team about your note"
.clear
%br
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"

View file

@ -0,0 +1,17 @@
- unless @notes.blank?
- if params[:last_id] && params[:first_id]
:plain
NoteList.replace(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- elsif params[:last_id]
:plain
NoteList.prepend(#{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- elsif params[:first_id]
:plain
NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- else
:plain

View file

@ -1,28 +1,26 @@
- if controller.action_name == "wall"
%ul#notes-list= render "notes/notes_list"
- else
%ul#notes-list= render "notes/notes_list"
%br
%br
- if can? current_user, :write_note, @project
= render "notes/form"
- if can? current_user, :write_note, @project
= render "notes/form"
.clear
%hr
%ul#notes-list= render "notes/notes_list"
:javascript
$('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); });
$('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); });
$("#new_note").live("ajax:before", function(){
$("#submit_note").attr("disabled", "disabled");
$("#submit_note").attr("disabled", "disabled");
})
$("#new_note").live("ajax:complete", function(){
$("#submit_note").removeAttr("disabled");
$("#submit_note").removeAttr("disabled");
})
- if ["issues", "projects"].include?(controller.controller_name)
:javascript
$(function(){
var int =self.setInterval("updatePage()", 20000);
$(function(){
$("#note_note").live("click", function(){
$(this).css("height", "100px");
$('.attach_holder').show();
});
NoteList.init("wall", #{@notes.last.try(:id) || 0}, #{@notes.first.try(:id) || 0});
});

View file

@ -1,17 +1,17 @@
%li{:id => dom_id(note)}
%div.note_author
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
%div.note_content.left
= simple_format(html_escape(note.note))
- if note.attachment.url
Attachment:
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
%br
%span.author= note.author.name
%cite.ago
%li{:id => dom_id(note), :class => "note"}
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
%div.note-author
%strong= note.author_name
%cite.cgray
= time_ago_in_words(note.updated_at)
ago
%br
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
= link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative"
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
= link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note right"
%div.note-title
= markdown(note.note)
- if note.attachment.url
.right
%span.file
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
.clear

View file

@ -1,11 +1,11 @@
- if @note.valid?
:plain
$("#new_note .errors").remove();
updatePage();
$('#note_note').val("");
NoteList.prepend(#{@note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => @note})}");
- else
:plain
$("#new_note").replaceWith("#{escape_javascript(render('form'))}");
:plain
:plain
$("#submit_note").removeAttr("disabled");

View file

@ -10,9 +10,9 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%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; "}
= link_to project_issue_url(@project, @issue) do
= link_to project_issue_url(@project, @issue) do
= "Issue ##{@issue.id.to_s}"
= truncate(@issue.title, :length => 45)
= truncate(@issue.title, :length => 45)
%br
%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

View file

@ -4,7 +4,7 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%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; "}
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; "}
Administrator created account for you. Now you are a member of company gitlab application.
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}

View file

@ -4,10 +4,10 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%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; "}
New comment -
= link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do
New comment -
= link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do
= "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"}
%tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}

View file

@ -4,7 +4,7 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%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; "}
New message on
New message on
= link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}")
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%tr

View file

@ -21,10 +21,15 @@
%td
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
%tr
%td
%td
.left= f.label :code
%cite.right http://yourserver/
%td= f.text_field :code, :placeholder => "example"
%tr
%td= f.label :tag_list
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
.field
= f.label :description
%br/
@ -39,10 +44,27 @@
= image_tag "ajax-loader.gif", :class => "append-bottom"
- if @project.new_record?
%h3.prepend-top Creating project &amp; repository. Please wait for few minutes
- else
- else
%h3.prepend-top Updating project &amp; repository. Please wait for few minutes
:javascript
$('.new_project, .edit_project').bind('ajax:before', function() {
$(this).find(".form_content").hide();
$('.new_project, .edit_project').bind('ajax:before', function() {
$(this).find(".form_content").hide();
$('.ajax_loader').show();
});
});
:javascript
$(function(){
var tag_field = $('#tag_field').tagify();
tag_field.tagify('inputField').autocomplete({
source: '/tags.json'
});
$('form').submit( function() {
var tag_field = $('#tag_field')
tag_field.val( tag_field.tagify('serialize') );
return true;
});
})

View file

@ -10,13 +10,18 @@
- @projects.each do |project|
%tr{ :class => "project", :url => project_path(project) }
%td= project.name
%td
= project.name
.small-tags
- project.tag_list.each do |tag|
= link_to tag, "/tags/#{tag}"
%td= truncate project.url_to_repo
%td= project.code
%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 "admin", 1, project.admins.include?(current_user), :disabled => :disabled
%td
%td
-if can? current_user, :admin_project, project
= link_to 'Edit', edit_project_path(project), :class => "lbutton positive"
%br

View file

@ -11,7 +11,7 @@
$(".list").toggle();
if($(".tile").is(":visible")){
$.cookie('project_view', 'tile', { expires: 14 });
} else {
} else {
$.cookie('project_view', 'list', { expires: 14 });
}
}

View file

@ -6,8 +6,8 @@
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%p{:style => "margin-bottom: 3px;"}
%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.author
= commit.author.name.force_encoding("UTF-8")

Some files were not shown because too many files have changed in this diff Show more