Commit b8ca1d62 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dev'

Conflicts:
	app/assets/images/ajax-loader.gif
	public/favicon.ico
parents 23187d60 1d1b5186
...@@ -5,7 +5,7 @@ gem 'rails', '3.1.0' ...@@ -5,7 +5,7 @@ gem 'rails', '3.1.0'
gem 'sqlite3' gem 'sqlite3'
gem 'devise', "1.4.7" gem 'devise', "1.4.7"
gem 'stamp' gem 'stamp'
gem 'will_paginate', '~> 3.0' gem 'kaminari'
gem 'haml-rails' gem 'haml-rails'
gem 'jquery-rails' gem 'jquery-rails'
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git' gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
...@@ -16,10 +16,12 @@ gem 'faker' ...@@ -16,10 +16,12 @@ gem 'faker'
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git' gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
gem "inifile" gem "inifile"
gem "pygments.rb", "0.2.3" gem "pygments.rb", "0.2.3"
gem "kaminari"
gem "thin" gem "thin"
gem "git" gem "git"
gem "acts_as_list" gem "acts_as_list"
gem 'rdiscount'
gem 'acts-as-taggable-on', '~>2.1.0'
group :assets do group :assets do
gem 'sass-rails', " ~> 3.1.0" gem 'sass-rails', " ~> 3.1.0"
...@@ -27,14 +29,15 @@ group :assets do ...@@ -27,14 +29,15 @@ group :assets do
gem 'uglifier' gem 'uglifier'
end end
group :development do group :development do
gem 'letter_opener'
gem 'rails-footnotes', '>= 3.7.5.rc4' gem 'rails-footnotes', '>= 3.7.5.rc4'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
end end
group :development, :test do group :development, :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'shoulda' gem "shoulda", "~> 3.0.0.beta2"
gem 'capybara' gem 'capybara'
gem 'autotest' gem 'autotest'
gem 'autotest-rails' gem 'autotest-rails'
......
...@@ -54,6 +54,8 @@ GEM ...@@ -54,6 +54,8 @@ GEM
activesupport (= 3.1.0) activesupport (= 3.1.0)
activesupport (3.1.0) activesupport (3.1.0)
multi_json (~> 1.0) multi_json (~> 1.0)
acts-as-taggable-on (2.1.1)
rails
acts_as_list (0.1.4) acts_as_list (0.1.4)
addressable (2.2.6) addressable (2.2.6)
ansi (1.3.0) ansi (1.3.0)
...@@ -119,6 +121,8 @@ GEM ...@@ -119,6 +121,8 @@ GEM
rails (>= 3.0.0) rails (>= 3.0.0)
launchy (2.0.5) launchy (2.0.5)
addressable (~> 2.2.6) addressable (~> 2.2.6)
letter_opener (0.0.2)
launchy
libv8 (3.3.10.2) libv8 (3.3.10.2)
linecache19 (0.5.12) linecache19 (0.5.12)
ruby_core_source (>= 0.1.4) ruby_core_source (>= 0.1.4)
...@@ -161,6 +165,7 @@ GEM ...@@ -161,6 +165,7 @@ GEM
rdoc (~> 3.4) rdoc (~> 3.4)
thor (~> 0.14.6) thor (~> 0.14.6)
rake (0.9.2) rake (0.9.2)
rdiscount (1.6.8)
rdoc (3.9.4) rdoc (3.9.4)
rspec (2.6.0) rspec (2.6.0)
rspec-core (~> 2.6.0) rspec-core (~> 2.6.0)
...@@ -200,7 +205,11 @@ GEM ...@@ -200,7 +205,11 @@ GEM
ffi (>= 1.0.7) ffi (>= 1.0.7)
json_pure json_pure
rubyzip rubyzip
shoulda (2.11.3) shoulda (3.0.0.beta2)
shoulda-context (~> 1.0.0.beta1)
shoulda-matchers (~> 1.0.0.beta1)
shoulda-context (1.0.0.beta1)
shoulda-matchers (1.0.0.beta3)
simplecov (0.5.3) simplecov (0.5.3)
multi_json (~> 1.0.3) multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3) simplecov-html (~> 0.5.3)
...@@ -232,7 +241,6 @@ GEM ...@@ -232,7 +241,6 @@ GEM
multi_json (>= 1.0.2) multi_json (>= 1.0.2)
warden (1.0.5) warden (1.0.5)
rack (>= 1.0) rack (>= 1.0)
will_paginate (3.0.0)
xpath (0.1.4) xpath (0.1.4)
nokogiri (~> 1.3) nokogiri (~> 1.3)
...@@ -240,6 +248,7 @@ PLATFORMS ...@@ -240,6 +248,7 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
acts-as-taggable-on (~> 2.1.0)
acts_as_list acts_as_list
annotate! annotate!
autotest autotest
...@@ -258,14 +267,16 @@ DEPENDENCIES ...@@ -258,14 +267,16 @@ DEPENDENCIES
jquery-rails jquery-rails
kaminari kaminari
launchy launchy
letter_opener
pygments.rb (= 0.2.3) pygments.rb (= 0.2.3)
rails (= 3.1.0) rails (= 3.1.0)
rails-footnotes (>= 3.7.5.rc4) rails-footnotes (>= 3.7.5.rc4)
rdiscount
rspec-rails rspec-rails
ruby-debug19 ruby-debug19
sass-rails (~> 3.1.0) sass-rails (~> 3.1.0)
seed-fu! seed-fu!
shoulda shoulda (~> 3.0.0.beta2)
simplecov simplecov
six six
sqlite3 sqlite3
...@@ -274,4 +285,3 @@ DEPENDENCIES ...@@ -274,4 +285,3 @@ DEPENDENCIES
thin thin
turn turn
uglifier uglifier
will_paginate (~> 3.0)
[Dolphin] [Dolphin]
ShowPreview=true ShowPreview=true
Timestamp=2011,9,14,20,34,18 Timestamp=2011,10,28,13,16,25
Version=2 Version=2
...@@ -5,11 +5,15 @@ ...@@ -5,11 +5,15 @@
// the compiled file. // the compiled file.
// //
//= require jquery //= require jquery
//= require jquery-ui
//= require jquery_ujs //= require jquery_ujs
//= require jquery.ui.selectmenu
//= require jquery.tagify
//= require jquery.cookie
//= require_tree . //= require_tree .
$(function(){ $(function(){
$(".one_click_select").click(function(){ $(".one_click_select").live("click", function(){
$(this).select(); $(this).select();
}); });
...@@ -17,6 +21,6 @@ $(function(){ ...@@ -17,6 +21,6 @@ $(function(){
$('select#tag').selectmenu({style:'popup', width:200}); $('select#tag').selectmenu({style:'popup', width:200});
}); });
function updatePage(){ function updatePage(data){
$.ajax({type: "GET", url: location.href, dataType: "script"}); $.ajax({type: "GET", url: location.href, data: data, dataType: "script"});
} }
// 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);
...@@ -7,3 +7,51 @@ $(document).ready(function(){ ...@@ -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();
}
});
}
}
/* Modernizr 2.0.6 | MIT & BSD
* Contains: All core tests, html5shiv, yepnope, respond.js. Get your own custom build at www.modernizr.com/download/
*/
;window.Modernizr=function(a,b,c){function I(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=a[b]in l;return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function G(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return F(d,b)}function F(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b){return!!~(""+a).indexOf(b)}function D(a,b){return typeof a===b}function C(a,b){return B(o.join(a+";")+(b||""))}function B(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},w=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;v("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y,z={}.hasOwnProperty,A;!D(z,c)&&!D(z.call,c)?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],c)};var H=function(c,d){var f=c.join(""),g=d.length;v(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||j.touch.offsetTop===9,e.csstransforms3d=j.csstransforms3d.offsetLeft===9,e.generatedcontent=j.generatedcontent.offsetHeight>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",o.join("touch-enabled),("),i,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",o.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',m,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!D(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b].toLowerCase()+"IndexedDB"])return!0;return!!a.indexedDB},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b]+"WebSocket"])return!0;return"WebSocket"in a},r.rgba=function(){B("background-color:rgba(150,255,150,.5)");return E(k.backgroundColor,"rgba")},r.hsla=function(){B("background-color:hsla(120,40%,100%,.5)");return E(k.backgroundColor,"rgba")||E(k.backgroundColor,"hsla")},r.multiplebgs=function(){B("background:url(https://),url(https://),red url(https://)");return/(url\s*\(.*?){3}/.test(k.background)},r.backgroundsize=function(){return G("backgroundSize")},r.borderimage=function(){return G("borderImage")},r.borderradius=function(){return G("borderRadius")},r.boxshadow=function(){return G("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){C("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return G("animationName")},r.csscolumns=function(){return G("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";B((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return E(k.backgroundImage,"gradient")},r.cssreflections=function(){return G("boxReflect")},r.csstransforms=function(){return!!F(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!F(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a},r.csstransitions=function(){return G("transitionProperty")},r.fontface=function(){return e.fontface},r.generatedcontent=function(){return e.generatedcontent},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}catch(d){}return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webworkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var J in r)A(r,J)&&(y=J.toLowerCase(),e[y]=r[J](),u.push((e[y]?"":"no-")+y));e.input||I(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return;b=typeof b=="boolean"?b:!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},B(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,e._prefixes=o,e._domPrefixes=p,e.mq=w,e.hasEvent=x,e.testProp=function(a){return F([a])},e.testAllProps=G,e.testStyles=v,e.prefixed=function(a){return G(a,"pfx")},g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+u.join(" "):"");return e}(this,this.document),function(a,b){function u(){r(!0)}a.respond={},respond.update=function(){},respond.mediaQueriesSupported=b;if(!b){var c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=j.getElementsByTagName("link"),l=[],m=function(){var b=k,c=b.length,d=0,e,f,g,i;for(;d<c;d++)e=b[d],f=e.href,g=e.media,i=e.rel&&e.rel.toLowerCase()==="stylesheet",!!f&&i&&!h[f]&&(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(f)||f.replace(RegExp.$1,"").split("/")[0]===a.location.host?l.push({href:f,media:g}):h[f]=!0);n()},n=function(){if(l.length){var a=l.shift();s(a.href,function(b){o(b,a.href,a.media),h[a.href]=!0,n()})}},o=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),g=d&&d.length||0,b=b.substring(0,b.lastIndexOf("/")),h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c,j=0,k,l,m,n,o;b.length&&(b+="/"),i&&(g=1);for(;j<g;j++){k=0,i?(l=c,f.push(h(a))):(l=d[j].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),n=l.split(","),o=n.length;for(;k<o;k++)m=n[k],e.push({media:m.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:f.length-1,minw:m.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:m.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}r()},p,q,r=function(a){var b="clientWidth",h=d[b],l=c.compatMode==="CSS1Compat"&&h||c.body[b]||h,m={},n=c.createDocumentFragment(),o=k[k.length-1],s=(new Date).getTime();if(a&&p&&s-p<i)clearTimeout(q),q=setTimeout(r,i);else{p=s;for(var t in e){var u=e[t];if(!u.minw&&!u.maxw||(!u.minw||u.minw&&l>=u.minw)&&(!u.maxw||u.maxw&&l<=u.maxw))m[u.media]||(m[u.media]=[]),m[u.media].push(f[u.rules])}for(var t in g)g[t]&&g[t].parentNode===j&&j.removeChild(g[t]);for(var t in m){var v=c.createElement("style"),w=m[t].join("\n");v.type="text/css",v.media=t,v.styleSheet?v.styleSheet.cssText=w:v.appendChild(c.createTextNode(w)),n.appendChild(v),g.push(v)}j.insertBefore(n,o.nextSibling)}},s=function(a,b){var c=t();if(!!c){c.open("GET",a,!0),c.onreadystatechange=function(){c.readyState==4&&(c.status==200||c.status==304)&&b(c.responseText)};if(c.readyState==4)return;c.send()}},t=function(){var a=!1,b=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest}],c=b.length;while(c--){try{a=b[c]()}catch(d){continue}break}return function(){return a}}();m(),respond.update=m,a.addEventListener?a.addEventListener("resize",u,!1):a.attachEvent&&a.attachEvent("onresize",u)}}(this,Modernizr.mq("only all")),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var e=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,j()):e(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){j()},0)):e(a)}},0)};e(c)}else c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload();m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
\ No newline at end of file
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();
}
});
}
}
...@@ -8,7 +8,7 @@ $(document).ready(function(){ ...@@ -8,7 +8,7 @@ $(document).ready(function(){
e.stopPropagation(); e.stopPropagation();
$(this).find("td.tree-item-file-name a").click(); $(this).find("td.tree-item-file-name a").click();
return false; return false;
} }
}); });
$("#projects-list .project").live('click', function(e){ $("#projects-list .project").live('click', function(e){
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory * This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope. * the top of the compiled file, but it's generally better to create a new file per style scope.
*= require jquery-ui/jquery-ui
*= require jquery-ui/jquery.ui.selectmenu
*= require jquery-ui/jquery.tagify
*= require_self *= require_self
*= require_tree . *= require_tree .
*/ */
/* @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 */
@mixin round-borders-all($radius) { @mixin round-borders-all($radius) {
border: 1px solid #eaeaea; border: 1px solid #eaeaea;
-moz-border-radius: $radius; -moz-border-radius: $radius;
-webkit-border-radius: $radius; -webkit-border-radius: $radius;
...@@ -28,11 +28,11 @@ td.linenos{ ...@@ -28,11 +28,11 @@ td.linenos{
.highlight pre{ .highlight pre{
} }
.linenodiv pre { .linenodiv pre {
white-space:pre-line; white-space:pre-line;
} }
td.linenos { td.linenos {
background:#ECECEC; background:#ECECEC;
color:#777; color:#777;
padding:10px 0px 0px 10px; padding:10px 0px 0px 10px;
...@@ -42,7 +42,7 @@ td.linenos { ...@@ -42,7 +42,7 @@ td.linenos {
} }
td.code .highlight { td.code .highlight {
overflow: auto; overflow: auto;
} }
table.highlighttable pre{ table.highlighttable pre{
...@@ -53,9 +53,8 @@ table.highlighttable pre{ ...@@ -53,9 +53,8 @@ table.highlighttable pre{
text-align:left; text-align:left;
} }
.git-empty .highlight { .git-empty .highlight {
@include round-borders-all(4px); @include round-borders-all(4px);
background:#eee; background:#eee;
padding:5px; padding:5px;
//overflow-x:scroll; //overflow-x:scroll;
...@@ -71,10 +70,9 @@ table.highlighttable pre{ ...@@ -71,10 +70,9 @@ table.highlighttable pre{
.shadow{ .shadow{
-webkit-box-shadow:0 5px 15px #000; -webkit-box-shadow:0 5px 15px #000;
-moz-box-shadow:0 5px 15px #000; -moz-box-shadow:0 5px 15px #000;
box-shadow:0 5px 15px #000; box-shadow:0 5px 15px #000;
} }
.hll { background-color: #ffffff } .hll { background-color: #ffffff }
.c { color: #888888; font-style: italic } /* Comment */ .c { color: #888888; font-style: italic } /* Comment */
.err { color: #a61717; background-color: #e3d2d2 } /* Error */ .err { color: #a61717; background-color: #e3d2d2 } /* Error */
...@@ -105,7 +103,7 @@ table.highlighttable pre{ ...@@ -105,7 +103,7 @@ table.highlighttable pre{
.highlight .nb{color:#0086B3;} /* Name.Builtin */ .highlight .nb{color:#0086B3;} /* Name.Builtin */
.highlight .nc{color:#458;font-weight:bold;} /* Name.Class */ .highlight .nc{color:#458;font-weight:bold;} /* Name.Class */
.highlight .no{color:#008080;} /* Name.Constant */ .highlight .no{color:#008080;} /* Name.Constant */
.highlight .ni{color:#800080;} .highlight .ni{color:#800080;}
.highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */ .highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */
.highlight .nf{color:#900;font-weight:bold;} /* Name.Function */ .highlight .nf{color:#900;font-weight:bold;} /* Name.Function */
.highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */ .highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// They will automatically be included in application.css. // They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/ // You can use Sass (SCSS) here: http://sass-lang.com/
@mixin round-borders-bottom($radius) { @mixin round-borders-bottom($radius) {
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
-moz-border-radius-bottomright: $radius; -moz-border-radius-bottomright: $radius;
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
-webkit-border-bottom-right-radius: $radius; -webkit-border-bottom-right-radius: $radius;
} }
@mixin round-borders-top($radius) { @mixin round-borders-top($radius) {
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
-moz-border-radius-topright: $radius; -moz-border-radius-topright: $radius;
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
-webkit-border-top-right-radius: $radius; -webkit-border-top-right-radius: $radius;
} }
@mixin round-borders-all($radius) { @mixin round-borders-all($radius) {
border: 1px solid #eaeaea; border: 1px solid #eaeaea;
-moz-border-radius: $radius; -moz-border-radius: $radius;
-webkit-border-radius: $radius; -webkit-border-radius: $radius;
border-radius: $radius; border-radius: $radius;
} }
@mixin hover-color { @mixin hover-color {
background: #fff !important; background: #fff !important;
background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important; background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important;
background: -moz-linear-gradient(top,#fff,#FFF6BF) !important; background: -moz-linear-gradient(top,#fff,#FFF6BF) !important;
...@@ -46,47 +46,48 @@ ...@@ -46,47 +46,48 @@
border:1px solid #CCC; border:1px solid #CCC;
margin-bottom:1em; margin-bottom:1em;
.diff_file_header { .diff_file_header {
padding:5px 5px; padding:5px 5px;
border-bottom:1px solid #CCC; border-bottom:1px solid #CCC;
background: #eee; background: #eee;
} }
.diff_file_content { .diff_file_content {
overflow-x: scroll; overflow:auto;
overflow-y:hidden;
background:#fff; background:#fff;
color:#333; color:#333;
font-size: 12px; font-size: 12px;
font-family: 'Courier New', 'andale mono','lucida console',monospace; font-family: 'Courier New', 'andale mono','lucida console',monospace;
} }
.diff_file_content_image { .diff_file_content_image {
background:#eee; background:#eee;
text-align:center; text-align:center;
img { img {
padding:100px; padding:100px;
max-width:300px; max-width:300px;
} }
} }
} }
#logo { #logo {
&:hover { &:hover {
background:none; background:none;
} }
} }
.file_stats { .file_stats {
margin-bottom:10px; margin-bottom:10px;
@include round-borders-all(4px); @include round-borders-all(4px);
span { span {
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
padding:5px 5px; padding:5px 5px;
display:block; display:block;
&:first-child { &:first-child {
border-top:none; border-top:none;
} }
img { img {
width:18px; width:18px;
float:left; float:left;
margin-right: 6px; margin-right: 6px;
...@@ -94,71 +95,22 @@ ...@@ -94,71 +95,22 @@
} }
} }
.round-borders { .round-borders {
@include round-borders-all(4px); @include round-borders-all(4px);
padding: 4px 0px; padding: 4px 0px;
} }
table.round-borders { table.round-borders {
float:left; float:left;
} }
.day-commits-table { @mixin panel-color {
@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 {
background: #111 !important; background: #111 !important;
background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important; background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important;
background: -moz-linear-gradient(top,#333,#111) !important; background: -moz-linear-gradient(top,#333,#111) !important;
background: transparent 9 !important; background: transparent 9 !important;
} }
#header-panel {
#header-panel {
@include panel-color; @include panel-color;
height:40px; height:40px;
position:fixed; position:fixed;
...@@ -178,23 +130,23 @@ table.round-borders { ...@@ -178,23 +130,23 @@ table.round-borders {
color:white; color:white;
} }
&.current { &.current {
border-bottom: 3px solid #EAEAEA !important; border-bottom: 3px solid #EAEAEA !important;
padding: 10px 20px 0; padding: 10px 20px 0;
color: #eaeaea; color: #eaeaea;
} }
} }
.search-holder { .search-holder {
float:left; float:left;
width:290px; width:290px;
input { input {
@include round-borders-all(4px); @include round-borders-all(4px);
width:290px; width:290px;
border-color:#888; border-color:#888;
padding:5px; padding:5px;
background:#666; background:#666;
color:#222; color:#222;
&:focus { &:focus {
background:#fff; background:#fff;
color:#000; color:#000;
} }
...@@ -211,28 +163,23 @@ table.round-borders { ...@@ -211,28 +163,23 @@ table.round-borders {
padding:20px; padding:20px;
} }
body {
background: #eaeaea;
}
a { a {
color: #111; color: #111;
} }
.diff_file_content{ .diff_file_content{
.old_line, .new_line { .old_line, .new_line {
background:#ECECEC; background:#ECECEC;
color:#777; color:#777;
width:15px; width:30px;
float:left; float:left;
padding: 0px 10px; padding: 0px 5px;
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
} }
} }
.view_file_content{ .view_file_content{
.old_line, .new_line { .old_line, .new_line {
background:#ECECEC; background:#ECECEC;
color:#777; color:#777;
width:15px; width:15px;
...@@ -249,20 +196,20 @@ a { ...@@ -249,20 +196,20 @@ a {
border:1px solid #CCC; border:1px solid #CCC;
margin-bottom:1em; margin-bottom:1em;
.view_file_header { .view_file_header {
padding:5px 5px; padding:5px 5px;
border-bottom:1px solid #CCC; border-bottom:1px solid #CCC;
background: #eee; background: #eee;
} }
.view_file_content { .view_file_content {
background:#fff; background:#fff;
color:#514721; color:#514721;
font-size: 11px; font-size: 11px;
} }
.view_file_content_image { .view_file_content_image {
background:#eee; background:#eee;
text-align:center; text-align:center;
img { img {
padding:100px; padding:100px;
max-width:300px; max-width:300px;
} }
...@@ -273,7 +220,7 @@ a { ...@@ -273,7 +220,7 @@ a {
} }
input.ssh_project_url { input.ssh_project_url {
padding:5px; padding:5px;
margin:0px; margin:0px;
float:right; float:right;
...@@ -281,53 +228,23 @@ input.ssh_project_url { ...@@ -281,53 +228,23 @@ input.ssh_project_url {
text-align:center; text-align:center;
} }
#projects-list .project {
.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 {
height:50px; height:50px;
} }
#tree-slider .tree-item,
#projects-list .project, #projects-list .project,
#snippets-table .snippet, #snippets-table .snippet,
#issues-table .issue{ #issues-table .issue{
cursor:pointer; cursor:pointer;
&:hover {
@include hover-color;
td {
@include hover-color;
}
}
} }
.clear { .clear {
clear: both; clear: both;
} }
.top_project_menu { .top_project_menu {
a { a {
border-right: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF;
box-shadow: -1px 0 #DDDDDD inset; box-shadow: -1px 0 #DDDDDD inset;
color: #666; color: #666;
...@@ -339,7 +256,7 @@ input.ssh_project_url { ...@@ -339,7 +256,7 @@ input.ssh_project_url {
text-shadow: 0 1px 0 #FFFFFF; text-shadow: 0 1px 0 #FFFFFF;
float:left; float:left;
&.current { &.current {
background-color: #FFFFFF; background-color: #FFFFFF;
color: #222222; color: #222222;
} }
...@@ -363,11 +280,11 @@ input.ssh_project_url { ...@@ -363,11 +280,11 @@ input.ssh_project_url {
.new_project, .new_project,
.new_snippet, .new_snippet,
.edit_snippet, .edit_snippet,
.edit_project { .edit_project {
input[type='text'], input[type='text'],
input[type='email'], input[type='email'],
input[type='password'], input[type='password'],
textarea { textarea {
width:400px; width:400px;
padding:8px; padding:8px;
font-size:14px; font-size:14px;
...@@ -375,7 +292,7 @@ input.ssh_project_url { ...@@ -375,7 +292,7 @@ input.ssh_project_url {
} }
} }
.input_button { .input_button {
//@include round-borders-all(4px); //@include round-borders-all(4px);
padding:8px; padding:8px;
font-size:14px; font-size:14px;
...@@ -387,23 +304,19 @@ input.ssh_project_url { ...@@ -387,23 +304,19 @@ input.ssh_project_url {
border-width: 1px; 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 { .top_menu_count {
background: none repeat scroll 0 0 #FFF6BF; background: none repeat scroll 0 0 white;
border-color: #FFD324; color: #333;
color: #514721; border-color: #4BB8D2;
border: 1px solid #DDDDDD;
padding: 2px; padding: 2px;
font-size:12px; font-size:10px;
position:relative;
top:-14px;
left:10px;
border-top:none; border-top:none;
text-align:center;
float:right;
width:25px;
} }
#logo { #logo {
...@@ -415,9 +328,9 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -415,9 +328,9 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
text-shadow: #555 1px 1px; text-shadow: #555 1px 1px;
} }
/** FALSH **/ /** FLASH **/
#flash_container { #flash_container {
height:40px; height:40px;
position:fixed; position:fixed;
z-index:1009; z-index:1009;
...@@ -429,10 +342,11 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -429,10 +342,11 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
cursor:pointer; cursor:pointer;
border-bottom:1px solid #777; border-bottom:1px solid #777;
h4 { h4 {
color:#444; color:#444;
font-size:22px; font-size:22px;
padding-top:5px; padding-top:5px;
margin:2px;
} }
} }
...@@ -460,50 +374,25 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -460,50 +374,25 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
color: #0099FF; color: #0099FF;
} }
&.hm { &.hm {
margin: 0px 0px; margin: 0px 0px;
} }
&.vm { &.vm {
margin: 5px 0px; margin: 5px 0px;
} }
} }
/** Notes **/ /** Notes **/
#notes-list { #notes-list {
display:block; display:block;
list-style:none; list-style:none;
margin:0px; margin:0px;
padding:0px; padding:0px;
li {
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; background: none repeat scroll 0 0 #FFF6BF;
border-color: #FFD324; border-color: #FFD324;
color: #514721; color: #514721;
...@@ -515,36 +404,28 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -515,36 +404,28 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
right: 6px; right: 6px;
top: 6px; top: 6px;
} }
.note_author {
float:left;
width:60px;
}
.note_content {
float:left;
width:650px;
}
.issue_notes { .issue_notes {
.note_content { .note_content {
float:left; float:left;
width:400px; width:400px;
} }
} }
#user_projects_limit{ #user_projects_limit{
width: 60px; width: 60px;
} }
.project_thumb { .project_thumb {
margin:20px 0; margin:20px 0;
width: 250px; width: 250px;
float:left; float:left;
padding:20px; padding:20px;
text-align:center; text-align:center;
p, h4 { p, h4 {
text-align:left; text-align:left;
} }
.lbutton { .lbutton {
float:left; float:left;
} }
} }
...@@ -559,8 +440,8 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -559,8 +440,8 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
padding: 10px; padding: 10px;
} }
.recent_message_parent { .recent_message_parent {
img { img {
padding-right:10px; padding-right:10px;
} }
...@@ -571,7 +452,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -571,7 +452,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
&.dash_wall{ &.dash_wall{
border-bottom: 2px solid orange; border-bottom: 2px solid orange;
span { span {
background: orange; background: orange;
color:black; color:black;
} }
...@@ -579,14 +460,14 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -579,14 +460,14 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
&.dash_issue{ &.dash_issue{
border-bottom: 2px solid #ffbbbb; border-bottom: 2px solid #ffbbbb;
span { span {
background: #ffbbbb; background: #ffbbbb;
} }
} }
&.dash_commit{ &.dash_commit{
border-bottom: 2px solid #bbbbff; border-bottom: 2px solid #bbbbff;
span{ span{
background: #bbbbff; background: #bbbbff;
} }
} }
...@@ -594,27 +475,25 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -594,27 +475,25 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
&.dash_snippet{ &.dash_snippet{
border-bottom: 2px solid #bbffbb; border-bottom: 2px solid #bbffbb;
span{ span{
background: #bbffbb; background: #bbffbb;
} }
} }
span{
span{
border: 1px solid #aaa; border: 1px solid #aaa;
color:black; color:black;
padding:1px 4px; padding:1px 4px;
} }
h4 { h4 {
margin-bottom:3px; margin-bottom:3px;
} }
} }
.commit, .commit,
.message, .message{
#notes-list{ .author {
.author {
background: #eaeaea; background: #eaeaea;
color: #333; color: #333;
border: 1px solid #aaa; border: 1px solid #aaa;
...@@ -624,17 +503,17 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -624,17 +503,17 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
} }
/* Note textare */ /* Note textare */
#note_note { #note_note {
height:100px; height:100px;
width:97%; width:97%;
font-size:14px; font-size:14px;
} }
.wall_page { #new_note {
#note_note { #note_note {
height:25px; height:25px;
} }
.attach_holder { .attach_holder {
display:none; display:none;
} }
} }
...@@ -652,32 +531,146 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -652,32 +531,146 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
@include round-borders-all(4px); @include round-borders-all(4px);
padding:2px 4px; padding:2px 4px;
border:none; border:none;
text-shadow:none;
&.high { &.high {
background: #D12F19; background: #D12F19;
color:white; color:white;
} }
&.today { &.today {
background: #44aa22; background: #44aa22;
color:white; color:white;
} }
&.yours { &.yours {
background: #4466cc; background: #4466cc;
color:white; color:white;
} }
&.normal {
background: #2c5ca6;
color:white;
}
&.notes { &.notes {
background: #2c5c66; background: #2c5c66;
color:white; color:white;
} }
} }
#issues-table .issue { #issues-table .issue {
&.critical { &.critical {
td { td {
//background: #D12F19; //background: #D12F19;
//color:#fff; //color:#fff;
} }
} }
} }
.top_panel_issues{
#issue_search_form {
margin:5px 0;
input {
border:1px solid #D3D3D3;
padding: 3px;
height: 28px;
width: 300px;
-webkit-appearance:none;
box-sizing: border-box;
-moz-box-sizing: border-box;
&:focus {
border-color:#c2e1ef;
}
}
}
}
.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;}
/* 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; }
}
.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;
}
\ No newline at end of file
class Admin::MailerController < ApplicationController class Admin::MailerController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
...@@ -20,7 +21,7 @@ class Admin::MailerController < ApplicationController ...@@ -20,7 +21,7 @@ class Admin::MailerController < ApplicationController
else else
render :file => 'notify/note_wall_email.html.haml', :layout => 'notify' render :file => 'notify/note_wall_email.html.haml', :layout => 'notify'
end end
rescue rescue
render :text => "Preview not avaialble" render :text => "Preview not avaialble"
end end
...@@ -29,7 +30,7 @@ class Admin::MailerController < ApplicationController ...@@ -29,7 +30,7 @@ class Admin::MailerController < ApplicationController
@password = "DHasJKDHAS!" @password = "DHasJKDHAS!"
render :file => 'notify/new_user_email.html.haml', :layout => 'notify' render :file => 'notify/new_user_email.html.haml', :layout => 'notify'
rescue rescue
render :text => "Preview not avaialble" render :text => "Preview not avaialble"
end end
...@@ -38,7 +39,7 @@ class Admin::MailerController < ApplicationController ...@@ -38,7 +39,7 @@ class Admin::MailerController < ApplicationController
@user = @issue.assignee @user = @issue.assignee
@project = @issue.project @project = @issue.project
render :file => 'notify/new_issue_email.html.haml', :layout => 'notify' render :file => 'notify/new_issue_email.html.haml', :layout => 'notify'
rescue rescue
render :text => "Preview not avaialble" render :text => "Preview not avaialble"
end end
end end
class Admin::ProjectsController < ApplicationController class Admin::ProjectsController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
def index def index
@admin_projects = Project.page(params[:page]) @admin_projects = Project.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_projects }
end
end end
def show def show
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_project }
end
end end
def new def new
@admin_project = Project.new @admin_project = Project.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_project }
end
end end
def edit def edit
...@@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController ...@@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.new(params[:project]) @admin_project = Project.new(params[:project])
@admin_project.owner = current_user @admin_project.owner = current_user
respond_to do |format| if @admin_project.save
if @admin_project.save redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' } else
format.json { render json: @admin_project, status: :created, location: @admin_project } render :action => "new"
else
format.html { render action: "new" }
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
end end
end end
def update def update
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
respond_to do |format| if @admin_project.update_attributes(params[:project])
if @admin_project.update_attributes(params[:project]) redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' } else
format.json { head :ok } render :action => "edit"
else
format.html { render action: "edit" }
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController ...@@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
@admin_project.destroy @admin_project.destroy
respond_to do |format| redirect_to admin_projects_url
format.html { redirect_to admin_projects_url }
format.json { head :ok }
end
end end
end end
class Admin::TeamMembersController < ApplicationController class Admin::TeamMembersController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
def index def index
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC") @admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC")
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_team_members }
end
end end
def show def show
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_team_member }
end
end end
def new def new
@admin_team_member = UsersProject.new(params[:team_member]) @admin_team_member = UsersProject.new(params[:team_member])
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_team_member }
end
end end
def edit def edit
...@@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController ...@@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.new(params[:team_member]) @admin_team_member = UsersProject.new(params[:team_member])
@admin_team_member.project_id = params[:team_member][:project_id] @admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format| if @admin_team_member.save
if @admin_team_member.save redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' } else
format.json { render json: @admin_team_member, status: :created, location: @team_member } render action: "new"
else
format.html { render action: "new" }
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController ...@@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
@admin_team_member.project_id = params[:team_member][:project_id] @admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format| if @admin_team_member.update_attributes(params[:team_member])
if @admin_team_member.update_attributes(params[:team_member]) redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' } else
format.json { head :ok } render action: "edit"
else
format.html { render action: "edit" }
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController ...@@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
@admin_team_member.destroy @admin_team_member.destroy
respond_to do |format| redirect_to admin_team_members_url
format.html { redirect_to admin_team_members_url }
format.json { head :ok }
end
end end
end end
class Admin::UsersController < ApplicationController class Admin::UsersController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
def index def index
@admin_users = User.page(params[:page]) @admin_users = User.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_users }
end
end end
def show def show
@admin_user = User.find(params[:id]) @admin_user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_user }
end
end end
def new def new
@admin_user = User.new(:projects_limit => 10) @admin_user = User.new(:projects_limit => 10)
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_user }
end
end end
def edit def edit
...@@ -36,7 +22,7 @@ class Admin::UsersController < ApplicationController ...@@ -36,7 +22,7 @@ class Admin::UsersController < ApplicationController
def create def create
admin = params[:user].delete("admin") admin = params[:user].delete("admin")
@admin_user = User.new(params[:user]) @admin_user = User.new(params[:user])
@admin_user.admin = (admin && admin.to_i > 0) @admin_user.admin = (admin && admin.to_i > 0)
respond_to do |format| respond_to do |format|
...@@ -54,8 +40,8 @@ class Admin::UsersController < ApplicationController ...@@ -54,8 +40,8 @@ class Admin::UsersController < ApplicationController
def update def update
admin = params[:user].delete("admin") admin = params[:user].delete("admin")
if params[:user][:password].empty? if params[:user][:password].empty?
params[:user].delete(:password) params[:user].delete(:password)
params[:user].delete(:password_confirmation) params[:user].delete(:password_confirmation)
end end
@admin_user = User.find(params[:id]) @admin_user = User.find(params[:id])
......
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :view_style
protect_from_forgery protect_from_forgery
helper_method :abilities, :can? helper_method :abilities, :can?
...@@ -8,7 +10,17 @@ class ApplicationController < ActionController::Base ...@@ -8,7 +10,17 @@ class ApplicationController < ActionController::Base
render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false
end end
protected layout :layout_by_resource
protected
def layout_by_resource
if devise_controller?
"devise"
else
"application"
end
end
def abilities def abilities
@abilities ||= Six.new @abilities ||= Six.new
...@@ -18,7 +30,7 @@ class ApplicationController < ActionController::Base ...@@ -18,7 +30,7 @@ class ApplicationController < ActionController::Base
abilities.allowed?(object, action, subject) abilities.allowed?(object, action, subject)
end end
def project def project
@project ||= Project.find_by_code(params[:project_id]) @project ||= Project.find_by_code(params[:project_id])
end end
...@@ -47,19 +59,13 @@ class ApplicationController < ActionController::Base ...@@ -47,19 +59,13 @@ class ApplicationController < ActionController::Base
end end
def load_refs def load_refs
@branch = unless params[:branch].blank? unless params[:ref].blank?
params[:branch] @ref = params[:ref]
else else
nil @branch = params[:branch].blank? ? nil : params[:branch]
end @tag = params[:tag].blank? ? nil : params[:tag]
@ref = @branch || @tag || "master"
@tag = unless params[:tag].blank? end
params[:tag]
else
nil
end
@ref = @branch || @tag || "master"
end end
def render_404 def render_404
...@@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base ...@@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base
def require_non_empty_project def require_non_empty_project
redirect_to @project unless @project.repo_exists? redirect_to @project unless @project.repo_exists?
end 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 end
...@@ -2,6 +2,7 @@ require "base64" ...@@ -2,6 +2,7 @@ require "base64"
class CommitsController < ApplicationController class CommitsController < ApplicationController
before_filter :project before_filter :project
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
...@@ -12,11 +13,12 @@ class CommitsController < ApplicationController ...@@ -12,11 +13,12 @@ class CommitsController < ApplicationController
load_refs # load @branch, @tag & @ref load_refs # load @branch, @tag & @ref
@repo = project.repo @repo = project.repo
limit, offset = (params[:limit] || 20), (params[:offset] || 0)
if params[:path] 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 else
@commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0) @commits = @repo.commits(@ref, limit, offset)
end end
respond_to do |format| respond_to do |format|
...@@ -27,12 +29,12 @@ class CommitsController < ApplicationController ...@@ -27,12 +29,12 @@ class CommitsController < ApplicationController
def show def show
@commit = project.repo.commits(params[:id]).first @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") @note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit")
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html
format.js format.js { respond_with_notes }
end end
end end
end end
class DashboardController < ApplicationController class DashboardController < ApplicationController
def index def index
@projects = current_user.projects.all @projects = current_user.projects.all
@active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
end end
end end
class IssuesController < ApplicationController class IssuesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
before_filter :issue, :only => [:edit, :update, :destroy, :show] before_filter :issue, :only => [:edit, :update, :destroy, :show]
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_issue! before_filter :authorize_read_issue!
before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort] before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort]
respond_to :js respond_to :js
...@@ -34,14 +35,19 @@ class IssuesController < ApplicationController ...@@ -34,14 +35,19 @@ class IssuesController < ApplicationController
end end
def show def show
@notes = @issue.notes @notes = @issue.notes.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @issue) @note = @project.notes.new(:noteable => @issue)
respond_to do |format|
format.html
format.js { respond_with_notes }
end
end end
def create def create
@issue = @project.issues.new(params[:issue]) @issue = @project.issues.new(params[:issue])
@issue.author = current_user @issue.author = current_user
if @issue.save if @issue.save && @issue.assignee != current_user
Notify.new_issue_email(@issue).deliver Notify.new_issue_email(@issue).deliver
end end
...@@ -57,14 +63,13 @@ class IssuesController < ApplicationController ...@@ -57,14 +63,13 @@ class IssuesController < ApplicationController
end end
end end
def destroy def destroy
return access_denied! unless can?(current_user, :admin_issue, @issue) return access_denied! unless can?(current_user, :admin_issue, @issue)
@issue.destroy @issue.destroy
respond_to do |format| respond_to do |format|
format.js { render :nothing => true } format.js { render :nothing => true }
end end
end end
...@@ -78,7 +83,23 @@ class IssuesController < ApplicationController ...@@ -78,7 +83,23 @@ class IssuesController < ApplicationController
render :nothing => true render :nothing => true
end end
protected def search
terms = params['terms']
@project = Project.find(params['project'])
@issues = case params[:status].to_i
when 1 then @project.issues
when 2 then @project.issues.closed
when 3 then @project.issues.opened.assigned(current_user)
else @project.issues.opened
end
@issues = @issues.where("title LIKE ? OR content LIKE ?", "%#{terms}%", "%#{terms}%") unless terms.blank?
render :partial => 'issues'
end
protected
def issue def issue
@issue ||= @project.issues.find(params[:id]) @issue ||= @project.issues.find(params[:id])
......
class KeysController < ApplicationController class KeysController < ApplicationController
layout "profile"
respond_to :js respond_to :js
def index def index
...@@ -24,7 +25,7 @@ class KeysController < ApplicationController ...@@ -24,7 +25,7 @@ class KeysController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to keys_url } format.html { redirect_to keys_url }
format.js { render :nothing => true } format.js { render :nothing => true }
end end
end end
end end
class NotesController < ApplicationController class NotesController < ApplicationController
before_filter :project before_filter :project
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_write_note!, :only => [:create] before_filter :authorize_write_note!, :only => [:create]
respond_to :js respond_to :js
...@@ -15,10 +15,9 @@ class NotesController < ApplicationController ...@@ -15,10 +15,9 @@ class NotesController < ApplicationController
notify if params[:notify] == '1' notify if params[:notify] == '1'
end end
respond_to do |format| respond_to do |format|
format.html {redirect_to :back} format.html {redirect_to :back}
format.js format.js
end end
end end
...@@ -30,11 +29,11 @@ class NotesController < ApplicationController ...@@ -30,11 +29,11 @@ class NotesController < ApplicationController
@note.destroy @note.destroy
respond_to do |format| respond_to do |format|
format.js { render :nothing => true } format.js { render :nothing => true }
end end
end end
protected protected
def notify def notify
@project.users.reject { |u| u.id == current_user.id } .each do |u| @project.users.reject { |u| u.id == current_user.id } .each do |u|
......
class ProfileController < ApplicationController class ProfileController < ApplicationController
layout "profile"
def show def show
@user = current_user @user = current_user
end end
...@@ -14,7 +15,7 @@ class ProfileController < ApplicationController ...@@ -14,7 +15,7 @@ class ProfileController < ApplicationController
end end
def password_update def password_update
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"} params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
@user = current_user @user = current_user
if @user.update_attributes(params[:user]) if @user.update_attributes(params[:user])
......
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
before_filter :project, :except => [:index, :new, :create] before_filter :project, :except => [:index, :new, :create]
layout :determine_layout
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_project!, :except => [:index, :new, :create] before_filter :authorize_read_project!, :except => [:index, :new, :create]
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
before_filter :require_non_empty_project, :only => [:blob, :tree] before_filter :require_non_empty_project, :only => [:blob, :tree]
def index 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 end
def new def new
...@@ -23,7 +26,7 @@ class ProjectsController < ApplicationController ...@@ -23,7 +26,7 @@ class ProjectsController < ApplicationController
@project = Project.new(params[:project]) @project = Project.new(params[:project])
@project.owner = current_user @project.owner = current_user
Project.transaction do Project.transaction do
@project.save! @project.save!
@project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user) @project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user)
end end
...@@ -31,7 +34,7 @@ class ProjectsController < ApplicationController ...@@ -31,7 +34,7 @@ class ProjectsController < ApplicationController
respond_to do |format| respond_to do |format|
if @project.valid? if @project.valid?
format.html { redirect_to @project, notice: 'Project was successfully created.' } format.html { redirect_to @project, notice: 'Project was successfully created.' }
format.js format.js
else else
format.html { render action: "new" } format.html { render action: "new" }
format.js format.js
...@@ -51,10 +54,10 @@ class ProjectsController < ApplicationController ...@@ -51,10 +54,10 @@ class ProjectsController < ApplicationController
respond_to do |format| respond_to do |format|
if project.update_attributes(params[:project]) if project.update_attributes(params[:project])
format.html { redirect_to project, :notice => 'Project was successfully updated.' } format.html { redirect_to project, :notice => 'Project was successfully updated.' }
format.js format.js
else else
format.html { render action: "edit" } format.html { render action: "edit" }
format.js format.js
end end
end end
end end
...@@ -85,13 +88,12 @@ class ProjectsController < ApplicationController ...@@ -85,13 +88,12 @@ class ProjectsController < ApplicationController
def wall def wall
@note = Note.new @note = Note.new
@notes = @project.common_notes.order("created_at DESC") @notes = @project.common_notes.order("created_at DESC")
@notes = @notes.fresh.limit(20)
@notes = case params[:view] respond_to do |format|
when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day) format.html
when "all" then @notes.all format.js { respond_with_notes }
when "day" then @notes.since(Date.today.at_beginning_of_day) end
else @notes.fresh.limit(10)
end
end end
# #
...@@ -105,7 +107,7 @@ class ProjectsController < ApplicationController ...@@ -105,7 +107,7 @@ class ProjectsController < ApplicationController
if params[:commit_id] if params[:commit_id]
@commit = @repo.commits(params[:commit_id]).first @commit = @repo.commits(params[:commit_id]).first
else else
@commit = @repo.commits(@ref || "master").first @commit = @repo.commits(@ref || "master").first
end end
...@@ -114,7 +116,7 @@ class ProjectsController < ApplicationController ...@@ -114,7 +116,7 @@ class ProjectsController < ApplicationController
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
format.js do format.js do
# diasbale cache to allow back button works # diasbale cache to allow back button works
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache" response.headers["Pragma"] = "no-cache"
...@@ -132,7 +134,7 @@ class ProjectsController < ApplicationController ...@@ -132,7 +134,7 @@ class ProjectsController < ApplicationController
if @tree.is_a?(Grit::Blob) if @tree.is_a?(Grit::Blob)
send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name)
else else
head(404) head(404)
end end
rescue rescue
...@@ -147,9 +149,17 @@ class ProjectsController < ApplicationController ...@@ -147,9 +149,17 @@ class ProjectsController < ApplicationController
end end
end end
protected protected
def project def project
@project ||= Project.find_by_code(params[:id]) @project ||= Project.find_by_code(params[:id])
end end
def determine_layout
if @project && !@project.new_record?
"project"
else
"application"
end
end
end end
class SnippetsController < ApplicationController class SnippetsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_snippet! before_filter :authorize_read_snippet!
before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort] before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort]
respond_to :html respond_to :html
...@@ -13,7 +14,7 @@ class SnippetsController < ApplicationController ...@@ -13,7 +14,7 @@ class SnippetsController < ApplicationController
@snippets = @project.snippets @snippets = @project.snippets
end end
def new def new
@snippet = @project.snippets.new @snippet = @project.snippets.new
end end
......
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
class TeamMembersController < ApplicationController class TeamMembersController < ApplicationController
before_filter :project before_filter :project
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update] before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update]
def show def show
@team_member = project.users_projects.find(params[:id]) @team_member = project.users_projects.find(params[:id])
...@@ -26,7 +27,7 @@ class TeamMembersController < ApplicationController ...@@ -26,7 +27,7 @@ class TeamMembersController < ApplicationController
respond_to do |format| respond_to do |format|
format.js format.js
format.html do format.html do
unless @team_member.valid? unless @team_member.valid?
flash[:alert] = "User should have at least one role" flash[:alert] = "User should have at least one role"
end end
...@@ -41,7 +42,7 @@ class TeamMembersController < ApplicationController ...@@ -41,7 +42,7 @@ class TeamMembersController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to root_path } format.html { redirect_to root_path }
format.js { render :nothing => true } format.js { render :nothing => true }
end end
end end
end end
...@@ -4,6 +4,14 @@ module ApplicationHelper ...@@ -4,6 +4,14 @@ module ApplicationHelper
"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon"
end 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) def commit_name(project, commit)
if project.commit.id == commit.id if project.commit.id == commit.id
"master" "master"
...@@ -23,18 +31,33 @@ module ApplicationHelper ...@@ -23,18 +31,33 @@ module ApplicationHelper
end end
def last_commit(project) def last_commit(project)
if project.repo_exists? if project.repo_exists?
time_ago_in_words(project.commit.committed_date) + " ago" time_ago_in_words(project.commit.committed_date) + " ago"
else else
"Never" "Never"
end end
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 end
def search_autocomplete_source def search_autocomplete_source
projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
default_nav = [ default_nav = [
{ :label => "Keys", :url => keys_path }, { :label => "Keys", :url => keys_path },
{ :label => "Projects", :url => projects_path }, { :label => "Projects", :url => projects_path },
{ :label => "Admin", :url => admin_root_path } { :label => "Admin", :url => admin_root_path }
] ]
...@@ -42,10 +65,10 @@ module ApplicationHelper ...@@ -42,10 +65,10 @@ module ApplicationHelper
if @project && !@project.new_record? if @project && !@project.new_record?
project_nav = [ project_nav = [
{ :label => "#{@project.code} / Issues", :url => project_issues_path(@project) }, { :label => "#{@project.code} / Issues", :url => project_issues_path(@project) },
{ :label => "#{@project.code} / Wall", :url => wall_project_path(@project) }, { :label => "#{@project.code} / Wall", :url => wall_project_path(@project) },
{ :label => "#{@project.code} / Tree", :url => tree_project_path(@project) }, { :label => "#{@project.code} / Tree", :url => tree_project_path(@project) },
{ :label => "#{@project.code} / Commits", :url => project_commits_path(@project) }, { :label => "#{@project.code} / Commits", :url => project_commits_path(@project) },
{ :label => "#{@project.code} / Team", :url => team_project_path(@project) } { :label => "#{@project.code} / Team", :url => team_project_path(@project) }
] ]
end end
......
module CommitsHelper module CommitsHelper
def diff_line(line, line_new = 0, line_old = 0) def diff_line(line, line_new = 0, line_old = 0)
full_line = html_escape(line.gsub(/\n/, '')) full_line = html_escape(line.gsub(/\n/, ''))
color = if line[0] == "+" color = if line[0] == "+"
full_line = "<span class=\"old_line\">&nbsp;</span><span class=\"new_line\">#{line_new}</span> " + full_line full_line = "<span class=\"old_line\">&nbsp;</span><span class=\"new_line\">#{line_new}</span> " + full_line
"#DFD" "#DFD"
elsif line[0] == "-" elsif line[0] == "-"
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">&nbsp;</span> " + full_line full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">&nbsp;</span> " + full_line
"#FDD" "#FDD"
else else
full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line
"none" "none"
end end
......
module DashboardHelper 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 end
...@@ -12,7 +12,7 @@ module ProjectsHelper ...@@ -12,7 +12,7 @@ module ProjectsHelper
else else
true true
end end
rescue rescue
nil nil
end end
end end
module SnippetsHelper module SnippetsHelper
def lifetime_select_options
options = [
['forever', nil],
['1 day', "#{Date.current + 1.day}"],
['1 week', "#{Date.current + 1.week}"],
['1 month', "#{Date.current + 1.month}"]
]
options_for_select(options)
end
end end
...@@ -17,14 +17,14 @@ class Ability ...@@ -17,14 +17,14 @@ class Ability
:read_issue, :read_issue,
:read_snippet, :read_snippet,
:read_team_member, :read_team_member,
:read_note :read_note
] if project.readers.include?(user) ] if project.readers.include?(user)
rules << [ rules << [
:write_project, :write_project,
:write_issue, :write_issue,
:write_snippet, :write_snippet,
:write_note :write_note
] if project.writers.include?(user) ] if project.writers.include?(user)
rules << [ rules << [
...@@ -32,13 +32,13 @@ class Ability ...@@ -32,13 +32,13 @@ class Ability
:admin_issue, :admin_issue,
:admin_snippet, :admin_snippet,
:admin_team_member, :admin_team_member,
:admin_note :admin_note
] if project.admins.include?(user) ] if project.admins.include?(user)
rules.flatten rules.flatten
end end
class << self class << self
[:issue, :note, :snippet].each do |name| [:issue, :note, :snippet].each do |name|
define_method "#{name}_abilities" do |user, subject| define_method "#{name}_abilities" do |user, subject|
if subject.author == user if subject.author == user
...@@ -48,7 +48,7 @@ class Ability ...@@ -48,7 +48,7 @@ class Ability
:"admin_#{name}" :"admin_#{name}"
] ]
else else
subject.respond_to?(:project) ? subject.respond_to?(:project) ?
project_abilities(user, subject.project) : [] project_abilities(user, subject.project) : []
end end
end end
......
...@@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base ...@@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base
validates_presence_of :assignee_id validates_presence_of :assignee_id
validates_presence_of :author_id validates_presence_of :author_id
delegate :name,
:email,
:to => :author,
:prefix => true
validates :title, validates :title,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..255 }
validates :content, #validates :content,
:presence => true, #:presence => true,
:length => { :within => 0..2000 } #:length => { :within => 0..2000 }
scope :critical, where(:critical => true) scope :critical, where(:critical => true)
scope :non_critical, where(:critical => false) scope :non_critical, where(:critical => false)
...@@ -30,7 +35,7 @@ class Issue < ActiveRecord::Base ...@@ -30,7 +35,7 @@ class Issue < ActiveRecord::Base
def today? def today?
Date.today == created_at.to_date Date.today == created_at.to_date
end end
def new? def new?
today? && created_at == updated_at today? && created_at == updated_at
end end
......
...@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base ...@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base
validates :key, validates :key,
:presence => true, :presence => true,
:uniqueness => true, :uniqueness => true,
:length => { :within => 0..1024 } :length => { :within => 0..1600 }
before_save :set_identifier before_save :set_identifier
after_save :update_gitosis after_save :update_gitosis
...@@ -17,11 +17,11 @@ class Key < ActiveRecord::Base ...@@ -17,11 +17,11 @@ class Key < ActiveRecord::Base
def set_identifier def set_identifier
self.identifier = "#{user.identifier}_#{Time.now.to_i}" self.identifier = "#{user.identifier}_#{Time.now.to_i}"
end end
def update_gitosis def update_gitosis
Gitosis.new.configure do |c| Gitosis.new.configure do |c|
c.update_keys(identifier, key) c.update_keys(identifier, key)
projects.each do |project| projects.each do |project|
c.update_project(project.path, project.gitosis_writers) c.update_project(project.path, project.gitosis_writers)
end end
......
...@@ -7,18 +7,23 @@ class Note < ActiveRecord::Base ...@@ -7,18 +7,23 @@ class Note < ActiveRecord::Base
belongs_to :author, belongs_to :author,
:class_name => "User" :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_presence_of :project
validates :note, validates :note,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..5000 }
validates :attachment, validates :attachment,
:file_size => { :file_size => {
:maximum => 10.megabytes.to_i :maximum => 10.megabytes.to_i
} }
scope :common, where(:noteable_id => nil) scope :common, where(:noteable_id => nil)
......
...@@ -9,6 +9,8 @@ class Project < ActiveRecord::Base ...@@ -9,6 +9,8 @@ class Project < ActiveRecord::Base
has_many :notes, :dependent => :destroy has_many :notes, :dependent => :destroy
has_many :snippets, :dependent => :destroy has_many :snippets, :dependent => :destroy
acts_as_taggable
validates :name, validates :name,
:uniqueness => true, :uniqueness => true,
:presence => true, :presence => true,
...@@ -20,7 +22,7 @@ class Project < ActiveRecord::Base ...@@ -20,7 +22,7 @@ class Project < ActiveRecord::Base
:format => { :with => /^[a-zA-Z0-9_\-]*$/, :format => { :with => /^[a-zA-Z0-9_\-]*$/,
:message => "only letters, digits & '_' '-' allowed" }, :message => "only letters, digits & '_' '-' allowed" },
:length => { :within => 0..255 } :length => { :within => 0..255 }
validates :description, validates :description,
:length => { :within => 0..2000 } :length => { :within => 0..2000 }
...@@ -57,13 +59,13 @@ class Project < ActiveRecord::Base ...@@ -57,13 +59,13 @@ class Project < ActiveRecord::Base
c.update_project(path, gitosis_writers) c.update_project(path, gitosis_writers)
end end
end end
def destroy_gitosis_project def destroy_gitosis_project
Gitosis.new.configure do |c| Gitosis.new.configure do |c|
c.destroy_project(self) c.destroy_project(self)
end end
end end
def add_access(user, *access) def add_access(user, *access)
opts = { :user => user } opts = { :user => user }
access.each { |name| opts.merge!(name => true) } access.each { |name| opts.merge!(name => true) }
...@@ -102,12 +104,12 @@ class Project < ActiveRecord::Base ...@@ -102,12 +104,12 @@ class Project < ActiveRecord::Base
def url_to_repo def url_to_repo
"#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
end end
def path_to_repo def path_to_repo
GITOSIS["base_path"] + path + ".git" GITOSIS["base_path"] + path + ".git"
end end
def repo def repo
@repo ||= Grit::Repo.new(path_to_repo) @repo ||= Grit::Repo.new(path_to_repo)
end end
...@@ -119,32 +121,52 @@ class Project < ActiveRecord::Base ...@@ -119,32 +121,52 @@ class Project < ActiveRecord::Base
repo rescue false repo rescue false
end 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) def commit(commit_id = nil)
if commit_id if commit_id
repo.commits(commit_id).first repo.commits(commit_id).first
else else
repo.commits.first repo.commits.first
end end
end end
def heads def heads
@heads ||= repo.heads @heads ||= repo.heads
end end
def fresh_commits def fresh_commits(n = 10)
commits = heads.map do |h| commits = heads.map do |h|
repo.commits(h.name, 10) repo.commits(h.name, n)
end.flatten.uniq { |c| c.id } end.flatten.uniq { |c| c.id }
commits.sort! do |x, y| commits.sort! do |x, y|
y.committed_date <=> x.committed_date y.committed_date <=> x.committed_date
end end
commits[0..10] commits[0...n]
end end
def commits_since(date) def commits_since(date)
commits = heads.map do |h| commits = heads.map do |h|
repo.log(h.name, nil, :since => date) repo.log(h.name, nil, :since => date)
end.flatten.uniq { |c| c.id } end.flatten.uniq { |c| c.id }
...@@ -165,7 +187,7 @@ class Project < ActiveRecord::Base ...@@ -165,7 +187,7 @@ class Project < ActiveRecord::Base
unless owner.can_create_project? unless owner.can_create_project?
errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it") errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it")
end end
rescue rescue
errors[:base] << ("Cant check your ability to create project") errors[:base] << ("Cant check your ability to create project")
end end
......
...@@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base ...@@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base
validates :title, validates :title,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..255 }
validates :file_name, validates :file_name,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..255 }
...@@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base ...@@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base
:presence => true, :presence => true,
:length => { :within => 0..10000 } :length => { :within => 0..10000 }
scope :fresh, order("created_at DESC")
scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current])
def self.content_types def self.content_types
[ [
".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java", ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb", ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
".js", ".sh", ".coffee", ".yml", ".md" ".js", ".sh", ".coffee", ".yml", ".md"
...@@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base ...@@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base
def colorize def colorize
system_colorize(content, file_name) system_colorize(content, file_name)
end end
def expired?
expires_at && expires_at < Time.current
end
end end
# == Schema Information # == Schema Information
# #
...@@ -47,5 +53,6 @@ end ...@@ -47,5 +53,6 @@ end
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# file_name :string(255) # file_name :string(255)
# expires_at :datetime
# #
...@@ -5,7 +5,7 @@ class User < ActiveRecord::Base ...@@ -5,7 +5,7 @@ class User < ActiveRecord::Base
:recoverable, :rememberable, :trackable, :validatable :recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model # Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, attr_accessible :email, :password, :password_confirmation, :remember_me,
:name, :projects_limit, :skype, :linkedin, :twitter :name, :projects_limit, :skype, :linkedin, :twitter
has_many :users_projects, :dependent => :destroy has_many :users_projects, :dependent => :destroy
......
%p This is page with preview for all system emails that are sent to user %p This is page with preview for all system emails that are sent to user
%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system %p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system
#accordion #accordion
%h3 %h3
%a New user %a New user
%div %div
%iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"} %iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"}
%h3 %h3
%a New issue %a New issue
%div %div
%iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"} %iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"}
%h3 %h3
%a Commit note %a Commit note
%div %div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"} %iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"}
%h3 %h3
%a Issue note %a Issue note
%div %div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"} %iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"}
%h3 %h3
%a Wall note %a Wall note
%div %div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"}
:javascript
:javascript
$(function() { $(function() {
$( "#accordion" ).accordion(); }); $( "#accordion" ).accordion(); });
%table %table
%tr %thead
%th Name %th Name
%th Code %th Code
%th Path %th Path
......
%p#notice= notice %p#notice= notice
.span-8.colborder .span-8.colborder
%h2= @admin_project.name %h2= @admin_project.name
%p %p
%b Name: %b Name:
...@@ -22,16 +22,16 @@ ...@@ -22,16 +22,16 @@
.span-14 .span-14
%h2 Team %h2 Team
%table.round-borders %table.round-borders
%tr %tr
%th Name %th Name
%th Added %th Added
%th Web %th Web
%th Git %th Git
%th Admin %th Admin
%th %th
- @admin_project.users_projects.each do |tm| - @admin_project.users_projects.each do |tm|
%tr %tr
......
- @admin_team_members.group_by(&:project).sort.each do |project, members| - @admin_team_members.group_by(&:project).sort.each do |project, members|
%h3= link_to project.name, [:admin, project] %h3= link_to project.name, [:admin, project]
%table %table
%tr %thead
%th Name %th Name
%th Email %th Email
%th Read %th Read
%th Git %th Git
%th Manage %th Manage
%th Added %th Added
%th %th
%th %th
%th %th
- members.each do |tm| - members.each do |tm|
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
%b Since: %b Since:
= @admin_team_member.updated_at = @admin_team_member.updated_at
.span-10 .span-10
.span-6 .span-6
%b Access: %b Access:
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
.field .field
= f.label :twitter = f.label :twitter
%br %br
= f.text_field :twitter = f.text_field :twitter
.clear .clear
%br %br
.actions .actions
......
%table %table
%tr %thead
%th Admin %th Admin
%th Name %th Name
%th Email %th Email
......
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
= render 'form' = render 'form'
= link_to 'Back', admin_users_path, :class => "right lbutton" = link_to 'Back', admin_users_path, :class => "right lbutton"
...@@ -19,28 +19,27 @@ ...@@ -19,28 +19,27 @@
= @admin_user.skype = @admin_user.skype
%p %p
%b LinkedIn: %b LinkedIn:
= @admin_user.linkedin = @admin_user.linkedin
%p %p
%b Twitter: %b Twitter:
= @admin_user.twitter = @admin_user.twitter
.clear .clear
= link_to 'Edit', edit_admin_user_path(@admin_user) = link_to 'Edit', edit_admin_user_path(@admin_user)
\| \|
= link_to 'Back', admin_users_path = link_to 'Back', admin_users_path
.span-14 .span-14
%h2 Projects %h2 Projects
%table.round-borders %table.round-borders
%tr %tr
%th Name %th Name
%th Added %th Added
%th Web %th Web
%th Git %th Git
%th Admin %th Admin
%th %th
- @admin_user.users_projects.each do |tm| - @admin_user.users_projects.each do |tm|
- project = tm.project - project = tm.project
......
- @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits|
.day-commits-table %div{ :class => "commits-date ui-box ui-box-small ui-box-big" }
.day-header .day-commits-table
%h3= day.stamp("28 Aug, 2010") %h3= day.stamp("28 Aug, 2010")
%ul .data
- commits.each do |commit| - commits.each do |commit|
%li{ :class => "commit", :url => project_commit_path(@project, :id => commit.id) } %a{ :class => "commit", :href => project_commit_path(@project, :id => commit.id) }
- if commit.author.email %span.commit-info
= image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" %data.commit-button
- else = truncate(commit.id.to_s, :length => 16)
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" %i
%p %data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"}
%strong Browse Code
= truncate(commit.safe_message, :length => 60) - if commit.author_email
= link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right" = image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
= link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right" - else
%span = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%span.author %span.commit-title
= commit.author %strong
= time_ago_in_words(commit.committed_date) = truncate(commit.safe_message, :length => 60)
ago %span.commit-author
= more_commits_link if @commits.size > 99 %strong= commit.author_name
= time_ago_in_words(commit.committed_date)
ago
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
.diff_file_header .diff_file_header
- if diff.deleted_file - if diff.deleted_file
%strong{:id => "#{diff.b_path}"}= diff.a_path %strong{:id => "#{diff.b_path}"}= diff.a_path
- else - else
= link_to tree_file_project_path(@project, @commit.id, diff.b_path) do = link_to tree_file_project_path(@project, @commit.id, diff.b_path) do
%strong{:id => "#{diff.b_path}"}= diff.b_path %strong{:id => "#{diff.b_path}"}= diff.b_path
%br/ %br/
...@@ -19,5 +19,5 @@ ...@@ -19,5 +19,5 @@
.diff_file_content_image .diff_file_content_image
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else - else
%p %p
%center No preview for this file type %center No preview for this file type
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
%h1 Listing commits %h1 Listing commits
%div{:id => dom_id(@project)} %div{:id => dom_id(@project)}
= render "commits" = render "commits"
%br/ %br/
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- line_new = 0 - line_new = 0
- lines_arr = diff.diff.lines.to_a - lines_arr = diff.diff.lines.to_a
- lines_arr.each do |line| - lines_arr.each do |line|
- next if line.match(/^--- \/dev\/null/)
- next if line.match(/^--- a/) - next if line.match(/^--- a/)
- next if line.match(/^\+\+\+ b/) - next if line.match(/^\+\+\+ b/)
- if line.match(/^@@ -/) - if line.match(/^@@ -/)
...@@ -12,10 +13,10 @@ ...@@ -12,10 +13,10 @@
= diff_line(line, line_new, line_old) = diff_line(line, line_new, line_old)
- if line[0] == "+" - if line[0] == "+"
- line_new += 1 - line_new += 1
- elsif - elsif
- line[0] == "-" - line[0] == "-"
- line_old += 1 - line_old += 1
- else - else
- line_new += 1 - line_new += 1
- line_old += 1 - line_old += 1
%div - content_for(:body_class, "project-page commits-page")
%h3
.left -#%a.right.button{:href => "#"} Download
= form_tag project_commits_path(@project), :method => :get do -#-if can? current_user, :admin_project, @project
= select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" %a.right.button.blue{:href => "#"} EDIT
&nbsp; %h2.icon
.left.prepend-1 %span
= form_tag project_commits_path(@project), :method => :get do %d
= select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" = link_to project_commits_path(@project) do
= text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"] = @project.name
.clear - if params[:path]
- if params[:path] \/
%h3{:style => "color:#555"} /#{params[:path]} %a{:href => "#"}= params[:path].split("/").join(" / ")
%div{:id => dom_id(@project)}
= render "commits" .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);
});
:plain
CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}");
%h3 %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" -#= link_to 'Back', project_commits_path(@project), :class => "button"
%table.round-borders %table.round-borders
%tr %tr
...@@ -7,33 +7,21 @@ ...@@ -7,33 +7,21 @@
%td= @commit.id %td= @commit.id
%tr %tr
%td Author %td Author
%td= @commit.author %td= @commit.author_name
%tr
%td Commiter
%td= @commit.committer
%tr %tr
%td Commited Date %td Commited Date
%td= @commit.committed_date %td= @commit.committed_date.stamp("21 Aug 2011, 11:15pm")
%tr %tr
%td Message %td Message
%td= @commit.safe_message %td
%pre.commit_message
= preserve @commit.safe_message
%tr %tr
%td Tree %td Tree
%td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id) %td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id)
.clear .clear
#tabs %br
%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"
:javascript = render "commits/diff"
$(function() { $( "#tabs" ).tabs(); }); = render "notes/notes"
-#:plain = render "notes/load"
$("#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'))}");
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
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
<div><%= f.submit "Resend confirmation instructions" %></div> <div><%= f.submit "Resend confirmation instructions" %></div>
<% end %> <% end %>
<%= render :partial => "devise/shared/links" %> <%= render :partial => "devise/shared/links" %>
\ No newline at end of file
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
<div><%= f.submit "Change my password" %></div> <div><%= f.submit "Change my password" %></div>
<% end %> <% end %>
<%= render :partial => "devise/shared/links" %> <%= render :partial => "devise/shared/links" %>
\ No newline at end of file
<h2>Forgot your password?</h2> <%= 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" %>
<div class="span-12 colborder"> <%= devise_error_messages! %>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> <%= f.email_field :email, :placeholder => "Email", :class => "text top" %>
<%= devise_error_messages! %> <br/>
<%= f.submit "Reset password", :class => "grey-button" %>
<div><%= f.label :email %><br /> <div class="right"> <%= render :partial => "devise/shared/links" %></div>
<%= f.email_field :email %></div> <% end %>
<div><%= f.submit "Send me reset password instructions", :class => "lbutton vm" %></div>
<% end %>
</div>
<div>
<%= render :partial => "devise/shared/links" %>
</div>
<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"> <% if devise_mapping.rememberable? -%>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<div><%= f.label :email %><br /> <% end -%>
<%= f.text_field :email %></div> <br/>
<%= f.submit "Sign in", :class => "grey-button" %>
<div><%= f.label :password %><br /> <div class="right"> <%= render :partial => "devise/shared/links" %></div>
<%= f.password_field :password %></div> <% end %>
<% 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>
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
<%- resource_class.omniauth_providers.each do |provider| %> <%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%> <% end -%>
<% end -%> <% end -%>
\ No newline at end of file
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
<div><%= f.submit "Resend unlock instructions" %></div> <div><%= f.submit "Resend unlock instructions" %></div>
<% end %> <% end %>
<%= render :partial => "devise/shared/links" %> <%= render :partial => "devise/shared/links" %>
\ No newline at end of file
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
.span-8 .span-8
= f.label :title = f.label :title
= f.text_field :title, :style => "width:450px" = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255
.span-8 -#.span-8
= f.label :content -#= f.label :content
= f.text_area :content, :style => "width:450px; height:130px" -#= f.text_area :content, :style => "width:450px; height:130px"
.span-8.append-bottom .span-8.append-bottom
= f.label :assignee_id = f.label :assignee_id
= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
......
%table.round-borders#issues-table %table.round-borders#issues-table
%tr %thead
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
%th %th
%th Assignee %th Assignee
%th ID %th ID
%th Title %th Title
%th Closed? %th Closed?
%th
- @issues.critical.each do |issue| - @issues.critical.each do |issue|
= render(:partial => 'show', :locals => {:issue => issue}) = render(:partial => 'show', :locals => {:issue => issue})
......
%tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) }
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" - if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0")
%td %td
= image_tag "move.png" , :class => [:handle, :left] = image_tag "move.png" , :class => [:handle, :left]
%td %td
= image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= truncate issue.assignee.name, :lenght => 20 = issue.assignee.name
%td ##{issue.id} %td ##{issue.id}
%td %td
= html_escape issue.title = truncate(html_escape(issue.title), :length => 200)
%br
%br %br
- if issue.critical - if issue.critical
%span.tag.high critical %span.tag.high critical
- if issue.today? - if issue.today?
%span.tag.today 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 -#- if issue.author == current_user
-#%span.tag.yours yours -#%span.tag.yours yours
-#- if issue.notes.count > 0 -#- if issue.notes.count > 0
...@@ -21,13 +30,8 @@ ...@@ -21,13 +30,8 @@
-#notes -#notes
%td %td
- if can? current_user, :write_issue, @project - if can? current_user, :write_issue, @project
= form_for([@project, issue], :remote => true) do |f| = form_for([@project, issue], :remote => true) do |f|
= f.check_box :closed, :onclick => "$(this).parent().submit();" = f.check_box :closed, :onclick => "$(this).parent().submit();"
= hidden_field_tag :status_only, true = hidden_field_tag :status_only, true
- else - else
= check_box_tag "closed", 1, issue.closed, :disabled => true = check_box_tag "closed", 1, issue.closed, :disabled => true
%td
- 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}"
%div %div
- if can? current_user, :write_issue, @project .top_panel_issues
.left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" - if can? current_user, :write_issue, @project
.right %div{:class => "left", :style => "margin-right: 10px;" }
= form_tag project_issues_path(@project), :method => :get do = link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
.span-2 = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues" = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
= label_tag "open_issues","Open" = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
.span-2
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues" .right.issues_filter
= label_tag "closed_issues","Closed" = form_tag project_issues_path(@project), :method => :get do
.span-2 .left
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues" = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status"
= label_tag "my_issues","To Me" = label_tag "open_issues","Open"
.left
.span-2 = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status"
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues" = label_tag "closed_issues","Closed"
= label_tag "all_issues","All" .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" #issues-table-holder= render "issues"
%br %br
:javascript :javascript
$('.delete-issue').live('ajax:success', function() { var href = $('.issue_search').parent().attr('action');
$(this).closest('tr').fadeOut(); }); var last_terms = '';
$('.issue_search').keyup(function() {
var terms = $(this).val();
var project_id = $('#project_id').val();
var status = $('.status:checked').val();
if (terms != last_terms) {
last_terms = terms;
if (terms.length >= 2 || terms.length == 0) {
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
$('#issues-table').html(response);
setSortable();
});
}
}
});
$('.delete-issue').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); updatePage();});
function setSortable(){ function setSortable(){
$('#issues-table>tbody').sortable({ $('#issues-table>tbody').sortable({
axis: 'y', axis: 'y',
......
%h2 %h2
= "Issue ##{@issue.id} - #{@issue.title}" %strong
Issue
.span-15 = "##{@issue.id}"
= simple_format html_escape(@issue.content) &ndash;
= html_escape(@issue.title)
.left.width-65p
.issue_notes= render "notes/notes" .issue_notes= render "notes/notes"
.span-8.right
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
.right.width-30p
.span-8 .span-8
- if @issue.closed
%center.success Closed
- else
%center.error Open
%table.round-borders %table.round-borders
%tr %tr
%td Title: %td Author:
%td
= truncate html_escape(@issue.title)
%tr
%td Project
%td
%strong= @issue.project.name
%tr
%td Author:
%td %td
= image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" = image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= @issue.author.name = @issue.author.name
%tr %tr
%td Assignee: %td Assignee:
%td %td
= image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= @issue.assignee.name = @issue.assignee.name
%tr
%td Tags
%td
- if @issue.critical
%span.tag.high critical
- else
%span.tag.normal normal
- if @issue.today?
%span.tag.today today
%tr %tr
%td Closed? %td Closed?
%td %td
- if can? current_user, :write_issue, @project - if can? current_user, :write_issue, @issue
= form_for([@project, @issue]) do |f| = form_for([@project, @issue]) do |f|
= f.check_box :closed, :onclick => "$(this).parent().submit();" = f.check_box :closed, :onclick => "$(this).parent().submit();"
= hidden_field_tag :status_only, true = hidden_field_tag :status_only, true
- else - else
= check_box_tag "closed", 1, @issue.closed, :disabled => true = check_box_tag "closed", 1, @issue.closed, :disabled => true
- if can?(current_user, :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 .clear
:plain = render "notes/load"
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
- if @issue.valid? - if @issue.valid?
:plain :plain
$("##{dom_id(@issue)}").fadeOut(); $("##{dom_id(@issue)}").fadeOut();
- else - else
- if @issue.valid? - if @issue.valid?
:plain :plain
$("#edit_issue_dialog").dialog("close"); $("#edit_issue_dialog").dialog("close");
$.ajax({type: "GET", url: location.href, dataType: "script"}); updatePage();
- else - else
:plain :plain
$("#edit_issue_dialog").empty(); $("#edit_issue_dialog").empty();
......
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
= render(:partial => 'show', :locals => {:key => key}) = render(:partial => 'show', :locals => {:key => key})
:javascript :javascript
$('.delete-key').live('ajax:success', function() { $('.delete-key').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); }); $(this).closest('tr').fadeOut(); });
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
%h4= text %h4= text
:javascript :javascript
$(function(){ $(function(){
$("#flash_container").slideDown("slow"); $("#flash_container").slideDown("slow");
$("#flash_container").click(function(){ $("#flash_container").click(function(){
$(this).slideUp("slow"); $(this).slideUp("slow");
}); });
setTimeout("hideFlash()",2000); setTimeout("hideFlash()",2000);
}); });
......
<div id="header-panel"> <!-- Page Header -->
<div class="container"> <header>
<div class="span-24"> <h1 class="logo">
<div class="span-10"> <a href="/">GITLAB</a>
<%#= image_tag "git.png", :height => 40, :class => "left" %> </h1>
<%#= link_to "gitlab", root_path, :id => "logo" %> <div class="account-box">
<span class="search-holder"> <%= link_to profile_path, :class => "pic" do %>
<%= text_field_tag "search", nil, :placeholder => "Search" %> <%= image_tag gravatar_icon(current_user.email) %>
</span> <% end %>
</div>
<div class="right"> <a href="#" class="arrow-up"></a>
<%= 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" %> <div class="account-links">
<%= link_to('Admin', admin_root_path, :class => admin_namespace? ? "current button" : "button" ) if current_user.is_admin? %> <%= link_to profile_path, :class => "username" do %>
<%= link_to profile_path, :class => ((controller.controller_name == "keys" || controller.controller_name == "profile") ? "current button" : "button") do %> <%#= current_user.name %>
<%= image_tag gravatar_icon(current_user.email) %> Your profile
<%= current_user.name.split(" ").first %> <% end %>
<% end %> <%= link_to "Fluid layout", url_for( :view_style => 'fluid' ) if cookies[:view_style] == "collapsed"%>
<%= link_to 'Logout', destroy_user_session_path, :style => "border-left: 1px solid #666;", :class => "button", :method => :delete %> <%= link_to "Fixed layout", url_for( :view_style => 'collapsed' ) unless cookies[:view_style] == "collapsed"%>
</div> <%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %>
</div> </div>
</div><!-- .account-box -->
<div class="search">
<%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %>
</div> </div>
</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 %> <% if current_user %>
<%= javascript_tag do %> <%= javascript_tag do %>
......
- if content_for?(:page_title)
= yield :page_title
!!!
%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
...@@ -2,28 +2,16 @@ ...@@ -2,28 +2,16 @@
%html %html
%head %head
%title %title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?} GitLab
= 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"
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body#thebody %body{ :class => body_class, :id => yield(:boyd_id)}
= render :partial => "layouts/flash" #container
- if user_signed_in? = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
.top_bar.container = render :partial => "layouts/page_title"
= render :partial => "projects/top_menu" if @project && !@project.new_record? = yield
= 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
!!!
%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
!!!
%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
!!!
%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
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%div %div
= f.label :note = f.label :note
%cite (255 symbols only) %cite
%br %br
= f.text_area :note, :size => 255 = f.text_area :note, :size => 255
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
= check_box_tag :notify, 1, true = check_box_tag :notify, 1, true
= label_tag :notify, "Notify project team about your note" = label_tag :notify, "Notify project team about your note"
.clear .clear
%br %br
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note" = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
- 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
- if controller.action_name == "wall" - if can? current_user, :write_note, @project
%ul#notes-list= render "notes/notes_list" = render "notes/form"
.clear
- else %hr
%ul#notes-list= render "notes/notes_list" %ul#notes-list= render "notes/notes_list"
%br
%br
- if can? current_user, :write_note, @project
= render "notes/form"
:javascript :javascript
$('.delete-note').live('ajax:success', function() { $('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); }); $(this).closest('li').fadeOut(); });
$("#new_note").live("ajax:before", function(){ $("#new_note").live("ajax:before", function(){
$("#submit_note").attr("disabled", "disabled"); $("#submit_note").attr("disabled", "disabled");
}) })
$("#new_note").live("ajax:complete", function(){ $("#new_note").live("ajax:complete", function(){
$("#submit_note").removeAttr("disabled"); $("#submit_note").removeAttr("disabled");
}) })
- if ["issues", "projects"].include?(controller.controller_name) $(function(){
:javascript $("#note_note").live("click", function(){
$(function(){ $(this).css("height", "100px");
var int =self.setInterval("updatePage()", 20000); $('.attach_holder').show();
}); });
NoteList.init("wall", #{@notes.last.try(:id) || 0}, #{@notes.first.try(:id) || 0});
});
%li{:id => dom_id(note)} %li{:id => dom_id(note), :class => "note"}
%div.note_author = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" %div.note-author
%div.note_content.left %strong= note.author_name
= simple_format(html_escape(note.note)) %cite.cgray
- if note.attachment.url
Attachment:
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
%br
%span.author= note.author.name
%cite.ago
= time_ago_in_words(note.updated_at) = time_ago_in_words(note.updated_at)
ago ago
%br - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
- 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"
= link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative"
%div.note-title
= markdown(note.note)
- if note.attachment.url
.right
%span.file
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
.clear .clear
- if @note.valid? - if @note.valid?
:plain :plain
$("#new_note .errors").remove(); $("#new_note .errors").remove();
updatePage();
$('#note_note').val(""); $('#note_note').val("");
NoteList.prepend(#{@note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => @note})}");
- else - else
:plain :plain
$("#new_note").replaceWith("#{escape_javascript(render('form'))}"); $("#new_note").replaceWith("#{escape_javascript(render('form'))}");
:plain :plain
$("#submit_note").removeAttr("disabled"); $("#submit_note").removeAttr("disabled");
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %td{:align => "left", :style => "padding: 20px 0 0;"}
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
= link_to project_issue_url(@project, @issue) do = link_to project_issue_url(@project, @issue) do
= "Issue ##{@issue.id.to_s}" = "Issue ##{@issue.id.to_s}"
= truncate(@issue.title, :length => 45) = truncate(@issue.title, :length => 45)
%br %br
%cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
= @issue.content = @issue.content
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %td{:align => "left", :style => "padding: 20px 0 0;"}
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
Hi #{@user.name}! Hi #{@user.name}!
%p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
Administrator created account for you. Now you are a member of company gitlab application. Administrator created account for you. Now you are a member of company gitlab application.
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %td{:align => "left", :style => "padding: 20px 0 0;"}
%h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
New comment - New comment -
= link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do = link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do
= "Issue ##{@issue.id.to_s}" = "Issue ##{@issue.id.to_s}"
= truncate(@issue.title, :length => 35) = truncate(@issue.title, :length => 35)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %td{:align => "left", :style => "padding: 20px 0 0;"}
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
New message on New message on
= link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}") = link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}")
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%tr %tr
......
...@@ -21,10 +21,15 @@ ...@@ -21,10 +21,15 @@
%td %td
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
%tr %tr
%td %td
.left= f.label :code .left= f.label :code
%cite.right http://yourserver/ %cite.right http://yourserver/
%td= f.text_field :code, :placeholder => "example" %td= f.text_field :code, :placeholder => "example"
%tr
%td= f.label :tag_list
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
.field .field
= f.label :description = f.label :description
%br/ %br/
...@@ -39,10 +44,27 @@ ...@@ -39,10 +44,27 @@
= image_tag "ajax-loader.gif", :class => "append-bottom" = image_tag "ajax-loader.gif", :class => "append-bottom"
- if @project.new_record? - if @project.new_record?
%h3.prepend-top Creating project &amp; repository. Please wait for few minutes %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 %h3.prepend-top Updating project &amp; repository. Please wait for few minutes
:javascript :javascript
$('.new_project, .edit_project').bind('ajax:before', function() { $('.new_project, .edit_project').bind('ajax:before', function() {
$(this).find(".form_content").hide(); $(this).find(".form_content").hide();
$('.ajax_loader').show(); $('.ajax_loader').show();
}); });
: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;
});
})
...@@ -10,13 +10,18 @@ ...@@ -10,13 +10,18 @@
- @projects.each do |project| - @projects.each do |project|
%tr{ :class => "project", :url => project_path(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= truncate project.url_to_repo
%td= project.code %td= project.code
%td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
%td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled
%td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled
%td %td
-if can? current_user, :admin_project, project -if can? current_user, :admin_project, project
= link_to 'Edit', edit_project_path(project), :class => "lbutton positive" = link_to 'Edit', edit_project_path(project), :class => "lbutton positive"
%br %br
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
$(".list").toggle(); $(".list").toggle();
if($(".tile").is(":visible")){ if($(".tile").is(":visible")){
$.cookie('project_view', 'tile', { expires: 14 }); $.cookie('project_view', 'tile', { expires: 14 });
} else { } else {
$.cookie('project_view', 'list', { expires: 14 }); $.cookie('project_view', 'list', { expires: 14 });
} }
} }
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%p{:style => "margin-bottom: 3px;"} %p{:style => "margin-bottom: 3px;"}
%strong %strong
= link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id)
%span %span
%span.author %span.author
= commit.author.name.force_encoding("UTF-8") = commit.author.name.force_encoding("UTF-8")
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
%p{:style => "margin-bottom: 3px;"} %p{:style => "margin-bottom: 3px;"}
%span.author %span.author
= note.author.name = note.author.name
= link_to truncate(note.note, :length => 200), link_to_item + "#note_#{note.id}" = link_to markdown(truncate(note.note, :length => 200)), link_to_item + "#note_#{note.id}"
- if note.attachment.url - if note.attachment.url
%br %br
Attachment: Attachment:
......
= form_tag destination, :method => :get, :class => "project-refs-form" do
= select_tag "ref", grouped_options_refs, :onchange => "this.form.submit();", :class => "project-refs-select"
:javascript
$(function(){
$('.project-refs-select').chosen();
})
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
%div#new-member-holder %div#new-member-holder
= link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "lbutton vm" = link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "lbutton vm"
%table.round-borders#team-table %table.round-borders#team-table
%tr %thead
%th Name %th Name
%th Email %th Email
%th Web %th Web
...@@ -14,5 +14,5 @@ ...@@ -14,5 +14,5 @@
= render(:partial => 'team_members/show', :locals => {:member => up}) = render(:partial => 'team_members/show', :locals => {:member => up})
:javascript :javascript
$('.delete-team-member').live('ajax:success', function() { $('.delete-team-member').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); }); $(this).closest('tr').fadeOut(); });
- @projects.in_groups_of(3, false) do |projects| - @projects.in_groups_of(3, false) do |projects|
- projects.each_with_index do |project, i| - projects.each_with_index do |project, i|
%div{ :class => "project_thumb round-borders", :style => i == 2 ? "" : "margin-right:30px;" } %div.grid_1
%div{ :class => "project", :url => project_path(project) } %div{ :class => "project-box ui-box ui-box-big" }
%h2 = link_to project_path(project) do
= image_tag gravatar_icon(project.name), :class => "left", :width => 40, :style => "padding-right:5px;" %h3= project.name
= link_to ("/" + project.code), project_path(project), :style => "text-decoration:none" .data
%p= project.name %p.title.repository
%p= project.url_to_repo %span Repository:
-#%p = project.url_to_repo
Commit &ndash; %p.title.activity
= last_commit(project) %span Last Activity:
%hr - last_note = project.notes.last
= link_to "Browse Code", tree_project_path(project), :class => "lbutton" = last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never"
= link_to "Commits", project_commits_path(project), :class => "lbutton", :style => "float:right;width:80px;"
.clear %p.small-tags
- project.tag_list.each do |tag|
= link_to tag, "/tags/#{tag}"
.buttons
%a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code
%a.commits.button.green{:href => project_commits_path(project)} Commits
%div.top_project_menu %div.top_project_menu
-#%span= link_to @project.code.capitalize, @project, :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
- if @project.repo_exists? - if @project.repo_exists?
%span= link_to image_tag("home.png", :width => 20), project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil %span= link_to image_tag("home.png", :width => 20), project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
%span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil
...@@ -23,7 +22,7 @@ ...@@ -23,7 +22,7 @@
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
Snippets Snippets
- if @project.snippets.count > 0 - if @project.snippets.count > 0
%span{ :class => "top_menu_count" }= @project.snippets.count %span{ :class => "top_menu_count" }= @project.snippets.non_expired.count
- if @commit - if @commit
%span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil %span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil
......
%h3
.left
= form_tag tree_project_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 tree_project_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
%h3#tree-breadcrumbs -#%a.right.button{:href => "#"} Download
= link_to @project.name, tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true -#-if can? current_user, :admin_project, @project
- if params[:path] %a.right.button.blue{:href => "#"} EDIT
- part_path = "" #tree-breadcrumbs
- params[:path].split("\/").each do |part| %h2.icon
- part_path = File.join(part_path, part) unless part_path.empty? %span
- if part_path.empty? %d
- part_path = part = link_to tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true do
\/ = @project.name
= link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id), :branch => @branch, :tag => @tag), :remote => :true - if params[:path]
- part_path = ""
- params[:path].split("\/").each do |part|
- part_path = File.join(part_path, part) unless part_path.empty?
- if part_path.empty?
- part_path = part
\/
= link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id), :branch => @branch, :tag => @tag), :remote => :true
&nbsp;
.right= render :partial => "projects/refs", :locals => { :destination => tree_project_path(@project) }
.clear
#tree-content-holder #tree-content-holder
- if tree.is_a?(Grit::Blob) - if tree.is_a?(Grit::Blob)
= render :partial => "projects/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree } = render :partial => "projects/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree }
- else - else
- contents = tree.contents - contents = tree.contents
%table#tree-slider.round-borders %table#tree-slider.round-borders
%tr %thead
%th Name %th Name
%th Last Update %th Last Update
%th %th
......
...@@ -40,7 +40,7 @@ eos ...@@ -40,7 +40,7 @@ eos
<p> <p>
Be careful! <br/> Be careful! <br/>
Project cant be recovered after destroy.</p> Project cant be recovered after destroy.</p>
<%= link_to 'Destroy', @project, <%= link_to 'Destroy', @project,
:confirm => 'Are you sure?', :method => :delete, :confirm => 'Are you sure?', :method => :delete,
:class => "left button negative span-6", :style => "text-align:center" %> :class => "left button negative span-6", :style => "text-align:center" %>
<div class="clear"></div> <div class="clear"></div>
......
- unless @projects.empty? - content_for(:body_class, "projects-page")
%div{:class => "tile", :style => view_mode_style("tile")} - content_for(:page_title) do
= render "tile" .container_4
%div{:class => "list", :style => view_mode_style("list")} .grid_4
= render "list" - if current_user.can_create_project?
- else %a.grey-button.right{:href => new_project_path} Create new project
%center.prepend-top %h2.icon
%h2 %span
%cite Nothing here Projects
%div.clear
- unless @projects.empty?
%div{:class => "tile", :style => view_mode_style("tile")}
= render "tile"
%div{:class => "list", :style => view_mode_style("list")}
= render "list"
- else
%center.prepend-top
%h2
%cite Nothing here
...@@ -13,11 +13,16 @@ ...@@ -13,11 +13,16 @@
= label_tag "week_view","Week" = label_tag "week_view","Week"
.clear .clear
%hr %hr
.span-11 .left.width-49p
%h3 Commits %h3 Commits
=render "projects/recent_commits" =render "projects/recent_commits"
.span-11.right .right.width-49p
%h3 Talk %h3 Talk
=render "projects/recent_messages" =render "projects/recent_messages"
:javascript
function updateDashboard(){
$('#content-container').load("#{escape_javascript(project_path(@project))} #content-container>*");
}
setInterval("updateDashboard()", 300000);
:plain :plain
$("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){
$("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
$("#tree-holder table").show("slide", { direction: "right" }, 150); $("#tree-holder table").show("slide", { direction: "right" }, 150);
}); });
%div.wall_page %div.wall_page
- if can? current_user, :write_note, @project = render "notes/notes"
= render "notes/form"
.right .loading{ :style => "display:none;"}
= form_tag wall_project_path(@project), :method => :get do %center= image_tag "ajax-loader.gif"
.span-2
= radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view"
= label_tag "recent_view","Recent"
.span-2
= radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view"
= label_tag "day_view","Today"
.span-2
= radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view"
= label_tag "week_view","Week"
.span-2
= radio_button_tag :view, "all", params[:view] == "all", :onclick => "this.form.submit()", :id => "all_view"
= label_tag "all_view","All"
.clear
%br
%hr
= render "notes/notes"
:javascript
$(function(){
$("#note_note").live("click", function(){
$(this).css("height", "100px");
$('.attach_holder').show();
});
});
:plain = render "notes/load"
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
...@@ -12,11 +12,14 @@ ...@@ -12,11 +12,14 @@
%tr %tr
%td= f.label :file_name %td= f.label :file_name
%td= f.text_field :file_name, :placeholder => "example.rb" %td= f.text_field :file_name, :placeholder => "example.rb"
%tr
%td= f.label "Lifetime"
%td= f.select :expires_at, lifetime_select_options
%tr %tr
%td{:colspan => 2} %td{:colspan => 2}
= f.label :content, "Code" = f.label :content, "Code"
%br %br
= f.text_area :content, :style => "height:240px;width:932px;" = f.text_area :content, :style => "height:240px;width:932px;"
.actions.prepend-top .actions.prepend-top
= f.submit 'Save', :class => "lbutton vm" = f.submit 'Save', :class => "lbutton vm"
%tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) } - unless snippet.expired?
%td %tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) }
= image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" %td
= truncate snippet.author.name, :lenght => 20 = image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
%td= html_escape snippet.title = truncate snippet.author.name, :lenght => 20
%td= html_escape snippet.file_name %td= html_escape snippet.title
%td %td= html_escape snippet.file_name
- if can?(current_user, :admin_snippet, @project) || snippet.author == current_user %td
= link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive" - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
- if can?(current_user, :admin_snippet, @project) || snippet.author == current_user = link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive"
= link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}" - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
= link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}"
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
%th Title %th Title
%th File name %th File name
%th %th
= render @snippets = render @snippets.fresh
:javascript :javascript
$('.delete-snippet').live('ajax:success', function() { $('.delete-snippet').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); }); $(this).closest('tr').fadeOut(); });
%h2 - if !@snippet.expired?
= "Snippet ##{@snippet.id} - #{@snippet.title}" %h2
= "Snippet ##{@snippet.id} - #{@snippet.title}"
.view_file .view_file
.view_file_header .view_file_header
%strong %strong
= @snippet.file_name = @snippet.file_name
%br/ %br/
.view_file_content .view_file_content
:erb :erb
<%= raw @snippet.colorize %> <%= raw @snippet.colorize %>
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive" = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}" = link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
.clear .clear
%br %br
.snippet_notes= render "notes/notes" .snippet_notes= render "notes/notes"
.clear .clear
- else
%h2
Sorry, this snippet is no longer exists
- content_for(:body_class, "projects-page")
- content_for(:page_title) do
.grid_4
%h2
Tags
.tags-list
- @tags.all.each do |tag|
= link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}"
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
%td= truncate user.email, :lenght => 16 %td= truncate user.email, :lenght => 16
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
= form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
%td= f.check_box :read, :onclick => "$(this.form).submit();" %td= f.check_box :read, :onclick => "$(this.form).submit();"
%td= f.check_box :write, :onclick => "$(this.form).submit();" %td= f.check_box :write, :onclick => "$(this.form).submit();"
%td= f.check_box :admin, :onclick => "$(this.form).submit();" %td= f.check_box :admin, :onclick => "$(this.form).submit();"
- else - else
%td= check_box_tag "read", 1, member.read, :disabled => :disabled %td= check_box_tag "read", 1, member.read, :disabled => :disabled
%td= check_box_tag "commit", 1, member.write, :disabled => :disabled %td= check_box_tag "commit", 1, member.write, :disabled => :disabled
%td= check_box_tag "admin", 1, member.admin, :disabled => :disabled %td= check_box_tag "admin", 1, member.admin, :disabled => :disabled
......
...@@ -25,4 +25,3 @@ ...@@ -25,4 +25,3 @@
%b Twitter: %b Twitter:
= user.twitter = user.twitter
...@@ -44,5 +44,8 @@ module Gitlab ...@@ -44,5 +44,8 @@ module Gitlab
# Version of your assets, change this if you want to expire all your assets # Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0' config.assets.version = '1.0'
# Extend assets path
config.assets.paths << Rails.root.join('vendor', 'assets', 'images', 'jquery-ui')
end end
end end
...@@ -29,4 +29,5 @@ Gitlab::Application.configure do ...@@ -29,4 +29,5 @@ Gitlab::Application.configure do
config.assets.debug = true config.assets.debug = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :letter_opener
end end
...@@ -58,7 +58,6 @@ Gitlab::Application.configure do ...@@ -58,7 +58,6 @@ Gitlab::Application.configure do
# Send deprecation notices to registered listeners # Send deprecation notices to registered listeners
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
config.action_mailer.delivery_method = :sendmail config.action_mailer.delivery_method = :sendmail
# Defaults to: # Defaults to:
# # config.action_mailer.sendmail_settings = { # # config.action_mailer.sendmail_settings = {
......
...@@ -7,6 +7,6 @@ Grit::Blob.class_eval do ...@@ -7,6 +7,6 @@ Grit::Blob.class_eval do
include Utils::Colorize include Utils::Colorize
end end
Grit::Commit.class_eval do Grit::Commit.class_eval do
include CommitExt include CommitExt
end end
Gitlab::Application.routes.draw do Gitlab::Application.routes.draw do
namespace :admin do
get 'tags'=> 'tags#index'
get 'tags/:tag' => 'projects#index'
namespace :admin do
resources :users resources :users
resources :projects resources :projects
resources :team_members resources :team_members
...@@ -10,19 +15,21 @@ Gitlab::Application.routes.draw do ...@@ -10,19 +15,21 @@ Gitlab::Application.routes.draw do
root :to => "users#index" root :to => "users#index"
end end
get "errors/gitosis" get "errors/gitosis"
get "profile/password", :to => "profile#password" get "profile/password", :to => "profile#password"
put "profile/password", :to => "profile#password_update" put "profile/password", :to => "profile#password_update"
put "profile/edit", :to => "profile#social_update" put "profile/edit", :to => "profile#social_update"
get "profile", :to => "profile#show" get "profile", :to => "profile#show"
get "dashboard", :to => "dashboard#index"
#get "profile/:id", :to => "profile#show" #get "profile/:id", :to => "profile#show"
resources :projects, :only => [:new, :create, :index] resources :projects, :only => [:new, :create, :index]
resources :keys resources :keys
devise_for :users devise_for :users
resources :projects, :except => [:new, :create, :index], :path => "/" do resources :projects, :except => [:new, :create, :index], :path => "/" do
member do member do
get "tree" get "tree"
get "blob" get "blob"
get "team" get "team"
...@@ -32,7 +39,7 @@ Gitlab::Application.routes.draw do ...@@ -32,7 +39,7 @@ Gitlab::Application.routes.draw do
get "tree/:commit_id" => "projects#tree" get "tree/:commit_id" => "projects#tree"
get "tree/:commit_id/:path" => "projects#tree", get "tree/:commit_id/:path" => "projects#tree",
:as => :tree_file, :as => :tree_file,
:constraints => { :constraints => {
:id => /[a-zA-Z0-9_\-]+/, :id => /[a-zA-Z0-9_\-]+/,
:commit_id => /[a-zA-Z0-9]+/, :commit_id => /[a-zA-Z0-9]+/,
:path => /.*/ :path => /.*/
...@@ -47,8 +54,11 @@ Gitlab::Application.routes.draw do ...@@ -47,8 +54,11 @@ Gitlab::Application.routes.draw do
collection do collection do
post :sort post :sort
end end
collection do
get :search
end
end end
resources :notes, :only => [:create, :destroy] resources :notes, :only => [:create, :destroy]
end end
root :to => "projects#index" root :to => "dashboard#index"
end end
...@@ -11,7 +11,6 @@ class DeviseCreateUsers < ActiveRecord::Migration ...@@ -11,7 +11,6 @@ class DeviseCreateUsers < ActiveRecord::Migration
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable # t.token_authenticatable
t.timestamps t.timestamps
end end
......
class AddExpiresAtToSnippets < ActiveRecord::Migration
def change
add_column :snippets, :expires_at, :datetime
end
end
class ChangeNoteNoteToText < ActiveRecord::Migration
def up
change_column :notes, :note, :text, :limit => false
end
def down
end
end
class IssueContenToNote < ActiveRecord::Migration
def up
puts "Issue content is deprecated -> move to notes"
Issue.find_each(:batch_size => 100) do |issue|
next if issue.content.blank?
note = Note.new(
:note => issue.content,
:project_id => issue.project_id,
:noteable => issue,
:created_at => issue.created_at,
:updated_at => issue.created_at
)
note.author_id = issue.author_id
if note.save
issue.update_attributes(:content => nil)
print "."
else
print "F"
end
end
total = Issue.where("content is not null").count
if total > 0
puts "content of #{total} issues were not migrated"
else
puts "Done"
end
end
def down
end
end
class ActsAsTaggableOnMigration < ActiveRecord::Migration
def self.up
create_table :tags do |t|
t.string :name
end
create_table :taggings do |t|
t.references :tag
# You should make sure that the column created is
# long enough to store the required class names.
t.references :taggable, :polymorphic => true
t.references :tagger, :polymorphic => true
t.string :context
t.datetime :created_at
end
add_index :taggings, :tag_id
add_index :taggings, [:taggable_id, :taggable_type, :context]
end
def self.down
drop_table :taggings
drop_table :tags
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20111025134235) do ActiveRecord::Schema.define(:version => 20111101222453) do
create_table "issues", :force => true do |t| create_table "issues", :force => true do |t|
t.string "title" t.string "title"
...@@ -36,7 +36,7 @@ ActiveRecord::Schema.define(:version => 20111025134235) do ...@@ -36,7 +36,7 @@ ActiveRecord::Schema.define(:version => 20111025134235) do
end end
create_table "notes", :force => true do |t| create_table "notes", :force => true do |t|
t.string "note" t.text "note"
t.string "noteable_id" t.string "noteable_id"
t.string "noteable_type" t.string "noteable_type"
t.integer "author_id" t.integer "author_id"
...@@ -65,6 +65,24 @@ ActiveRecord::Schema.define(:version => 20111025134235) do ...@@ -65,6 +65,24 @@ ActiveRecord::Schema.define(:version => 20111025134235) do
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "file_name" t.string "file_name"
t.datetime "expires_at"
end
create_table "taggings", :force => true do |t|
t.integer "tag_id"
t.integer "taggable_id"
t.string "taggable_type"
t.integer "tagger_id"
t.string "tagger_type"
t.string "context"
t.datetime "created_at"
end
add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
create_table "tags", :force => true do |t|
t.string "name"
end end
create_table "users", :force => true do |t| create_table "users", :force => true do |t|
......
...@@ -17,7 +17,7 @@ module Color ...@@ -17,7 +17,7 @@ module Color
def command(string) def command(string)
`#{string}` `#{string}`
if $?.to_i > 0 if $?.to_i > 0
puts red " == #{string} - FAIL" puts red " == #{string} - FAIL"
puts red " == Error during configure" puts red " == Error during configure"
exit exit
......
module CommitExt module CommitExt
def safe_message def safe_message
message.encode("UTF-8", message.encode("UTF-8",
:invalid => :replace, :invalid => :replace,
:undef => :replace, :undef => :replace,
:universal_newline => true, :universal_newline => true,
:replace => "") :replace => "")
rescue rescue
"-- invalid encoding for commit message" "-- invalid encoding for commit message"
end end
def created_at
committed_date
end
def author_email
author.email.force_encoding(Encoding::UTF_8)
end
def author_name
author.name.force_encoding(Encoding::UTF_8)
end
end end
...@@ -33,7 +33,7 @@ class FileSizeValidator < ActiveModel::EachValidator ...@@ -33,7 +33,7 @@ class FileSizeValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String) value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
CHECKS.each do |key, validity_check| CHECKS.each do |key, validity_check|
...@@ -53,7 +53,7 @@ class FileSizeValidator < ActiveModel::EachValidator ...@@ -53,7 +53,7 @@ class FileSizeValidator < ActiveModel::EachValidator
record.errors.add(attribute, MESSAGES[key], errors_options) record.errors.add(attribute, MESSAGES[key], errors_options)
end end
end end
def help def help
Helper.instance Helper.instance
end end
......
module Utils module Utils
module FileHelper module FileHelper
def binary?(string) def binary?(string)
string.each_byte do |x| string.each_byte do |x|
x.nonzero? or return true x.nonzero? or return true
end end
false false
end end
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
text-decoration: none; text-decoration: none;
} }
#page { #page {
background-color: #f0f0f0; background-color: #f0f0f0;
width: 750px; width: 750px;
...@@ -57,7 +56,6 @@ ...@@ -57,7 +56,6 @@
padding-right: 30px; padding-right: 30px;
} }
#header { #header {
background-image: url("/assets/rails.png"); background-image: url("/assets/rails.png");
background-repeat: no-repeat; background-repeat: no-repeat;
...@@ -71,7 +69,6 @@ ...@@ -71,7 +69,6 @@
font-size: 16px; font-size: 16px;
} }
#about h3 { #about h3 {
margin: 0; margin: 0;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -112,7 +109,6 @@ ...@@ -112,7 +109,6 @@
padding: 10px; padding: 10px;
} }
#getting-started { #getting-started {
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
margin-top: 25px; margin-top: 25px;
...@@ -149,7 +145,6 @@ ...@@ -149,7 +145,6 @@
font-size: 13px; font-size: 13px;
} }
#sidebar ul { #sidebar ul {
margin-left: 0; margin-left: 0;
padding-left: 0; padding-left: 0;
......
...@@ -32,7 +32,6 @@ end ...@@ -32,7 +32,6 @@ end
Factory.add(:issue, Issue) do |obj| Factory.add(:issue, Issue) do |obj|
obj.title = Faker::Lorem.sentence obj.title = Faker::Lorem.sentence
obj.content = Faker::Lorem.sentences
end end
Factory.add(:snippet, Snippet) do |obj| Factory.add(:snippet, Snippet) do |obj|
......
class Factory class Factory
@factories = {} @factories = {}
class << self class << self
def add(name, klass, &block) def add(name, klass, &block)
@factories[name] = [klass, block] @factories[name] = [klass, block]
end end
...@@ -13,10 +13,10 @@ class Factory ...@@ -13,10 +13,10 @@ class Factory
def new(name, opts) def new(name, opts)
factory = @factories[name] factory = @factories[name]
factory[0].new.tap do |obj| factory[0].new.tap do |obj|
factory[1].call(obj) factory[1].call(obj)
end.tap do |obj| end.tap do |obj|
opts.each do |k, opt| opts.each do |k, opt|
obj.send("#{k}=", opt) obj.send("#{k}=", opt)
end end
end end
end end
......
...@@ -14,7 +14,7 @@ describe Issue do ...@@ -14,7 +14,7 @@ describe Issue do
it { should validate_presence_of(:assignee_id) } it { should validate_presence_of(:assignee_id) }
end end
describe "Scope" do describe "Scope" do
it { Issue.should respond_to :closed } it { Issue.should respond_to :closed }
it { Issue.should respond_to :opened } it { Issue.should respond_to :opened }
end end
......
...@@ -10,7 +10,7 @@ describe Key do ...@@ -10,7 +10,7 @@ describe Key do
it { should validate_presence_of(:key) } it { should validate_presence_of(:key) }
end end
describe "Methods" do describe "Methods" do
it { should respond_to :projects } it { should respond_to :projects }
end end
......
...@@ -13,8 +13,8 @@ describe Note do ...@@ -13,8 +13,8 @@ describe Note do
it { Factory.create(:note, it { Factory.create(:note,
:project => Factory.create(:project)).should be_valid } :project => Factory.create(:project)).should be_valid }
describe :authorization do describe :authorization do
before do before do
@p1 = Factory :project @p1 = Factory :project
@p2 = Factory :project, :code => "alien", :path => "legit_1" @p2 = Factory :project, :code => "alien", :path => "legit_1"
@u1 = Factory :user @u1 = Factory :user
...@@ -24,10 +24,10 @@ describe Note do ...@@ -24,10 +24,10 @@ describe Note do
@abilities << Ability @abilities << Ability
end end
describe :read do describe :read do
before do before do
@p1.users_projects.create(:user => @u1, :read => false) @p1.users_projects.create(:user => @u1, :read => false)
@p1.users_projects.create(:user => @u2, :read => true) @p1.users_projects.create(:user => @u2, :read => true)
@p2.users_projects.create(:user => @u3, :read => true) @p2.users_projects.create(:user => @u3, :read => true)
end end
...@@ -36,11 +36,11 @@ describe Note do ...@@ -36,11 +36,11 @@ describe Note do
it { @abilities.allowed?(@u3, :read_note, @p1).should be_false } it { @abilities.allowed?(@u3, :read_note, @p1).should be_false }
end end
describe :write do describe :write do
before do before do
@p1.users_projects.create(:user => @u1, :write => false) @p1.users_projects.create(:user => @u1, :write => false)
@p1.users_projects.create(:user => @u2, :write => true) @p1.users_projects.create(:user => @u2, :write => true)
@p2.users_projects.create(:user => @u3, :write => true) @p2.users_projects.create(:user => @u3, :write => true)
end end
it { @abilities.allowed?(@u1, :write_note, @p1).should be_false } it { @abilities.allowed?(@u1, :write_note, @p1).should be_false }
...@@ -48,11 +48,11 @@ describe Note do ...@@ -48,11 +48,11 @@ describe Note do
it { @abilities.allowed?(@u3, :write_note, @p1).should be_false } it { @abilities.allowed?(@u3, :write_note, @p1).should be_false }
end end
describe :admin do describe :admin do
before do before do
@p1.users_projects.create(:user => @u1, :admin => false) @p1.users_projects.create(:user => @u1, :admin => false)
@p1.users_projects.create(:user => @u2, :admin => true) @p1.users_projects.create(:user => @u2, :admin => true)
@p2.users_projects.create(:user => @u3, :admin => true) @p2.users_projects.create(:user => @u3, :admin => true)
end end
it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false } it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false }
......
require 'spec_helper' require 'spec_helper'
describe Project do describe Project do
describe :authorization do describe :authorization do
before do before do
@p1 = Factory :project @p1 = Factory :project
@u1 = Factory :user @u1 = Factory :user
@u2 = Factory :user @u2 = Factory :user
...@@ -10,30 +10,30 @@ describe Project do ...@@ -10,30 +10,30 @@ describe Project do
@abilities << Ability @abilities << Ability
end end
describe :read do describe :read do
before do before do
@p1.users_projects.create(:project => @p1, :user => @u1, :read => false) @p1.users_projects.create(:project => @p1, :user => @u1, :read => false)
@p1.users_projects.create(:project => @p1, :user => @u2, :read => true) @p1.users_projects.create(:project => @p1, :user => @u2, :read => true)
end end
it { @abilities.allowed?(@u1, :read_project, @p1).should be_false } it { @abilities.allowed?(@u1, :read_project, @p1).should be_false }
it { @abilities.allowed?(@u2, :read_project, @p1).should be_true } it { @abilities.allowed?(@u2, :read_project, @p1).should be_true }
end end
describe :write do describe :write do
before do before do
@p1.users_projects.create(:project => @p1, :user => @u1, :write => false) @p1.users_projects.create(:project => @p1, :user => @u1, :write => false)
@p1.users_projects.create(:project => @p1, :user => @u2, :write => true) @p1.users_projects.create(:project => @p1, :user => @u2, :write => true)
end end
it { @abilities.allowed?(@u1, :write_project, @p1).should be_false } it { @abilities.allowed?(@u1, :write_project, @p1).should be_false }
it { @abilities.allowed?(@u2, :write_project, @p1).should be_true } it { @abilities.allowed?(@u2, :write_project, @p1).should be_true }
end end
describe :admin do describe :admin do
before do before do
@p1.users_projects.create(:project => @p1, :user => @u1, :admin => false) @p1.users_projects.create(:project => @p1, :user => @u1, :admin => false)
@p1.users_projects.create(:project => @p1, :user => @u2, :admin => true) @p1.users_projects.create(:project => @p1, :user => @u2, :admin => true)
end end
it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false } it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false }
......
...@@ -40,20 +40,20 @@ describe Project do ...@@ -40,20 +40,20 @@ describe Project do
should_not allow_value("gitosis-admin").for(:path) should_not allow_value("gitosis-admin").for(:path)
end end
it "should return valid url to repo" do it "should return valid url to repo" do
project = Project.new(:path => "somewhere") project = Project.new(:path => "somewhere")
project.url_to_repo.should == "git@localhost:somewhere.git" project.url_to_repo.should == "git@localhost:somewhere.git"
end end
it "should return path to repo" do it "should return path to repo" do
project = Project.new(:path => "somewhere") project = Project.new(:path => "somewhere")
project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere") project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere")
end end
describe :valid_repo? do describe :valid_repo? do
it "should be valid repo" do it "should be valid repo" do
project = Factory :project project = Factory :project
project.valid_repo?.should be_true project.valid_repo?.should be_true
end end
it "should be invalid repo" do it "should be invalid repo" do
...@@ -62,43 +62,88 @@ describe Project do ...@@ -62,43 +62,88 @@ describe Project do
end end
end end
describe "Git methods" do describe "updates" do
let(:project) { Factory :project } let(:project) { Factory :project }
describe :repo do before do
it "should return valid repo" do @issue = Factory :issue,
:project => project,
:author => Factory(:user),
:assignee => Factory(:user)
@note = Factory :note,
:project => project,
:author => Factory(:user)
@commit = project.fresh_commits(1).first
end
describe "return commit, note & issue" do
it { project.updates(3).count.should == 3 }
it { project.updates(3).last.id.should == @commit.id }
it { project.updates(3).include?(@issue).should be_true }
it { project.updates(3).include?(@note).should be_true }
end
end
describe "last_activity" do
let(:project) { Factory :project }
before do
@note = Factory :note,
:project => project,
:author => Factory(:user)
end
it { project.last_activity.should == @note }
it { project.last_activity_date.to_s.should == @note.created_at.to_s }
end
describe "fresh commits" do
let(:project) { Factory :project }
it { project.fresh_commits(3).count.should == 3 }
it { project.fresh_commits.first.id.should == "2fb376f61875b58bceee0492e270e9c805294b1a" }
it { project.fresh_commits.last.id.should == "0dac878dbfe0b9c6104a87d65fe999149a8d862c" }
end
describe "Git methods" do
let(:project) { Factory :project }
describe :repo do
it "should return valid repo" do
project.repo.should be_kind_of(Grit::Repo) project.repo.should be_kind_of(Grit::Repo)
end end
it "should return nil" do it "should return nil" do
lambda { Project.new(:path => "invalid").repo }.should raise_error(Grit::NoSuchPathError) lambda { Project.new(:path => "invalid").repo }.should raise_error(Grit::NoSuchPathError)
end end
it "should return nil" do it "should return nil" do
lambda { Project.new.repo }.should raise_error(TypeError) lambda { Project.new.repo }.should raise_error(TypeError)
end end
end end
describe :commit do describe :commit do
it "should return first head commit if without params" do it "should return first head commit if without params" do
project.commit.id.should == project.repo.commits.first.id project.commit.id.should == project.repo.commits.first.id
end end
it "should return valid commit" do it "should return valid commit" do
project.commit(ValidCommit::ID).should be_valid_commit project.commit(ValidCommit::ID).should be_valid_commit
end end
it "should return nil" do it "should return nil" do
project.commit("+123_4532530XYZ").should be_nil project.commit("+123_4532530XYZ").should be_nil
end end
end end
describe :tree do describe :tree do
before do before do
@commit = project.commit(ValidCommit::ID) @commit = project.commit(ValidCommit::ID)
end end
it "should raise error w/o arguments" do it "should raise error w/o arguments" do
lambda { project.tree }.should raise_error lambda { project.tree }.should raise_error
end end
......
...@@ -26,5 +26,6 @@ end ...@@ -26,5 +26,6 @@ end
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# file_name :string(255) # file_name :string(255)
# expires_at :datetime
# #
...@@ -14,7 +14,7 @@ describe User do ...@@ -14,7 +14,7 @@ describe User do
it { should respond_to(:name) } it { should respond_to(:name) }
end end
it "should return valid identifier" do it "should return valid identifier" do
user = User.new(:email => "test@mail.com") user = User.new(:email => "test@mail.com")
user.identifier.should == "test_mail.com" user.identifier.should == "test_mail.com"
end end
......
...@@ -11,7 +11,7 @@ describe UsersProject do ...@@ -11,7 +11,7 @@ describe UsersProject do
it { should validate_presence_of(:project_id) } it { should validate_presence_of(:project_id) }
end end
describe "Delegate methods" do describe "Delegate methods" do
it { should respond_to(:user_name) } it { should respond_to(:user_name) }
it { should respond_to(:user_email) } it { should respond_to(:user_email) }
end end
......
# Stubbing Project <-> gitosis path # Stubbing Project <-> gitosis path
# create project using Factory only # create project using Factory only
class Project class Project
def update_gitosis_project def update_gitosis_project
true true
end end
...@@ -9,12 +9,12 @@ class Project ...@@ -9,12 +9,12 @@ class Project
true true
end end
def path_to_repo def path_to_repo
File.join(Rails.root, "tmp", "tests", path) File.join(Rails.root, "tmp", "tests", path)
end end
end end
class Key class Key
def update_gitosis def update_gitosis
true true
end end
......
require 'spec_helper' require 'spec_helper'
describe "Admin::Projects" do describe "Admin::Projects" do
before do before do
@project = Factory :project, @project = Factory :project,
:name => "LeGiT", :name => "LeGiT",
:code => "LGT" :code => "LGT"
...@@ -9,7 +9,7 @@ describe "Admin::Projects" do ...@@ -9,7 +9,7 @@ describe "Admin::Projects" do
end end
describe "GET /admin/projects" do describe "GET /admin/projects" do
before do before do
visit admin_projects_path visit admin_projects_path
end end
...@@ -17,49 +17,49 @@ describe "Admin::Projects" do ...@@ -17,49 +17,49 @@ describe "Admin::Projects" do
current_path.should == admin_projects_path current_path.should == admin_projects_path
end end
it "should have projects list" do it "should have projects list" do
page.should have_content(@project.code) page.should have_content(@project.code)
page.should have_content(@project.name) page.should have_content(@project.name)
end end
end end
describe "GET /admin/projects/:id" do describe "GET /admin/projects/:id" do
before do before do
visit admin_projects_path visit admin_projects_path
click_link "Show" click_link "Show"
end end
it "should have project info" do it "should have project info" do
page.should have_content(@project.code) page.should have_content(@project.code)
page.should have_content(@project.name) page.should have_content(@project.name)
end end
end end
describe "GET /admin/projects/:id/edit" do describe "GET /admin/projects/:id/edit" do
before do before do
visit admin_projects_path visit admin_projects_path
click_link "edit_project_#{@project.id}" click_link "edit_project_#{@project.id}"
end end
it "should have project edit page" do it "should have project edit page" do
page.should have_content("Name") page.should have_content("Name")
page.should have_content("Code") page.should have_content("Code")
end end
describe "Update project" do describe "Update project" do
before do before do
fill_in "project_name", :with => "Big Bang" fill_in "project_name", :with => "Big Bang"
fill_in "project_code", :with => "BB1" fill_in "project_code", :with => "BB1"
click_button "Save" click_button "Save"
@project.reload @project.reload
end end
it "should show page with new data" do it "should show page with new data" do
page.should have_content("BB1") page.should have_content("BB1")
page.should have_content("Big Bang") page.should have_content("Big Bang")
end end
it "should change project entry" do it "should change project entry" do
@project.name.should == "Big Bang" @project.name.should == "Big Bang"
@project.code.should == "BB1" @project.code.should == "BB1"
end end
...@@ -67,24 +67,24 @@ describe "Admin::Projects" do ...@@ -67,24 +67,24 @@ describe "Admin::Projects" do
end end
describe "GET /admin/projects/new" do describe "GET /admin/projects/new" do
before do before do
visit admin_projects_path visit admin_projects_path
click_link "New Project" click_link "New Project"
end end
it "should be correct path" do it "should be correct path" do
current_path.should == new_admin_project_path current_path.should == new_admin_project_path
end end
it "should have labels for new project" do it "should have labels for new project" do
page.should have_content("Name") page.should have_content("Name")
page.should have_content("Path") page.should have_content("Path")
page.should have_content("Description") page.should have_content("Description")
end end
end end
describe "POST /admin/projects" do describe "POST /admin/projects" do
before do before do
visit new_admin_project_path visit new_admin_project_path
fill_in 'Name', :with => 'NewProject' fill_in 'Name', :with => 'NewProject'
fill_in 'Code', :with => 'NPR' fill_in 'Code', :with => 'NPR'
......
...@@ -4,7 +4,7 @@ describe "Admin::Users" do ...@@ -4,7 +4,7 @@ describe "Admin::Users" do
before { login_as :admin } before { login_as :admin }
describe "GET /admin/users" do describe "GET /admin/users" do
before do before do
visit admin_users_path visit admin_users_path
end end
...@@ -12,14 +12,14 @@ describe "Admin::Users" do ...@@ -12,14 +12,14 @@ describe "Admin::Users" do
current_path.should == admin_users_path current_path.should == admin_users_path
end end
it "should have users list" do it "should have users list" do
page.should have_content(@user.email) page.should have_content(@user.email)
page.should have_content(@user.name) page.should have_content(@user.name)
end end
end end
describe "GET /admin/users/new" do describe "GET /admin/users/new" do
before do before do
@password = "123ABC" @password = "123ABC"
visit new_admin_user_path visit new_admin_user_path
fill_in "user_name", :with => "Big Bang" fill_in "user_name", :with => "Big Bang"
...@@ -28,23 +28,23 @@ describe "Admin::Users" do ...@@ -28,23 +28,23 @@ describe "Admin::Users" do
fill_in "user_password_confirmation", :with => @password fill_in "user_password_confirmation", :with => @password
end end
it "should create new user" do it "should create new user" do
expect { click_button "Save" }.to change {User.count}.by(1) expect { click_button "Save" }.to change {User.count}.by(1)
end end
it "should create user with valid data" do it "should create user with valid data" do
click_button "Save" click_button "Save"
user = User.last user = User.last
user.name.should == "Big Bang" user.name.should == "Big Bang"
user.email.should == "bigbang@mail.com" user.email.should == "bigbang@mail.com"
end end
it "should call send mail" do it "should call send mail" do
Notify.should_receive(:new_user_email).and_return(stub(:deliver => true)) Notify.should_receive(:new_user_email).and_return(stub(:deliver => true))
click_button "Save" click_button "Save"
end end
it "should send valid email to user with email & password" do it "should send valid email to user with email & password" do
click_button "Save" click_button "Save"
user = User.last user = User.last
email = ActionMailer::Base.deliveries.last email = ActionMailer::Base.deliveries.last
...@@ -54,45 +54,45 @@ describe "Admin::Users" do ...@@ -54,45 +54,45 @@ describe "Admin::Users" do
end end
end end
describe "GET /admin/users/:id" do describe "GET /admin/users/:id" do
before do before do
visit admin_users_path visit admin_users_path
click_link "Show" click_link "Show"
end end
it "should have user info" do it "should have user info" do
page.should have_content(@user.email) page.should have_content(@user.email)
page.should have_content(@user.name) page.should have_content(@user.name)
page.should have_content(@user.is_admin?) page.should have_content(@user.is_admin?)
end end
end end
describe "GET /admin/users/:id/edit" do describe "GET /admin/users/:id/edit" do
before do before do
@simple_user = Factory :user @simple_user = Factory :user
visit admin_users_path visit admin_users_path
click_link "edit_user_#{@simple_user.id}" click_link "edit_user_#{@simple_user.id}"
end end
it "should have user edit page" do it "should have user edit page" do
page.should have_content("Name") page.should have_content("Name")
page.should have_content("Password") page.should have_content("Password")
end end
describe "Update user" do describe "Update user" do
before do before do
fill_in "user_name", :with => "Big Bang" fill_in "user_name", :with => "Big Bang"
fill_in "user_email", :with => "bigbang@mail.com" fill_in "user_email", :with => "bigbang@mail.com"
check "user_admin" check "user_admin"
click_button "Save" click_button "Save"
end end
it "should show page with new data" do it "should show page with new data" do
page.should have_content("bigbang@mail.com") page.should have_content("bigbang@mail.com")
page.should have_content("Big Bang") page.should have_content("Big Bang")
end end
it "should change user entry" do it "should change user entry" do
@simple_user.reload @simple_user.reload
@simple_user.name.should == "Big Bang" @simple_user.name.should == "Big Bang"
@simple_user.is_admin?.should be_true @simple_user.is_admin?.should be_true
......
require 'spec_helper' require 'spec_helper'
describe "Admin::Projects" do describe "Admin::Projects" do
describe "GET /admin/projects" do describe "GET /admin/projects" do
it { admin_projects_path.should be_allowed_for :admin } it { admin_projects_path.should be_allowed_for :admin }
it { admin_projects_path.should be_denied_for :user } it { admin_projects_path.should be_denied_for :user }
it { admin_projects_path.should be_denied_for :visitor } it { admin_projects_path.should be_denied_for :visitor }
end end
describe "GET /admin/users" do describe "GET /admin/users" do
it { admin_users_path.should be_allowed_for :admin } it { admin_users_path.should be_allowed_for :admin }
it { admin_users_path.should be_denied_for :user } it { admin_users_path.should be_denied_for :user }
it { admin_users_path.should be_denied_for :visitor } it { admin_users_path.should be_denied_for :visitor }
end end
describe "GET /admin/team_members" do describe "GET /admin/team_members" do
it { admin_team_members_path.should be_allowed_for :admin } it { admin_team_members_path.should be_allowed_for :admin }
it { admin_team_members_path.should be_denied_for :user } it { admin_team_members_path.should be_denied_for :user }
it { admin_team_members_path.should be_denied_for :visitor } it { admin_team_members_path.should be_denied_for :visitor }
end end
describe "GET /admin/emails" do describe "GET /admin/emails" do
it { admin_emails_path.should be_allowed_for :admin } it { admin_emails_path.should be_allowed_for :admin }
it { admin_emails_path.should be_denied_for :user } it { admin_emails_path.should be_denied_for :user }
it { admin_emails_path.should be_denied_for :visitor } it { admin_emails_path.should be_denied_for :visitor }
......
...@@ -4,15 +4,14 @@ describe "Issues" do ...@@ -4,15 +4,14 @@ describe "Issues" do
let(:project) { Factory :project } let(:project) { Factory :project }
let!(:commit) { project.repo.commits.first } let!(:commit) { project.repo.commits.first }
before do before do
login_as :user login_as :user
project.add_access(@user, :read, :write) project.add_access(@user, :read, :write)
end end
describe "add new note", :js => true do describe "add new note", :js => true do
before do before do
visit project_commit_path(project, commit) visit project_commit_path(project, commit)
click_link "Comments" # notes tab
fill_in "note_note", :with => "I commented this commit" fill_in "note_note", :with => "I commented this commit"
click_button "Add note" click_button "Add note"
end end
......
...@@ -3,13 +3,13 @@ require 'spec_helper' ...@@ -3,13 +3,13 @@ require 'spec_helper'
describe "Commits" do describe "Commits" do
let(:project) { Factory :project } let(:project) { Factory :project }
let!(:commit) { project.repo.commits.first } let!(:commit) { project.repo.commits.first }
before do before do
login_as :user login_as :user
project.add_access(@user, :read) project.add_access(@user, :read)
end end
describe "GET /commits" do describe "GET /commits" do
before do before do
visit project_commits_path(project) visit project_commits_path(project)
end end
...@@ -17,22 +17,22 @@ describe "Commits" do ...@@ -17,22 +17,22 @@ describe "Commits" do
current_path.should == project_commits_path(project) current_path.should == project_commits_path(project)
end end
it "should have project name" do it "should have project name" do
page.should have_content(project.name) page.should have_content(project.name)
end end
it "should list commits" do it "should list commits" do
page.should have_content(commit.author) page.should have_content(commit.author)
page.should have_content(commit.message) page.should have_content(commit.message)
end end
end end
describe "GET /commits/:id" do describe "GET /commits/:id" do
before do before do
visit project_commit_path(project, commit) visit project_commit_path(project, commit)
end end
it "should have valid path" do it "should have valid path" do
current_path.should == project_commit_path(project, commit) current_path.should == project_commit_path(project, commit)
end end
end end
......
require 'spec_helper'
describe "Dashboard" do
before { login_as :user }
describe "GET /dashboard" do
before do
@project = Factory :project
@project.add_access(@user, :read, :write)
visit dashboard_path
end
it "should be on dashboard page" do
current_path.should == dashboard_path
end
it "should have projects panel" do
within ".project-list" do
page.should have_content(@project.name)
end
end
it "should have news feed" do
within "#news-feed" do
page.should have_content(@project.commit.author.name)
page.should have_content(@project.commit.safe_message)
end
end
end
end
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe "Issues" do describe "Issues" do
let(:project) { Factory :project } let(:project) { Factory :project }
before do before do
login_as :user login_as :user
project.add_access(@user, :read, :write) project.add_access(@user, :read, :write)
...@@ -13,8 +13,8 @@ describe "Issues" do ...@@ -13,8 +13,8 @@ describe "Issues" do
:project => project :project => project
end end
describe "add new note", :js => true do describe "add new note", :js => true do
before do before do
visit project_issue_path(project, @issue) visit project_issue_path(project, @issue)
fill_in "note_note", :with => "I commented this issue" fill_in "note_note", :with => "I commented this issue"
click_button "Add note" click_button "Add note"
......
...@@ -3,13 +3,16 @@ require 'spec_helper' ...@@ -3,13 +3,16 @@ require 'spec_helper'
describe "Issues" do describe "Issues" do
let(:project) { Factory :project } let(:project) { Factory :project }
before do before do
login_as :user login_as :user
@user2 = Factory :user
project.add_access(@user, :read, :write) project.add_access(@user, :read, :write)
project.add_access(@user2, :read, :write)
end end
describe "GET /issues" do describe "GET /issues" do
before do before do
@issue = Factory :issue, @issue = Factory :issue,
:author => @user, :author => @user,
:assignee => @user, :assignee => @user,
...@@ -24,23 +27,23 @@ describe "Issues" do ...@@ -24,23 +27,23 @@ describe "Issues" do
it { should have_content(@issue.project.name) } it { should have_content(@issue.project.name) }
it { should have_content(@issue.assignee.name) } it { should have_content(@issue.assignee.name) }
describe "Destroy" do describe "Destroy" do
before do before do
# admin access to remove issue # admin access to remove issue
@user.users_projects.destroy_all @user.users_projects.destroy_all
project.add_access(@user, :read, :write, :admin) project.add_access(@user, :read, :write, :admin)
visit project_issues_path(project) visit project_issues_path(project)
end end
it "should remove entry" do it "should remove entry" do
expect { expect {
click_link "destroy_issue_#{@issue.id}" click_link "destroy_issue_#{@issue.id}"
}.to change { Issue.count }.by(-1) }.to change { Issue.count }.by(-1)
end end
end end
describe "statuses", :js => true do describe "statuses", :js => true do
before do before do
@closed_issue = Factory :issue, @closed_issue = Factory :issue,
:author => @user, :author => @user,
:assignee => @user, :assignee => @user,
...@@ -48,72 +51,119 @@ describe "Issues" do ...@@ -48,72 +51,119 @@ describe "Issues" do
:closed => true :closed => true
end end
it "should show only open" do it "should show only open" do
should have_content(@issue.title) should have_content(@issue.title[0..25])
should have_no_content(@closed_issue.title) should have_no_content(@closed_issue.title)
end end
it "should show only closed" do it "should show only closed" do
choose "closed_issues" choose "closed_issues"
should have_no_content(@issue.title) should have_no_content(@issue.title)
should have_content(@closed_issue.title) should have_content(@closed_issue.title[0..25])
end end
it "should show all" do it "should show all" do
choose "all_issues" choose "all_issues"
should have_content(@issue.title) should have_content(@issue.title[0..25])
should have_content(@closed_issue.title) should have_content(@closed_issue.title[0..25])
end end
end end
end end
describe "New issue", :js => true do describe "New issue", :js => true do
before do before do
visit project_issues_path(project) visit project_issues_path(project)
click_link "New Issue" click_link "New Issue"
end end
it "should open new issue popup" do it "should open new issue popup" do
page.should have_content("Add new issue") page.should have_content("Add new issue")
end end
describe "fill in" do describe "fill in" do
before do describe 'assign to me' do
fill_in "issue_title", :with => "bug 345" before do
fill_in "issue_content", :with => "app bug 345" fill_in "issue_title", :with => "bug 345"
click_link "Select user" click_link "Select user"
click_link @user.name within "#issue_assignee_id-menu" do
click_link @user.name
end
end
it { expect { click_button "Save" }.to change {Issue.count}.by(1) }
it "should add new issue to table" do
click_button "Save"
page.should_not have_content("Add new issue")
page.should have_content @user.name
page.should have_content "bug 345"
page.should have_content project.name
end
it "should call send mail" do
Notify.should_not_receive(:new_issue_email)
click_button "Save"
end
end end
it { expect { click_button "Save" }.to change {Issue.count}.by(1) } describe 'assign to other' do
before do
fill_in "issue_title", :with => "bug 345"
click_link "Select user"
within "#issue_assignee_id-menu" do
click_link @user2.name
end
end
it { expect { click_button "Save" }.to change {Issue.count}.by(1) }
it "should add new issue to table" do
click_button "Save"
page.should_not have_content("Add new issue")
page.should have_content @user2.name
page.should have_content "bug 345"
page.should have_content project.name
end
it "should call send mail" do
Notify.should_receive(:new_issue_email).and_return(stub(:deliver => true))
click_button "Save"
end
it "should send valid email to user with email & password" do
click_button "Save"
issue = Issue.last
email = ActionMailer::Base.deliveries.last
email.subject.should have_content("New Issue was created")
email.body.should have_content(issue.title)
email.body.should have_content(issue.assignee.name)
end
it "should add new issue to table" do
click_button "Save"
page.should_not have_content("Add new issue")
page.should have_content @user.name
page.should have_content "bug 345"
page.should have_content project.name
end end
end
end
it "should call send mail" do describe "Show issue" do
Notify.should_receive(:new_issue_email).and_return(stub(:deliver => true)) before do
click_button "Save" @issue = Factory :issue,
end :author => @user,
:assignee => @user,
:project => project
it "should send valid email to user with email & password" do visit project_issue_path(project, @issue)
click_button "Save" end
issue = Issue.last
email = ActionMailer::Base.deliveries.last it "should have valid show page for issue" do
email.subject.should have_content("New Issue was created") page.should have_content @issue.title
email.body.should have_content(issue.title) page.should have_content @user.name
email.body.should have_content(issue.assignee.name) page.should have_content "today"
end
end end
end end
describe "Edit issue", :js => true do describe "Edit issue", :js => true do
before do before do
@issue = Factory :issue, @issue = Factory :issue,
:author => @user, :author => @user,
:assignee => @user, :assignee => @user,
...@@ -122,19 +172,18 @@ describe "Issues" do ...@@ -122,19 +172,18 @@ describe "Issues" do
click_link "Edit" click_link "Edit"
end end
it "should open new issue popup" do it "should open new issue popup" do
page.should have_content("Issue ##{@issue.id}") page.should have_content("Issue ##{@issue.id}")
end end
describe "fill in" do describe "fill in" do
before do before do
fill_in "issue_title", :with => "bug 345" fill_in "issue_title", :with => "bug 345"
fill_in "issue_content", :with => "app bug 345"
end end
it { expect { click_button "Save" }.to_not change {Issue.count} } it { expect { click_button "Save" }.to_not change {Issue.count} }
it "should update issue fields" do it "should update issue fields" do
click_button "Save" click_button "Save"
page.should_not have_content("Issue ##{@issue.id}") page.should_not have_content("Issue ##{@issue.id}")
...@@ -144,4 +193,51 @@ describe "Issues" do ...@@ -144,4 +193,51 @@ describe "Issues" do
end end
end end
end end
describe "Search issue", :js => true do
before do
['foobar', 'foobar2', 'gitlab'].each do |title|
@issue = Factory :issue,
:author => @user,
:assignee => @user,
:project => project,
:title => title
@issue.save
end
end
it "should be able to search on different statuses" do
@issue = Issue.first
@issue.closed = true
@issue.save
visit project_issues_path(project)
choose 'closed_issues'
fill_in 'issue_search', :with => 'foobar'
page.should have_content 'foobar'
page.should_not have_content 'foobar2'
page.should_not have_content 'gitlab'
end
it "should search for term and return the correct results" do
visit project_issues_path(project)
fill_in 'issue_search', :with => 'foobar'
page.should have_content 'foobar'
page.should have_content 'foobar2'
page.should_not have_content 'gitlab'
end
it "should return all results if term has been cleared" do
visit project_issues_path(project)
fill_in "issue_search", :with => "foobar"
# Because fill_in, :with => "" triggers nothing we need to trigger a keyup event
page.execute_script("$('.issue_search').val('').keyup();");
page.should have_content 'foobar'
page.should have_content 'foobar2'
page.should have_content 'gitlab'
end
end
end end
require 'spec_helper' require 'spec_helper'
describe "Issues" do describe "Issues" do
before do before do
login_as :user login_as :user
end end
describe "GET /keys" do describe "GET /keys" do
before do before do
@key = Factory :key, :user => @user @key = Factory :key, :user => @user
visit keys_path visit keys_path
end end
...@@ -15,8 +15,8 @@ describe "Issues" do ...@@ -15,8 +15,8 @@ describe "Issues" do
it { should have_content(@key.title) } it { should have_content(@key.title) }
describe "Destroy" do describe "Destroy" do
it "should remove entry" do it "should remove entry" do
expect { expect {
click_link "destroy_key_#{@key.id}" click_link "destroy_key_#{@key.id}"
}.to change { @user.keys.count }.by(-1) }.to change { @user.keys.count }.by(-1)
...@@ -24,17 +24,17 @@ describe "Issues" do ...@@ -24,17 +24,17 @@ describe "Issues" do
end end
end end
describe "New key", :js => true do describe "New key", :js => true do
before do before do
visit keys_path visit keys_path
click_link "Add new" click_link "Add new"
end end
it "should open new key popup" do it "should open new key popup" do
page.should have_content("Add new public key") page.should have_content("Add new public key")
end end
describe "fill in" do describe "fill in" do
before do before do
fill_in "key_title", :with => "laptop" fill_in "key_title", :with => "laptop"
fill_in "key_key", :with => "publickey234=" fill_in "key_key", :with => "publickey234="
...@@ -42,7 +42,7 @@ describe "Issues" do ...@@ -42,7 +42,7 @@ describe "Issues" do
it { expect { click_button "Save" }.to change {Key.count}.by(1) } it { expect { click_button "Save" }.to change {Key.count}.by(1) }
it "should add new key to table" do it "should add new key to table" do
click_button "Save" click_button "Save"
page.should_not have_content("Add new public key") page.should_not have_content("Add new public key")
......
require 'spec_helper' require 'spec_helper'
describe "Profile" do describe "Profile" do
before do before do
login_as :user login_as :user
end end
describe "Show profile" do describe "Show profile" do
before do before do
visit profile_path visit profile_path
end end
...@@ -15,13 +15,13 @@ describe "Profile" do ...@@ -15,13 +15,13 @@ describe "Profile" do
end end
describe "Profile update" do describe "Profile update" do
before do before do
visit profile_path visit profile_path
fill_in "user_skype", :with => "testskype" fill_in "user_skype", :with => "testskype"
fill_in "user_linkedin", :with => "testlinkedin" fill_in "user_linkedin", :with => "testlinkedin"
fill_in "user_twitter", :with => "testtwitter" fill_in "user_twitter", :with => "testtwitter"
click_button "Save" click_button "Save"
@user.reload @user.reload
end end
it { @user.skype.should == 'testskype' } it { @user.skype.should == 'testskype' }
...@@ -29,18 +29,17 @@ describe "Profile" do ...@@ -29,18 +29,17 @@ describe "Profile" do
it { @user.twitter.should == 'testtwitter' } it { @user.twitter.should == 'testtwitter' }
end end
describe "Password update" do describe "Password update" do
before do before do
visit profile_password_path visit profile_password_path
end end
it { page.should have_content("Password") } it { page.should have_content("Password") }
it { page.should have_content("Password confirmation") } it { page.should have_content("Password confirmation") }
describe "change password" do describe "change password" do
before do before do
@old_pwd = @user.encrypted_password @old_pwd = @user.encrypted_password
fill_in "user_password", :with => "777777" fill_in "user_password", :with => "777777"
fill_in "user_password_confirmation", :with => "777777" fill_in "user_password_confirmation", :with => "777777"
click_button "Save" click_button "Save"
...@@ -51,18 +50,18 @@ describe "Profile" do ...@@ -51,18 +50,18 @@ describe "Profile" do
current_path.should == new_user_session_path current_path.should == new_user_session_path
end end
it "should change password" do it "should change password" do
@user.encrypted_password.should_not == @old_pwd @user.encrypted_password.should_not == @old_pwd
end end
describe "login with new password" do describe "login with new password" do
before do before do
fill_in "user_email", :with => @user.email fill_in "user_email", :with => @user.email
fill_in "user_password", :with => "777777" fill_in "user_password", :with => "777777"
click_button "Sign in" click_button "Sign in"
end end
it "should login user" do it "should login user" do
current_path.should == root_path current_path.should == root_path
end end
end end
......
require 'spec_helper' require 'spec_helper'
describe "Projects" do describe "Projects" do
describe "GET /projects" do describe "GET /projects" do
it { projects_path.should be_allowed_for :admin } it { projects_path.should be_allowed_for :admin }
it { projects_path.should be_allowed_for :user } it { projects_path.should be_allowed_for :user }
it { projects_path.should be_denied_for :visitor } it { projects_path.should be_denied_for :visitor }
end end
describe "GET /projects/new" do describe "GET /projects/new" do
it { projects_path.should be_allowed_for :admin } it { projects_path.should be_allowed_for :admin }
it { projects_path.should be_allowed_for :user } it { projects_path.should be_allowed_for :user }
it { projects_path.should be_denied_for :visitor } it { projects_path.should be_denied_for :visitor }
end end
describe "Project" do describe "Project" do
before do before do
@project = Factory :project @project = Factory :project
@u1 = Factory :user @u1 = Factory :user
@u2 = Factory :user @u2 = Factory :user
@u3 = Factory :user @u3 = Factory :user
# full access # full access
@project.users_projects.create(:user => @u1, :read => true, :write => true, :admin => true) @project.users_projects.create(:user => @u1, :read => true, :write => true, :admin => true)
# no access # no access
@project.users_projects.create(:user => @u2, :read => false, :write => false, :admin => false) @project.users_projects.create(:user => @u2, :read => false, :write => false, :admin => false)
# readonly # readonly
@project.users_projects.create(:user => @u3, :read => true, :write => false, :admin => false) @project.users_projects.create(:user => @u3, :read => true, :write => false, :admin => false)
end end
describe "GET /project_code" do describe "GET /project_code" do
it { project_path(@project).should be_allowed_for @u1 } it { project_path(@project).should be_allowed_for @u1 }
it { project_path(@project).should be_allowed_for @u3 } it { project_path(@project).should be_allowed_for @u3 }
it { project_path(@project).should be_denied_for :admin } it { project_path(@project).should be_denied_for :admin }
...@@ -36,7 +36,7 @@ describe "Projects" do ...@@ -36,7 +36,7 @@ describe "Projects" do
it { project_path(@project).should be_denied_for :visitor } it { project_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/tree" do describe "GET /project_code/tree" do
it { tree_project_path(@project).should be_allowed_for @u1 } it { tree_project_path(@project).should be_allowed_for @u1 }
it { tree_project_path(@project).should be_allowed_for @u3 } it { tree_project_path(@project).should be_allowed_for @u3 }
it { tree_project_path(@project).should be_denied_for :admin } it { tree_project_path(@project).should be_denied_for :admin }
...@@ -45,7 +45,7 @@ describe "Projects" do ...@@ -45,7 +45,7 @@ describe "Projects" do
it { tree_project_path(@project).should be_denied_for :visitor } it { tree_project_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/commits" do describe "GET /project_code/commits" do
it { project_commits_path(@project).should be_allowed_for @u1 } it { project_commits_path(@project).should be_allowed_for @u1 }
it { project_commits_path(@project).should be_allowed_for @u3 } it { project_commits_path(@project).should be_allowed_for @u3 }
it { project_commits_path(@project).should be_denied_for :admin } it { project_commits_path(@project).should be_denied_for :admin }
...@@ -54,7 +54,7 @@ describe "Projects" do ...@@ -54,7 +54,7 @@ describe "Projects" do
it { project_commits_path(@project).should be_denied_for :visitor } it { project_commits_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/commit" do describe "GET /project_code/commit" do
it { project_commit_path(@project, @project.commit).should be_allowed_for @u1 } it { project_commit_path(@project, @project.commit).should be_allowed_for @u1 }
it { project_commit_path(@project, @project.commit).should be_allowed_for @u3 } it { project_commit_path(@project, @project.commit).should be_allowed_for @u3 }
it { project_commit_path(@project, @project.commit).should be_denied_for :admin } it { project_commit_path(@project, @project.commit).should be_denied_for :admin }
...@@ -63,7 +63,7 @@ describe "Projects" do ...@@ -63,7 +63,7 @@ describe "Projects" do
it { project_commit_path(@project, @project.commit).should be_denied_for :visitor } it { project_commit_path(@project, @project.commit).should be_denied_for :visitor }
end end
describe "GET /project_code/team" do describe "GET /project_code/team" do
it { team_project_path(@project).should be_allowed_for @u1 } it { team_project_path(@project).should be_allowed_for @u1 }
it { team_project_path(@project).should be_allowed_for @u3 } it { team_project_path(@project).should be_allowed_for @u3 }
it { team_project_path(@project).should be_denied_for :admin } it { team_project_path(@project).should be_denied_for :admin }
...@@ -72,7 +72,7 @@ describe "Projects" do ...@@ -72,7 +72,7 @@ describe "Projects" do
it { team_project_path(@project).should be_denied_for :visitor } it { team_project_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/wall" do describe "GET /project_code/wall" do
it { wall_project_path(@project).should be_allowed_for @u1 } it { wall_project_path(@project).should be_allowed_for @u1 }
it { wall_project_path(@project).should be_allowed_for @u3 } it { wall_project_path(@project).should be_allowed_for @u3 }
it { wall_project_path(@project).should be_denied_for :admin } it { wall_project_path(@project).should be_denied_for :admin }
...@@ -81,8 +81,8 @@ describe "Projects" do ...@@ -81,8 +81,8 @@ describe "Projects" do
it { wall_project_path(@project).should be_denied_for :visitor } it { wall_project_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/blob" do describe "GET /project_code/blob" do
before do before do
@commit = @project.commit @commit = @project.commit
@path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name
@blob_path = blob_project_path(@project, :commit_id => @commit.id, :path => @path) @blob_path = blob_project_path(@project, :commit_id => @commit.id, :path => @path)
...@@ -96,7 +96,7 @@ describe "Projects" do ...@@ -96,7 +96,7 @@ describe "Projects" do
it { @blob_path.should be_denied_for :visitor } it { @blob_path.should be_denied_for :visitor }
end end
describe "GET /project_code/edit" do describe "GET /project_code/edit" do
it { edit_project_path(@project).should be_allowed_for @u1 } it { edit_project_path(@project).should be_allowed_for @u1 }
it { edit_project_path(@project).should be_denied_for @u3 } it { edit_project_path(@project).should be_denied_for @u3 }
it { edit_project_path(@project).should be_denied_for :admin } it { edit_project_path(@project).should be_denied_for :admin }
...@@ -105,7 +105,7 @@ describe "Projects" do ...@@ -105,7 +105,7 @@ describe "Projects" do
it { edit_project_path(@project).should be_denied_for :visitor } it { edit_project_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/issues" do describe "GET /project_code/issues" do
it { project_issues_path(@project).should be_allowed_for @u1 } it { project_issues_path(@project).should be_allowed_for @u1 }
it { project_issues_path(@project).should be_allowed_for @u3 } it { project_issues_path(@project).should be_allowed_for @u3 }
it { project_issues_path(@project).should be_denied_for :admin } it { project_issues_path(@project).should be_denied_for :admin }
...@@ -114,7 +114,7 @@ describe "Projects" do ...@@ -114,7 +114,7 @@ describe "Projects" do
it { project_issues_path(@project).should be_denied_for :visitor } it { project_issues_path(@project).should be_denied_for :visitor }
end end
describe "GET /project_code/snippets" do describe "GET /project_code/snippets" do
it { project_snippets_path(@project).should be_allowed_for @u1 } it { project_snippets_path(@project).should be_allowed_for @u1 }
it { project_snippets_path(@project).should be_allowed_for @u3 } it { project_snippets_path(@project).should be_allowed_for @u3 }
it { project_snippets_path(@project).should be_denied_for :admin } it { project_snippets_path(@project).should be_denied_for :admin }
......
...@@ -4,38 +4,38 @@ describe "Projects" do ...@@ -4,38 +4,38 @@ describe "Projects" do
before { login_as :user } before { login_as :user }
describe "GET /projects" do describe "GET /projects" do
before do before do
visit projects_path visit projects_path
end end
it "should be on projects page" do it "should be on projects page" do
current_path.should == projects_path current_path.should == projects_path
end end
it "should have link to new project" do it "should have link to new project" do
page.should have_content("New Project") page.should have_content("Create new project")
end end
end end
describe "GET /projects/new" do describe "GET /projects/new" do
before do before do
visit projects_path visit projects_path
click_link "New Project" click_link "Create new project"
end end
it "should be correct path" do it "should be correct path" do
current_path.should == new_project_path current_path.should == new_project_path
end end
it "should have labels for new project" do it "should have labels for new project" do
page.should have_content("Name") page.should have_content("Name")
page.should have_content("Path") page.should have_content("Path")
page.should have_content("Description") page.should have_content("Description")
end end
end end
describe "POST /projects" do describe "POST /projects" do
before do before do
visit new_project_path visit new_project_path
fill_in 'Name', :with => 'NewProject' fill_in 'Name', :with => 'NewProject'
fill_in 'Code', :with => 'NPR' fill_in 'Code', :with => 'NPR'
...@@ -61,7 +61,7 @@ describe "Projects" do ...@@ -61,7 +61,7 @@ describe "Projects" do
end end
describe "GET /projects/show" do describe "GET /projects/show" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -72,14 +72,14 @@ describe "Projects" do ...@@ -72,14 +72,14 @@ describe "Projects" do
current_path.should == project_path(@project) current_path.should == project_path(@project)
end end
it "should beahave like dashboard" do it "should beahave like dashboard" do
page.should have_content("History") page.should have_content("History")
end end
end end
describe "GET /projects/team" do describe "GET /projects/team" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -92,13 +92,13 @@ describe "Projects" do ...@@ -92,13 +92,13 @@ describe "Projects" do
current_path.should == team_project_path(@project) current_path.should == team_project_path(@project)
end end
it "should have as as team member" do it "should have as as team member" do
page.should have_content(@user.name) page.should have_content(@user.name)
end end
end end
describe "GET /projects/:id/edit" do describe "GET /projects/:id/edit" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :admin, :read) @project.add_access(@user, :admin, :read)
...@@ -110,14 +110,14 @@ describe "Projects" do ...@@ -110,14 +110,14 @@ describe "Projects" do
end end
it "should have labels for new project" do it "should have labels for new project" do
page.should have_content("Name") page.should have_content("Name")
page.should have_content("Path") page.should have_content("Path")
page.should have_content("Description") page.should have_content("Description")
end end
end end
describe "PUT /projects/:id" do describe "PUT /projects/:id" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :admin, :read) @project.add_access(@user, :admin, :read)
...@@ -140,14 +140,14 @@ describe "Projects" do ...@@ -140,14 +140,14 @@ describe "Projects" do
end end
#describe "DELETE /projects/:id", :js => true do #describe "DELETE /projects/:id", :js => true do
#before do #before do
#@project = Factory :project #@project = Factory :project
#@project.add_access(@user, :read, :admin) #@project.add_access(@user, :read, :admin)
#visit projects_path #visit projects_path
#end #end
#it "should be correct path" do #it "should be correct path" do
#expect { click_link "Destroy" }.to change {Project.count}.by(1) #expect { click_link "Destroy" }.to change {Project.count}.by(1)
#end #end
#end #end
end end
...@@ -6,13 +6,13 @@ describe "Projects" do ...@@ -6,13 +6,13 @@ describe "Projects" do
describe "GET /projects/tree" do describe "GET /projects/tree" do
describe "head" do describe "head" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
end end
it "should be fast" do it "should be fast" do
time = Benchmark.realtime do time = Benchmark.realtime do
visit tree_project_path(@project) visit tree_project_path(@project)
end end
...@@ -21,12 +21,12 @@ describe "Projects" do ...@@ -21,12 +21,12 @@ describe "Projects" do
end end
describe ValidCommit::ID do describe ValidCommit::ID do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
end end
it "should be fast" do it "should be fast" do
time = Benchmark.realtime do time = Benchmark.realtime do
visit tree_project_path(@project, :commit_id => ValidCommit::ID) visit tree_project_path(@project, :commit_id => ValidCommit::ID)
end end
......
...@@ -5,7 +5,7 @@ describe "Projects" do ...@@ -5,7 +5,7 @@ describe "Projects" do
describe "GET /projects/tree" do describe "GET /projects/tree" do
describe "head" do describe "head" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -20,7 +20,7 @@ describe "Projects" do ...@@ -20,7 +20,7 @@ describe "Projects" do
end end
describe ValidCommit::ID do describe ValidCommit::ID do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -36,7 +36,7 @@ describe "Projects" do ...@@ -36,7 +36,7 @@ describe "Projects" do
end end
describe "branch passed" do describe "branch passed" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -53,7 +53,7 @@ describe "Projects" do ...@@ -53,7 +53,7 @@ describe "Projects" do
# TREE FILE PREVIEW # TREE FILE PREVIEW
describe "file preview" do describe "file preview" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -70,9 +70,9 @@ describe "Projects" do ...@@ -70,9 +70,9 @@ describe "Projects" do
end end
end end
# RAW FILE # RAW FILE
describe "GET /projects/blob" do describe "GET /projects/blob" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
...@@ -85,7 +85,7 @@ describe "Projects" do ...@@ -85,7 +85,7 @@ describe "Projects" do
current_path.should == blob_project_path(@project) current_path.should == blob_project_path(@project)
end end
it "raw file response" do it "raw file response" do
page.source.should == ValidCommit::BLOB_FILE page.source.should == ValidCommit::BLOB_FILE
end end
end end
......
...@@ -3,13 +3,13 @@ require 'spec_helper' ...@@ -3,13 +3,13 @@ require 'spec_helper'
describe "Projects", "Wall" do describe "Projects", "Wall" do
let(:project) { Factory :project } let(:project) { Factory :project }
before do before do
login_as :user login_as :user
project.add_access(@user, :read, :write) project.add_access(@user, :read, :write)
end end
describe "View notes on wall" do describe "View notes on wall" do
before do before do
Factory :note, :project => project, :note => "Project specs", :author => @user Factory :note, :project => project, :note => "Project specs", :author => @user
visit wall_project_path(project) visit wall_project_path(project)
end end
...@@ -19,8 +19,8 @@ describe "Projects", "Wall" do ...@@ -19,8 +19,8 @@ describe "Projects", "Wall" do
it { page.should have_content("less than a minute ago") } it { page.should have_content("less than a minute ago") }
end end
describe "add new note", :js => true do describe "add new note", :js => true do
before do before do
visit wall_project_path(project) visit wall_project_path(project)
fill_in "note_note", :with => "my post on wall" fill_in "note_note", :with => "my post on wall"
click_button "Add note" click_button "Add note"
......
...@@ -3,13 +3,13 @@ require 'spec_helper' ...@@ -3,13 +3,13 @@ require 'spec_helper'
describe "Snippets" do describe "Snippets" do
let(:project) { Factory :project } let(:project) { Factory :project }
before do before do
login_as :user login_as :user
project.add_access(@user, :read, :write) project.add_access(@user, :read, :write)
end end
describe "GET /snippets" do describe "GET /snippets" do
before do before do
@snippet = Factory :snippet, @snippet = Factory :snippet,
:author => @user, :author => @user,
:project => project :project => project
...@@ -23,15 +23,23 @@ describe "Snippets" do ...@@ -23,15 +23,23 @@ describe "Snippets" do
it { should have_content(@snippet.project.name) } it { should have_content(@snippet.project.name) }
it { should have_content(@snippet.author.name) } it { should have_content(@snippet.author.name) }
describe "Destroy" do it "doesn't show expired snippets" do
before do @snippet.update_attribute(:expires_at, 1.day.ago.to_time)
visit project_snippet_path(project, @snippet)
page.should have_content("Sorry, this snippet is no longer exists")
page.should_not have_content(@snippet.title)
page.should_not have_content(@snippet.content)
end
describe "Destroy" do
before do
# admin access to remove snippet # admin access to remove snippet
@user.users_projects.destroy_all @user.users_projects.destroy_all
project.add_access(@user, :read, :write, :admin) project.add_access(@user, :read, :write, :admin)
visit project_snippets_path(project) visit project_snippets_path(project)
end end
it "should remove entry" do it "should remove entry" do
expect { expect {
click_link "destroy_snippet_#{@snippet.id}" click_link "destroy_snippet_#{@snippet.id}"
}.to change { Snippet.count }.by(-1) }.to change { Snippet.count }.by(-1)
...@@ -39,17 +47,17 @@ describe "Snippets" do ...@@ -39,17 +47,17 @@ describe "Snippets" do
end end
end end
describe "New snippet" do describe "New snippet" do
before do before do
visit project_snippets_path(project) visit project_snippets_path(project)
click_link "New Snippet" click_link "New Snippet"
end end
it "should open new snippet popup" do it "should open new snippet popup" do
page.current_path.should == new_project_snippet_path(project) page.current_path.should == new_project_snippet_path(project)
end end
describe "fill in" do describe "fill in" do
before do before do
fill_in "snippet_title", :with => "login function" fill_in "snippet_title", :with => "login function"
fill_in "snippet_file_name", :with => "test.rb" fill_in "snippet_file_name", :with => "test.rb"
...@@ -58,7 +66,7 @@ describe "Snippets" do ...@@ -58,7 +66,7 @@ describe "Snippets" do
it { expect { click_button "Save" }.to change {Snippet.count}.by(1) } it { expect { click_button "Save" }.to change {Snippet.count}.by(1) }
it "should add new snippet to table" do it "should add new snippet to table" do
click_button "Save" click_button "Save"
page.current_path.should == project_snippet_path(project, Snippet.last) page.current_path.should == project_snippet_path(project, Snippet.last)
page.should have_content "login function" page.should have_content "login function"
...@@ -67,8 +75,8 @@ describe "Snippets" do ...@@ -67,8 +75,8 @@ describe "Snippets" do
end end
end end
describe "Edit snippet" do describe "Edit snippet" do
before do before do
@snippet = Factory :snippet, @snippet = Factory :snippet,
:author => @user, :author => @user,
:project => project :project => project
...@@ -76,11 +84,11 @@ describe "Snippets" do ...@@ -76,11 +84,11 @@ describe "Snippets" do
click_link "Edit" click_link "Edit"
end end
it "should open edit page" do it "should open edit page" do
page.current_path.should == edit_project_snippet_path(project, @snippet) page.current_path.should == edit_project_snippet_path(project, @snippet)
end end
describe "fill in" do describe "fill in" do
before do before do
fill_in "snippet_title", :with => "login function" fill_in "snippet_title", :with => "login function"
fill_in "snippet_file_name", :with => "test.rb" fill_in "snippet_file_name", :with => "test.rb"
...@@ -89,7 +97,7 @@ describe "Snippets" do ...@@ -89,7 +97,7 @@ describe "Snippets" do
it { expect { click_button "Save" }.to_not change {Snippet.count} } it { expect { click_button "Save" }.to_not change {Snippet.count} }
it "should update snippet fields" do it "should update snippet fields" do
click_button "Save" click_button "Save"
page.current_path.should == project_snippet_path(project, @snippet) page.current_path.should == project_snippet_path(project, @snippet)
......
require 'spec_helper'
describe "Tags" do
before { login_as :user }
# describe "GET 'tags/index'" do
# it "should be successful" do
# get 'tags/index'
# response.should be_success
# end
# end
describe "GET '/tags.json'" do
before do
@project = Factory :project
@project.add_access(@user, :read)
@project.tag_list = 'demo1'
@project.save
visit '/tags.json'
end
it "should contains tags" do
page.should have_content('demo1')
end
end
end
require 'spec_helper' require 'spec_helper'
describe "TeamMembers" do describe "TeamMembers" do
before do before do
login_as :user login_as :user
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read, :admin) @project.add_access(@user, :read, :admin)
...@@ -10,7 +10,7 @@ describe "TeamMembers" do ...@@ -10,7 +10,7 @@ describe "TeamMembers" do
describe "View profile" do describe "View profile" do
it "should be available" do it "should be available" do
visit(team_project_path(@project)) visit(team_project_path(@project))
within "#team-table" do within "#team-table" do
click_link(@user.name) click_link(@user.name)
end end
page.should have_content @user.skype page.should have_content @user.skype
...@@ -18,23 +18,23 @@ describe "TeamMembers" do ...@@ -18,23 +18,23 @@ describe "TeamMembers" do
end end
end end
describe "New Team member", :js => true do describe "New Team member", :js => true do
before do before do
@user_1 = Factory :user @user_1 = Factory :user
visit team_project_path(@project) visit team_project_path(@project)
click_link "Add new" click_link "Add new"
end end
it "should open new team member popup" do it "should open new team member popup" do
page.should have_content("Add new member to project") page.should have_content("Add new member to project")
end end
describe "fill in" do describe "fill in" do
before do before do
click_link "Select user" click_link "Select user"
click_link @user_1.name click_link @user_1.name
within "#team_member_new" do within "#team_member_new" do
check "team_member_read" check "team_member_read"
check "team_member_write" check "team_member_write"
end end
...@@ -42,7 +42,7 @@ describe "TeamMembers" do ...@@ -42,7 +42,7 @@ describe "TeamMembers" do
it { expect { click_button "Save";sleep(1) }.to change {UsersProject.count}.by(1) } it { expect { click_button "Save";sleep(1) }.to change {UsersProject.count}.by(1) }
it "should add new member to table" do it "should add new member to table" do
click_button "Save" click_button "Save"
@member = UsersProject.last @member = UsersProject.last
...@@ -53,8 +53,8 @@ describe "TeamMembers" do ...@@ -53,8 +53,8 @@ describe "TeamMembers" do
@member.admin.should be_false @member.admin.should be_false
end end
it "should not allow creation without access selected" do it "should not allow creation without access selected" do
within "#team_member_new" do within "#team_member_new" do
uncheck "team_member_read" uncheck "team_member_read"
uncheck "team_member_write" uncheck "team_member_write"
uncheck "team_member_admin" uncheck "team_member_admin"
...@@ -66,8 +66,8 @@ describe "TeamMembers" do ...@@ -66,8 +66,8 @@ describe "TeamMembers" do
end end
end end
describe "Cancel membership" do describe "Cancel membership" do
it "should cancel membership" do it "should cancel membership" do
visit team_project_path(@project) visit team_project_path(@project)
expect { click_link "Cancel" }.to change { UsersProject.count }.by(-1) expect { click_link "Cancel" }.to change { UsersProject.count }.by(-1)
end end
......
...@@ -4,7 +4,7 @@ describe "Top Panel", :js => true do ...@@ -4,7 +4,7 @@ describe "Top Panel", :js => true do
before { login_as :user } before { login_as :user }
describe "Search autocomplete" do describe "Search autocomplete" do
before do before do
visit projects_path visit projects_path
fill_in "search", :with => "Ke" fill_in "search", :with => "Ke"
sleep(2) sleep(2)
...@@ -12,12 +12,12 @@ describe "Top Panel", :js => true do ...@@ -12,12 +12,12 @@ describe "Top Panel", :js => true do
end end
it "should be on projects page" do it "should be on projects page" do
current_path.should == keys_path current_path.should == keys_path
end end
end end
describe "with project" do describe "with project" do
before do before do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
visit project_path(@project) visit project_path(@project)
...@@ -28,7 +28,7 @@ describe "Top Panel", :js => true do ...@@ -28,7 +28,7 @@ describe "Top Panel", :js => true do
end end
it "should be on projects page" do it "should be on projects page" do
current_path.should == project_commits_path(@project) current_path.should == project_commits_path(@project)
end end
end end
end end
...@@ -2,32 +2,32 @@ require 'spec_helper' ...@@ -2,32 +2,32 @@ require 'spec_helper'
describe "Users Security" do describe "Users Security" do
describe "Project" do describe "Project" do
before do before do
@u1 = Factory :user @u1 = Factory :user
end end
describe "GET /login" do describe "GET /login" do
#it { new_user_session_path.should be_denied_for @u1 } #it { new_user_session_path.should be_denied_for @u1 }
#it { new_user_session_path.should be_denied_for :admin } #it { new_user_session_path.should be_denied_for :admin }
#it { new_user_session_path.should be_denied_for :user } #it { new_user_session_path.should be_denied_for :user }
it { new_user_session_path.should_not be_404_for :visitor } it { new_user_session_path.should_not be_404_for :visitor }
end end
describe "GET /keys" do describe "GET /keys" do
it { keys_path.should be_allowed_for @u1 } it { keys_path.should be_allowed_for @u1 }
it { keys_path.should be_allowed_for :admin } it { keys_path.should be_allowed_for :admin }
it { keys_path.should be_allowed_for :user } it { keys_path.should be_allowed_for :user }
it { keys_path.should be_denied_for :visitor } it { keys_path.should be_denied_for :visitor }
end end
describe "GET /profile" do describe "GET /profile" do
it { profile_path.should be_allowed_for @u1 } it { profile_path.should be_allowed_for @u1 }
it { profile_path.should be_allowed_for :admin } it { profile_path.should be_allowed_for :admin }
it { profile_path.should be_allowed_for :user } it { profile_path.should be_allowed_for :user }
it { profile_path.should be_denied_for :visitor } it { profile_path.should be_denied_for :visitor }
end end
describe "GET /profile/password" do describe "GET /profile/password" do
it { profile_password_path.should be_allowed_for @u1 } it { profile_password_path.should be_allowed_for @u1 }
it { profile_password_path.should be_allowed_for :admin } it { profile_password_path.should be_allowed_for :admin }
it { profile_password_path.should be_allowed_for :user } it { profile_password_path.should be_allowed_for :user }
......
...@@ -11,7 +11,6 @@ require 'capybara/dsl' ...@@ -11,7 +11,6 @@ require 'capybara/dsl'
require 'factories' require 'factories'
require 'monkeypatch' require 'monkeypatch'
# Requires supporting ruby files with custom matchers and macros, etc, # Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories. # in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
......
module LoginMacros module LoginMacros
def login_as role def login_as role
@user = User.create(:email => "user#{User.count}@mail.com", @user = User.create(:email => "user#{User.count}@mail.com",
:name => "John Smith", :name => "John Smith",
:password => "123456", :password => "123456",
:password_confirmation => "123456", :password_confirmation => "123456",
:skype => 'user_skype') :skype => 'user_skype')
if role == :admin if role == :admin
@user.admin = true @user.admin = true
@user.save! @user.save!
end end
visit new_user_session_path visit new_user_session_path
fill_in "Email", :with => @user.email fill_in "user_email", :with => @user.email
fill_in "Password", :with => "123456" fill_in "user_password", :with => "123456"
click_button "Sign in" click_button "Sign in"
end end
def login_with(user) def login_with(user)
visit new_user_session_path visit new_user_session_path
fill_in "Email", :with => user.email fill_in "user_email", :with => user.email
fill_in "Password", :with => "123456" fill_in "user_password", :with => "123456"
click_button "Sign in" click_button "Sign in"
end end
def logout def logout
click_link "Logout" rescue nil click_link "Logout" rescue nil
end end
......
...@@ -18,17 +18,17 @@ RSpec::Matchers.define :be_denied_for do |user| ...@@ -18,17 +18,17 @@ RSpec::Matchers.define :be_denied_for do |user|
match do |url| match do |url|
include UrlAccess include UrlAccess
url_denied?(user, url) url_denied?(user, url)
end end
end end
RSpec::Matchers.define :be_404_for do |user| RSpec::Matchers.define :be_404_for do |user|
match do |url| match do |url|
include UrlAccess include UrlAccess
url_404?(user, url) url_404?(user, url)
end end
end end
module UrlAccess module UrlAccess
def url_allowed?(user, url) def url_allowed?(user, url)
emulate_user(user) emulate_user(user)
visit url visit url
......
...@@ -6,13 +6,12 @@ shared_examples_for :project_side_pane do ...@@ -6,13 +6,12 @@ shared_examples_for :project_side_pane do
it { should have_content("Tree") } it { should have_content("Tree") }
end end
shared_examples_for :tree_view do shared_examples_for :tree_view do
subject { page } subject { page }
it "should have Tree View of project" do it "should have Tree View of project" do
should have_content("app") should have_content("app")
should have_content("history") should have_content("history")
should have_content("Gemfile") should have_content("Gemfile")
end end
end end
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie = function (key, value, options) {
// key and at least value given, set cookie...
if (arguments.length > 1 && String(value) !== "[object Object]") {
options = jQuery.extend({}, options);
if (value === null || value === undefined) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=',
options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || {};
var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};
/* Author: Alicia Liu */
(function ($) {
$.widget("ui.tagify", {
options: {
delimiters: [13, 188], // what user can type to complete a tag in char codes: [enter], [comma]
outputDelimiter: ',', // delimiter for tags in original input field
cssClass: 'tagify-container', // CSS class to style the tagify div and tags, see stylesheet
addTagPrompt: 'add tags' // placeholder text
},
_create: function() {
var self = this,
el = self.element,
opts = self.options;
this.tags = [];
// hide text field and replace with a div that contains it's own input field for entering tags
this.tagInput = $("<input type='text'>")
.attr( 'placeholder', opts.addTagPrompt )
.keypress( function(e) {
var $this = $(this),
pressed = e.which;
for ( i in opts.delimiters ) {
if (pressed == opts.delimiters[i]) {
self.add( $this.val() );
e.preventDefault();
return false;
}
}
})
// for some reason, in Safari, backspace is only recognized on keyup
.keyup( function(e) {
var $this = $(this),
pressed = e.which;
// if backspace is hit with no input, remove the last tag
if (pressed == 8) { // backspace
if ( $this.val() == "" ) {
self.remove();
return false;
}
return;
}
});
this.tagDiv = $("<div></div>")
.addClass( opts.cssClass )
.click( function() {
$(this).children('input').focus();
})
.append( this.tagInput )
.insertAfter( el.hide() );
// if the field isn't empty, parse the field for tags, and prepopulate existing tags
var initVal = $.trim( el.val() );
if ( initVal ) {
var initTags = initVal.split( opts.outputDelimiter );
$.each( initTags, function(i, tag) {
self.add( tag );
});
}
},
_setOption: function( key, value ) {
options.key = value;
},
// add a tag, public function
add: function(text) {
var self = this;
text = text || self.tagInput.val();
if (text) {
var tagIndex = self.tags.length;
var removeButton = $("<a href='#'>x</a>")
.click( function() {
self.remove( tagIndex );
return false;
});
var newTag = $("<span></span>")
.text( text )
.append( removeButton );
self.tagInput.before( newTag );
self.tags.push( text );
self.tagInput.val('');
}
},
// remove a tag by index, public function
// if index is blank, remove the last tag
remove: function( tagIndex ) {
var self = this;
if ( tagIndex == null || tagIndex === (self.tags.length - 1) ) {
this.tagDiv.children("span").last().remove();
self.tags.pop();
}
if ( typeof(tagIndex) == 'number' ) {
// otherwise just hide this tag, and we don't mess up the index
this.tagDiv.children( "span:eq(" + tagIndex + ")" ).hide();
// we rely on the serialize function to remove null values
delete( self.tags[tagIndex] );
}
},
// serialize the tags with the given delimiter, and write it back into the tagified field
serialize: function() {
var self = this;
var delim = self.options.outputDelimiter;
var tagsStr = self.tags.join( delim );
// our tags might have deleted entries, remove them here
var dupes = new RegExp(delim + delim + '+', 'g'); // regex: /,,+/g
var ends = new RegExp('^' + delim + '|' + delim + '$', 'g'); // regex: /^,|,$/g
var outputStr = tagsStr.replace( dupes, delim ).replace(ends, '');
self.element.val(outputStr);
return outputStr;
},
inputField: function() {
return this.tagInput;
},
containerDiv: function() {
return this.tagDiv;
},
// remove the div, and show original input
destroy: function() {
$.Widget.prototype.destroy.apply(this);
this.tagDiv.remove();
this.element.show();
}
});
})(jQuery);
\ No newline at end of file
/*
* jQuery UI selectmenu dev version
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
* https://github.com/fnagel/jquery-ui/wiki/Selectmenu
*/
(function($) {
$.widget("ui.selectmenu", {
getter: "value",
version: "1.8",
eventPrefix: "selectmenu",
options: {
transferClasses: true,
typeAhead: "sequential",
style: 'dropdown',
positionOptions: {
my: "left top",
at: "left bottom",
offset: null
},
width: null,
menuWidth: null,
handleWidth: 26,
maxHeight: null,
icons: null,
format: null,
bgImage: function() {},
wrapperElement: "<div />"
},
_create: function() {
var self = this, o = this.options;
// set a default id value, generate a new random one if not set by developer
var selectmenuId = this.element.attr( 'id' ) || 'ui-selectmenu-' + Math.random().toString( 16 ).slice( 2, 10 );
// quick array of button and menu id's
this.ids = [ selectmenuId + '-button', selectmenuId + '-menu' ];
// define safe mouseup for future toggling
this._safemouseup = true;
// create menu button wrapper
this.newelement = $( '<a />', {
'class': this.widgetBaseClass + ' ui-widget ui-state-default ui-corner-all',
'id' : this.ids[ 0 ],
'role': 'button',
'href': '#nogo',
'tabindex': this.element.attr( 'disabled' ) ? 1 : 0,
'aria-haspopup': true,
'aria-owns': this.ids[ 1 ]
});
this.newelementWrap = $( o.wrapperElement )
.append( this.newelement )
.insertAfter( this.element );
// transfer tabindex
var tabindex = this.element.attr( 'tabindex' );
if ( tabindex ) {
this.newelement.attr( 'tabindex', tabindex );
}
// save reference to select in data for ease in calling methods
this.newelement.data( 'selectelement', this.element );
// menu icon
this.selectmenuIcon = $( '<span class="' + this.widgetBaseClass + '-icon ui-icon"></span>' )
.prependTo( this.newelement );
// append status span to button
this.newelement.prepend( '<span class="' + self.widgetBaseClass + '-status" />' );
// make associated form label trigger focus
$( 'label[for="' + selectmenuId + '"]' )
.attr( 'for', this.ids[0] )
.bind( 'click.selectmenu', function() {
self.newelement[0].focus();
return false;
});
// click toggle for menu visibility
this.newelement
.bind('mousedown.selectmenu', function(event) {
self._toggle(event, true);
// make sure a click won't open/close instantly
if (o.style == "popup") {
self._safemouseup = false;
setTimeout(function() { self._safemouseup = true; }, 300);
}
return false;
})
.bind('click.selectmenu', function() {
return false;
})
.bind("keydown.selectmenu", function(event) {
var ret = false;
switch (event.keyCode) {
case $.ui.keyCode.ENTER:
ret = true;
break;
case $.ui.keyCode.SPACE:
self._toggle(event);
break;
case $.ui.keyCode.UP:
if (event.altKey) {
self.open(event);
} else {
self._moveSelection(-1);
}
break;
case $.ui.keyCode.DOWN:
if (event.altKey) {
self.open(event);
} else {
self._moveSelection(1);
}
break;
case $.ui.keyCode.LEFT:
self._moveSelection(-1);
break;
case $.ui.keyCode.RIGHT:
self._moveSelection(1);
break;
case $.ui.keyCode.TAB:
ret = true;
break;
default:
ret = true;
}
return ret;
})
.bind('keypress.selectmenu', function(event) {
self._typeAhead(event.which, 'mouseup');
return true;
})
.bind('mouseover.selectmenu focus.selectmenu', function() {
if (!o.disabled) {
$(this).addClass(self.widgetBaseClass + '-focus ui-state-hover');
}
})
.bind('mouseout.selectmenu blur.selectmenu', function() {
if (!o.disabled) {
$(this).removeClass(self.widgetBaseClass + '-focus ui-state-hover');
}
});
// document click closes menu
$(document).bind("mousedown.selectmenu", function(event) {
self.close(event);
});
// change event on original selectmenu
this.element
.bind("click.selectmenu", function() {
self._refreshValue();
})
// FIXME: newelement can be null under unclear circumstances in IE8
// TODO not sure if this is still a problem (fnagel 20.03.11)
.bind("focus.selectmenu", function() {
if (self.newelement) {
self.newelement[0].focus();
}
});
// set width when not set via options
if (!o.width) {
o.width = this.element.outerWidth();
}
// set menu button width
this.newelement.width(o.width);
// hide original selectmenu element
this.element.hide();
// create menu portion, append to body
this.list = $( '<ul />', {
'class': 'ui-widget ui-widget-content',
'aria-hidden': true,
'role': 'listbox',
'aria-labelledby': this.ids[0],
'id': this.ids[1]
});
this.listWrap = $( o.wrapperElement )
.addClass( self.widgetBaseClass + '-menu' )
.append( this.list )
.appendTo( 'body' );
// transfer menu click to menu button
this.list
.bind("keydown.selectmenu", function(event) {
var ret = false;
switch (event.keyCode) {
case $.ui.keyCode.UP:
if (event.altKey) {
self.close(event, true);
} else {
self._moveFocus(-1);
}
break;
case $.ui.keyCode.DOWN:
if (event.altKey) {
self.close(event, true);
} else {
self._moveFocus(1);
}
break;
case $.ui.keyCode.LEFT:
self._moveFocus(-1);
break;
case $.ui.keyCode.RIGHT:
self._moveFocus(1);
break;
case $.ui.keyCode.HOME:
self._moveFocus(':first');
break;
case $.ui.keyCode.PAGE_UP:
self._scrollPage('up');
break;
case $.ui.keyCode.PAGE_DOWN:
self._scrollPage('down');
break;
case $.ui.keyCode.END:
self._moveFocus(':last');
break;
case $.ui.keyCode.ENTER:
case $.ui.keyCode.SPACE:
self.close(event, true);
$(event.target).parents('li:eq(0)').trigger('mouseup');
break;
case $.ui.keyCode.TAB:
ret = true;
self.close(event, true);
$(event.target).parents('li:eq(0)').trigger('mouseup');
break;
case $.ui.keyCode.ESCAPE:
self.close(event, true);
break;
default:
ret = true;
}
return ret;
})
.bind('keypress.selectmenu', function(event) {
self._typeAhead(event.which, 'focus');
return true;
})
// this allows for using the scrollbar in an overflowed list
.bind( 'mousedown.selectmenu mouseup.selectmenu', function() { return false; });
// needed when window is resized
// TODO seems to be useless, but causes errors (fnagel 01.08.11)
// see: https://github.com/fnagel/jquery-ui/issues/147
// $(window).bind( "resize.selectmenu", $.proxy( self._refreshPosition, this ) );
},
_init: function() {
var self = this, o = this.options;
// serialize selectmenu element options
var selectOptionData = [];
this.element
.find('option')
.each(function() {
var opt = $(this);
selectOptionData.push({
value: opt.attr('value'),
text: self._formatText(opt.text()),
selected: opt.attr('selected'),
disabled: opt.attr('disabled'),
classes: opt.attr('class'),
typeahead: opt.attr('typeahead'),
parentOptGroup: opt.parent('optgroup'),
bgImage: o.bgImage.call(opt)
});
});
// active state class is only used in popup style
var activeClass = (self.options.style == "popup") ? " ui-state-active" : "";
// empty list so we can refresh the selectmenu via selectmenu()
this.list.html("");
// write li's
if (selectOptionData.length) {
for (var i = 0; i < selectOptionData.length; i++) {
var thisLiAttr = { role : 'presentation' };
if ( selectOptionData[ i ].disabled ) {
thisLiAttr[ 'class' ] = this.namespace + '-state-disabled';
}
var thisAAttr = {
html: selectOptionData[i].text,
href : '#nogo',
tabindex : -1,
role : 'option',
'aria-selected' : false
};
if ( selectOptionData[ i ].disabled ) {
thisAAttr[ 'aria-disabled' ] = selectOptionData[ i ].disabled;
}
if ( selectOptionData[ i ].typeahead ) {
thisAAttr[ 'typeahead' ] = selectOptionData[ i ].typeahead;
}
var thisA = $('<a/>', thisAAttr);
var thisLi = $('<li/>', thisLiAttr)
.append(thisA)
.data('index', i)
.addClass(selectOptionData[i].classes)
.data('optionClasses', selectOptionData[i].classes || '')
.bind("mouseup.selectmenu", function(event) {
if (self._safemouseup && !self._disabled(event.currentTarget) && !self._disabled($( event.currentTarget ).parents( "ul>li." + self.widgetBaseClass + "-group " )) ) {
var changed = $(this).data('index') != self._selectedIndex();
self.index($(this).data('index'));
self.select(event);
if (changed) {
self.change(event);
}
self.close(event, true);
}
return false;
})
.bind("click.selectmenu", function() {
return false;
})
.bind('mouseover.selectmenu focus.selectmenu', function(e) {
// no hover if diabled
if (!$(e.currentTarget).hasClass(self.namespace + '-state-disabled') && !$(e.currentTarget).parent("ul").parent("li").hasClass(self.namespace + '-state-disabled')) {
self._selectedOptionLi().addClass(activeClass);
self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
$(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover');
}
})
.bind('mouseout.selectmenu blur.selectmenu', function() {
if ($(this).is(self._selectedOptionLi().selector)) {
$(this).addClass(activeClass);
}
$(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
});
// optgroup or not...
if ( selectOptionData[i].parentOptGroup.length ) {
var optGroupName = self.widgetBaseClass + '-group-' + this.element.find( 'optgroup' ).index( selectOptionData[i].parentOptGroup );
if (this.list.find( 'li.' + optGroupName ).length ) {
this.list.find( 'li.' + optGroupName + ':last ul' ).append( thisLi );
} else {
$(' <li role="presentation" class="' + self.widgetBaseClass + '-group ' + optGroupName + (selectOptionData[i].parentOptGroup.attr("disabled") ? ' ' + this.namespace + '-state-disabled" aria-disabled="true"' : '"' ) + '><span class="' + self.widgetBaseClass + '-group-label">' + selectOptionData[i].parentOptGroup.attr('label') + '</span><ul></ul></li> ')
.appendTo( this.list )
.find( 'ul' )
.append( thisLi );
}
} else {
thisLi.appendTo(this.list);
}
// append icon if option is specified
if (o.icons) {
for (var j in o.icons) {
if (thisLi.is(o.icons[j].find)) {
thisLi
.data('optionClasses', selectOptionData[i].classes + ' ' + self.widgetBaseClass + '-hasIcon')
.addClass(self.widgetBaseClass + '-hasIcon');
var iconClass = o.icons[j].icon || "";
thisLi
.find('a:eq(0)')
.prepend('<span class="' + self.widgetBaseClass + '-item-icon ui-icon ' + iconClass + '"></span>');
if (selectOptionData[i].bgImage) {
thisLi.find('span').css('background-image', selectOptionData[i].bgImage);
}
}
}
}
}
} else {
$('<li role="presentation"><a href="#nogo" tabindex="-1" role="option"></a></li>').appendTo(this.list);
}
// we need to set and unset the CSS classes for dropdown and popup style
var isDropDown = ( o.style == 'dropdown' );
this.newelement
.toggleClass( self.widgetBaseClass + '-dropdown', isDropDown )
.toggleClass( self.widgetBaseClass + '-popup', !isDropDown );
this.list
.toggleClass( self.widgetBaseClass + '-menu-dropdown ui-corner-bottom', isDropDown )
.toggleClass( self.widgetBaseClass + '-menu-popup ui-corner-all', !isDropDown )
// add corners to top and bottom menu items
.find( 'li:first' )
.toggleClass( 'ui-corner-top', !isDropDown )
.end().find( 'li:last' )
.addClass( 'ui-corner-bottom' );
this.selectmenuIcon
.toggleClass( 'ui-icon-triangle-1-s', isDropDown )
.toggleClass( 'ui-icon-triangle-2-n-s', !isDropDown );
// transfer classes to selectmenu and list
if ( o.transferClasses ) {
var transferClasses = this.element.attr( 'class' ) || '';
this.newelement.add( this.list ).addClass( transferClasses );
}
// set menu width to either menuWidth option value, width option value, or select width
if ( o.style == 'dropdown' ) {
this.list.width( o.menuWidth ? o.menuWidth : o.width );
} else {
this.list.width( o.menuWidth ? o.menuWidth : o.width - o.handleWidth );
}
// reset height to auto
this.list.css( 'height', 'auto' );
var listH = this.listWrap.height();
// calculate default max height
if ( o.maxHeight && o.maxHeight < listH ) {
this.list.height( o.maxHeight );
} else {
var winH = $( window ).height() / 3;
if ( winH < listH ) this.list.height( winH );
}
// save reference to actionable li's (not group label li's)
this._optionLis = this.list.find( 'li:not(.' + self.widgetBaseClass + '-group)' );
// transfer disabled state
if ( this.element.attr( 'disabled' ) ) {
this.disable();
} else {
this.enable()
}
// update value
this.index( this._selectedIndex() );
// needed when selectmenu is placed at the very bottom / top of the page
window.setTimeout( function() {
self._refreshPosition();
}, 200 );
},
destroy: function() {
this.element.removeData( this.widgetName )
.removeClass( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled' )
.removeAttr( 'aria-disabled' )
.unbind( ".selectmenu" );
// TODO unneded as event binding has been disabled
// $( window ).unbind( ".selectmenu" );
$( document ).unbind( ".selectmenu" );
// unbind click on label, reset its for attr
$( 'label[for=' + this.newelement.attr('id') + ']' )
.attr( 'for', this.element.attr( 'id' ) )
.unbind( '.selectmenu' );
this.newelementWrap.remove();
this.listWrap.remove();
this.element.show();
// call widget destroy function
$.Widget.prototype.destroy.apply(this, arguments);
},
_typeAhead: function( code, eventType ){
var self = this, focusFound = false, C = String.fromCharCode(code).toUpperCase();
c = C.toLowerCase();
if ( self.options.typeAhead == 'sequential' ) {
// clear the timeout so we can use _prevChar
window.clearTimeout('ui.selectmenu-' + self.selectmenuId);
// define our find var
var find = typeof( self._prevChar ) == 'undefined' ? '' : self._prevChar.join( '' );
function focusOptSeq( elem, ind, c ){
focusFound = true;
$( elem ).trigger( eventType );
typeof( self._prevChar ) == 'undefined' ? self._prevChar = [ c ] : self._prevChar[ self._prevChar.length ] = c;
}
this.list.find( 'li a' ).each( function( i ) {
if ( !focusFound ) {
// allow the typeahead attribute on the option tag for a more specific lookup
var thisText = $( this ).attr( 'typeahead' ) || $(this).text();
if ( thisText.indexOf( find + C ) === 0 ) {
focusOptSeq( this, i, C );
} else if (thisText.indexOf(find+c) === 0 ) {
focusOptSeq( this, i, c );
}
}
});
// set a 1 second timeout for sequenctial typeahead
// keep this set even if we have no matches so it doesnt typeahead somewhere else
window.setTimeout( function( el ) {
self._prevChar = undefined;
}, 1000, self );
} else {
// define self._prevChar if needed
if ( !self._prevChar ) { self._prevChar = [ '' , 0 ]; }
focusFound = false;
function focusOpt( elem, ind ){
focusFound = true;
$( elem ).trigger( eventType );
self._prevChar[ 1 ] = ind;
}
this.list.find( 'li a' ).each(function( i ){
if (!focusFound){
var thisText = $(this).text();
if ( thisText.indexOf( C ) === 0 || thisText.indexOf( c ) === 0 ) {
if (self._prevChar[0] == C){
if ( self._prevChar[ 1 ] < i ){ focusOpt( this, i ); }
} else{
focusOpt( this, i );
}
}
}
});
this._prevChar[ 0 ] = C;
}
},
// returns some usefull information, called by callbacks only
_uiHash: function() {
var index = this.index();
return {
index: index,
option: $("option", this.element).get(index),
value: this.element[0].value
};
},
open: function(event) {
var self = this, o = this.options;
if ( self.newelement.attr("aria-disabled") != 'true' ) {
self._closeOthers(event);
self.newelement.addClass('ui-state-active');
self.listWrap.appendTo( o.appendTo );
self.list.attr('aria-hidden', false);
if ( o.style == "dropdown" ) {
self.newelement.removeClass('ui-corner-all').addClass('ui-corner-top');
}
self.listWrap.addClass( self.widgetBaseClass + '-open' );
// positioning needed for IE7 (tested 01.08.11 on MS VPC Image)
// see https://github.com/fnagel/jquery-ui/issues/147
if ( $.browser.msie && $.browser.version.substr( 0,1 ) == 7 ) {
self._refreshPosition();
}
var selected = self.list.attr('aria-hidden', false).find('li:not(.' + self.widgetBaseClass + '-group):eq(' + self._selectedIndex() + '):visible a');
if (selected.length) selected[0].focus();
// positioning needed for FF, Chrome, IE8, IE7, IE6 (tested 01.08.11 on MS VPC Image)
self._refreshPosition();
self._trigger("open", event, self._uiHash());
}
},
close: function(event, retainFocus) {
if ( this.newelement.is('.ui-state-active') ) {
this.newelement
.removeClass('ui-state-active');
this.listWrap.removeClass(this.widgetBaseClass + '-open');
this.list.attr('aria-hidden', true);
if ( this.options.style == "dropdown" ) {
this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all');
}
if ( retainFocus ) {
this.newelement.focus();
}
this._trigger("close", event, this._uiHash());
}
},
change: function(event) {
this.element.trigger("change");
this._trigger("change", event, this._uiHash());
},
select: function(event) {
if (this._disabled(event.currentTarget)) { return false; }
this._trigger("select", event, this._uiHash());
},
_closeOthers: function(event) {
$('.' + this.widgetBaseClass + '.ui-state-active').not(this.newelement).each(function() {
$(this).data('selectelement').selectmenu('close', event);
});
$('.' + this.widgetBaseClass + '.ui-state-hover').trigger('mouseout');
},
_toggle: function(event, retainFocus) {
if ( this.list.parent().is('.' + this.widgetBaseClass + '-open') ) {
this.close(event, retainFocus);
} else {
this.open(event);
}
},
_formatText: function(text) {
return (this.options.format ? this.options.format(text) : text);
},
_selectedIndex: function() {
return this.element[0].selectedIndex;
},
_selectedOptionLi: function() {
return this._optionLis.eq(this._selectedIndex());
},
_focusedOptionLi: function() {
return this.list.find('.' + this.widgetBaseClass + '-item-focus');
},
_moveSelection: function(amt, recIndex) {
// do nothing if disabled
if (!this.options.disabled) {
var currIndex = parseInt(this._selectedOptionLi().data('index') || 0, 10);
var newIndex = currIndex + amt;
// do not loop when using up key
if (newIndex < 0) {
newIndex = 0;
}
if (newIndex > this._optionLis.size() - 1) {
newIndex = this._optionLis.size() - 1;
}
// Occurs when a full loop has been made
if (newIndex === recIndex) { return false; }
if (this._optionLis.eq(newIndex).hasClass( this.namespace + '-state-disabled' )) {
// if option at newIndex is disabled, call _moveFocus, incrementing amt by one
(amt > 0) ? ++amt : --amt;
this._moveSelection(amt, newIndex);
} else {
return this._optionLis.eq(newIndex).trigger('mouseup');
}
}
},
_moveFocus: function(amt, recIndex) {
if (!isNaN(amt)) {
var currIndex = parseInt(this._focusedOptionLi().data('index') || 0, 10);
var newIndex = currIndex + amt;
} else {
var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10);
}
if (newIndex < 0) {
newIndex = 0;
}
if (newIndex > this._optionLis.size() - 1) {
newIndex = this._optionLis.size() - 1;
}
//Occurs when a full loop has been made
if (newIndex === recIndex) { return false; }
var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
this._focusedOptionLi().find('a:eq(0)').attr('id', '');
if (this._optionLis.eq(newIndex).hasClass( this.namespace + '-state-disabled' )) {
// if option at newIndex is disabled, call _moveFocus, incrementing amt by one
(amt > 0) ? ++amt : --amt;
this._moveFocus(amt, newIndex);
} else {
this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID).focus();
}
this.list.attr('aria-activedescendant', activeID);
},
_scrollPage: function(direction) {
var numPerPage = Math.floor(this.list.outerHeight() / this.list.find('li:first').outerHeight());
numPerPage = (direction == 'up' ? -numPerPage : numPerPage);
this._moveFocus(numPerPage);
},
_setOption: function(key, value) {
this.options[key] = value;
// set
if (key == 'disabled') {
this.close();
this.element
.add(this.newelement)
.add(this.list)[value ? 'addClass' : 'removeClass'](
this.widgetBaseClass + '-disabled' + ' ' +
this.namespace + '-state-disabled')
.attr("aria-disabled", value);
}
},
disable: function(index, type){
// if options is not provided, call the parents disable function
if ( typeof( index ) == 'undefined' ) {
this._setOption( 'disabled', true );
} else {
if ( type == "optgroup" ) {
this._disableOptgroup(index);
} else {
this._disableOption(index);
}
}
},
enable: function(index, type) {
// if options is not provided, call the parents enable function
if ( typeof( index ) == 'undefined' ) {
this._setOption('disabled', false);
} else {
if ( type == "optgroup" ) {
this._enableOptgroup(index);
} else {
this._enableOption(index);
}
}
},
_disabled: function(elem) {
return $(elem).hasClass( this.namespace + '-state-disabled' );
},
_disableOption: function(index) {
var optionElem = this._optionLis.eq(index);
if (optionElem) {
optionElem.addClass(this.namespace + '-state-disabled')
.find("a").attr("aria-disabled", true);
this.element.find("option").eq(index).attr("disabled", "disabled");
}
},
_enableOption: function(index) {
var optionElem = this._optionLis.eq(index);
if (optionElem) {
optionElem.removeClass( this.namespace + '-state-disabled' )
.find("a").attr("aria-disabled", false);
this.element.find("option").eq(index).removeAttr("disabled");
}
},
_disableOptgroup: function(index) {
var optGroupElem = this.list.find( 'li.' + this.widgetBaseClass + '-group-' + index );
if (optGroupElem) {
optGroupElem.addClass(this.namespace + '-state-disabled')
.attr("aria-disabled", true);
this.element.find("optgroup").eq(index).attr("disabled", "disabled");
}
},
_enableOptgroup: function(index) {
var optGroupElem = this.list.find( 'li.' + this.widgetBaseClass + '-group-' + index );
if (optGroupElem) {
optGroupElem.removeClass(this.namespace + '-state-disabled')
.attr("aria-disabled", false);
this.element.find("optgroup").eq(index).removeAttr("disabled");
}
},
index: function(newValue) {
if (arguments.length) {
if (!this._disabled($(this._optionLis[newValue]))) {
this.element[0].selectedIndex = newValue;
this._refreshValue();
} else {
return false;
}
} else {
return this._selectedIndex();
}
},
value: function(newValue) {
if (arguments.length) {
this.element[0].value = newValue;
this._refreshValue();
} else {
return this.element[0].value;
}
},
_refreshValue: function() {
var activeClass = (this.options.style == "popup") ? " ui-state-active" : "";
var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
// deselect previous
this.list
.find('.' + this.widgetBaseClass + '-item-selected')
.removeClass(this.widgetBaseClass + "-item-selected" + activeClass)
.find('a')
.attr('aria-selected', 'false')
.attr('id', '');
// select new
this._selectedOptionLi()
.addClass(this.widgetBaseClass + "-item-selected" + activeClass)
.find('a')
.attr('aria-selected', 'true')
.attr('id', activeID);
// toggle any class brought in from option
var currentOptionClasses = (this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : "");
var newOptionClasses = (this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : "");
this.newelement
.removeClass(currentOptionClasses)
.data('optionClasses', newOptionClasses)
.addClass( newOptionClasses )
.find('.' + this.widgetBaseClass + '-status')
.html(
this._selectedOptionLi()
.find('a:eq(0)')
.html()
);
this.list.attr('aria-activedescendant', activeID);
},
_refreshPosition: function() {
var o = this.options;
// if its a native pop-up we need to calculate the position of the selected li
if ( o.style == "popup" && !o.positionOptions.offset ) {
var selected = this._selectedOptionLi();
var _offset = "0 -" + ( selected.outerHeight() + selected.offset().top - this.list.offset().top );
}
// update zIndex if jQuery UI is able to process
var zIndexElement = this.element.zIndex();
if ( zIndexElement ) {
this.listWrap.css( 'zIndex', zIndexElement );
}
this.listWrap.position({
// set options for position plugin
of: o.positionOptions.of || this.newelement,
my: o.positionOptions.my,
at: o.positionOptions.at,
offset: o.positionOptions.offset || _offset,
collision: o.positionOptions.collision || 'flip'
});
}
});
})(jQuery);
/*
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #dddddd; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { color: #222222; font-weight: bold; }
.ui-widget-header a { color: #222222; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(ui-icons_222222_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(ui-icons_222222_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(ui-icons_222222_256x240.png); }
.ui-state-default .ui-icon { background-image: url(ui-icons_888888_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-icons_454545_256x240.png); }
.ui-state-active .ui-icon {background-image: url(ui-icons_454545_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(ui-icons_2e83ff_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-icons_cd0a0a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
/*.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }*/
/*.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }*/
/*.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }*/
/*.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }*/
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Resizable 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; border:1px solid #ddd}
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.16
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
}
.ui-menu .ui-menu {
margin-top: -3px;
}
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
display:block;
padding:.2em .4em;
line-height:1.5;
zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
background: #fff !important;
background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important;
background: -moz-linear-gradient(top,#fff,#FFF6BF) !important;
background: transparent 9 !important;
border-radius:0px;
border-color:white;
border-bottom: 1px solid #E2EAEE;
border-top: 1px solid #E2EAEE;
}
/*
* jQuery UI Button 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background: #F7F7F7; color:#555; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0;}
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; background:#eaeaea}
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: 0; border:none; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap;}
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; width:200px}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 0; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
/* Tagify styles
Author: Alicia Liu test
*/
.tagify-container {
}
.tagify-container > span {
display: inline-block;
padding: 8px 11px 8px 11px;
margin: 1px 5px 0px 0px;
border-radius: 4px;
border: 1px solid #d0e1ff;
background-color: #d0e1ff;
color: #0f326d;
font-weight: bold;
font-size: 14px;
}
.tagify-container > span > a {
padding-left: 5px !important;
color: #83a5e1;
text-decoration: none;
font-weight: bold;
}
.tagify-container > input {
border: 0 none;
width: 100px !important;
}
.tagify-container > input:focus {
outline: none;
}
\ No newline at end of file
/* Selectmenu
----------------------------------*/
.ui-selectmenu { background:none; font-size:12px;display: block; display: inline-block; position: relative; height: 2.2em; vertical-align: middle; text-decoration: none; overflow: hidden; zoom: 1; }
.ui-selectmenu-icon { position:absolute; right:6px; margin-top:-8px; top: 50%; }
.ui-selectmenu-menu { padding:0; margin:0; position:absolute; top: 0; display: none; z-index: 1005;} /* z-index: 1005 to make selectmenu work with dialog */
.ui-selectmenu-menu ul { padding:0; margin:0; list-style:none; position: relative; overflow: auto; overflow-y: auto ; overflow-x: hidden; }
.ui-selectmenu-open { display: block; }
.ui-selectmenu.ui-widget { background:none; }
.ui-selectmenu-menu-popup { margin-top: -1px; }
.ui-selectmenu-menu-dropdown { }
.ui-selectmenu-menu li.ui-state-active { background:#F7FBFC; border:none; padding:1px 0;}
.ui-selectmenu-menu li { padding:0; margin:0; display: block; border-top: 1px dotted transparent; border-bottom: 1px dotted transparent; border-right-width: 0 !important; border-left-width: 0 !important; font-weight: normal !important; }
.ui-selectmenu-menu li a,.ui-selectmenu-status { line-height: 1.4em; display: block; padding: .405em 2.1em .405em 1em; outline:none; text-decoration:none; }
.ui-selectmenu-menu li.ui-state-disabled a, .ui-state-disabled { cursor: default; }
.ui-selectmenu-menu li.ui-selectmenu-hasIcon a,
.ui-selectmenu-hasIcon .ui-selectmenu-status { padding-left: 20px; position: relative; margin-left: 5px; }
.ui-selectmenu-menu li .ui-icon, .ui-selectmenu-status .ui-icon { position: absolute; top: 1em; margin-top: -8px; left: 0; }
.ui-selectmenu-status { line-height: 1.4em; }
.ui-selectmenu-open li.ui-selectmenu-item-focus { background: none repeat scroll 0 0 #FFF6BF; border:1px solid #eaeaea;}
.ui-selectmenu-open li.ui-selectmenu-item-selected { }
.ui-selectmenu-menu li span,.ui-selectmenu-status span { display:block; margin-bottom: .2em; }
.ui-selectmenu-menu li .ui-selectmenu-item-header { font-weight: bold; }
.ui-selectmenu-menu li .ui-selectmenu-item-content { }
.ui-selectmenu-menu li .ui-selectmenu-item-footer { opacity: .8; }
/* for optgroups */
.ui-selectmenu-menu .ui-selectmenu-group { font-size: 1em; }
.ui-selectmenu-menu .ui-selectmenu-group .ui-selectmenu-group-label { line-height: 1.4em; display:block; padding: .6em .5em 0; font-weight: bold; }
.ui-selectmenu-menu .ui-selectmenu-group ul { margin: 0; padding: 0; }
/* IE6 workaround (dotted transparent borders) */
* html .ui-selectmenu-menu li { border-color: pink; filter:chroma(color=pink); width:100%; }
* html .ui-selectmenu-menu li a { position: relative }
/* IE7 workaround (opacity disabled) */
*+html .ui-state-disabled, *+html .ui-state-disabled a { color: silver; }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment