Commit b8ca1d62c453fcdb8cb7f65ee793fcd159b4c336
Exists in
master
and in
4 other branches
Merge branch 'dev'
Conflicts: app/assets/images/ajax-loader.gif public/favicon.ico
Showing
195 changed files
with
6401 additions
and
1157 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 195 files displayed.
Gemfile
@@ -5,7 +5,7 @@ gem 'rails', '3.1.0' | @@ -5,7 +5,7 @@ gem 'rails', '3.1.0' | ||
5 | gem 'sqlite3' | 5 | gem 'sqlite3' |
6 | gem 'devise', "1.4.7" | 6 | gem 'devise', "1.4.7" |
7 | gem 'stamp' | 7 | gem 'stamp' |
8 | -gem 'will_paginate', '~> 3.0' | 8 | +gem 'kaminari' |
9 | gem 'haml-rails' | 9 | gem 'haml-rails' |
10 | gem 'jquery-rails' | 10 | gem 'jquery-rails' |
11 | gem 'grit', :git => 'git://github.com/gitlabhq/grit.git' | 11 | gem 'grit', :git => 'git://github.com/gitlabhq/grit.git' |
@@ -16,10 +16,12 @@ gem 'faker' | @@ -16,10 +16,12 @@ gem 'faker' | ||
16 | gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git' | 16 | gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git' |
17 | gem "inifile" | 17 | gem "inifile" |
18 | gem "pygments.rb", "0.2.3" | 18 | gem "pygments.rb", "0.2.3" |
19 | -gem "kaminari" | ||
20 | gem "thin" | 19 | gem "thin" |
21 | gem "git" | 20 | gem "git" |
22 | gem "acts_as_list" | 21 | gem "acts_as_list" |
22 | +gem 'rdiscount' | ||
23 | + | ||
24 | +gem 'acts-as-taggable-on', '~>2.1.0' | ||
23 | 25 | ||
24 | group :assets do | 26 | group :assets do |
25 | gem 'sass-rails', " ~> 3.1.0" | 27 | gem 'sass-rails', " ~> 3.1.0" |
@@ -27,14 +29,15 @@ group :assets do | @@ -27,14 +29,15 @@ group :assets do | ||
27 | gem 'uglifier' | 29 | gem 'uglifier' |
28 | end | 30 | end |
29 | 31 | ||
30 | -group :development do | 32 | +group :development do |
33 | + gem 'letter_opener' | ||
31 | gem 'rails-footnotes', '>= 3.7.5.rc4' | 34 | gem 'rails-footnotes', '>= 3.7.5.rc4' |
32 | gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' | 35 | gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' |
33 | end | 36 | end |
34 | 37 | ||
35 | group :development, :test do | 38 | group :development, :test do |
36 | gem 'rspec-rails' | 39 | gem 'rspec-rails' |
37 | - gem 'shoulda' | 40 | + gem "shoulda", "~> 3.0.0.beta2" |
38 | gem 'capybara' | 41 | gem 'capybara' |
39 | gem 'autotest' | 42 | gem 'autotest' |
40 | gem 'autotest-rails' | 43 | gem 'autotest-rails' |
Gemfile.lock
@@ -54,6 +54,8 @@ GEM | @@ -54,6 +54,8 @@ GEM | ||
54 | activesupport (= 3.1.0) | 54 | activesupport (= 3.1.0) |
55 | activesupport (3.1.0) | 55 | activesupport (3.1.0) |
56 | multi_json (~> 1.0) | 56 | multi_json (~> 1.0) |
57 | + acts-as-taggable-on (2.1.1) | ||
58 | + rails | ||
57 | acts_as_list (0.1.4) | 59 | acts_as_list (0.1.4) |
58 | addressable (2.2.6) | 60 | addressable (2.2.6) |
59 | ansi (1.3.0) | 61 | ansi (1.3.0) |
@@ -119,6 +121,8 @@ GEM | @@ -119,6 +121,8 @@ GEM | ||
119 | rails (>= 3.0.0) | 121 | rails (>= 3.0.0) |
120 | launchy (2.0.5) | 122 | launchy (2.0.5) |
121 | addressable (~> 2.2.6) | 123 | addressable (~> 2.2.6) |
124 | + letter_opener (0.0.2) | ||
125 | + launchy | ||
122 | libv8 (3.3.10.2) | 126 | libv8 (3.3.10.2) |
123 | linecache19 (0.5.12) | 127 | linecache19 (0.5.12) |
124 | ruby_core_source (>= 0.1.4) | 128 | ruby_core_source (>= 0.1.4) |
@@ -161,6 +165,7 @@ GEM | @@ -161,6 +165,7 @@ GEM | ||
161 | rdoc (~> 3.4) | 165 | rdoc (~> 3.4) |
162 | thor (~> 0.14.6) | 166 | thor (~> 0.14.6) |
163 | rake (0.9.2) | 167 | rake (0.9.2) |
168 | + rdiscount (1.6.8) | ||
164 | rdoc (3.9.4) | 169 | rdoc (3.9.4) |
165 | rspec (2.6.0) | 170 | rspec (2.6.0) |
166 | rspec-core (~> 2.6.0) | 171 | rspec-core (~> 2.6.0) |
@@ -200,7 +205,11 @@ GEM | @@ -200,7 +205,11 @@ GEM | ||
200 | ffi (>= 1.0.7) | 205 | ffi (>= 1.0.7) |
201 | json_pure | 206 | json_pure |
202 | rubyzip | 207 | rubyzip |
203 | - shoulda (2.11.3) | 208 | + shoulda (3.0.0.beta2) |
209 | + shoulda-context (~> 1.0.0.beta1) | ||
210 | + shoulda-matchers (~> 1.0.0.beta1) | ||
211 | + shoulda-context (1.0.0.beta1) | ||
212 | + shoulda-matchers (1.0.0.beta3) | ||
204 | simplecov (0.5.3) | 213 | simplecov (0.5.3) |
205 | multi_json (~> 1.0.3) | 214 | multi_json (~> 1.0.3) |
206 | simplecov-html (~> 0.5.3) | 215 | simplecov-html (~> 0.5.3) |
@@ -232,7 +241,6 @@ GEM | @@ -232,7 +241,6 @@ GEM | ||
232 | multi_json (>= 1.0.2) | 241 | multi_json (>= 1.0.2) |
233 | warden (1.0.5) | 242 | warden (1.0.5) |
234 | rack (>= 1.0) | 243 | rack (>= 1.0) |
235 | - will_paginate (3.0.0) | ||
236 | xpath (0.1.4) | 244 | xpath (0.1.4) |
237 | nokogiri (~> 1.3) | 245 | nokogiri (~> 1.3) |
238 | 246 | ||
@@ -240,6 +248,7 @@ PLATFORMS | @@ -240,6 +248,7 @@ PLATFORMS | ||
240 | ruby | 248 | ruby |
241 | 249 | ||
242 | DEPENDENCIES | 250 | DEPENDENCIES |
251 | + acts-as-taggable-on (~> 2.1.0) | ||
243 | acts_as_list | 252 | acts_as_list |
244 | annotate! | 253 | annotate! |
245 | autotest | 254 | autotest |
@@ -258,14 +267,16 @@ DEPENDENCIES | @@ -258,14 +267,16 @@ DEPENDENCIES | ||
258 | jquery-rails | 267 | jquery-rails |
259 | kaminari | 268 | kaminari |
260 | launchy | 269 | launchy |
270 | + letter_opener | ||
261 | pygments.rb (= 0.2.3) | 271 | pygments.rb (= 0.2.3) |
262 | rails (= 3.1.0) | 272 | rails (= 3.1.0) |
263 | rails-footnotes (>= 3.7.5.rc4) | 273 | rails-footnotes (>= 3.7.5.rc4) |
274 | + rdiscount | ||
264 | rspec-rails | 275 | rspec-rails |
265 | ruby-debug19 | 276 | ruby-debug19 |
266 | sass-rails (~> 3.1.0) | 277 | sass-rails (~> 3.1.0) |
267 | seed-fu! | 278 | seed-fu! |
268 | - shoulda | 279 | + shoulda (~> 3.0.0.beta2) |
269 | simplecov | 280 | simplecov |
270 | six | 281 | six |
271 | sqlite3 | 282 | sqlite3 |
@@ -274,4 +285,3 @@ DEPENDENCIES | @@ -274,4 +285,3 @@ DEPENDENCIES | ||
274 | thin | 285 | thin |
275 | turn | 286 | turn |
276 | uglifier | 287 | uglifier |
277 | - will_paginate (~> 3.0) |
app/assets/images/.directory
212 Bytes
396 Bytes
422 Bytes
8.49 KB
1.4 KB
app/assets/javascripts/application.js
@@ -5,11 +5,15 @@ | @@ -5,11 +5,15 @@ | ||
5 | // the compiled file. | 5 | // the compiled file. |
6 | // | 6 | // |
7 | //= require jquery | 7 | //= require jquery |
8 | +//= require jquery-ui | ||
8 | //= require jquery_ujs | 9 | //= require jquery_ujs |
10 | +//= require jquery.ui.selectmenu | ||
11 | +//= require jquery.tagify | ||
12 | +//= require jquery.cookie | ||
9 | //= require_tree . | 13 | //= require_tree . |
10 | 14 | ||
11 | $(function(){ | 15 | $(function(){ |
12 | - $(".one_click_select").click(function(){ | 16 | + $(".one_click_select").live("click", function(){ |
13 | $(this).select(); | 17 | $(this).select(); |
14 | }); | 18 | }); |
15 | 19 | ||
@@ -17,6 +21,6 @@ $(function(){ | @@ -17,6 +21,6 @@ $(function(){ | ||
17 | $('select#tag').selectmenu({style:'popup', width:200}); | 21 | $('select#tag').selectmenu({style:'popup', width:200}); |
18 | }); | 22 | }); |
19 | 23 | ||
20 | -function updatePage(){ | ||
21 | - $.ajax({type: "GET", url: location.href, dataType: "script"}); | 24 | +function updatePage(data){ |
25 | + $.ajax({type: "GET", url: location.href, data: data, dataType: "script"}); | ||
22 | } | 26 | } |
@@ -0,0 +1,901 @@ | @@ -0,0 +1,901 @@ | ||
1 | +// Chosen, a Select Box Enhancer for jQuery and Protoype | ||
2 | +// by Patrick Filler for Harvest, http://getharvest.com | ||
3 | +// | ||
4 | +// Version 0.9.5 | ||
5 | +// Full source at https://github.com/harvesthq/chosen | ||
6 | +// Copyright (c) 2011 Harvest http://getharvest.com | ||
7 | + | ||
8 | +// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md | ||
9 | +// This file is generated by `cake build`, do not edit it by hand. | ||
10 | +(function() { | ||
11 | + var SelectParser; | ||
12 | + SelectParser = (function() { | ||
13 | + function SelectParser() { | ||
14 | + this.options_index = 0; | ||
15 | + this.parsed = []; | ||
16 | + } | ||
17 | + SelectParser.prototype.add_node = function(child) { | ||
18 | + if (child.nodeName === "OPTGROUP") { | ||
19 | + return this.add_group(child); | ||
20 | + } else { | ||
21 | + return this.add_option(child); | ||
22 | + } | ||
23 | + }; | ||
24 | + SelectParser.prototype.add_group = function(group) { | ||
25 | + var group_position, option, _i, _len, _ref, _results; | ||
26 | + group_position = this.parsed.length; | ||
27 | + this.parsed.push({ | ||
28 | + array_index: group_position, | ||
29 | + group: true, | ||
30 | + label: group.label, | ||
31 | + children: 0, | ||
32 | + disabled: group.disabled | ||
33 | + }); | ||
34 | + _ref = group.childNodes; | ||
35 | + _results = []; | ||
36 | + for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
37 | + option = _ref[_i]; | ||
38 | + _results.push(this.add_option(option, group_position, group.disabled)); | ||
39 | + } | ||
40 | + return _results; | ||
41 | + }; | ||
42 | + SelectParser.prototype.add_option = function(option, group_position, group_disabled) { | ||
43 | + if (option.nodeName === "OPTION") { | ||
44 | + if (option.text !== "") { | ||
45 | + if (group_position != null) { | ||
46 | + this.parsed[group_position].children += 1; | ||
47 | + } | ||
48 | + this.parsed.push({ | ||
49 | + array_index: this.parsed.length, | ||
50 | + options_index: this.options_index, | ||
51 | + value: option.value, | ||
52 | + text: option.text, | ||
53 | + html: option.innerHTML, | ||
54 | + selected: option.selected, | ||
55 | + disabled: group_disabled === true ? group_disabled : option.disabled, | ||
56 | + group_array_index: group_position, | ||
57 | + classes: option.className, | ||
58 | + style: option.style.cssText | ||
59 | + }); | ||
60 | + } else { | ||
61 | + this.parsed.push({ | ||
62 | + array_index: this.parsed.length, | ||
63 | + options_index: this.options_index, | ||
64 | + empty: true | ||
65 | + }); | ||
66 | + } | ||
67 | + return this.options_index += 1; | ||
68 | + } | ||
69 | + }; | ||
70 | + return SelectParser; | ||
71 | + })(); | ||
72 | + SelectParser.select_to_array = function(select) { | ||
73 | + var child, parser, _i, _len, _ref; | ||
74 | + parser = new SelectParser(); | ||
75 | + _ref = select.childNodes; | ||
76 | + for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
77 | + child = _ref[_i]; | ||
78 | + parser.add_node(child); | ||
79 | + } | ||
80 | + return parser.parsed; | ||
81 | + }; | ||
82 | + this.SelectParser = SelectParser; | ||
83 | +}).call(this); | ||
84 | +(function() { | ||
85 | + /* | ||
86 | + Chosen source: generate output using 'cake build' | ||
87 | + Copyright (c) 2011 by Harvest | ||
88 | + */ | ||
89 | + var AbstractChosen, root; | ||
90 | + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | ||
91 | + root = this; | ||
92 | + AbstractChosen = (function() { | ||
93 | + function AbstractChosen(form_field, options) { | ||
94 | + this.form_field = form_field; | ||
95 | + this.options = options != null ? options : {}; | ||
96 | + this.set_default_values(); | ||
97 | + this.is_multiple = this.form_field.multiple; | ||
98 | + this.default_text_default = this.is_multiple ? "Select Some Options" : "Select an Option"; | ||
99 | + this.setup(); | ||
100 | + this.set_up_html(); | ||
101 | + this.register_observers(); | ||
102 | + this.finish_setup(); | ||
103 | + } | ||
104 | + AbstractChosen.prototype.set_default_values = function() { | ||
105 | + this.click_test_action = __bind(function(evt) { | ||
106 | + return this.test_active_click(evt); | ||
107 | + }, this); | ||
108 | + this.activate_action = __bind(function(evt) { | ||
109 | + return this.activate_field(evt); | ||
110 | + }, this); | ||
111 | + this.active_field = false; | ||
112 | + this.mouse_on_container = false; | ||
113 | + this.results_showing = false; | ||
114 | + this.result_highlighted = null; | ||
115 | + this.result_single_selected = null; | ||
116 | + this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false; | ||
117 | + this.disable_search_threshold = this.options.disable_search_threshold || 0; | ||
118 | + this.choices = 0; | ||
119 | + return this.results_none_found = this.options.no_results_text || "No results match"; | ||
120 | + }; | ||
121 | + AbstractChosen.prototype.mouse_enter = function() { | ||
122 | + return this.mouse_on_container = true; | ||
123 | + }; | ||
124 | + AbstractChosen.prototype.mouse_leave = function() { | ||
125 | + return this.mouse_on_container = false; | ||
126 | + }; | ||
127 | + AbstractChosen.prototype.input_focus = function(evt) { | ||
128 | + if (!this.active_field) { | ||
129 | + return setTimeout((__bind(function() { | ||
130 | + return this.container_mousedown(); | ||
131 | + }, this)), 50); | ||
132 | + } | ||
133 | + }; | ||
134 | + AbstractChosen.prototype.input_blur = function(evt) { | ||
135 | + if (!this.mouse_on_container) { | ||
136 | + this.active_field = false; | ||
137 | + return setTimeout((__bind(function() { | ||
138 | + return this.blur_test(); | ||
139 | + }, this)), 100); | ||
140 | + } | ||
141 | + }; | ||
142 | + AbstractChosen.prototype.result_add_option = function(option) { | ||
143 | + var classes, style; | ||
144 | + if (!option.disabled) { | ||
145 | + option.dom_id = this.container_id + "_o_" + option.array_index; | ||
146 | + classes = option.selected && this.is_multiple ? [] : ["active-result"]; | ||
147 | + if (option.selected) { | ||
148 | + classes.push("result-selected"); | ||
149 | + } | ||
150 | + if (option.group_array_index != null) { | ||
151 | + classes.push("group-option"); | ||
152 | + } | ||
153 | + if (option.classes !== "") { | ||
154 | + classes.push(option.classes); | ||
155 | + } | ||
156 | + style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : ""; | ||
157 | + return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>'; | ||
158 | + } else { | ||
159 | + return ""; | ||
160 | + } | ||
161 | + }; | ||
162 | + AbstractChosen.prototype.results_update_field = function() { | ||
163 | + this.result_clear_highlight(); | ||
164 | + this.result_single_selected = null; | ||
165 | + return this.results_build(); | ||
166 | + }; | ||
167 | + AbstractChosen.prototype.results_toggle = function() { | ||
168 | + if (this.results_showing) { | ||
169 | + return this.results_hide(); | ||
170 | + } else { | ||
171 | + return this.results_show(); | ||
172 | + } | ||
173 | + }; | ||
174 | + AbstractChosen.prototype.results_search = function(evt) { | ||
175 | + if (this.results_showing) { | ||
176 | + return this.winnow_results(); | ||
177 | + } else { | ||
178 | + return this.results_show(); | ||
179 | + } | ||
180 | + }; | ||
181 | + AbstractChosen.prototype.keyup_checker = function(evt) { | ||
182 | + var stroke, _ref; | ||
183 | + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; | ||
184 | + this.search_field_scale(); | ||
185 | + switch (stroke) { | ||
186 | + case 8: | ||
187 | + if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { | ||
188 | + return this.keydown_backstroke(); | ||
189 | + } else if (!this.pending_backstroke) { | ||
190 | + this.result_clear_highlight(); | ||
191 | + return this.results_search(); | ||
192 | + } | ||
193 | + break; | ||
194 | + case 13: | ||
195 | + evt.preventDefault(); | ||
196 | + if (this.results_showing) { | ||
197 | + return this.result_select(evt); | ||
198 | + } | ||
199 | + break; | ||
200 | + case 27: | ||
201 | + if (this.results_showing) { | ||
202 | + return this.results_hide(); | ||
203 | + } | ||
204 | + break; | ||
205 | + case 9: | ||
206 | + case 38: | ||
207 | + case 40: | ||
208 | + case 16: | ||
209 | + case 91: | ||
210 | + case 17: | ||
211 | + break; | ||
212 | + default: | ||
213 | + return this.results_search(); | ||
214 | + } | ||
215 | + }; | ||
216 | + AbstractChosen.prototype.generate_field_id = function() { | ||
217 | + var new_id; | ||
218 | + new_id = this.generate_random_id(); | ||
219 | + this.form_field.id = new_id; | ||
220 | + return new_id; | ||
221 | + }; | ||
222 | + AbstractChosen.prototype.generate_random_char = function() { | ||
223 | + var chars, newchar, rand; | ||
224 | + chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"; | ||
225 | + rand = Math.floor(Math.random() * chars.length); | ||
226 | + return newchar = chars.substring(rand, rand + 1); | ||
227 | + }; | ||
228 | + return AbstractChosen; | ||
229 | + })(); | ||
230 | + root.AbstractChosen = AbstractChosen; | ||
231 | +}).call(this); | ||
232 | +(function() { | ||
233 | + /* | ||
234 | + Chosen source: generate output using 'cake build' | ||
235 | + Copyright (c) 2011 by Harvest | ||
236 | + */ | ||
237 | + var $, Chosen, get_side_border_padding, root; | ||
238 | + var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | ||
239 | + for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | ||
240 | + function ctor() { this.constructor = child; } | ||
241 | + ctor.prototype = parent.prototype; | ||
242 | + child.prototype = new ctor; | ||
243 | + child.__super__ = parent.prototype; | ||
244 | + return child; | ||
245 | + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | ||
246 | + root = this; | ||
247 | + $ = jQuery; | ||
248 | + $.fn.extend({ | ||
249 | + chosen: function(options) { | ||
250 | + if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) { | ||
251 | + return this; | ||
252 | + } | ||
253 | + return $(this).each(function(input_field) { | ||
254 | + if (!($(this)).hasClass("chzn-done")) { | ||
255 | + return new Chosen(this, options); | ||
256 | + } | ||
257 | + }); | ||
258 | + } | ||
259 | + }); | ||
260 | + Chosen = (function() { | ||
261 | + __extends(Chosen, AbstractChosen); | ||
262 | + function Chosen() { | ||
263 | + Chosen.__super__.constructor.apply(this, arguments); | ||
264 | + } | ||
265 | + Chosen.prototype.setup = function() { | ||
266 | + this.form_field_jq = $(this.form_field); | ||
267 | + return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl"); | ||
268 | + }; | ||
269 | + Chosen.prototype.finish_setup = function() { | ||
270 | + return this.form_field_jq.addClass("chzn-done"); | ||
271 | + }; | ||
272 | + Chosen.prototype.set_up_html = function() { | ||
273 | + var container_div, dd_top, dd_width, sf_width; | ||
274 | + this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id(); | ||
275 | + this.container_id += "_chzn"; | ||
276 | + this.f_width = this.form_field_jq.outerWidth(); | ||
277 | + this.default_text = this.form_field_jq.data('placeholder') ? this.form_field_jq.data('placeholder') : this.default_text_default; | ||
278 | + container_div = $("<div />", { | ||
279 | + id: this.container_id, | ||
280 | + "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''), | ||
281 | + style: 'width: ' + this.f_width + 'px;' | ||
282 | + }); | ||
283 | + if (this.is_multiple) { | ||
284 | + 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>'); | ||
285 | + } else { | ||
286 | + 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>'); | ||
287 | + } | ||
288 | + this.form_field_jq.hide().after(container_div); | ||
289 | + this.container = $('#' + this.container_id); | ||
290 | + this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single")); | ||
291 | + this.dropdown = this.container.find('div.chzn-drop').first(); | ||
292 | + dd_top = this.container.height(); | ||
293 | + dd_width = this.f_width - get_side_border_padding(this.dropdown); | ||
294 | + this.dropdown.css({ | ||
295 | + "width": dd_width + "px", | ||
296 | + "top": dd_top + "px" | ||
297 | + }); | ||
298 | + this.search_field = this.container.find('input').first(); | ||
299 | + this.search_results = this.container.find('ul.chzn-results').first(); | ||
300 | + this.search_field_scale(); | ||
301 | + this.search_no_results = this.container.find('li.no-results').first(); | ||
302 | + if (this.is_multiple) { | ||
303 | + this.search_choices = this.container.find('ul.chzn-choices').first(); | ||
304 | + this.search_container = this.container.find('li.search-field').first(); | ||
305 | + } else { | ||
306 | + this.search_container = this.container.find('div.chzn-search').first(); | ||
307 | + this.selected_item = this.container.find('.chzn-single').first(); | ||
308 | + sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field); | ||
309 | + this.search_field.css({ | ||
310 | + "width": sf_width + "px" | ||
311 | + }); | ||
312 | + } | ||
313 | + this.results_build(); | ||
314 | + this.set_tab_index(); | ||
315 | + return this.form_field_jq.trigger("liszt:ready", { | ||
316 | + chosen: this | ||
317 | + }); | ||
318 | + }; | ||
319 | + Chosen.prototype.register_observers = function() { | ||
320 | + this.container.mousedown(__bind(function(evt) { | ||
321 | + return this.container_mousedown(evt); | ||
322 | + }, this)); | ||
323 | + this.container.mouseup(__bind(function(evt) { | ||
324 | + return this.container_mouseup(evt); | ||
325 | + }, this)); | ||
326 | + this.container.mouseenter(__bind(function(evt) { | ||
327 | + return this.mouse_enter(evt); | ||
328 | + }, this)); | ||
329 | + this.container.mouseleave(__bind(function(evt) { | ||
330 | + return this.mouse_leave(evt); | ||
331 | + }, this)); | ||
332 | + this.search_results.mouseup(__bind(function(evt) { | ||
333 | + return this.search_results_mouseup(evt); | ||
334 | + }, this)); | ||
335 | + this.search_results.mouseover(__bind(function(evt) { | ||
336 | + return this.search_results_mouseover(evt); | ||
337 | + }, this)); | ||
338 | + this.search_results.mouseout(__bind(function(evt) { | ||
339 | + return this.search_results_mouseout(evt); | ||
340 | + }, this)); | ||
341 | + this.form_field_jq.bind("liszt:updated", __bind(function(evt) { | ||
342 | + return this.results_update_field(evt); | ||
343 | + }, this)); | ||
344 | + this.search_field.blur(__bind(function(evt) { | ||
345 | + return this.input_blur(evt); | ||
346 | + }, this)); | ||
347 | + this.search_field.keyup(__bind(function(evt) { | ||
348 | + return this.keyup_checker(evt); | ||
349 | + }, this)); | ||
350 | + this.search_field.keydown(__bind(function(evt) { | ||
351 | + return this.keydown_checker(evt); | ||
352 | + }, this)); | ||
353 | + if (this.is_multiple) { | ||
354 | + this.search_choices.click(__bind(function(evt) { | ||
355 | + return this.choices_click(evt); | ||
356 | + }, this)); | ||
357 | + return this.search_field.focus(__bind(function(evt) { | ||
358 | + return this.input_focus(evt); | ||
359 | + }, this)); | ||
360 | + } | ||
361 | + }; | ||
362 | + Chosen.prototype.search_field_disabled = function() { | ||
363 | + this.is_disabled = this.form_field_jq[0].disabled; | ||
364 | + if (this.is_disabled) { | ||
365 | + this.container.addClass('chzn-disabled'); | ||
366 | + this.search_field[0].disabled = true; | ||
367 | + if (!this.is_multiple) { | ||
368 | + this.selected_item.unbind("focus", this.activate_action); | ||
369 | + } | ||
370 | + return this.close_field(); | ||
371 | + } else { | ||
372 | + this.container.removeClass('chzn-disabled'); | ||
373 | + this.search_field[0].disabled = false; | ||
374 | + if (!this.is_multiple) { | ||
375 | + return this.selected_item.bind("focus", this.activate_action); | ||
376 | + } | ||
377 | + } | ||
378 | + }; | ||
379 | + Chosen.prototype.container_mousedown = function(evt) { | ||
380 | + var target_closelink; | ||
381 | + if (!this.is_disabled) { | ||
382 | + target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false; | ||
383 | + if (evt && evt.type === "mousedown") { | ||
384 | + evt.stopPropagation(); | ||
385 | + } | ||
386 | + if (!this.pending_destroy_click && !target_closelink) { | ||
387 | + if (!this.active_field) { | ||
388 | + if (this.is_multiple) { | ||
389 | + this.search_field.val(""); | ||
390 | + } | ||
391 | + $(document).click(this.click_test_action); | ||
392 | + this.results_show(); | ||
393 | + } else if (!this.is_multiple && evt && ($(evt.target) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) { | ||
394 | + evt.preventDefault(); | ||
395 | + this.results_toggle(); | ||
396 | + } | ||
397 | + return this.activate_field(); | ||
398 | + } else { | ||
399 | + return this.pending_destroy_click = false; | ||
400 | + } | ||
401 | + } | ||
402 | + }; | ||
403 | + Chosen.prototype.container_mouseup = function(evt) { | ||
404 | + if (evt.target.nodeName === "ABBR") { | ||
405 | + return this.results_reset(evt); | ||
406 | + } | ||
407 | + }; | ||
408 | + Chosen.prototype.blur_test = function(evt) { | ||
409 | + if (!this.active_field && this.container.hasClass("chzn-container-active")) { | ||
410 | + return this.close_field(); | ||
411 | + } | ||
412 | + }; | ||
413 | + Chosen.prototype.close_field = function() { | ||
414 | + $(document).unbind("click", this.click_test_action); | ||
415 | + if (!this.is_multiple) { | ||
416 | + this.selected_item.attr("tabindex", this.search_field.attr("tabindex")); | ||
417 | + this.search_field.attr("tabindex", -1); | ||
418 | + } | ||
419 | + this.active_field = false; | ||
420 | + this.results_hide(); | ||
421 | + this.container.removeClass("chzn-container-active"); | ||
422 | + this.winnow_results_clear(); | ||
423 | + this.clear_backstroke(); | ||
424 | + this.show_search_field_default(); | ||
425 | + return this.search_field_scale(); | ||
426 | + }; | ||
427 | + Chosen.prototype.activate_field = function() { | ||
428 | + if (!this.is_multiple && !this.active_field) { | ||
429 | + this.search_field.attr("tabindex", this.selected_item.attr("tabindex")); | ||
430 | + this.selected_item.attr("tabindex", -1); | ||
431 | + } | ||
432 | + this.container.addClass("chzn-container-active"); | ||
433 | + this.active_field = true; | ||
434 | + this.search_field.val(this.search_field.val()); | ||
435 | + return this.search_field.focus(); | ||
436 | + }; | ||
437 | + Chosen.prototype.test_active_click = function(evt) { | ||
438 | + if ($(evt.target).parents('#' + this.container_id).length) { | ||
439 | + return this.active_field = true; | ||
440 | + } else { | ||
441 | + return this.close_field(); | ||
442 | + } | ||
443 | + }; | ||
444 | + Chosen.prototype.results_build = function() { | ||
445 | + var content, data, startTime, _i, _len, _ref; | ||
446 | + startTime = new Date(); | ||
447 | + this.parsing = true; | ||
448 | + this.results_data = root.SelectParser.select_to_array(this.form_field); | ||
449 | + if (this.is_multiple && this.choices > 0) { | ||
450 | + this.search_choices.find("li.search-choice").remove(); | ||
451 | + this.choices = 0; | ||
452 | + } else if (!this.is_multiple) { | ||
453 | + this.selected_item.find("span").text(this.default_text); | ||
454 | + if (this.form_field.options.length <= this.disable_search_threshold) { | ||
455 | + this.container.addClass("chzn-container-single-nosearch"); | ||
456 | + } else { | ||
457 | + this.container.removeClass("chzn-container-single-nosearch"); | ||
458 | + } | ||
459 | + } | ||
460 | + content = ''; | ||
461 | + _ref = this.results_data; | ||
462 | + for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
463 | + data = _ref[_i]; | ||
464 | + if (data.group) { | ||
465 | + content += this.result_add_group(data); | ||
466 | + } else if (!data.empty) { | ||
467 | + content += this.result_add_option(data); | ||
468 | + if (data.selected && this.is_multiple) { | ||
469 | + this.choice_build(data); | ||
470 | + } else if (data.selected && !this.is_multiple) { | ||
471 | + this.selected_item.find("span").text(data.text); | ||
472 | + if (this.allow_single_deselect) { | ||
473 | + this.single_deselect_control_build(); | ||
474 | + } | ||
475 | + } | ||
476 | + } | ||
477 | + } | ||
478 | + this.search_field_disabled(); | ||
479 | + this.show_search_field_default(); | ||
480 | + this.search_field_scale(); | ||
481 | + this.search_results.html(content); | ||
482 | + return this.parsing = false; | ||
483 | + }; | ||
484 | + Chosen.prototype.result_add_group = function(group) { | ||
485 | + if (!group.disabled) { | ||
486 | + group.dom_id = this.container_id + "_g_" + group.array_index; | ||
487 | + return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>'; | ||
488 | + } else { | ||
489 | + return ""; | ||
490 | + } | ||
491 | + }; | ||
492 | + Chosen.prototype.result_do_highlight = function(el) { | ||
493 | + var high_bottom, high_top, maxHeight, visible_bottom, visible_top; | ||
494 | + if (el.length) { | ||
495 | + this.result_clear_highlight(); | ||
496 | + this.result_highlight = el; | ||
497 | + this.result_highlight.addClass("highlighted"); | ||
498 | + maxHeight = parseInt(this.search_results.css("maxHeight"), 10); | ||
499 | + visible_top = this.search_results.scrollTop(); | ||
500 | + visible_bottom = maxHeight + visible_top; | ||
501 | + high_top = this.result_highlight.position().top + this.search_results.scrollTop(); | ||
502 | + high_bottom = high_top + this.result_highlight.outerHeight(); | ||
503 | + if (high_bottom >= visible_bottom) { | ||
504 | + return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0); | ||
505 | + } else if (high_top < visible_top) { | ||
506 | + return this.search_results.scrollTop(high_top); | ||
507 | + } | ||
508 | + } | ||
509 | + }; | ||
510 | + Chosen.prototype.result_clear_highlight = function() { | ||
511 | + if (this.result_highlight) { | ||
512 | + this.result_highlight.removeClass("highlighted"); | ||
513 | + } | ||
514 | + return this.result_highlight = null; | ||
515 | + }; | ||
516 | + Chosen.prototype.results_show = function() { | ||
517 | + var dd_top; | ||
518 | + if (!this.is_multiple) { | ||
519 | + this.selected_item.addClass("chzn-single-with-drop"); | ||
520 | + if (this.result_single_selected) { | ||
521 | + this.result_do_highlight(this.result_single_selected); | ||
522 | + } | ||
523 | + } | ||
524 | + dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1; | ||
525 | + this.dropdown.css({ | ||
526 | + "top": dd_top + "px", | ||
527 | + "left": 0 | ||
528 | + }); | ||
529 | + this.results_showing = true; | ||
530 | + this.search_field.focus(); | ||
531 | + this.search_field.val(this.search_field.val()); | ||
532 | + return this.winnow_results(); | ||
533 | + }; | ||
534 | + Chosen.prototype.results_hide = function() { | ||
535 | + if (!this.is_multiple) { | ||
536 | + this.selected_item.removeClass("chzn-single-with-drop"); | ||
537 | + } | ||
538 | + this.result_clear_highlight(); | ||
539 | + this.dropdown.css({ | ||
540 | + "left": "-9000px" | ||
541 | + }); | ||
542 | + return this.results_showing = false; | ||
543 | + }; | ||
544 | + Chosen.prototype.set_tab_index = function(el) { | ||
545 | + var ti; | ||
546 | + if (this.form_field_jq.attr("tabindex")) { | ||
547 | + ti = this.form_field_jq.attr("tabindex"); | ||
548 | + this.form_field_jq.attr("tabindex", -1); | ||
549 | + if (this.is_multiple) { | ||
550 | + return this.search_field.attr("tabindex", ti); | ||
551 | + } else { | ||
552 | + this.selected_item.attr("tabindex", ti); | ||
553 | + return this.search_field.attr("tabindex", -1); | ||
554 | + } | ||
555 | + } | ||
556 | + }; | ||
557 | + Chosen.prototype.show_search_field_default = function() { | ||
558 | + if (this.is_multiple && this.choices < 1 && !this.active_field) { | ||
559 | + this.search_field.val(this.default_text); | ||
560 | + return this.search_field.addClass("default"); | ||
561 | + } else { | ||
562 | + this.search_field.val(""); | ||
563 | + return this.search_field.removeClass("default"); | ||
564 | + } | ||
565 | + }; | ||
566 | + Chosen.prototype.search_results_mouseup = function(evt) { | ||
567 | + var target; | ||
568 | + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); | ||
569 | + if (target.length) { | ||
570 | + this.result_highlight = target; | ||
571 | + return this.result_select(evt); | ||
572 | + } | ||
573 | + }; | ||
574 | + Chosen.prototype.search_results_mouseover = function(evt) { | ||
575 | + var target; | ||
576 | + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); | ||
577 | + if (target) { | ||
578 | + return this.result_do_highlight(target); | ||
579 | + } | ||
580 | + }; | ||
581 | + Chosen.prototype.search_results_mouseout = function(evt) { | ||
582 | + if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) { | ||
583 | + return this.result_clear_highlight(); | ||
584 | + } | ||
585 | + }; | ||
586 | + Chosen.prototype.choices_click = function(evt) { | ||
587 | + evt.preventDefault(); | ||
588 | + if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) { | ||
589 | + return this.results_show(); | ||
590 | + } | ||
591 | + }; | ||
592 | + Chosen.prototype.choice_build = function(item) { | ||
593 | + var choice_id, link; | ||
594 | + choice_id = this.container_id + "_c_" + item.array_index; | ||
595 | + this.choices += 1; | ||
596 | + 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>'); | ||
597 | + link = $('#' + choice_id).find("a").first(); | ||
598 | + return link.click(__bind(function(evt) { | ||
599 | + return this.choice_destroy_link_click(evt); | ||
600 | + }, this)); | ||
601 | + }; | ||
602 | + Chosen.prototype.choice_destroy_link_click = function(evt) { | ||
603 | + evt.preventDefault(); | ||
604 | + if (!this.is_disabled) { | ||
605 | + this.pending_destroy_click = true; | ||
606 | + return this.choice_destroy($(evt.target)); | ||
607 | + } else { | ||
608 | + return evt.stopPropagation; | ||
609 | + } | ||
610 | + }; | ||
611 | + Chosen.prototype.choice_destroy = function(link) { | ||
612 | + this.choices -= 1; | ||
613 | + this.show_search_field_default(); | ||
614 | + if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) { | ||
615 | + this.results_hide(); | ||
616 | + } | ||
617 | + this.result_deselect(link.attr("rel")); | ||
618 | + return link.parents('li').first().remove(); | ||
619 | + }; | ||
620 | + Chosen.prototype.results_reset = function(evt) { | ||
621 | + this.form_field.options[0].selected = true; | ||
622 | + this.selected_item.find("span").text(this.default_text); | ||
623 | + this.show_search_field_default(); | ||
624 | + $(evt.target).remove(); | ||
625 | + this.form_field_jq.trigger("change"); | ||
626 | + if (this.active_field) { | ||
627 | + return this.results_hide(); | ||
628 | + } | ||
629 | + }; | ||
630 | + Chosen.prototype.result_select = function(evt) { | ||
631 | + var high, high_id, item, position; | ||
632 | + if (this.result_highlight) { | ||
633 | + high = this.result_highlight; | ||
634 | + high_id = high.attr("id"); | ||
635 | + this.result_clear_highlight(); | ||
636 | + if (this.is_multiple) { | ||
637 | + this.result_deactivate(high); | ||
638 | + } else { | ||
639 | + this.search_results.find(".result-selected").removeClass("result-selected"); | ||
640 | + this.result_single_selected = high; | ||
641 | + } | ||
642 | + high.addClass("result-selected"); | ||
643 | + position = high_id.substr(high_id.lastIndexOf("_") + 1); | ||
644 | + item = this.results_data[position]; | ||
645 | + item.selected = true; | ||
646 | + this.form_field.options[item.options_index].selected = true; | ||
647 | + if (this.is_multiple) { | ||
648 | + this.choice_build(item); | ||
649 | + } else { | ||
650 | + this.selected_item.find("span").first().text(item.text); | ||
651 | + if (this.allow_single_deselect) { | ||
652 | + this.single_deselect_control_build(); | ||
653 | + } | ||
654 | + } | ||
655 | + if (!(evt.metaKey && this.is_multiple)) { | ||
656 | + this.results_hide(); | ||
657 | + } | ||
658 | + this.search_field.val(""); | ||
659 | + this.form_field_jq.trigger("change"); | ||
660 | + return this.search_field_scale(); | ||
661 | + } | ||
662 | + }; | ||
663 | + Chosen.prototype.result_activate = function(el) { | ||
664 | + return el.addClass("active-result"); | ||
665 | + }; | ||
666 | + Chosen.prototype.result_deactivate = function(el) { | ||
667 | + return el.removeClass("active-result"); | ||
668 | + }; | ||
669 | + Chosen.prototype.result_deselect = function(pos) { | ||
670 | + var result, result_data; | ||
671 | + result_data = this.results_data[pos]; | ||
672 | + result_data.selected = false; | ||
673 | + this.form_field.options[result_data.options_index].selected = false; | ||
674 | + result = $("#" + this.container_id + "_o_" + pos); | ||
675 | + result.removeClass("result-selected").addClass("active-result").show(); | ||
676 | + this.result_clear_highlight(); | ||
677 | + this.winnow_results(); | ||
678 | + this.form_field_jq.trigger("change"); | ||
679 | + return this.search_field_scale(); | ||
680 | + }; | ||
681 | + Chosen.prototype.single_deselect_control_build = function() { | ||
682 | + if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) { | ||
683 | + return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>"); | ||
684 | + } | ||
685 | + }; | ||
686 | + Chosen.prototype.winnow_results = function() { | ||
687 | + var found, option, part, parts, regex, result_id, results, searchText, startTime, startpos, text, zregex, _i, _j, _len, _len2, _ref; | ||
688 | + startTime = new Date(); | ||
689 | + this.no_results_clear(); | ||
690 | + results = 0; | ||
691 | + searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html(); | ||
692 | + regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); | ||
693 | + zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); | ||
694 | + _ref = this.results_data; | ||
695 | + for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
696 | + option = _ref[_i]; | ||
697 | + if (!option.disabled && !option.empty) { | ||
698 | + if (option.group) { | ||
699 | + $('#' + option.dom_id).hide(); | ||
700 | + } else if (!(this.is_multiple && option.selected)) { | ||
701 | + found = false; | ||
702 | + result_id = option.dom_id; | ||
703 | + if (regex.test(option.html)) { | ||
704 | + found = true; | ||
705 | + results += 1; | ||
706 | + } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) { | ||
707 | + parts = option.html.replace(/\[|\]/g, "").split(" "); | ||
708 | + if (parts.length) { | ||
709 | + for (_j = 0, _len2 = parts.length; _j < _len2; _j++) { | ||
710 | + part = parts[_j]; | ||
711 | + if (regex.test(part)) { | ||
712 | + found = true; | ||
713 | + results += 1; | ||
714 | + } | ||
715 | + } | ||
716 | + } | ||
717 | + } | ||
718 | + if (found) { | ||
719 | + if (searchText.length) { | ||
720 | + startpos = option.html.search(zregex); | ||
721 | + text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length); | ||
722 | + text = text.substr(0, startpos) + '<em>' + text.substr(startpos); | ||
723 | + } else { | ||
724 | + text = option.html; | ||
725 | + } | ||
726 | + if ($("#" + result_id).html !== text) { | ||
727 | + $("#" + result_id).html(text); | ||
728 | + } | ||
729 | + this.result_activate($("#" + result_id)); | ||
730 | + if (option.group_array_index != null) { | ||
731 | + $("#" + this.results_data[option.group_array_index].dom_id).show(); | ||
732 | + } | ||
733 | + } else { | ||
734 | + if (this.result_highlight && result_id === this.result_highlight.attr('id')) { | ||
735 | + this.result_clear_highlight(); | ||
736 | + } | ||
737 | + this.result_deactivate($("#" + result_id)); | ||
738 | + } | ||
739 | + } | ||
740 | + } | ||
741 | + } | ||
742 | + if (results < 1 && searchText.length) { | ||
743 | + return this.no_results(searchText); | ||
744 | + } else { | ||
745 | + return this.winnow_results_set_highlight(); | ||
746 | + } | ||
747 | + }; | ||
748 | + Chosen.prototype.winnow_results_clear = function() { | ||
749 | + var li, lis, _i, _len, _results; | ||
750 | + this.search_field.val(""); | ||
751 | + lis = this.search_results.find("li"); | ||
752 | + _results = []; | ||
753 | + for (_i = 0, _len = lis.length; _i < _len; _i++) { | ||
754 | + li = lis[_i]; | ||
755 | + li = $(li); | ||
756 | + _results.push(li.hasClass("group-result") ? li.show() : !this.is_multiple || !li.hasClass("result-selected") ? this.result_activate(li) : void 0); | ||
757 | + } | ||
758 | + return _results; | ||
759 | + }; | ||
760 | + Chosen.prototype.winnow_results_set_highlight = function() { | ||
761 | + var do_high, selected_results; | ||
762 | + if (!this.result_highlight) { | ||
763 | + selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : []; | ||
764 | + do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first(); | ||
765 | + if (do_high != null) { | ||
766 | + return this.result_do_highlight(do_high); | ||
767 | + } | ||
768 | + } | ||
769 | + }; | ||
770 | + Chosen.prototype.no_results = function(terms) { | ||
771 | + var no_results_html; | ||
772 | + no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>'); | ||
773 | + no_results_html.find("span").first().html(terms); | ||
774 | + return this.search_results.append(no_results_html); | ||
775 | + }; | ||
776 | + Chosen.prototype.no_results_clear = function() { | ||
777 | + return this.search_results.find(".no-results").remove(); | ||
778 | + }; | ||
779 | + Chosen.prototype.keydown_arrow = function() { | ||
780 | + var first_active, next_sib; | ||
781 | + if (!this.result_highlight) { | ||
782 | + first_active = this.search_results.find("li.active-result").first(); | ||
783 | + if (first_active) { | ||
784 | + this.result_do_highlight($(first_active)); | ||
785 | + } | ||
786 | + } else if (this.results_showing) { | ||
787 | + next_sib = this.result_highlight.nextAll("li.active-result").first(); | ||
788 | + if (next_sib) { | ||
789 | + this.result_do_highlight(next_sib); | ||
790 | + } | ||
791 | + } | ||
792 | + if (!this.results_showing) { | ||
793 | + return this.results_show(); | ||
794 | + } | ||
795 | + }; | ||
796 | + Chosen.prototype.keyup_arrow = function() { | ||
797 | + var prev_sibs; | ||
798 | + if (!this.results_showing && !this.is_multiple) { | ||
799 | + return this.results_show(); | ||
800 | + } else if (this.result_highlight) { | ||
801 | + prev_sibs = this.result_highlight.prevAll("li.active-result"); | ||
802 | + if (prev_sibs.length) { | ||
803 | + return this.result_do_highlight(prev_sibs.first()); | ||
804 | + } else { | ||
805 | + if (this.choices > 0) { | ||
806 | + this.results_hide(); | ||
807 | + } | ||
808 | + return this.result_clear_highlight(); | ||
809 | + } | ||
810 | + } | ||
811 | + }; | ||
812 | + Chosen.prototype.keydown_backstroke = function() { | ||
813 | + if (this.pending_backstroke) { | ||
814 | + this.choice_destroy(this.pending_backstroke.find("a").first()); | ||
815 | + return this.clear_backstroke(); | ||
816 | + } else { | ||
817 | + this.pending_backstroke = this.search_container.siblings("li.search-choice").last(); | ||
818 | + return this.pending_backstroke.addClass("search-choice-focus"); | ||
819 | + } | ||
820 | + }; | ||
821 | + Chosen.prototype.clear_backstroke = function() { | ||
822 | + if (this.pending_backstroke) { | ||
823 | + this.pending_backstroke.removeClass("search-choice-focus"); | ||
824 | + } | ||
825 | + return this.pending_backstroke = null; | ||
826 | + }; | ||
827 | + Chosen.prototype.keydown_checker = function(evt) { | ||
828 | + var stroke, _ref; | ||
829 | + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; | ||
830 | + this.search_field_scale(); | ||
831 | + if (stroke !== 8 && this.pending_backstroke) { | ||
832 | + this.clear_backstroke(); | ||
833 | + } | ||
834 | + switch (stroke) { | ||
835 | + case 8: | ||
836 | + this.backstroke_length = this.search_field.val().length; | ||
837 | + break; | ||
838 | + case 9: | ||
839 | + if (this.results_showing && !this.is_multiple) { | ||
840 | + this.result_select(evt); | ||
841 | + } | ||
842 | + this.mouse_on_container = false; | ||
843 | + break; | ||
844 | + case 13: | ||
845 | + evt.preventDefault(); | ||
846 | + break; | ||
847 | + case 38: | ||
848 | + evt.preventDefault(); | ||
849 | + this.keyup_arrow(); | ||
850 | + break; | ||
851 | + case 40: | ||
852 | + this.keydown_arrow(); | ||
853 | + break; | ||
854 | + } | ||
855 | + }; | ||
856 | + Chosen.prototype.search_field_scale = function() { | ||
857 | + var dd_top, div, h, style, style_block, styles, w, _i, _len; | ||
858 | + if (this.is_multiple) { | ||
859 | + h = 0; | ||
860 | + w = 0; | ||
861 | + style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"; | ||
862 | + styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; | ||
863 | + for (_i = 0, _len = styles.length; _i < _len; _i++) { | ||
864 | + style = styles[_i]; | ||
865 | + style_block += style + ":" + this.search_field.css(style) + ";"; | ||
866 | + } | ||
867 | + div = $('<div />', { | ||
868 | + 'style': style_block | ||
869 | + }); | ||
870 | + div.text(this.search_field.val()); | ||
871 | + $('body').append(div); | ||
872 | + w = div.width() + 25; | ||
873 | + div.remove(); | ||
874 | + if (w > this.f_width - 10) { | ||
875 | + w = this.f_width - 10; | ||
876 | + } | ||
877 | + this.search_field.css({ | ||
878 | + 'width': w + 'px' | ||
879 | + }); | ||
880 | + dd_top = this.container.height(); | ||
881 | + return this.dropdown.css({ | ||
882 | + "top": dd_top + "px" | ||
883 | + }); | ||
884 | + } | ||
885 | + }; | ||
886 | + Chosen.prototype.generate_random_id = function() { | ||
887 | + var string; | ||
888 | + string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char(); | ||
889 | + while ($("#" + string).length > 0) { | ||
890 | + string += this.generate_random_char(); | ||
891 | + } | ||
892 | + return string; | ||
893 | + }; | ||
894 | + return Chosen; | ||
895 | + })(); | ||
896 | + get_side_border_padding = function(elmt) { | ||
897 | + var side_border_padding; | ||
898 | + return side_border_padding = elmt.outerWidth() - elmt.width(); | ||
899 | + }; | ||
900 | + root.get_side_border_padding = get_side_border_padding; | ||
901 | +}).call(this); |
app/assets/javascripts/commits.js
@@ -7,3 +7,51 @@ $(document).ready(function(){ | @@ -7,3 +7,51 @@ $(document).ready(function(){ | ||
7 | } | 7 | } |
8 | }); | 8 | }); |
9 | }); | 9 | }); |
10 | + | ||
11 | + | ||
12 | + | ||
13 | +var CommitsList = { | ||
14 | + | ||
15 | +ref:null, | ||
16 | +limit:0, | ||
17 | +offset:0, | ||
18 | + | ||
19 | +init: | ||
20 | + function(ref, limit) { | ||
21 | + this.ref=ref; | ||
22 | + this.limit=limit; | ||
23 | + this.offset=limit; | ||
24 | + this.initLoadMore(); | ||
25 | + $('.loading').show(); | ||
26 | + }, | ||
27 | + | ||
28 | +getOld: | ||
29 | + function() { | ||
30 | + $('.loading').show(); | ||
31 | + $.ajax({ | ||
32 | + type: "GET", | ||
33 | + url: location.href, | ||
34 | + data: "limit=" + this.limit + "&offset=" + this.offset + "&ref=" + this.ref, | ||
35 | + complete: function(){ $('.loading').hide()}, | ||
36 | + dataType: "script"}); | ||
37 | + }, | ||
38 | + | ||
39 | +append: | ||
40 | + function(count, html) { | ||
41 | + $("#commits_list").append(html); | ||
42 | + if(count > 0) { | ||
43 | + this.offset += count; | ||
44 | + this.initLoadMore(); | ||
45 | + } | ||
46 | + }, | ||
47 | + | ||
48 | +initLoadMore: | ||
49 | + function() { | ||
50 | + $(window).bind('scroll', function(){ | ||
51 | + if($(window).scrollTop() == $(document).height() - $(window).height()){ | ||
52 | + $(window).unbind('scroll'); | ||
53 | + CommitsList.getOld(); | ||
54 | + } | ||
55 | + }); | ||
56 | + } | ||
57 | +} |
@@ -0,0 +1,4 @@ | @@ -0,0 +1,4 @@ | ||
1 | +/* Modernizr 2.0.6 | MIT & BSD | ||
2 | + * Contains: All core tests, html5shiv, yepnope, respond.js. Get your own custom build at www.modernizr.com/download/ | ||
3 | + */ | ||
4 | +;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=["­","<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))}; | ||
0 | \ No newline at end of file | 5 | \ No newline at end of file |
@@ -0,0 +1,87 @@ | @@ -0,0 +1,87 @@ | ||
1 | +var NoteList = { | ||
2 | + | ||
3 | +first_id: 0, | ||
4 | +last_id: 0, | ||
5 | +resource_name: null, | ||
6 | + | ||
7 | +init: | ||
8 | + function(resource_name, first_id, last_id) { | ||
9 | + this.resource_name = resource_name; | ||
10 | + this.first_id = first_id; | ||
11 | + this.last_id = last_id; | ||
12 | + this.initRefresh(); | ||
13 | + this.initLoadMore(); | ||
14 | + }, | ||
15 | + | ||
16 | +getOld: | ||
17 | + function() { | ||
18 | + $('.loading').show(); | ||
19 | + $.ajax({ | ||
20 | + type: "GET", | ||
21 | + url: location.href, | ||
22 | + data: "first_id=" + this.first_id, | ||
23 | + complete: function(){ $('.loading').hide()}, | ||
24 | + dataType: "script"}); | ||
25 | + }, | ||
26 | + | ||
27 | +append: | ||
28 | + function(id, html) { | ||
29 | + this.first_id = id; | ||
30 | + $("#notes-list").append(html); | ||
31 | + this.initLoadMore(); | ||
32 | + }, | ||
33 | + | ||
34 | +replace: | ||
35 | + function(fid, lid, html) { | ||
36 | + this.first_id = fid; | ||
37 | + this.last_id = lid; | ||
38 | + $("#notes-list").html(html); | ||
39 | + this.initLoadMore(); | ||
40 | + }, | ||
41 | + | ||
42 | + | ||
43 | +prepend: | ||
44 | + function(id, html) { | ||
45 | + this.last_id = id; | ||
46 | + $("#notes-list").prepend(html); | ||
47 | + }, | ||
48 | + | ||
49 | +getNew: | ||
50 | + function() { | ||
51 | + // refersh notes list | ||
52 | + $.ajax({ | ||
53 | + type: "GET", | ||
54 | + url: location.href, | ||
55 | + data: "last_id=" + this.last_id, | ||
56 | + dataType: "script"}); | ||
57 | + }, | ||
58 | + | ||
59 | +refresh: | ||
60 | + function() { | ||
61 | + // refersh notes list | ||
62 | + $.ajax({ | ||
63 | + type: "GET", | ||
64 | + url: location.href, | ||
65 | + data: "first_id=" + this.first_id + "&last_id=" + this.last_id, | ||
66 | + dataType: "script"}); | ||
67 | + }, | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | +initRefresh: | ||
72 | + function() { | ||
73 | + // init timer | ||
74 | + var intNew = setInterval("NoteList.getNew()", 15000); | ||
75 | + var intRefresh = setInterval("NoteList.refresh()", 90000); | ||
76 | + }, | ||
77 | + | ||
78 | +initLoadMore: | ||
79 | + function() { | ||
80 | + $(window).bind('scroll', function(){ | ||
81 | + if($(window).scrollTop() == $(document).height() - $(window).height()){ | ||
82 | + $(window).unbind('scroll'); | ||
83 | + NoteList.getOld(); | ||
84 | + } | ||
85 | + }); | ||
86 | + } | ||
87 | +} |
app/assets/javascripts/projects.js
@@ -8,7 +8,7 @@ $(document).ready(function(){ | @@ -8,7 +8,7 @@ $(document).ready(function(){ | ||
8 | e.stopPropagation(); | 8 | e.stopPropagation(); |
9 | $(this).find("td.tree-item-file-name a").click(); | 9 | $(this).find("td.tree-item-file-name a").click(); |
10 | return false; | 10 | return false; |
11 | - } | 11 | + } |
12 | }); | 12 | }); |
13 | 13 | ||
14 | $("#projects-list .project").live('click', function(e){ | 14 | $("#projects-list .project").live('click', function(e){ |
app/assets/stylesheets/application.css
@@ -2,6 +2,9 @@ | @@ -2,6 +2,9 @@ | ||
2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory | 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory |
3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at | 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at |
4 | * the top of the compiled file, but it's generally better to create a new file per style scope. | 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. |
5 | + *= require jquery-ui/jquery-ui | ||
6 | + *= require jquery-ui/jquery.ui.selectmenu | ||
7 | + *= require jquery-ui/jquery.tagify | ||
5 | *= require_self | 8 | *= require_self |
6 | - *= require_tree . | 9 | + *= require_tree . |
7 | */ | 10 | */ |
@@ -0,0 +1,367 @@ | @@ -0,0 +1,367 @@ | ||
1 | +/* @group Base */ | ||
2 | +.chzn-container { | ||
3 | + font-size: 13px; | ||
4 | + position: relative; | ||
5 | + display: inline-block; | ||
6 | + zoom: 1; | ||
7 | + *display: inline; | ||
8 | +} | ||
9 | +.chzn-container .chzn-drop { | ||
10 | + background: #fff; | ||
11 | + border: 1px solid #aaa; | ||
12 | + border-top: 0; | ||
13 | + position: absolute; | ||
14 | + top: 29px; | ||
15 | + left: 0; | ||
16 | + -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15); | ||
17 | + -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15); | ||
18 | + -o-box-shadow : 0 4px 5px rgba(0,0,0,.15); | ||
19 | + box-shadow : 0 4px 5px rgba(0,0,0,.15); | ||
20 | + z-index: 999; | ||
21 | +} | ||
22 | +/* @end */ | ||
23 | + | ||
24 | +/* @group Single Chosen */ | ||
25 | +.chzn-container-single .chzn-single { | ||
26 | + background-color: #fff; | ||
27 | + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); | ||
28 | + background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); | ||
29 | + background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); | ||
30 | + background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%); | ||
31 | + background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%); | ||
32 | + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); | ||
33 | + background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%); | ||
34 | + -webkit-border-radius: 4px; | ||
35 | + -moz-border-radius : 4px; | ||
36 | + border-radius : 4px; | ||
37 | + -moz-background-clip : padding; | ||
38 | + -webkit-background-clip: padding-box; | ||
39 | + background-clip : padding-box; | ||
40 | + border: 1px solid #aaa; | ||
41 | + display: block; | ||
42 | + overflow: hidden; | ||
43 | + white-space: nowrap; | ||
44 | + position: relative; | ||
45 | + height: 26px; | ||
46 | + line-height: 26px; | ||
47 | + padding: 0 0 0 8px; | ||
48 | + color: #444; | ||
49 | + text-decoration: none; | ||
50 | +} | ||
51 | +.chzn-container-single .chzn-single span { | ||
52 | + margin-right: 26px; | ||
53 | + display: block; | ||
54 | + overflow: hidden; | ||
55 | + white-space: nowrap; | ||
56 | + -o-text-overflow: ellipsis; | ||
57 | + -ms-text-overflow: ellipsis; | ||
58 | + text-overflow: ellipsis; | ||
59 | +} | ||
60 | +.chzn-container-single .chzn-single abbr { | ||
61 | + display: block; | ||
62 | + position: absolute; | ||
63 | + right: 26px; | ||
64 | + top: 8px; | ||
65 | + width: 12px; | ||
66 | + height: 13px; | ||
67 | + font-size: 1px; | ||
68 | + background: url(chosen-sprite.png) right top no-repeat; | ||
69 | +} | ||
70 | +.chzn-container-single .chzn-single abbr:hover { | ||
71 | + background-position: right -11px; | ||
72 | +} | ||
73 | +.chzn-container-single .chzn-single div { | ||
74 | + -webkit-border-radius: 0 4px 4px 0; | ||
75 | + -moz-border-radius : 0 4px 4px 0; | ||
76 | + border-radius : 0 4px 4px 0; | ||
77 | + -moz-background-clip : padding; | ||
78 | + -webkit-background-clip: padding-box; | ||
79 | + background-clip : padding-box; | ||
80 | + background: #ccc; | ||
81 | + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); | ||
82 | + background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); | ||
83 | + background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); | ||
84 | + background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); | ||
85 | + background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%); | ||
86 | + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 ); | ||
87 | + background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%); | ||
88 | + border-left: 1px solid #aaa; | ||
89 | + position: absolute; | ||
90 | + right: 0; | ||
91 | + top: 0; | ||
92 | + display: block; | ||
93 | + height: 100%; | ||
94 | + width: 18px; | ||
95 | +} | ||
96 | +.chzn-container-single .chzn-single div b { | ||
97 | + background: url('chosen-sprite.png') no-repeat 0 1px; | ||
98 | + display: block; | ||
99 | + width: 100%; | ||
100 | + height: 100%; | ||
101 | +} | ||
102 | +.chzn-container-single .chzn-search { | ||
103 | + padding: 3px 4px; | ||
104 | + position: relative; | ||
105 | + margin: 0; | ||
106 | + white-space: nowrap; | ||
107 | + z-index: 1010; | ||
108 | +} | ||
109 | +.chzn-container-single .chzn-search input { | ||
110 | + background: #fff url('chosen-sprite.png') no-repeat 100% -22px; | ||
111 | + 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)); | ||
112 | + background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); | ||
113 | + background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); | ||
114 | + background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); | ||
115 | + background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); | ||
116 | + background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); | ||
117 | + margin: 1px 0; | ||
118 | + padding: 4px 20px 4px 5px; | ||
119 | + outline: 0; | ||
120 | + border: 1px solid #aaa; | ||
121 | + font-family: sans-serif; | ||
122 | + font-size: 1em; | ||
123 | +} | ||
124 | +.chzn-container-single .chzn-drop { | ||
125 | + -webkit-border-radius: 0 0 4px 4px; | ||
126 | + -moz-border-radius : 0 0 4px 4px; | ||
127 | + border-radius : 0 0 4px 4px; | ||
128 | + -moz-background-clip : padding; | ||
129 | + -webkit-background-clip: padding-box; | ||
130 | + background-clip : padding-box; | ||
131 | +} | ||
132 | +/* @end */ | ||
133 | + | ||
134 | +.chzn-container-single-nosearch .chzn-search input { | ||
135 | + position: absolute; | ||
136 | + left: -9000px; | ||
137 | +} | ||
138 | + | ||
139 | +/* @group Multi Chosen */ | ||
140 | +.chzn-container-multi .chzn-choices { | ||
141 | + background-color: #fff; | ||
142 | + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); | ||
143 | + background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); | ||
144 | + background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); | ||
145 | + background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%); | ||
146 | + background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); | ||
147 | + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); | ||
148 | + background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%); | ||
149 | + border: 1px solid #aaa; | ||
150 | + margin: 0; | ||
151 | + padding: 0; | ||
152 | + cursor: text; | ||
153 | + overflow: hidden; | ||
154 | + height: auto !important; | ||
155 | + height: 1%; | ||
156 | + position: relative; | ||
157 | +} | ||
158 | +.chzn-container-multi .chzn-choices li { | ||
159 | + float: left; | ||
160 | + list-style: none; | ||
161 | +} | ||
162 | +.chzn-container-multi .chzn-choices .search-field { | ||
163 | + white-space: nowrap; | ||
164 | + margin: 0; | ||
165 | + padding: 0; | ||
166 | +} | ||
167 | +.chzn-container-multi .chzn-choices .search-field input { | ||
168 | + color: #666; | ||
169 | + background: transparent !important; | ||
170 | + border: 0 !important; | ||
171 | + padding: 5px; | ||
172 | + margin: 1px 0; | ||
173 | + outline: 0; | ||
174 | + -webkit-box-shadow: none; | ||
175 | + -moz-box-shadow : none; | ||
176 | + -o-box-shadow : none; | ||
177 | + box-shadow : none; | ||
178 | +} | ||
179 | +.chzn-container-multi .chzn-choices .search-field .default { | ||
180 | + color: #999; | ||
181 | +} | ||
182 | +.chzn-container-multi .chzn-choices .search-choice { | ||
183 | + -webkit-border-radius: 3px; | ||
184 | + -moz-border-radius : 3px; | ||
185 | + border-radius : 3px; | ||
186 | + -moz-background-clip : padding; | ||
187 | + -webkit-background-clip: padding-box; | ||
188 | + background-clip : padding-box; | ||
189 | + background-color: #e4e4e4; | ||
190 | + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee)); | ||
191 | + background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); | ||
192 | + background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); | ||
193 | + background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%); | ||
194 | + background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); | ||
195 | + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 ); | ||
196 | + background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); | ||
197 | + color: #333; | ||
198 | + border: 1px solid #b4b4b4; | ||
199 | + line-height: 13px; | ||
200 | + padding: 3px 19px 3px 6px; | ||
201 | + margin: 3px 0 3px 5px; | ||
202 | + position: relative; | ||
203 | +} | ||
204 | +.chzn-container-multi .chzn-choices .search-choice span { | ||
205 | + cursor: default; | ||
206 | +} | ||
207 | +.chzn-container-multi .chzn-choices .search-choice-focus { | ||
208 | + background: #d4d4d4; | ||
209 | +} | ||
210 | +.chzn-container-multi .chzn-choices .search-choice .search-choice-close { | ||
211 | + display: block; | ||
212 | + position: absolute; | ||
213 | + right: 3px; | ||
214 | + top: 4px; | ||
215 | + width: 12px; | ||
216 | + height: 13px; | ||
217 | + font-size: 1px; | ||
218 | + background: url(chosen-sprite.png) right top no-repeat; | ||
219 | +} | ||
220 | +.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { | ||
221 | + background-position: right -11px; | ||
222 | +} | ||
223 | +.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { | ||
224 | + background-position: right -11px; | ||
225 | +} | ||
226 | +/* @end */ | ||
227 | + | ||
228 | +/* @group Results */ | ||
229 | +.chzn-container .chzn-results { | ||
230 | + margin: 0 4px 4px 0; | ||
231 | + max-height: 190px; | ||
232 | + padding: 0 0 0 4px; | ||
233 | + position: relative; | ||
234 | + overflow-x: hidden; | ||
235 | + overflow-y: auto; | ||
236 | +} | ||
237 | +.chzn-container-multi .chzn-results { | ||
238 | + margin: -1px 0 0; | ||
239 | + padding: 0; | ||
240 | +} | ||
241 | +.chzn-container .chzn-results li { | ||
242 | + display: none; | ||
243 | + line-height: 80%; | ||
244 | + padding: 7px 7px 8px; | ||
245 | + margin: 0; | ||
246 | + list-style: none; | ||
247 | +} | ||
248 | +.chzn-container .chzn-results .active-result { | ||
249 | + cursor: pointer; | ||
250 | + display: list-item; | ||
251 | +} | ||
252 | +.chzn-container .chzn-results .highlighted { | ||
253 | + background: #3875d7; | ||
254 | + color: #fff; | ||
255 | +} | ||
256 | +.chzn-container .chzn-results li em { | ||
257 | + background: #feffde; | ||
258 | + font-style: normal; | ||
259 | +} | ||
260 | +.chzn-container .chzn-results .highlighted em { | ||
261 | + background: transparent; | ||
262 | +} | ||
263 | +.chzn-container .chzn-results .no-results { | ||
264 | + background: #f4f4f4; | ||
265 | + display: list-item; | ||
266 | +} | ||
267 | +.chzn-container .chzn-results .group-result { | ||
268 | + cursor: default; | ||
269 | + color: #999; | ||
270 | + font-weight: bold; | ||
271 | +} | ||
272 | +.chzn-container .chzn-results .group-option { | ||
273 | + padding-left: 20px; | ||
274 | +} | ||
275 | +.chzn-container-multi .chzn-drop .result-selected { | ||
276 | + display: none; | ||
277 | +} | ||
278 | +/* @end */ | ||
279 | + | ||
280 | +/* @group Active */ | ||
281 | +.chzn-container-active .chzn-single { | ||
282 | + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); | ||
283 | + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); | ||
284 | + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); | ||
285 | + box-shadow : 0 0 5px rgba(0,0,0,.3); | ||
286 | + border: 1px solid #5897fb; | ||
287 | +} | ||
288 | +.chzn-container-active .chzn-single-with-drop { | ||
289 | + border: 1px solid #aaa; | ||
290 | + -webkit-box-shadow: 0 1px 0 #fff inset; | ||
291 | + -moz-box-shadow : 0 1px 0 #fff inset; | ||
292 | + -o-box-shadow : 0 1px 0 #fff inset; | ||
293 | + box-shadow : 0 1px 0 #fff inset; | ||
294 | + background-color: #eee; | ||
295 | + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); | ||
296 | + background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); | ||
297 | + background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); | ||
298 | + background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); | ||
299 | + background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); | ||
300 | + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); | ||
301 | + background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); | ||
302 | + -webkit-border-bottom-left-radius : 0; | ||
303 | + -webkit-border-bottom-right-radius: 0; | ||
304 | + -moz-border-radius-bottomleft : 0; | ||
305 | + -moz-border-radius-bottomright: 0; | ||
306 | + border-bottom-left-radius : 0; | ||
307 | + border-bottom-right-radius: 0; | ||
308 | +} | ||
309 | +.chzn-container-active .chzn-single-with-drop div { | ||
310 | + background: transparent; | ||
311 | + border-left: none; | ||
312 | +} | ||
313 | +.chzn-container-active .chzn-single-with-drop div b { | ||
314 | + background-position: -18px 1px; | ||
315 | +} | ||
316 | +.chzn-container-active .chzn-choices { | ||
317 | + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); | ||
318 | + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); | ||
319 | + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); | ||
320 | + box-shadow : 0 0 5px rgba(0,0,0,.3); | ||
321 | + border: 1px solid #5897fb; | ||
322 | +} | ||
323 | +.chzn-container-active .chzn-choices .search-field input { | ||
324 | + color: #111 !important; | ||
325 | +} | ||
326 | +/* @end */ | ||
327 | + | ||
328 | +/* @group Disabled Support */ | ||
329 | +.chzn-disabled { | ||
330 | + cursor: default; | ||
331 | + opacity:0.5 !important; | ||
332 | +} | ||
333 | +.chzn-disabled .chzn-single { | ||
334 | + cursor: default; | ||
335 | +} | ||
336 | +.chzn-disabled .chzn-choices .search-choice .search-choice-close { | ||
337 | + cursor: default; | ||
338 | +} | ||
339 | + | ||
340 | +/* @group Right to Left */ | ||
341 | +.chzn-rtl { direction:rtl;text-align: right; } | ||
342 | +.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; } | ||
343 | +.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; } | ||
344 | +.chzn-rtl .chzn-single div { | ||
345 | + left: 0; right: auto; | ||
346 | + border-left: none; border-right: 1px solid #aaaaaa; | ||
347 | + -webkit-border-radius: 4px 0 0 4px; | ||
348 | + -moz-border-radius : 4px 0 0 4px; | ||
349 | + border-radius : 4px 0 0 4px; | ||
350 | +} | ||
351 | +.chzn-rtl .chzn-choices li { float: right; } | ||
352 | +.chzn-rtl .chzn-choices .search-choice { padding: 3px 6px 3px 19px; margin: 3px 5px 3px 0; } | ||
353 | +.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;} | ||
354 | +.chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; } | ||
355 | +.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; } | ||
356 | +.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; } | ||
357 | +.chzn-rtl .chzn-search input { | ||
358 | + background: url('chosen-sprite.png') no-repeat -38px -22px, #ffffff; | ||
359 | + 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)); | ||
360 | + background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); | ||
361 | + background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); | ||
362 | + background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); | ||
363 | + background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); | ||
364 | + background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); | ||
365 | + padding: 4px 5px 4px 20px; | ||
366 | +} | ||
367 | +/* @end */ |
app/assets/stylesheets/highlight.css.scss
1 | -@mixin round-borders-all($radius) { | 1 | +@mixin round-borders-all($radius) { |
2 | border: 1px solid #eaeaea; | 2 | border: 1px solid #eaeaea; |
3 | -moz-border-radius: $radius; | 3 | -moz-border-radius: $radius; |
4 | -webkit-border-radius: $radius; | 4 | -webkit-border-radius: $radius; |
@@ -28,11 +28,11 @@ td.linenos{ | @@ -28,11 +28,11 @@ td.linenos{ | ||
28 | .highlight pre{ | 28 | .highlight pre{ |
29 | } | 29 | } |
30 | 30 | ||
31 | -.linenodiv pre { | 31 | +.linenodiv pre { |
32 | white-space:pre-line; | 32 | white-space:pre-line; |
33 | } | 33 | } |
34 | 34 | ||
35 | -td.linenos { | 35 | +td.linenos { |
36 | background:#ECECEC; | 36 | background:#ECECEC; |
37 | color:#777; | 37 | color:#777; |
38 | padding:10px 0px 0px 10px; | 38 | padding:10px 0px 0px 10px; |
@@ -42,7 +42,7 @@ td.linenos { | @@ -42,7 +42,7 @@ td.linenos { | ||
42 | 42 | ||
43 | } | 43 | } |
44 | 44 | ||
45 | -td.code .highlight { | 45 | +td.code .highlight { |
46 | overflow: auto; | 46 | overflow: auto; |
47 | } | 47 | } |
48 | table.highlighttable pre{ | 48 | table.highlighttable pre{ |
@@ -53,9 +53,8 @@ table.highlighttable pre{ | @@ -53,9 +53,8 @@ table.highlighttable pre{ | ||
53 | text-align:left; | 53 | text-align:left; |
54 | } | 54 | } |
55 | 55 | ||
56 | - | ||
57 | .git-empty .highlight { | 56 | .git-empty .highlight { |
58 | - @include round-borders-all(4px); | 57 | + @include round-borders-all(4px); |
59 | background:#eee; | 58 | background:#eee; |
60 | padding:5px; | 59 | padding:5px; |
61 | //overflow-x:scroll; | 60 | //overflow-x:scroll; |
@@ -71,10 +70,9 @@ table.highlighttable pre{ | @@ -71,10 +70,9 @@ table.highlighttable pre{ | ||
71 | .shadow{ | 70 | .shadow{ |
72 | -webkit-box-shadow:0 5px 15px #000; | 71 | -webkit-box-shadow:0 5px 15px #000; |
73 | -moz-box-shadow:0 5px 15px #000; | 72 | -moz-box-shadow:0 5px 15px #000; |
74 | - box-shadow:0 5px 15px #000; | 73 | + box-shadow:0 5px 15px #000; |
75 | } | 74 | } |
76 | 75 | ||
77 | - | ||
78 | .hll { background-color: #ffffff } | 76 | .hll { background-color: #ffffff } |
79 | .c { color: #888888; font-style: italic } /* Comment */ | 77 | .c { color: #888888; font-style: italic } /* Comment */ |
80 | .err { color: #a61717; background-color: #e3d2d2 } /* Error */ | 78 | .err { color: #a61717; background-color: #e3d2d2 } /* Error */ |
@@ -105,7 +103,7 @@ table.highlighttable pre{ | @@ -105,7 +103,7 @@ table.highlighttable pre{ | ||
105 | .highlight .nb{color:#0086B3;} /* Name.Builtin */ | 103 | .highlight .nb{color:#0086B3;} /* Name.Builtin */ |
106 | .highlight .nc{color:#458;font-weight:bold;} /* Name.Class */ | 104 | .highlight .nc{color:#458;font-weight:bold;} /* Name.Class */ |
107 | .highlight .no{color:#008080;} /* Name.Constant */ | 105 | .highlight .no{color:#008080;} /* Name.Constant */ |
108 | -.highlight .ni{color:#800080;} | 106 | +.highlight .ni{color:#800080;} |
109 | .highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */ | 107 | .highlight .ne{color:#900;font-weight:bold;} /* Name.Exception */ |
110 | .highlight .nf{color:#900;font-weight:bold;} /* Name.Function */ | 108 | .highlight .nf{color:#900;font-weight:bold;} /* Name.Function */ |
111 | .highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */ | 109 | .highlight .nn{color:#005;font-weight:bold;} /* Name.Namespace */ |
app/assets/stylesheets/projects.css.scss
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | // They will automatically be included in application.css. | 2 | // They will automatically be included in application.css. |
3 | // You can use Sass (SCSS) here: http://sass-lang.com/ | 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ |
4 | 4 | ||
5 | -@mixin round-borders-bottom($radius) { | 5 | +@mixin round-borders-bottom($radius) { |
6 | border-top: 1px solid #eaeaea; | 6 | border-top: 1px solid #eaeaea; |
7 | 7 | ||
8 | -moz-border-radius-bottomright: $radius; | 8 | -moz-border-radius-bottomright: $radius; |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | -webkit-border-bottom-right-radius: $radius; | 15 | -webkit-border-bottom-right-radius: $radius; |
16 | } | 16 | } |
17 | 17 | ||
18 | -@mixin round-borders-top($radius) { | 18 | +@mixin round-borders-top($radius) { |
19 | border-top: 1px solid #eaeaea; | 19 | border-top: 1px solid #eaeaea; |
20 | 20 | ||
21 | -moz-border-radius-topright: $radius; | 21 | -moz-border-radius-topright: $radius; |
@@ -28,14 +28,14 @@ | @@ -28,14 +28,14 @@ | ||
28 | -webkit-border-top-right-radius: $radius; | 28 | -webkit-border-top-right-radius: $radius; |
29 | } | 29 | } |
30 | 30 | ||
31 | -@mixin round-borders-all($radius) { | 31 | +@mixin round-borders-all($radius) { |
32 | border: 1px solid #eaeaea; | 32 | border: 1px solid #eaeaea; |
33 | -moz-border-radius: $radius; | 33 | -moz-border-radius: $radius; |
34 | -webkit-border-radius: $radius; | 34 | -webkit-border-radius: $radius; |
35 | border-radius: $radius; | 35 | border-radius: $radius; |
36 | } | 36 | } |
37 | 37 | ||
38 | -@mixin hover-color { | 38 | +@mixin hover-color { |
39 | background: #fff !important; | 39 | background: #fff !important; |
40 | background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important; | 40 | background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important; |
41 | background: -moz-linear-gradient(top,#fff,#FFF6BF) !important; | 41 | background: -moz-linear-gradient(top,#fff,#FFF6BF) !important; |
@@ -46,47 +46,48 @@ | @@ -46,47 +46,48 @@ | ||
46 | border:1px solid #CCC; | 46 | border:1px solid #CCC; |
47 | margin-bottom:1em; | 47 | margin-bottom:1em; |
48 | 48 | ||
49 | - .diff_file_header { | 49 | + .diff_file_header { |
50 | padding:5px 5px; | 50 | padding:5px 5px; |
51 | border-bottom:1px solid #CCC; | 51 | border-bottom:1px solid #CCC; |
52 | background: #eee; | 52 | background: #eee; |
53 | } | 53 | } |
54 | - .diff_file_content { | ||
55 | - overflow-x: scroll; | 54 | + .diff_file_content { |
55 | + overflow:auto; | ||
56 | + overflow-y:hidden; | ||
56 | background:#fff; | 57 | background:#fff; |
57 | color:#333; | 58 | color:#333; |
58 | font-size: 12px; | 59 | font-size: 12px; |
59 | font-family: 'Courier New', 'andale mono','lucida console',monospace; | 60 | font-family: 'Courier New', 'andale mono','lucida console',monospace; |
60 | } | 61 | } |
61 | - .diff_file_content_image { | 62 | + .diff_file_content_image { |
62 | background:#eee; | 63 | background:#eee; |
63 | text-align:center; | 64 | text-align:center; |
64 | - img { | 65 | + img { |
65 | padding:100px; | 66 | padding:100px; |
66 | max-width:300px; | 67 | max-width:300px; |
67 | } | 68 | } |
68 | } | 69 | } |
69 | } | 70 | } |
70 | 71 | ||
71 | -#logo { | ||
72 | - &:hover { | 72 | +#logo { |
73 | + &:hover { | ||
73 | background:none; | 74 | background:none; |
74 | } | 75 | } |
75 | } | 76 | } |
76 | 77 | ||
77 | -.file_stats { | 78 | +.file_stats { |
78 | margin-bottom:10px; | 79 | margin-bottom:10px; |
79 | @include round-borders-all(4px); | 80 | @include round-borders-all(4px); |
80 | 81 | ||
81 | - span { | 82 | + span { |
82 | border-top: 1px solid #eaeaea; | 83 | border-top: 1px solid #eaeaea; |
83 | padding:5px 5px; | 84 | padding:5px 5px; |
84 | display:block; | 85 | display:block; |
85 | - &:first-child { | 86 | + &:first-child { |
86 | border-top:none; | 87 | border-top:none; |
87 | } | 88 | } |
88 | 89 | ||
89 | - img { | 90 | + img { |
90 | width:18px; | 91 | width:18px; |
91 | float:left; | 92 | float:left; |
92 | margin-right: 6px; | 93 | margin-right: 6px; |
@@ -94,71 +95,22 @@ | @@ -94,71 +95,22 @@ | ||
94 | } | 95 | } |
95 | } | 96 | } |
96 | 97 | ||
97 | -.round-borders { | 98 | +.round-borders { |
98 | @include round-borders-all(4px); | 99 | @include round-borders-all(4px); |
99 | padding: 4px 0px; | 100 | padding: 4px 0px; |
100 | } | 101 | } |
101 | -table.round-borders { | 102 | +table.round-borders { |
102 | float:left; | 103 | float:left; |
103 | } | 104 | } |
104 | 105 | ||
105 | -.day-commits-table { | ||
106 | - @include round-borders-all(4px); | ||
107 | - padding: 4px 0px; | ||
108 | - margin-bottom:10px; | ||
109 | - display:block; | ||
110 | - width:100%; | ||
111 | - background: #E6F1F6; | ||
112 | - | ||
113 | - .day-header { | ||
114 | - padding:10px; | ||
115 | - h3 { | ||
116 | - margin:0px; | ||
117 | - } | ||
118 | - } | ||
119 | - | ||
120 | - ul { | ||
121 | - display:block; | ||
122 | - list-style:none; | ||
123 | - margin:0px; | ||
124 | - padding:0px; | ||
125 | - | ||
126 | - li.commit { | ||
127 | - display:list-item; | ||
128 | - padding:8px; | ||
129 | - margin:0px; | ||
130 | - background: #F7FBFC; | ||
131 | - border-top: 1px solid #E2EAEE; | ||
132 | - | ||
133 | - &:first-child { | ||
134 | - border-top: 1px solid #E2EAEE; | ||
135 | - } | ||
136 | - &:nth-child(2n+1) { | ||
137 | - background: white; | ||
138 | - } | ||
139 | - | ||
140 | - a.button { | ||
141 | - width:85px; | ||
142 | - padding:10px; | ||
143 | - margin:0px; | ||
144 | - float:right; | ||
145 | - } | ||
146 | - p { | ||
147 | - margin-bottom: 3px; | ||
148 | - font-size: 13px; | ||
149 | - } | ||
150 | - } | ||
151 | - } | ||
152 | -} | ||
153 | -@mixin panel-color { | 106 | +@mixin panel-color { |
154 | background: #111 !important; | 107 | background: #111 !important; |
155 | background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important; | 108 | background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important; |
156 | background: -moz-linear-gradient(top,#333,#111) !important; | 109 | background: -moz-linear-gradient(top,#333,#111) !important; |
157 | background: transparent 9 !important; | 110 | background: transparent 9 !important; |
158 | } | 111 | } |
159 | 112 | ||
160 | - | ||
161 | -#header-panel { | 113 | +#header-panel { |
162 | @include panel-color; | 114 | @include panel-color; |
163 | height:40px; | 115 | height:40px; |
164 | position:fixed; | 116 | position:fixed; |
@@ -178,23 +130,23 @@ table.round-borders { | @@ -178,23 +130,23 @@ table.round-borders { | ||
178 | color:white; | 130 | color:white; |
179 | } | 131 | } |
180 | 132 | ||
181 | - &.current { | 133 | + &.current { |
182 | border-bottom: 3px solid #EAEAEA !important; | 134 | border-bottom: 3px solid #EAEAEA !important; |
183 | padding: 10px 20px 0; | 135 | padding: 10px 20px 0; |
184 | color: #eaeaea; | 136 | color: #eaeaea; |
185 | } | 137 | } |
186 | } | 138 | } |
187 | - .search-holder { | 139 | + .search-holder { |
188 | float:left; | 140 | float:left; |
189 | - width:290px; | 141 | + width:290px; |
190 | input { | 142 | input { |
191 | @include round-borders-all(4px); | 143 | @include round-borders-all(4px); |
192 | - width:290px; | 144 | + width:290px; |
193 | border-color:#888; | 145 | border-color:#888; |
194 | padding:5px; | 146 | padding:5px; |
195 | background:#666; | 147 | background:#666; |
196 | color:#222; | 148 | color:#222; |
197 | - &:focus { | 149 | + &:focus { |
198 | background:#fff; | 150 | background:#fff; |
199 | color:#000; | 151 | color:#000; |
200 | } | 152 | } |
@@ -211,28 +163,23 @@ table.round-borders { | @@ -211,28 +163,23 @@ table.round-borders { | ||
211 | padding:20px; | 163 | padding:20px; |
212 | } | 164 | } |
213 | 165 | ||
214 | -body { | ||
215 | - background: #eaeaea; | ||
216 | -} | ||
217 | - | ||
218 | a { | 166 | a { |
219 | color: #111; | 167 | color: #111; |
220 | } | 168 | } |
221 | 169 | ||
222 | .diff_file_content{ | 170 | .diff_file_content{ |
223 | - .old_line, .new_line { | 171 | + .old_line, .new_line { |
224 | background:#ECECEC; | 172 | background:#ECECEC; |
225 | color:#777; | 173 | color:#777; |
226 | - width:15px; | 174 | + width:30px; |
227 | float:left; | 175 | float:left; |
228 | - padding: 0px 10px; | 176 | + padding: 0px 5px; |
229 | border-right: 1px solid #ccc; | 177 | border-right: 1px solid #ccc; |
230 | } | 178 | } |
231 | } | 179 | } |
232 | 180 | ||
233 | - | ||
234 | .view_file_content{ | 181 | .view_file_content{ |
235 | - .old_line, .new_line { | 182 | + .old_line, .new_line { |
236 | background:#ECECEC; | 183 | background:#ECECEC; |
237 | color:#777; | 184 | color:#777; |
238 | width:15px; | 185 | width:15px; |
@@ -249,20 +196,20 @@ a { | @@ -249,20 +196,20 @@ a { | ||
249 | border:1px solid #CCC; | 196 | border:1px solid #CCC; |
250 | margin-bottom:1em; | 197 | margin-bottom:1em; |
251 | 198 | ||
252 | - .view_file_header { | 199 | + .view_file_header { |
253 | padding:5px 5px; | 200 | padding:5px 5px; |
254 | border-bottom:1px solid #CCC; | 201 | border-bottom:1px solid #CCC; |
255 | background: #eee; | 202 | background: #eee; |
256 | } | 203 | } |
257 | - .view_file_content { | 204 | + .view_file_content { |
258 | background:#fff; | 205 | background:#fff; |
259 | color:#514721; | 206 | color:#514721; |
260 | font-size: 11px; | 207 | font-size: 11px; |
261 | } | 208 | } |
262 | - .view_file_content_image { | 209 | + .view_file_content_image { |
263 | background:#eee; | 210 | background:#eee; |
264 | text-align:center; | 211 | text-align:center; |
265 | - img { | 212 | + img { |
266 | padding:100px; | 213 | padding:100px; |
267 | max-width:300px; | 214 | max-width:300px; |
268 | } | 215 | } |
@@ -273,7 +220,7 @@ a { | @@ -273,7 +220,7 @@ a { | ||
273 | 220 | ||
274 | } | 221 | } |
275 | 222 | ||
276 | -input.ssh_project_url { | 223 | +input.ssh_project_url { |
277 | padding:5px; | 224 | padding:5px; |
278 | margin:0px; | 225 | margin:0px; |
279 | float:right; | 226 | float:right; |
@@ -281,53 +228,23 @@ input.ssh_project_url { | @@ -281,53 +228,23 @@ input.ssh_project_url { | ||
281 | text-align:center; | 228 | text-align:center; |
282 | } | 229 | } |
283 | 230 | ||
284 | - | ||
285 | - | ||
286 | -.day-commits-table li.commit { | ||
287 | - cursor:pointer; | ||
288 | - | ||
289 | - &:hover { | ||
290 | - @include hover-color; | ||
291 | - } | ||
292 | -} | ||
293 | - | ||
294 | -/* | ||
295 | -#FFF6BF | ||
296 | -#FFD324 | ||
297 | -*/ | ||
298 | -#tree-slider tr.tree-item { | ||
299 | - cursor:pointer; | ||
300 | - | ||
301 | - &:hover { | ||
302 | - @include hover-color; | ||
303 | - td { | ||
304 | - @include hover-color; | ||
305 | - } | ||
306 | - } | ||
307 | -} | ||
308 | -#projects-list .project { | 231 | +#projects-list .project { |
309 | height:50px; | 232 | height:50px; |
310 | } | 233 | } |
311 | 234 | ||
235 | +#tree-slider .tree-item, | ||
312 | #projects-list .project, | 236 | #projects-list .project, |
313 | #snippets-table .snippet, | 237 | #snippets-table .snippet, |
314 | -#issues-table .issue{ | 238 | +#issues-table .issue{ |
315 | cursor:pointer; | 239 | cursor:pointer; |
316 | - | ||
317 | - &:hover { | ||
318 | - @include hover-color; | ||
319 | - td { | ||
320 | - @include hover-color; | ||
321 | - } | ||
322 | - } | ||
323 | } | 240 | } |
324 | 241 | ||
325 | -.clear { | 242 | +.clear { |
326 | clear: both; | 243 | clear: both; |
327 | } | 244 | } |
328 | 245 | ||
329 | -.top_project_menu { | ||
330 | - a { | 246 | +.top_project_menu { |
247 | + a { | ||
331 | border-right: 1px solid #FFFFFF; | 248 | border-right: 1px solid #FFFFFF; |
332 | box-shadow: -1px 0 #DDDDDD inset; | 249 | box-shadow: -1px 0 #DDDDDD inset; |
333 | color: #666; | 250 | color: #666; |
@@ -339,7 +256,7 @@ input.ssh_project_url { | @@ -339,7 +256,7 @@ input.ssh_project_url { | ||
339 | text-shadow: 0 1px 0 #FFFFFF; | 256 | text-shadow: 0 1px 0 #FFFFFF; |
340 | float:left; | 257 | float:left; |
341 | 258 | ||
342 | - &.current { | 259 | + &.current { |
343 | background-color: #FFFFFF; | 260 | background-color: #FFFFFF; |
344 | color: #222222; | 261 | color: #222222; |
345 | } | 262 | } |
@@ -363,11 +280,11 @@ input.ssh_project_url { | @@ -363,11 +280,11 @@ input.ssh_project_url { | ||
363 | .new_project, | 280 | .new_project, |
364 | .new_snippet, | 281 | .new_snippet, |
365 | .edit_snippet, | 282 | .edit_snippet, |
366 | -.edit_project { | 283 | +.edit_project { |
367 | input[type='text'], | 284 | input[type='text'], |
368 | input[type='email'], | 285 | input[type='email'], |
369 | input[type='password'], | 286 | input[type='password'], |
370 | - textarea { | 287 | + textarea { |
371 | width:400px; | 288 | width:400px; |
372 | padding:8px; | 289 | padding:8px; |
373 | font-size:14px; | 290 | font-size:14px; |
@@ -375,7 +292,7 @@ input.ssh_project_url { | @@ -375,7 +292,7 @@ input.ssh_project_url { | ||
375 | } | 292 | } |
376 | } | 293 | } |
377 | 294 | ||
378 | -.input_button { | 295 | +.input_button { |
379 | //@include round-borders-all(4px); | 296 | //@include round-borders-all(4px); |
380 | padding:8px; | 297 | padding:8px; |
381 | font-size:14px; | 298 | font-size:14px; |
@@ -387,23 +304,19 @@ input.ssh_project_url { | @@ -387,23 +304,19 @@ input.ssh_project_url { | ||
387 | border-width: 1px; | 304 | border-width: 1px; |
388 | } | 305 | } |
389 | 306 | ||
390 | -tbody tr:nth-child(2n) td, tbody tr.even td { | ||
391 | - background: none repeat scroll 0 0 #F7FBFC; | ||
392 | - border-top: 1px solid #E2EAEE; | ||
393 | - border-bottom: 1px solid #E2EAEE; | ||
394 | -} | ||
395 | 307 | ||
396 | -.top_menu_count { | ||
397 | - background: none repeat scroll 0 0 #FFF6BF; | ||
398 | - border-color: #FFD324; | ||
399 | - color: #514721; | ||
400 | - border: 1px solid #DDDDDD; | 308 | +.top_menu_count { |
309 | + background: none repeat scroll 0 0 white; | ||
310 | + color: #333; | ||
311 | + border-color: #4BB8D2; | ||
401 | padding: 2px; | 312 | padding: 2px; |
402 | - font-size:12px; | ||
403 | - position:relative; | ||
404 | - top:-14px; | ||
405 | - left:10px; | 313 | + font-size:10px; |
406 | border-top:none; | 314 | border-top:none; |
315 | + text-align:center; | ||
316 | + float:right; | ||
317 | + width:25px; | ||
318 | + | ||
319 | + | ||
407 | } | 320 | } |
408 | 321 | ||
409 | #logo { | 322 | #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 { | ||
415 | text-shadow: #555 1px 1px; | 328 | text-shadow: #555 1px 1px; |
416 | } | 329 | } |
417 | 330 | ||
418 | -/** FALSH **/ | 331 | +/** FLASH **/ |
419 | 332 | ||
420 | -#flash_container { | 333 | +#flash_container { |
421 | height:40px; | 334 | height:40px; |
422 | position:fixed; | 335 | position:fixed; |
423 | z-index:1009; | 336 | 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 { | ||
429 | cursor:pointer; | 342 | cursor:pointer; |
430 | border-bottom:1px solid #777; | 343 | border-bottom:1px solid #777; |
431 | 344 | ||
432 | - h4 { | 345 | + h4 { |
433 | color:#444; | 346 | color:#444; |
434 | font-size:22px; | 347 | font-size:22px; |
435 | padding-top:5px; | 348 | padding-top:5px; |
349 | + margin:2px; | ||
436 | } | 350 | } |
437 | } | 351 | } |
438 | 352 | ||
@@ -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 { | ||
460 | color: #0099FF; | 374 | color: #0099FF; |
461 | } | 375 | } |
462 | 376 | ||
463 | - &.hm { | 377 | + &.hm { |
464 | margin: 0px 0px; | 378 | margin: 0px 0px; |
465 | } | 379 | } |
466 | 380 | ||
467 | - &.vm { | 381 | + &.vm { |
468 | margin: 5px 0px; | 382 | margin: 5px 0px; |
469 | } | 383 | } |
470 | } | 384 | } |
471 | 385 | ||
472 | /** Notes **/ | 386 | /** Notes **/ |
473 | 387 | ||
474 | -#notes-list { | 388 | +#notes-list { |
475 | display:block; | 389 | display:block; |
476 | list-style:none; | 390 | list-style:none; |
477 | margin:0px; | 391 | margin:0px; |
478 | padding:0px; | 392 | padding:0px; |
479 | - | ||
480 | - li { | ||
481 | - display:list-item; | ||
482 | - padding:8px; | ||
483 | - margin:0px; | ||
484 | - background: #F7FBFC; | ||
485 | - border-top: 1px solid #E2EAEE; | ||
486 | - | ||
487 | - &:first-child { | ||
488 | - border-top: none; | ||
489 | - } | ||
490 | - &:nth-child(2n+1) { | ||
491 | - background: white; | ||
492 | - } | ||
493 | - p { | ||
494 | - margin-bottom: 4px; | ||
495 | - font-size: 13px; | ||
496 | - color:#111; | ||
497 | - } | ||
498 | - } | ||
499 | - cite { | ||
500 | - &.ago { | ||
501 | - color:#666; | ||
502 | - } | ||
503 | - } | ||
504 | } | 393 | } |
505 | 394 | ||
506 | -.notes_count { | 395 | +.notes_count { |
507 | background: none repeat scroll 0 0 #FFF6BF; | 396 | background: none repeat scroll 0 0 #FFF6BF; |
508 | border-color: #FFD324; | 397 | border-color: #FFD324; |
509 | color: #514721; | 398 | 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 { | ||
515 | right: 6px; | 404 | right: 6px; |
516 | top: 6px; | 405 | top: 6px; |
517 | } | 406 | } |
518 | -.note_author { | ||
519 | - float:left; | ||
520 | - width:60px; | ||
521 | -} | ||
522 | -.note_content { | ||
523 | - float:left; | ||
524 | - width:650px; | ||
525 | -} | ||
526 | 407 | ||
527 | -.issue_notes { | ||
528 | - .note_content { | 408 | +.issue_notes { |
409 | + .note_content { | ||
529 | float:left; | 410 | float:left; |
530 | width:400px; | 411 | width:400px; |
531 | } | 412 | } |
532 | } | 413 | } |
533 | 414 | ||
534 | #user_projects_limit{ | 415 | #user_projects_limit{ |
535 | - width: 60px; | 416 | + width: 60px; |
536 | } | 417 | } |
537 | 418 | ||
538 | -.project_thumb { | 419 | +.project_thumb { |
539 | margin:20px 0; | 420 | margin:20px 0; |
540 | width: 250px; | 421 | width: 250px; |
541 | float:left; | 422 | float:left; |
542 | padding:20px; | 423 | padding:20px; |
543 | text-align:center; | 424 | text-align:center; |
544 | - p, h4 { | 425 | + p, h4 { |
545 | text-align:left; | 426 | text-align:left; |
546 | } | 427 | } |
547 | - .lbutton { | 428 | + .lbutton { |
548 | float:left; | 429 | float:left; |
549 | } | 430 | } |
550 | } | 431 | } |
@@ -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 { | ||
559 | padding: 10px; | 440 | padding: 10px; |
560 | } | 441 | } |
561 | 442 | ||
562 | -.recent_message_parent { | ||
563 | - img { | 443 | +.recent_message_parent { |
444 | + img { | ||
564 | padding-right:10px; | 445 | padding-right:10px; |
565 | } | 446 | } |
566 | 447 | ||
@@ -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 { | ||
571 | 452 | ||
572 | &.dash_wall{ | 453 | &.dash_wall{ |
573 | border-bottom: 2px solid orange; | 454 | border-bottom: 2px solid orange; |
574 | - span { | 455 | + span { |
575 | background: orange; | 456 | background: orange; |
576 | color:black; | 457 | color:black; |
577 | } | 458 | } |
@@ -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 { | ||
579 | 460 | ||
580 | &.dash_issue{ | 461 | &.dash_issue{ |
581 | border-bottom: 2px solid #ffbbbb; | 462 | border-bottom: 2px solid #ffbbbb; |
582 | - span { | 463 | + span { |
583 | background: #ffbbbb; | 464 | background: #ffbbbb; |
584 | } | 465 | } |
585 | } | 466 | } |
586 | &.dash_commit{ | 467 | &.dash_commit{ |
587 | border-bottom: 2px solid #bbbbff; | 468 | border-bottom: 2px solid #bbbbff; |
588 | 469 | ||
589 | - span{ | 470 | + span{ |
590 | background: #bbbbff; | 471 | background: #bbbbff; |
591 | } | 472 | } |
592 | } | 473 | } |
@@ -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 { | ||
594 | &.dash_snippet{ | 475 | &.dash_snippet{ |
595 | border-bottom: 2px solid #bbffbb; | 476 | border-bottom: 2px solid #bbffbb; |
596 | 477 | ||
597 | - span{ | 478 | + span{ |
598 | background: #bbffbb; | 479 | background: #bbffbb; |
599 | } | 480 | } |
600 | } | 481 | } |
601 | 482 | ||
602 | - | ||
603 | - span{ | 483 | + span{ |
604 | border: 1px solid #aaa; | 484 | border: 1px solid #aaa; |
605 | color:black; | 485 | color:black; |
606 | padding:1px 4px; | 486 | padding:1px 4px; |
607 | } | 487 | } |
608 | 488 | ||
609 | - h4 { | 489 | + h4 { |
610 | margin-bottom:3px; | 490 | margin-bottom:3px; |
611 | } | 491 | } |
612 | 492 | ||
613 | } | 493 | } |
614 | .commit, | 494 | .commit, |
615 | -.message, | ||
616 | -#notes-list{ | ||
617 | - .author { | 495 | +.message{ |
496 | + .author { | ||
618 | background: #eaeaea; | 497 | background: #eaeaea; |
619 | color: #333; | 498 | color: #333; |
620 | border: 1px solid #aaa; | 499 | 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 { | ||
624 | } | 503 | } |
625 | 504 | ||
626 | /* Note textare */ | 505 | /* Note textare */ |
627 | -#note_note { | 506 | +#note_note { |
628 | height:100px; | 507 | height:100px; |
629 | width:97%; | 508 | width:97%; |
630 | font-size:14px; | 509 | font-size:14px; |
631 | } | 510 | } |
632 | 511 | ||
633 | -.wall_page { | ||
634 | - #note_note { | 512 | +#new_note { |
513 | + #note_note { | ||
635 | height:25px; | 514 | height:25px; |
636 | } | 515 | } |
637 | - .attach_holder { | 516 | + .attach_holder { |
638 | display:none; | 517 | display:none; |
639 | } | 518 | } |
640 | } | 519 | } |
@@ -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 { | ||
652 | @include round-borders-all(4px); | 531 | @include round-borders-all(4px); |
653 | padding:2px 4px; | 532 | padding:2px 4px; |
654 | border:none; | 533 | border:none; |
534 | + text-shadow:none; | ||
655 | 535 | ||
656 | - &.high { | 536 | + &.high { |
657 | background: #D12F19; | 537 | background: #D12F19; |
658 | color:white; | 538 | color:white; |
659 | } | 539 | } |
660 | 540 | ||
661 | - &.today { | 541 | + &.today { |
662 | background: #44aa22; | 542 | background: #44aa22; |
663 | color:white; | 543 | color:white; |
664 | } | 544 | } |
665 | 545 | ||
666 | - &.yours { | 546 | + &.yours { |
667 | background: #4466cc; | 547 | background: #4466cc; |
668 | color:white; | 548 | color:white; |
669 | } | 549 | } |
550 | + &.normal { | ||
551 | + background: #2c5ca6; | ||
552 | + color:white; | ||
553 | + } | ||
670 | &.notes { | 554 | &.notes { |
671 | background: #2c5c66; | 555 | background: #2c5c66; |
672 | color:white; | 556 | color:white; |
673 | } | 557 | } |
674 | } | 558 | } |
675 | 559 | ||
676 | -#issues-table .issue { | ||
677 | - &.critical { | 560 | +#issues-table .issue { |
561 | + &.critical { | ||
678 | td { | 562 | td { |
679 | //background: #D12F19; | 563 | //background: #D12F19; |
680 | //color:#fff; | 564 | //color:#fff; |
681 | } | 565 | } |
682 | } | 566 | } |
683 | } | 567 | } |
568 | + | ||
569 | +.top_panel_issues{ | ||
570 | + #issue_search_form { | ||
571 | + margin:5px 0; | ||
572 | + input { | ||
573 | + border:1px solid #D3D3D3; | ||
574 | + padding: 3px; | ||
575 | + height: 28px; | ||
576 | + width: 300px; | ||
577 | + -webkit-appearance:none; | ||
578 | + box-sizing: border-box; | ||
579 | + -moz-box-sizing: border-box; | ||
580 | + | ||
581 | + &:focus { | ||
582 | + border-color:#c2e1ef; | ||
583 | + } | ||
584 | + } | ||
585 | + } | ||
586 | +} | ||
587 | + | ||
588 | +.left { | ||
589 | + float:left; | ||
590 | +} | ||
591 | +.right { | ||
592 | + float:right; | ||
593 | +} | ||
594 | + | ||
595 | +.width-50p{ | ||
596 | + width:50%; | ||
597 | +} | ||
598 | +.width-49p{ | ||
599 | + width:49%; | ||
600 | +} | ||
601 | +.width-30p{ | ||
602 | + width:30%; | ||
603 | +} | ||
604 | +.width-65p{ | ||
605 | + width:65%; | ||
606 | +} | ||
607 | +pre.commit_message { | ||
608 | + white-space: pre-wrap; | ||
609 | +} | ||
610 | + | ||
611 | +#container { | ||
612 | + min-height:100%; | ||
613 | +} | ||
614 | +.ui-selectmenu{ | ||
615 | + @include round-borders-all(4px); | ||
616 | + margin-right:10px; | ||
617 | + font-size:1.5em; | ||
618 | + height:auto; | ||
619 | + font-weight:bold; | ||
620 | + .ui-selectmenu-status { | ||
621 | + padding:3px 10px; | ||
622 | + } | ||
623 | +} | ||
624 | + | ||
625 | +td.code { | ||
626 | + width: 100%; | ||
627 | + .highlight { | ||
628 | + margin-left: 55px; | ||
629 | + overflow:auto; | ||
630 | + overflow-y:hidden; | ||
631 | + } | ||
632 | +} | ||
633 | +.highlight pre { | ||
634 | + white-space: pre; | ||
635 | + word-wrap:normal; | ||
636 | +} | ||
637 | + | ||
638 | +.highlighttable tr:hover { | ||
639 | + background:white; | ||
640 | +} | ||
641 | +table.highlighttable pre{ | ||
642 | + line-height:16px !important; | ||
643 | + font-size:12px !important; | ||
644 | +} | ||
645 | + | ||
646 | +.project-refs-form { | ||
647 | + span { | ||
648 | + background: none !important; | ||
649 | + position:static !important; | ||
650 | + width:auto !important; | ||
651 | + height: auto !important; | ||
652 | + } | ||
653 | +} | ||
654 | + | ||
655 | +.project-refs-select { | ||
656 | + width:200px; | ||
657 | +} | ||
658 | + | ||
659 | +.issues_filter { | ||
660 | + margin-top:10px; | ||
661 | + .left { | ||
662 | + margin-right:15px; | ||
663 | + } | ||
664 | +} | ||
665 | + | ||
666 | +.cgray { color:gray; } | ||
667 | +.cred { color:#D12F19; } | ||
668 | +.cgreen { color:#44aa22; } | ||
669 | + | ||
670 | +body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} | ||
671 | +body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} | ||
672 | +body.project-page #notes-list .note img{float: left; margin-right: 10px;} | ||
673 | +body.project-page #notes-list .note span.note-title{display: block;} | ||
674 | +body.project-page #notes-list .note span.note-title{margin-bottom: 10px} | ||
675 | +body.project-page #notes-list .note span.note-author{color: #999; font-weight: normal; font-style: italic;} | ||
676 | +body.project-page #notes-list .note span.note-author strong{font-weight: bold; font-style: normal;} |
@@ -0,0 +1,661 @@ | @@ -0,0 +1,661 @@ | ||
1 | +/* HTML5 ✰ Boilerplate | ||
2 | + * ==|== normalize ========================================================== | ||
3 | + */ | ||
4 | + | ||
5 | +article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } | ||
6 | +audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } | ||
7 | +audio:not([controls]) { display: none; } | ||
8 | +[hidden] { display: none; } | ||
9 | + | ||
10 | +html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } | ||
11 | +body { margin: 0; font-size: 13px; line-height: 1.231; } | ||
12 | +body, button, input, select, textarea { font-family: sans-serif; color: #222; } | ||
13 | + | ||
14 | +::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; } | ||
15 | +::selection { background: #fe57a1; color: #fff; text-shadow: none; } | ||
16 | + | ||
17 | +a { color: #00e; } | ||
18 | +a:hover { color: #06e; } | ||
19 | +a:focus { outline: thin dotted; } | ||
20 | +a:hover, a:active { outline: 0; } | ||
21 | + | ||
22 | +abbr[title] { border-bottom: 1px dotted; } | ||
23 | +b, strong { font-weight: bold; } | ||
24 | +blockquote { margin: 1em 40px; } | ||
25 | +dfn { font-style: italic; } | ||
26 | +hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } | ||
27 | +ins { background: #ff9; color: #000; text-decoration: none; } | ||
28 | +mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } | ||
29 | +pre, code, kbd, samp { font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 1em; } | ||
30 | +pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } | ||
31 | +q { quotes: none; } | ||
32 | +q:before, q:after { content: ""; content: none; } | ||
33 | +small { font-size: 85%; } | ||
34 | +sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } | ||
35 | +sup { top: -0.5em; } | ||
36 | +sub { bottom: -0.25em; } | ||
37 | +ul, ol { margin: 1em 0; padding: 0 0 0 40px; } | ||
38 | +dd { margin: 0 0 0 40px; } | ||
39 | +nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; } | ||
40 | +img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } | ||
41 | +svg:not(:root) { overflow: hidden; } | ||
42 | +figure { margin: 0; } | ||
43 | + | ||
44 | +form { margin: 0; } | ||
45 | +fieldset { border: 0; margin: 0; padding: 0; } | ||
46 | +label { cursor: pointer; } | ||
47 | +legend { border: 0; *margin-left: -7px; padding: 0; } | ||
48 | +button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; } | ||
49 | +button, input { line-height: normal; *overflow: visible; } | ||
50 | +table button, table input { *overflow: auto; } | ||
51 | +button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; } | ||
52 | +input[type="checkbox"], input[type="radio"] { box-sizing: border-box; } | ||
53 | +input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } | ||
54 | +input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } | ||
55 | +button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } | ||
56 | +textarea { overflow: auto; vertical-align: top; resize: vertical; } | ||
57 | +input:valid, textarea:valid { } | ||
58 | +input:invalid, textarea:invalid { background-color: #f0dddd; } | ||
59 | + | ||
60 | +table { border-collapse: collapse; border-spacing: 0; } | ||
61 | +td { vertical-align: top; } | ||
62 | + | ||
63 | + | ||
64 | +/* ==|== primary styles ===================================================== | ||
65 | + Author: Ricardo Rauch | ||
66 | + ========================================================================== */ | ||
67 | + | ||
68 | +/* 960gs */ | ||
69 | +.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} | ||
70 | +/* eo 960gs*/ | ||
71 | + | ||
72 | +/* Vars */ | ||
73 | +$color: "#4BB8D2"; | ||
74 | +$blue_link: "#2fa0bb"; | ||
75 | +/* eo Vars */ | ||
76 | + | ||
77 | +html{ -webkit-font-smoothing:antialiased; } | ||
78 | +*{text-shadow: 0 1px 0 white} | ||
79 | +body{font-size: 12px; background-color: #eee;} | ||
80 | +a{text-decoration: none; font-weight: bold; color: #666} | ||
81 | +a:hover{color: #333} | ||
82 | +/* Typography */ | ||
83 | +h1,h2,h3,h4,h5{font-weight: normal; color: #666} | ||
84 | +h2{margin: 1.5em 0} | ||
85 | +/* eo Typography */ | ||
86 | + | ||
87 | +/* Forms */ | ||
88 | +input[type="text"]:focus, input[type="password"]:focus { outline: none; } | ||
89 | +input.text{border: 1px solid #ccc; border-radius: 4px; display: block; padding: 10px} | ||
90 | +/* eo Forms */ | ||
91 | + | ||
92 | +/* Tables */ | ||
93 | +table {width:100%; border: 1px solid #DEE2E3} | ||
94 | +table thead{ | ||
95 | + -webkit-border-top-left-radius: 5px; | ||
96 | + -webkit-border-top-right-radius: 5px; | ||
97 | + -moz-border-radius-topleft: 5px; | ||
98 | + -moz-border-radius-topright: 5px; | ||
99 | + border-top-left-radius: 5px; | ||
100 | + border-top-right-radius: 5px; | ||
101 | +} | ||
102 | +table thead th{ | ||
103 | + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); | ||
104 | + background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
105 | + background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
106 | + background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
107 | + margin: 0; | ||
108 | + font-weight: normal; | ||
109 | + font-weight: bold; | ||
110 | + text-align: left; | ||
111 | + color: #97A0A5; | ||
112 | +} | ||
113 | +td, th{ padding: .9em 1em; vertical-align: middle; } | ||
114 | + | ||
115 | +table thead .image{width:100px} | ||
116 | +table tr:hover, .listed_items tr.odd:hover{background-color:#FFFFCF} | ||
117 | +/* eo Tables */ | ||
118 | + | ||
119 | + | ||
120 | +/* Buttons */ | ||
121 | +.grey-button{ | ||
122 | + border-radius: 5px; | ||
123 | + font-size: 12px; | ||
124 | + font-weight: bold; | ||
125 | + padding: 6px 20px; | ||
126 | + border: 1px solid #999; | ||
127 | + color: #666; | ||
128 | + display: inline-block; | ||
129 | + box-shadow: 0 1px 2px rgba(0,0,0,.3); | ||
130 | + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #f7f7f7), to(#d5d5d5)); | ||
131 | + background-image: -webkit-linear-gradient(#f7f7f7 7.6%, #d5d5d5); | ||
132 | + background-image: -moz-linear-gradient(#f7f7f7 7.6%, #d5d5d5); | ||
133 | + background-image: -o-linear-gradient(#f7f7f7 7.6%, #d5d5d5); | ||
134 | +} | ||
135 | + | ||
136 | +.button{ | ||
137 | + padding: 10px 20px; | ||
138 | + text-align: center; | ||
139 | + display: inline-block; | ||
140 | + border-radius: 5px; | ||
141 | + color: #578E91; | ||
142 | + font-size: 12px; | ||
143 | + text-transform: uppercase; | ||
144 | + border: 1px solid #8CE2E6; | ||
145 | + background-image: -webkit-gradient(linear, 0 0, 0 34, color-stop(0.794, #dbf5f6), to(#c5eef0)); | ||
146 | + background-image: -webkit-linear-gradient(#dbf5f6 79.4%, #c5eef0); | ||
147 | + background-image: -moz-linear-gradient(#dbf5f6 79.4%, #c5eef0); | ||
148 | + background-image: -o-linear-gradient(#dbf5f6 79.4%, #c5eef0); | ||
149 | +} | ||
150 | + | ||
151 | +.button:hover {color: rgba(0,0,0,.8)} | ||
152 | + | ||
153 | +.button.green {margin-right: 0; } | ||
154 | + | ||
155 | +.button.yellow{ | ||
156 | + color: #908054; | ||
157 | + border-color: #DDCDA1; | ||
158 | + background-image: -webkit-gradient(linear, 0 0, 0 34, color-stop(0.794, #FFEFC3), to(#F3E3B7)); | ||
159 | + background-image: -webkit-linear-gradient(#FFEFC3 79.4%, #F3E3B7); | ||
160 | + background-image: -moz-linear-gradient(#FFEFC3 79.4%, #F3E3B7); | ||
161 | + background-image: -o-linear-gradient(#FFEFC3 79.4%, #F3E3B7); | ||
162 | +} | ||
163 | + | ||
164 | +.button.blue{ | ||
165 | + color: #417E97; | ||
166 | + border-color: #b2cdec; | ||
167 | + background-image: -webkit-gradient(linear, 0 0, 0 34, color-stop(0.794, #dbe8f6), to(#c7daf1)); | ||
168 | + background-image: -webkit-linear-gradient(#dbe8f6 79.4%, #c7daf1); | ||
169 | + background-image: -moz-linear-gradient(#dbe8f6 79.4%, #c7daf1); | ||
170 | + background-image: -o-linear-gradient(#dbe8f6 79.4%, #c7daf1); | ||
171 | +} | ||
172 | + | ||
173 | +.button-small{ text-shadow: none; padding: 4px 10px; } | ||
174 | +.button-green{background: #A6B807; color: white} | ||
175 | + | ||
176 | +/* eo Buttons */ | ||
177 | + | ||
178 | +/* UI Box */ | ||
179 | +.ui-box{border: 1px solid #DEDFE1; float: left; border-radius: 5px} | ||
180 | +.ui-box h3{ | ||
181 | + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); | ||
182 | + background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
183 | + background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
184 | + background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
185 | + margin: 0; | ||
186 | + padding: 1em; | ||
187 | + font-size: 12px; | ||
188 | + font-weight: normal; | ||
189 | + font-weight: bold; | ||
190 | + font-size: 16px; | ||
191 | + border-bottom: 1px solid #DEDFE1; | ||
192 | + -webkit-border-top-left-radius: 5px; | ||
193 | + -webkit-border-top-right-radius: 5px; | ||
194 | + -moz-border-radius-topleft: 5px; | ||
195 | + -moz-border-radius-topright: 5px; | ||
196 | + border-top-left-radius: 5px; | ||
197 | + border-top-right-radius: 5px; | ||
198 | +} | ||
199 | + | ||
200 | +.ui-box.ui-box-small h3{ | ||
201 | + padding: 8px 10px; | ||
202 | + font-size: 12px; | ||
203 | +} | ||
204 | + | ||
205 | + | ||
206 | +.ui-box .data{padding: .5em 1em} | ||
207 | + | ||
208 | +.ui-box .buttons{background-color: #f7f8f9; padding: 1em; | ||
209 | + -webkit-border-bottom-right-radius: 5px; | ||
210 | + -webkit-border-bottom-left-radius: 5px; | ||
211 | + -moz-border-radius-bottomright: 5px; | ||
212 | + -moz-border-radius-bottomleft: 5px; | ||
213 | + border-bottom-right-radius: 5px; | ||
214 | + border-bottom-left-radius: 5px; | ||
215 | +} | ||
216 | + | ||
217 | +.ui-box .buttons .button{padding: 8px 9px; font-size: 11px} | ||
218 | + | ||
219 | +.ui-box.hover:hover{box-shadow: 0 0 10px rgba(0,0,0,.1); border: 1px solid #ccc; | ||
220 | + | ||
221 | + -webkit-transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715); | ||
222 | + -moz-transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715); | ||
223 | + -o-transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715); | ||
224 | + transition: all 200ms cubic-bezier(0.470, 0.000, 0.745, 0.715); | ||
225 | +} | ||
226 | + | ||
227 | +/* eo UI Box */ | ||
228 | + | ||
229 | +/* Login Page */ | ||
230 | +body.login-page{background-color: #f1f1f1; padding-top: 10%} | ||
231 | + | ||
232 | +.login-box{ | ||
233 | + width: 304px; | ||
234 | + position: relative; | ||
235 | + border-radius: 5px; | ||
236 | + margin: auto; | ||
237 | + padding: 20px; | ||
238 | + background: white; | ||
239 | + 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; | ||
240 | +} | ||
241 | + | ||
242 | +.login-box .login-logo{ | ||
243 | + margin: 10px 0 30px 0; | ||
244 | + display: block; | ||
245 | +} | ||
246 | + | ||
247 | +.login-box input.text{background-color: #f1f1f1; font-size: 16px; border-radius: 0; padding: 14px 10px; width: 280px} | ||
248 | + | ||
249 | +.login-box input.text.top{ | ||
250 | + -webkit-border-top-left-radius: 5px; | ||
251 | + -webkit-border-top-right-radius: 5px; | ||
252 | + -moz-border-radius-topleft: 5px; | ||
253 | + -moz-border-radius-topright: 5px; | ||
254 | + border-top-left-radius: 5px; | ||
255 | + border-top-right-radius: 5px; | ||
256 | +} | ||
257 | + | ||
258 | +.login-box input.text.bottom{ | ||
259 | + -webkit-border-bottom-right-radius: 5px; | ||
260 | + -webkit-border-bottom-left-radius: 5px; | ||
261 | + -moz-border-radius-bottomright: 5px; | ||
262 | + -moz-border-radius-bottomleft: 5px; | ||
263 | + border-bottom-right-radius: 5px; | ||
264 | + border-bottom-left-radius: 5px; | ||
265 | + border-top: 0; | ||
266 | + margin-bottom: 20px; | ||
267 | +} | ||
268 | + | ||
269 | +.login-box a.forgot{float: right; padding-top: 6px} | ||
270 | + | ||
271 | + | ||
272 | +/* Icons */ | ||
273 | +.directory, .file{ | ||
274 | + display: inline-block; | ||
275 | + margin-right: 10px; | ||
276 | + width: 14px; | ||
277 | +} | ||
278 | + | ||
279 | +.directory{ | ||
280 | + background: url('images.png') no-repeat -73px -26px; | ||
281 | + height: 11px; | ||
282 | + margin-bottom: -1px; | ||
283 | +} | ||
284 | + | ||
285 | +.file{ | ||
286 | + background: url('images.png') no-repeat -114px -24px; | ||
287 | + height: 16px; | ||
288 | + margin-bottom: -3px; | ||
289 | +} | ||
290 | + | ||
291 | +/* eo Icons*/ | ||
292 | + | ||
293 | +/* General */ | ||
294 | +#container{background-color: white; overflow: hidden;} | ||
295 | +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)} | ||
296 | + | ||
297 | + | ||
298 | + | ||
299 | +/* Header */ | ||
300 | +header{background: #474D57 url('bg-header.png') repeat-x bottom; z-index: 10000; height: 44px; padding: 10px 2% 6px 2%} | ||
301 | +header a{color: white; text-shadow: 0 -1px 0 black} | ||
302 | +header a:hover{color: #f1f1f1} | ||
303 | +header h1{ | ||
304 | + width: 65px; | ||
305 | +} | ||
306 | +header h1.logo{margin: 0; padding: 0} | ||
307 | +header h1.logo a{ | ||
308 | + background: url('images.png') no-repeat -3px -7px; | ||
309 | + width: 65px; | ||
310 | + height: 26px; | ||
311 | + margin: 5px 0; | ||
312 | + padding: 0; | ||
313 | + display: block; | ||
314 | + float: left; | ||
315 | + text-indent: -1000em; | ||
316 | +} | ||
317 | + | ||
318 | + | ||
319 | + | ||
320 | +header nav{border-radius: 4px; box-shadow: 0 1px 2px black; width: 294px; margin: auto; | ||
321 | + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595d63), to(#31363e)); | ||
322 | + background-image: -webkit-linear-gradient(#595d63 6.6%, #31363e); | ||
323 | + background-image: -moz-linear-gradient(#595d63 6.6%, #31363e); | ||
324 | + background-image: -o-linear-gradient(#595d63 6.6%, #31363e); | ||
325 | + margin-top: 2px; | ||
326 | + height:30px | ||
327 | +} | ||
328 | +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} | ||
329 | +header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 6px;} | ||
330 | +header nav a:last-child {border: 0; box-shadow: none} | ||
331 | +header nav a:hover, header nav a.current{ | ||
332 | + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595d63), to(#2c2f35)); | ||
333 | + background-image: -webkit-linear-gradient(#595d63 6.6%, #2c2f35); | ||
334 | + background-image: -moz-linear-gradient(#595d63 6.6%, #202227); | ||
335 | + background-image: -o-linear-gradient(#595d63 6.6%, #202227); | ||
336 | +} | ||
337 | + | ||
338 | +header nav a:active{ | ||
339 | + box-shadow: 0 1px 4px rgba(0,0,0,.8) inset; | ||
340 | +} | ||
341 | + | ||
342 | + | ||
343 | +header nav a.dashboard { | ||
344 | + -webkit-border-top-left-radius: 4px; | ||
345 | + -webkit-border-bottom-left-radius: 4px; | ||
346 | + -moz-border-radius-topleft: 4px; | ||
347 | + -moz-border-radius-bottomleft: 4px; | ||
348 | + border-top-left-radius: 4px; | ||
349 | + border-bottom-left-radius: 4px; | ||
350 | +} | ||
351 | + | ||
352 | +header nav a.admin{ | ||
353 | + -webkit-border-top-right-radius: 4px; | ||
354 | + -webkit-border-bottom-right-radius: 4px; | ||
355 | + -moz-border-radius-topright: 4px; | ||
356 | + -moz-border-radius-bottomright: 4px; | ||
357 | + border-top-right-radius: 4px; | ||
358 | + border-bottom-right-radius: 4px; | ||
359 | +} | ||
360 | + | ||
361 | + | ||
362 | +header .search{ display: inline-block; float: right; margin-right: 10px} | ||
363 | + | ||
364 | +header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 6px;} | ||
365 | + | ||
366 | +header nav a.dashboard span{background: url('images.png') no-repeat -161px 0;} | ||
367 | +header nav a.admin span{background: url('images.png') no-repeat -184px 0;} | ||
368 | +header nav a.project span{background: url('images.png') no-repeat -209px -1px; top: 7px} | ||
369 | +/* | ||
370 | + | ||
371 | +header nav a span{width: 20px; height: 20px; display: inline-block; background: red; position: absolute; left: 8px; top: 14px;} | ||
372 | + | ||
373 | +header nav a.dashboard.current span{ background-position: -163px -22px; } | ||
374 | +header nav a.admin.current span{ background-position: -186px -22px;} | ||
375 | +header nav a.project.current span{ background-position: -211px -23px;} | ||
376 | + | ||
377 | +header nav a.project span{background: url('images.png') no-repeat -209px -1px; top: 15px} | ||
378 | + | ||
379 | + | ||
380 | +header nav a span.current{top: 18px} | ||
381 | + | ||
382 | + | ||
383 | +header nav {margin-left: 180px; display: inline-block; float: left;} | ||
384 | +header nav a{float: left; background: #31363e; padding: 16px 20px 20px 34px; margin-right: 10px; | ||
385 | + -webkit-border-top-left-radius: 5px; | ||
386 | + -webkit-border-top-right-radius: 5px; | ||
387 | + -moz-border-radius-topleft: 5px; | ||
388 | + -moz-border-radius-topright: 5px; | ||
389 | + border-top-left-radius: 5px; | ||
390 | + border-top-right-radius: 5px; | ||
391 | + position: relative; | ||
392 | +} | ||
393 | + | ||
394 | +header nav a.current{background: white; color: #333; text-shadow: none;} | ||
395 | +*/ | ||
396 | + | ||
397 | +header .login-top{float: right; width: 180px; | ||
398 | + background-image: -webkit-gradient(linear, 0 0, 0 62, color-stop(0.032, #464c56), to(#363c45)); | ||
399 | + background-image: -webkit-linear-gradient(#464c56 3.2%, #363c45); | ||
400 | + background-image: -moz-linear-gradient(#464c56 3.2%, #363c45); | ||
401 | + background-image: -o-linear-gradient(#464c56 3.2%, #363c45); | ||
402 | + padding: 0 10px; | ||
403 | + height: 44px; | ||
404 | +} | ||
405 | +header .login-top a{display: block;} | ||
406 | +header .login-top a.pic{float: left; margin-right: 10px; | ||
407 | + img{ height: 36px; width: 36px; border: 1px solid black} | ||
408 | +} | ||
409 | +header .login-top a.username{margin-bottom: 5px} | ||
410 | +header .login-top a.logout{color: #ccc} | ||
411 | +header{margin-bottom: 0; clear: both; } | ||
412 | + | ||
413 | +.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} | ||
414 | +.page-title h1{font-size: 20px; width: 400px; margin: 0; padding-top: 8px } | ||
415 | +.page-title a.grey-button{float: right;} | ||
416 | +.right{float: right;} | ||
417 | + | ||
418 | +/* Account box */ | ||
419 | +header .account-box{position: relative;z-index: 10000; top: -3px; width: 38px; height: 38px; font-size: 11px; float: right; display: block; cursor: pointer; } | ||
420 | +header .account-box img{ border-radius: 4px; width: 38px; height: 38px; display: block; box-shadow: 0 1px 2px black} | ||
421 | +header .account-box:after{ | ||
422 | + content: " "; | ||
423 | + display: block; | ||
424 | + position: absolute; | ||
425 | + top: 0; | ||
426 | + right: 0; | ||
427 | +left: 0; | ||
428 | + bottom: 0; | ||
429 | +float: right; | ||
430 | + border-radius: 5px; | ||
431 | + border: 1px solid rgba(255, 255, 255, .1); | ||
432 | + border-bottom: 0; | ||
433 | + 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))); | ||
434 | + 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)); | ||
435 | + 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)); | ||
436 | + -webkit-background-origin: border-box; | ||
437 | + -moz-background-origin: border; | ||
438 | + background-origin: border-box; | ||
439 | +} | ||
440 | + | ||
441 | +.account-box:hover > .account-links, .account-box:hover > .arrow-up{display: block;} | ||
442 | +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); } | ||
443 | +header .account-links a{color: #666; padding: 6px 10px; display: block; text-shadow: none; border-bottom: 1px solid #eee} | ||
444 | +header .account-links a:hover{background-color: #f1f1f1; text-shadow: none; color: #333} | ||
445 | + | ||
446 | +header .account-links a:first-child{ | ||
447 | + -webkit-border-top-left-radius: 5px; | ||
448 | + -webkit-border-top-right-radius: 5px; | ||
449 | + -moz-border-radius-topleft: 5px; | ||
450 | + -moz-border-radius-topright: 5px; | ||
451 | + border-top-left-radius: 5px; | ||
452 | + border-top-right-radius: 5px; | ||
453 | +} | ||
454 | + | ||
455 | +header .account-links a:last-child{ | ||
456 | + -webkit-border-bottom-right-radius: 5px; | ||
457 | + -webkit-border-bottom-left-radius: 5px; | ||
458 | + -moz-border-radius-bottomright: 5px; | ||
459 | + -moz-border-radius-bottomleft: 5px; | ||
460 | + border-bottom-right-radius: 5px; | ||
461 | + border-bottom-left-radius: 5px; | ||
462 | + border-bottom: 0; | ||
463 | +} | ||
464 | + | ||
465 | +header a.arrow-up{ | ||
466 | + display: none; | ||
467 | + width: 0; | ||
468 | + height: 0; | ||
469 | + float: right; | ||
470 | + margin-right: 26px; | ||
471 | + margin-bottom: 0; | ||
472 | + border-left: 5px solid transparent; | ||
473 | + border-right: 5px solid transparent; | ||
474 | + | ||
475 | + border-bottom: 5px solid white; | ||
476 | +} | ||
477 | +/* eo Account Box */ | ||
478 | +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 } | ||
479 | +input.search-input:focus{ background-color: white; width: 216px;} | ||
480 | +input.search-input::-webkit-input-placeholder {color: #666} | ||
481 | +/* eo Header */ | ||
482 | + | ||
483 | + | ||
484 | +h2.icon{position: relative; padding-left: 40px; float: left; } | ||
485 | +/*h2 a{font-weight: normal;}*/ | ||
486 | +h2.icon span{background: #E3E5EA url('images.png'); height: 32px; width: 32px; left: 0; top: -5px; border-radius: 4px; display: inline-block; position: absolute} | ||
487 | + | ||
488 | + | ||
489 | + | ||
490 | +/* Dashboard Page */ | ||
491 | +html, body { height: 100%; } | ||
492 | + | ||
493 | +body.dashboard-page h2.icon span{ background-position: 9px -69px; } | ||
494 | +body.dashboard-page header{margin-bottom: 0} | ||
495 | +body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; margin-left: 1%} | ||
496 | +body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; } | ||
497 | +body.dashboard-page .news-feed h2{float: left;} | ||
498 | +body.dashboard-page aside{ width: 420px; float: right; right: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; border-left: 1px solid #ccc } | ||
499 | +body.dashboard-page aside h4{margin: 0; border-bottom: 1px solid #ccc; padding: 10px 10px; font-size: 11px; font-weight: bold; text-transform: uppercase;} | ||
500 | +body.dashboard-page aside h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 4%; margin-top: -4px; display: block;} | ||
501 | +body.dashboard-page aside .project-list {list-style: none; margin: 0; padding: 0;} | ||
502 | +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;} | ||
503 | +body.dashboard-page aside .project-list li a:hover {background: #f1f1f1} | ||
504 | +body.dashboard-page aside .project-list li a:hover span.arrow{background-color: #E3E5EA;} | ||
505 | +body.dashboard-page aside .project-list li a span.project-name{font-size: 14px; display: block; margin-bottom: 8px} | ||
506 | +body.dashboard-page aside .project-list li a span.time{color: #666; font-weight: normal; font-size: 11px} | ||
507 | +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} | ||
508 | +body.dashboard-page .news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;} | ||
509 | +body.dashboard-page .news-feed .project-updates .data{ padding: 0} | ||
510 | +body.dashboard-page .news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} | ||
511 | +body.dashboard-page .news-feed .project-updates a.project-update:last-child{border-bottom: 0} | ||
512 | +body.dashboard-page .news-feed .project-updates a.project-update img{float: left; margin-right: 10px;} | ||
513 | +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;} | ||
514 | +body.dashboard-page .news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px} | ||
515 | +body.dashboard-page .news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;} | ||
516 | +body.dashboard-page .news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;} | ||
517 | +/* eo Dashboard Page */ | ||
518 | + | ||
519 | + | ||
520 | +.grey-button.right{margin-top: 20px} | ||
521 | + | ||
522 | +/* Project Page */ | ||
523 | + | ||
524 | +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;} | ||
525 | +body.project-page h2.icon .project-name i.arrow{float: right; | ||
526 | + position: absolute; | ||
527 | + right: 10px; | ||
528 | + top: 13px; | ||
529 | + display: block; | ||
530 | + background: url('images.png') no-repeat -97px -29px; | ||
531 | + width: 4px; | ||
532 | + height: 5px; | ||
533 | +} | ||
534 | + | ||
535 | + | ||
536 | + | ||
537 | +body.project-page h2.icon span{ background-position: -78px -68px; } | ||
538 | +body.project-page .project-container{ position: relative; float: left; width: 100%; height: 100%; } | ||
539 | +body.project-page .page-title{margin-bottom: 0} | ||
540 | +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; } | ||
541 | +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;} | ||
542 | +body.project-page .project-sidebar aside{width: 219px} | ||
543 | +body.project-page .project-sidebar aside a{display: block; position: relative; background: white; padding: 15px 10px; border-bottom: 1px solid #eee} | ||
544 | +body.project-page .project-sidebar aside a:first-child{ | ||
545 | + -webkit-border-top-left-radius: 5px; | ||
546 | + -moz-border-radius-topleft: 5px; | ||
547 | + border-top-left-radius: 5px; | ||
548 | +} | ||
549 | +.project-page .project-sidebar aside a:last-child{ | ||
550 | + -webkit-border-bottom-left-radius: 5px; | ||
551 | + -moz-border-radius-bottomleft: 5px; | ||
552 | + border-bottom-left-radius: 5px; | ||
553 | +} | ||
554 | +body.project-page .project-sidebar aside a:hover{background-color: #eee;} | ||
555 | +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} | ||
556 | +body.project-page .project-sidebar aside a.current{background-color: #79c3e0; color: white; text-shadow: none; border-color: transparent} | ||
557 | +body.project-page .project-content{ padding: 20px; display: block; margin-left: 250px } | ||
558 | +body.project-page .project-content h2{ margin-top: 6px} | ||
559 | +body.project-page .project-content .button.right{margin-left: 20px} | ||
560 | +body.project-page table .commit a{color: #{$blue_link}} | ||
561 | +body.project-page table th, body.project-page table td{ border-bottom: 1px solid #DEE2E3;} | ||
562 | +body.project-page .fixed{position: fixed; } | ||
563 | + | ||
564 | +/* Commit Page */ | ||
565 | +body.project-page.commits-page .commit-info{float: right;} | ||
566 | +body.project-page.commits-page .commit-info data{ | ||
567 | + padding: 4px 10px; | ||
568 | + font-size: 11px; | ||
569 | +} | ||
570 | +body.project-page.commits-page .commit-info data.commit-button{ | ||
571 | + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4)); | ||
572 | + background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4); | ||
573 | + background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4); | ||
574 | + background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4); | ||
575 | + box-shadow: 0 -1px 0 white inset; | ||
576 | + display: block; | ||
577 | + border: 1px solid #eee; | ||
578 | + border-radius: 5px; | ||
579 | + margin-bottom: 2px; | ||
580 | + position: relative; | ||
581 | + padding-right: 20px; | ||
582 | +} | ||
583 | + | ||
584 | + | ||
585 | +body.project-page.commits-page .commit-button i{ | ||
586 | + background: url('images.png') no-repeat -138px -27px; | ||
587 | + width: 6px; | ||
588 | + height: 9px; | ||
589 | + float: right; | ||
590 | + position: absolute; | ||
591 | + top: 6px; | ||
592 | + right: 5px; | ||
593 | +} | ||
594 | +body.project-page.commits-page .commits-date {display: block; width: 100%; margin-bottom: 20px} | ||
595 | +body.project-page.commits-page .commits-date .data {padding: 0} | ||
596 | +body.project-page.commits-page a.commit{padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} | ||
597 | +body.project-page.commits-page .commits-date a.commit {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} | ||
598 | +body.project-page.commits-page .commits-date a.commit:last-child{border-bottom: 0} | ||
599 | +body.project-page.commits-page .commits-date a.commit img{float: left; margin-right: 10px;} | ||
600 | +body.project-page.commits-page .commits-date a.commit span.commit-title{display: block;} | ||
601 | +body.project-page.commits-page .commits-date a.commit span.commit-title{margin-bottom: 10px} | ||
602 | +body.project-page.commits-page .commits-date a.commit span.commit-author{color: #999; font-weight: normal; font-style: italic;} | ||
603 | +body.project-page.commits-page .commits-date a.commit span.commit-author strong{font-weight: bold; font-style: normal;} | ||
604 | + | ||
605 | +/* eo Commit Page */ | ||
606 | + | ||
607 | +/* eo Project Page */ | ||
608 | + | ||
609 | + | ||
610 | + | ||
611 | + | ||
612 | +/* Projects Page */ | ||
613 | +body.projects-page h2.icon span{background-position: -31px -70px;} | ||
614 | +body.projects-page .project-box.ui-box .data .repository {margin-bottom: 20px} | ||
615 | +body.projects-page .project-box.ui-box .data .title span{ font-weight: bold;} | ||
616 | +body.projects-page .project-box{width: 100%; margin-bottom: 3em} | ||
617 | +body.projects-page .browse-code{margin-right: 10px} | ||
618 | +/* eo Projects Page */ | ||
619 | + | ||
620 | + | ||
621 | +/* ==|== non-semantic helper classes ======================================== */ | ||
622 | +.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; } | ||
623 | +.ir br { display: none; } | ||
624 | +.hidden { display: none !important; visibility: hidden; } | ||
625 | +.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } | ||
626 | +.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } | ||
627 | +.invisible { visibility: hidden; } | ||
628 | +.clearfix:before, .clearfix:after { content: ""; display: table; } | ||
629 | +.clearfix:after { clear: both; } | ||
630 | +.clearfix { zoom: 1; } | ||
631 | + | ||
632 | + | ||
633 | +/* ==|== media queries ====================================================== */ | ||
634 | + | ||
635 | +@media only screen and (min-width: 480px) { | ||
636 | + | ||
637 | + | ||
638 | +} | ||
639 | + | ||
640 | +@media only screen and (min-width: 768px) { | ||
641 | + | ||
642 | +} | ||
643 | + | ||
644 | + | ||
645 | + | ||
646 | +/* ==|== print styles ======================================================= */ | ||
647 | + | ||
648 | +@media print { | ||
649 | + * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } | ||
650 | + a, a:visited { text-decoration: underline; } | ||
651 | + a[href]:after { content: " (" attr(href) ")"; } | ||
652 | + abbr[title]:after { content: " (" attr(title) ")"; } | ||
653 | + .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } | ||
654 | + pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } | ||
655 | + thead { display: table-header-group; } | ||
656 | + tr, img { page-break-inside: avoid; } | ||
657 | + img { max-width: 100% !important; } | ||
658 | + @page { margin: 0.5cm; } | ||
659 | + p, h2, h3 { orphans: 3; widows: 3; } | ||
660 | + h2, h3 { page-break-after: avoid; } | ||
661 | +} |
@@ -0,0 +1,30 @@ | @@ -0,0 +1,30 @@ | ||
1 | +.tags-list { | ||
2 | + padding : 0px 10px 10px 10px; | ||
3 | + | ||
4 | +} | ||
5 | + | ||
6 | +.tags-list a { | ||
7 | + display: inline-block; | ||
8 | + padding: 8px 11px 8px 11px; | ||
9 | + margin: 1px 5px 0px 0px; | ||
10 | + border-radius: 4px; | ||
11 | + border: 1px solid #72bbdf; | ||
12 | + background-color: #72bbdf; | ||
13 | + color: #0f326d; | ||
14 | + font-weight: bold; | ||
15 | + font-size: 14px; | ||
16 | +} | ||
17 | + | ||
18 | + | ||
19 | +.small-tags a{ | ||
20 | + font-size: 9px; | ||
21 | + | ||
22 | + display: inline-block; | ||
23 | + padding: 2px 3px 1px 3px; | ||
24 | + margin: 0px 3px 0px 0px; | ||
25 | + border-radius: 2px; | ||
26 | + background-color: #72bbdf; | ||
27 | + color: #FFF; | ||
28 | + text-shadow: none; | ||
29 | + font-weight: bold; | ||
30 | +} | ||
0 | \ No newline at end of file | 31 | \ No newline at end of file |
app/controllers/admin/mailer_controller.rb
1 | class Admin::MailerController < ApplicationController | 1 | class Admin::MailerController < ApplicationController |
2 | + layout "admin" | ||
2 | before_filter :authenticate_user! | 3 | before_filter :authenticate_user! |
3 | before_filter :authenticate_admin! | 4 | before_filter :authenticate_admin! |
4 | 5 | ||
@@ -20,7 +21,7 @@ class Admin::MailerController < ApplicationController | @@ -20,7 +21,7 @@ class Admin::MailerController < ApplicationController | ||
20 | else | 21 | else |
21 | render :file => 'notify/note_wall_email.html.haml', :layout => 'notify' | 22 | render :file => 'notify/note_wall_email.html.haml', :layout => 'notify' |
22 | end | 23 | end |
23 | - rescue | 24 | + rescue |
24 | render :text => "Preview not avaialble" | 25 | render :text => "Preview not avaialble" |
25 | end | 26 | end |
26 | 27 | ||
@@ -29,7 +30,7 @@ class Admin::MailerController < ApplicationController | @@ -29,7 +30,7 @@ class Admin::MailerController < ApplicationController | ||
29 | @password = "DHasJKDHAS!" | 30 | @password = "DHasJKDHAS!" |
30 | 31 | ||
31 | render :file => 'notify/new_user_email.html.haml', :layout => 'notify' | 32 | render :file => 'notify/new_user_email.html.haml', :layout => 'notify' |
32 | - rescue | 33 | + rescue |
33 | render :text => "Preview not avaialble" | 34 | render :text => "Preview not avaialble" |
34 | end | 35 | end |
35 | 36 | ||
@@ -38,7 +39,7 @@ class Admin::MailerController < ApplicationController | @@ -38,7 +39,7 @@ class Admin::MailerController < ApplicationController | ||
38 | @user = @issue.assignee | 39 | @user = @issue.assignee |
39 | @project = @issue.project | 40 | @project = @issue.project |
40 | render :file => 'notify/new_issue_email.html.haml', :layout => 'notify' | 41 | render :file => 'notify/new_issue_email.html.haml', :layout => 'notify' |
41 | - rescue | 42 | + rescue |
42 | render :text => "Preview not avaialble" | 43 | render :text => "Preview not avaialble" |
43 | end | 44 | end |
44 | end | 45 | end |
app/controllers/admin/projects_controller.rb
1 | class Admin::ProjectsController < ApplicationController | 1 | class Admin::ProjectsController < ApplicationController |
2 | + layout "admin" | ||
2 | before_filter :authenticate_user! | 3 | before_filter :authenticate_user! |
3 | before_filter :authenticate_admin! | 4 | before_filter :authenticate_admin! |
4 | 5 | ||
5 | def index | 6 | def index |
6 | @admin_projects = Project.page(params[:page]) | 7 | @admin_projects = Project.page(params[:page]) |
7 | - | ||
8 | - respond_to do |format| | ||
9 | - format.html # index.html.erb | ||
10 | - format.json { render json: @admin_projects } | ||
11 | - end | ||
12 | end | 8 | end |
13 | 9 | ||
14 | def show | 10 | def show |
15 | @admin_project = Project.find_by_code(params[:id]) | 11 | @admin_project = Project.find_by_code(params[:id]) |
16 | - | ||
17 | - respond_to do |format| | ||
18 | - format.html # show.html.erb | ||
19 | - format.json { render json: @admin_project } | ||
20 | - end | ||
21 | end | 12 | end |
22 | 13 | ||
23 | def new | 14 | def new |
24 | @admin_project = Project.new | 15 | @admin_project = Project.new |
25 | - | ||
26 | - respond_to do |format| | ||
27 | - format.html # new.html.erb | ||
28 | - format.json { render json: @admin_project } | ||
29 | - end | ||
30 | end | 16 | end |
31 | 17 | ||
32 | def edit | 18 | def edit |
@@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController | @@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController | ||
37 | @admin_project = Project.new(params[:project]) | 23 | @admin_project = Project.new(params[:project]) |
38 | @admin_project.owner = current_user | 24 | @admin_project.owner = current_user |
39 | 25 | ||
40 | - respond_to do |format| | ||
41 | - if @admin_project.save | ||
42 | - format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' } | ||
43 | - format.json { render json: @admin_project, status: :created, location: @admin_project } | ||
44 | - else | ||
45 | - format.html { render action: "new" } | ||
46 | - format.json { render json: @admin_project.errors, status: :unprocessable_entity } | ||
47 | - end | 26 | + if @admin_project.save |
27 | + redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' | ||
28 | + else | ||
29 | + render :action => "new" | ||
48 | end | 30 | end |
49 | end | 31 | end |
50 | 32 | ||
51 | def update | 33 | def update |
52 | @admin_project = Project.find_by_code(params[:id]) | 34 | @admin_project = Project.find_by_code(params[:id]) |
53 | 35 | ||
54 | - respond_to do |format| | ||
55 | - if @admin_project.update_attributes(params[:project]) | ||
56 | - format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' } | ||
57 | - format.json { head :ok } | ||
58 | - else | ||
59 | - format.html { render action: "edit" } | ||
60 | - format.json { render json: @admin_project.errors, status: :unprocessable_entity } | ||
61 | - end | 36 | + if @admin_project.update_attributes(params[:project]) |
37 | + redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' | ||
38 | + else | ||
39 | + render :action => "edit" | ||
62 | end | 40 | end |
63 | end | 41 | end |
64 | 42 | ||
@@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController | @@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController | ||
66 | @admin_project = Project.find_by_code(params[:id]) | 44 | @admin_project = Project.find_by_code(params[:id]) |
67 | @admin_project.destroy | 45 | @admin_project.destroy |
68 | 46 | ||
69 | - respond_to do |format| | ||
70 | - format.html { redirect_to admin_projects_url } | ||
71 | - format.json { head :ok } | ||
72 | - end | 47 | + redirect_to admin_projects_url |
73 | end | 48 | end |
74 | end | 49 | end |
app/controllers/admin/team_members_controller.rb
1 | class Admin::TeamMembersController < ApplicationController | 1 | class Admin::TeamMembersController < ApplicationController |
2 | + layout "admin" | ||
2 | before_filter :authenticate_user! | 3 | before_filter :authenticate_user! |
3 | before_filter :authenticate_admin! | 4 | before_filter :authenticate_admin! |
4 | 5 | ||
5 | def index | 6 | def index |
6 | @admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC") | 7 | @admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC") |
7 | - | ||
8 | - respond_to do |format| | ||
9 | - format.html # index.html.erb | ||
10 | - format.json { render json: @admin_team_members } | ||
11 | - end | ||
12 | end | 8 | end |
13 | 9 | ||
14 | def show | 10 | def show |
15 | @admin_team_member = UsersProject.find(params[:id]) | 11 | @admin_team_member = UsersProject.find(params[:id]) |
16 | - | ||
17 | - respond_to do |format| | ||
18 | - format.html # show.html.erb | ||
19 | - format.json { render json: @admin_team_member } | ||
20 | - end | ||
21 | end | 12 | end |
22 | 13 | ||
23 | def new | 14 | def new |
24 | @admin_team_member = UsersProject.new(params[:team_member]) | 15 | @admin_team_member = UsersProject.new(params[:team_member]) |
25 | - | ||
26 | - respond_to do |format| | ||
27 | - format.html # new.html.erb | ||
28 | - format.json { render json: @admin_team_member } | ||
29 | - end | ||
30 | end | 16 | end |
31 | 17 | ||
32 | def edit | 18 | def edit |
@@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController | @@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController | ||
37 | @admin_team_member = UsersProject.new(params[:team_member]) | 23 | @admin_team_member = UsersProject.new(params[:team_member]) |
38 | @admin_team_member.project_id = params[:team_member][:project_id] | 24 | @admin_team_member.project_id = params[:team_member][:project_id] |
39 | 25 | ||
40 | - respond_to do |format| | ||
41 | - if @admin_team_member.save | ||
42 | - format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' } | ||
43 | - format.json { render json: @admin_team_member, status: :created, location: @team_member } | ||
44 | - else | ||
45 | - format.html { render action: "new" } | ||
46 | - format.json { render json: @admin_team_member.errors, status: :unprocessable_entity } | ||
47 | - end | 26 | + if @admin_team_member.save |
27 | + redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' | ||
28 | + else | ||
29 | + render action: "new" | ||
48 | end | 30 | end |
49 | end | 31 | end |
50 | 32 | ||
@@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController | @@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController | ||
52 | @admin_team_member = UsersProject.find(params[:id]) | 34 | @admin_team_member = UsersProject.find(params[:id]) |
53 | @admin_team_member.project_id = params[:team_member][:project_id] | 35 | @admin_team_member.project_id = params[:team_member][:project_id] |
54 | 36 | ||
55 | - respond_to do |format| | ||
56 | - if @admin_team_member.update_attributes(params[:team_member]) | ||
57 | - format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' } | ||
58 | - format.json { head :ok } | ||
59 | - else | ||
60 | - format.html { render action: "edit" } | ||
61 | - format.json { render json: @admin_team_member.errors, status: :unprocessable_entity } | ||
62 | - end | 37 | + if @admin_team_member.update_attributes(params[:team_member]) |
38 | + redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' | ||
39 | + else | ||
40 | + render action: "edit" | ||
63 | end | 41 | end |
64 | end | 42 | end |
65 | 43 | ||
@@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController | @@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController | ||
67 | @admin_team_member = UsersProject.find(params[:id]) | 45 | @admin_team_member = UsersProject.find(params[:id]) |
68 | @admin_team_member.destroy | 46 | @admin_team_member.destroy |
69 | 47 | ||
70 | - respond_to do |format| | ||
71 | - format.html { redirect_to admin_team_members_url } | ||
72 | - format.json { head :ok } | ||
73 | - end | 48 | + redirect_to admin_team_members_url |
74 | end | 49 | end |
75 | end | 50 | end |
app/controllers/admin/users_controller.rb
1 | class Admin::UsersController < ApplicationController | 1 | class Admin::UsersController < ApplicationController |
2 | + layout "admin" | ||
2 | before_filter :authenticate_user! | 3 | before_filter :authenticate_user! |
3 | before_filter :authenticate_admin! | 4 | before_filter :authenticate_admin! |
4 | 5 | ||
5 | def index | 6 | def index |
6 | @admin_users = User.page(params[:page]) | 7 | @admin_users = User.page(params[:page]) |
7 | - | ||
8 | - respond_to do |format| | ||
9 | - format.html # index.html.erb | ||
10 | - format.json { render json: @admin_users } | ||
11 | - end | ||
12 | end | 8 | end |
13 | 9 | ||
14 | def show | 10 | def show |
15 | @admin_user = User.find(params[:id]) | 11 | @admin_user = User.find(params[:id]) |
16 | - | ||
17 | - respond_to do |format| | ||
18 | - format.html # show.html.erb | ||
19 | - format.json { render json: @admin_user } | ||
20 | - end | ||
21 | end | 12 | end |
22 | 13 | ||
23 | def new | 14 | def new |
24 | @admin_user = User.new(:projects_limit => 10) | 15 | @admin_user = User.new(:projects_limit => 10) |
25 | - | ||
26 | - respond_to do |format| | ||
27 | - format.html # new.html.erb | ||
28 | - format.json { render json: @admin_user } | ||
29 | - end | ||
30 | end | 16 | end |
31 | 17 | ||
32 | def edit | 18 | def edit |
@@ -36,7 +22,7 @@ class Admin::UsersController < ApplicationController | @@ -36,7 +22,7 @@ class Admin::UsersController < ApplicationController | ||
36 | def create | 22 | def create |
37 | admin = params[:user].delete("admin") | 23 | admin = params[:user].delete("admin") |
38 | 24 | ||
39 | - @admin_user = User.new(params[:user]) | 25 | + @admin_user = User.new(params[:user]) |
40 | @admin_user.admin = (admin && admin.to_i > 0) | 26 | @admin_user.admin = (admin && admin.to_i > 0) |
41 | 27 | ||
42 | respond_to do |format| | 28 | respond_to do |format| |
@@ -54,8 +40,8 @@ class Admin::UsersController < ApplicationController | @@ -54,8 +40,8 @@ class Admin::UsersController < ApplicationController | ||
54 | def update | 40 | def update |
55 | admin = params[:user].delete("admin") | 41 | admin = params[:user].delete("admin") |
56 | if params[:user][:password].empty? | 42 | if params[:user][:password].empty? |
57 | - params[:user].delete(:password) | ||
58 | - params[:user].delete(:password_confirmation) | 43 | + params[:user].delete(:password) |
44 | + params[:user].delete(:password_confirmation) | ||
59 | end | 45 | end |
60 | 46 | ||
61 | @admin_user = User.find(params[:id]) | 47 | @admin_user = User.find(params[:id]) |
app/controllers/application_controller.rb
1 | class ApplicationController < ActionController::Base | 1 | class ApplicationController < ActionController::Base |
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | + before_filter :view_style | ||
4 | + | ||
3 | protect_from_forgery | 5 | protect_from_forgery |
4 | 6 | ||
5 | helper_method :abilities, :can? | 7 | helper_method :abilities, :can? |
@@ -8,7 +10,17 @@ class ApplicationController < ActionController::Base | @@ -8,7 +10,17 @@ class ApplicationController < ActionController::Base | ||
8 | render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false | 10 | render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false |
9 | end | 11 | end |
10 | 12 | ||
11 | - protected | 13 | + layout :layout_by_resource |
14 | + | ||
15 | + protected | ||
16 | + | ||
17 | + def layout_by_resource | ||
18 | + if devise_controller? | ||
19 | + "devise" | ||
20 | + else | ||
21 | + "application" | ||
22 | + end | ||
23 | + end | ||
12 | 24 | ||
13 | def abilities | 25 | def abilities |
14 | @abilities ||= Six.new | 26 | @abilities ||= Six.new |
@@ -18,7 +30,7 @@ class ApplicationController < ActionController::Base | @@ -18,7 +30,7 @@ class ApplicationController < ActionController::Base | ||
18 | abilities.allowed?(object, action, subject) | 30 | abilities.allowed?(object, action, subject) |
19 | end | 31 | end |
20 | 32 | ||
21 | - def project | 33 | + def project |
22 | @project ||= Project.find_by_code(params[:project_id]) | 34 | @project ||= Project.find_by_code(params[:project_id]) |
23 | end | 35 | end |
24 | 36 | ||
@@ -47,19 +59,13 @@ class ApplicationController < ActionController::Base | @@ -47,19 +59,13 @@ class ApplicationController < ActionController::Base | ||
47 | end | 59 | end |
48 | 60 | ||
49 | def load_refs | 61 | def load_refs |
50 | - @branch = unless params[:branch].blank? | ||
51 | - params[:branch] | ||
52 | - else | ||
53 | - nil | ||
54 | - end | ||
55 | - | ||
56 | - @tag = unless params[:tag].blank? | ||
57 | - params[:tag] | ||
58 | - else | ||
59 | - nil | ||
60 | - end | ||
61 | - | ||
62 | - @ref = @branch || @tag || "master" | 62 | + unless params[:ref].blank? |
63 | + @ref = params[:ref] | ||
64 | + else | ||
65 | + @branch = params[:branch].blank? ? nil : params[:branch] | ||
66 | + @tag = params[:tag].blank? ? nil : params[:tag] | ||
67 | + @ref = @branch || @tag || "master" | ||
68 | + end | ||
63 | end | 69 | end |
64 | 70 | ||
65 | def render_404 | 71 | def render_404 |
@@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base | @@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base | ||
69 | def require_non_empty_project | 75 | def require_non_empty_project |
70 | redirect_to @project unless @project.repo_exists? | 76 | redirect_to @project unless @project.repo_exists? |
71 | end | 77 | end |
78 | + | ||
79 | + def view_style | ||
80 | + if params[:view_style] == "collapsed" | ||
81 | + cookies[:view_style] = "collapsed" | ||
82 | + elsif params[:view_style] == "fluid" | ||
83 | + cookies[:view_style] = "" | ||
84 | + end | ||
85 | + | ||
86 | + @view_mode = if cookies[:view_style] == "collapsed" | ||
87 | + :fixed | ||
88 | + else | ||
89 | + :fluid | ||
90 | + end | ||
91 | + end | ||
92 | + | ||
93 | + def respond_with_notes | ||
94 | + if params[:last_id] && params[:first_id] | ||
95 | + @notes = @notes.where("id >= ?", params[:first_id]) | ||
96 | + elsif params[:last_id] | ||
97 | + @notes = @notes.where("id > ?", params[:last_id]) | ||
98 | + elsif params[:first_id] | ||
99 | + @notes = @notes.where("id < ?", params[:first_id]) | ||
100 | + else | ||
101 | + nil | ||
102 | + end | ||
103 | + end | ||
72 | end | 104 | end |
app/controllers/commits_controller.rb
@@ -2,6 +2,7 @@ require "base64" | @@ -2,6 +2,7 @@ require "base64" | ||
2 | 2 | ||
3 | class CommitsController < ApplicationController | 3 | class CommitsController < ApplicationController |
4 | before_filter :project | 4 | before_filter :project |
5 | + layout "project" | ||
5 | 6 | ||
6 | # Authorize | 7 | # Authorize |
7 | before_filter :add_project_abilities | 8 | before_filter :add_project_abilities |
@@ -12,11 +13,12 @@ class CommitsController < ApplicationController | @@ -12,11 +13,12 @@ class CommitsController < ApplicationController | ||
12 | load_refs # load @branch, @tag & @ref | 13 | load_refs # load @branch, @tag & @ref |
13 | 14 | ||
14 | @repo = project.repo | 15 | @repo = project.repo |
16 | + limit, offset = (params[:limit] || 20), (params[:offset] || 0) | ||
15 | 17 | ||
16 | if params[:path] | 18 | if params[:path] |
17 | - @commits = @repo.log(@ref, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0) | 19 | + @commits = @repo.log(@ref, params[:path], :max_count => limit, :skip => offset) |
18 | else | 20 | else |
19 | - @commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0) | 21 | + @commits = @repo.commits(@ref, limit, offset) |
20 | end | 22 | end |
21 | 23 | ||
22 | respond_to do |format| | 24 | respond_to do |format| |
@@ -27,12 +29,12 @@ class CommitsController < ApplicationController | @@ -27,12 +29,12 @@ class CommitsController < ApplicationController | ||
27 | 29 | ||
28 | def show | 30 | def show |
29 | @commit = project.repo.commits(params[:id]).first | 31 | @commit = project.repo.commits(params[:id]).first |
30 | - @notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit") | 32 | + @notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit").order("created_at DESC").limit(20) |
31 | @note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit") | 33 | @note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit") |
32 | 34 | ||
33 | - respond_to do |format| | ||
34 | - format.html # show.html.erb | ||
35 | - format.js | 35 | + respond_to do |format| |
36 | + format.html | ||
37 | + format.js { respond_with_notes } | ||
36 | end | 38 | end |
37 | end | 39 | end |
38 | end | 40 | end |
app/controllers/dashboard_controller.rb
1 | class DashboardController < ApplicationController | 1 | class DashboardController < ApplicationController |
2 | def index | 2 | def index |
3 | @projects = current_user.projects.all | 3 | @projects = current_user.projects.all |
4 | + @active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse | ||
4 | end | 5 | end |
5 | end | 6 | end |
app/controllers/issues_controller.rb
1 | class IssuesController < ApplicationController | 1 | class IssuesController < ApplicationController |
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | - before_filter :project | 3 | + before_filter :project |
4 | before_filter :issue, :only => [:edit, :update, :destroy, :show] | 4 | before_filter :issue, :only => [:edit, :update, :destroy, :show] |
5 | + layout "project" | ||
5 | 6 | ||
6 | # Authorize | 7 | # Authorize |
7 | before_filter :add_project_abilities | 8 | before_filter :add_project_abilities |
8 | before_filter :authorize_read_issue! | 9 | before_filter :authorize_read_issue! |
9 | - before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort] | 10 | + before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort] |
10 | 11 | ||
11 | respond_to :js | 12 | respond_to :js |
12 | 13 | ||
@@ -34,14 +35,19 @@ class IssuesController < ApplicationController | @@ -34,14 +35,19 @@ class IssuesController < ApplicationController | ||
34 | end | 35 | end |
35 | 36 | ||
36 | def show | 37 | def show |
37 | - @notes = @issue.notes | 38 | + @notes = @issue.notes.order("created_at DESC").limit(20) |
38 | @note = @project.notes.new(:noteable => @issue) | 39 | @note = @project.notes.new(:noteable => @issue) |
40 | + | ||
41 | + respond_to do |format| | ||
42 | + format.html | ||
43 | + format.js { respond_with_notes } | ||
44 | + end | ||
39 | end | 45 | end |
40 | 46 | ||
41 | def create | 47 | def create |
42 | @issue = @project.issues.new(params[:issue]) | 48 | @issue = @project.issues.new(params[:issue]) |
43 | @issue.author = current_user | 49 | @issue.author = current_user |
44 | - if @issue.save | 50 | + if @issue.save && @issue.assignee != current_user |
45 | Notify.new_issue_email(@issue).deliver | 51 | Notify.new_issue_email(@issue).deliver |
46 | end | 52 | end |
47 | 53 | ||
@@ -57,14 +63,13 @@ class IssuesController < ApplicationController | @@ -57,14 +63,13 @@ class IssuesController < ApplicationController | ||
57 | end | 63 | end |
58 | end | 64 | end |
59 | 65 | ||
60 | - | ||
61 | def destroy | 66 | def destroy |
62 | return access_denied! unless can?(current_user, :admin_issue, @issue) | 67 | return access_denied! unless can?(current_user, :admin_issue, @issue) |
63 | 68 | ||
64 | @issue.destroy | 69 | @issue.destroy |
65 | 70 | ||
66 | respond_to do |format| | 71 | respond_to do |format| |
67 | - format.js { render :nothing => true } | 72 | + format.js { render :nothing => true } |
68 | end | 73 | end |
69 | end | 74 | end |
70 | 75 | ||
@@ -78,7 +83,23 @@ class IssuesController < ApplicationController | @@ -78,7 +83,23 @@ class IssuesController < ApplicationController | ||
78 | render :nothing => true | 83 | render :nothing => true |
79 | end | 84 | end |
80 | 85 | ||
81 | - protected | 86 | + def search |
87 | + terms = params['terms'] | ||
88 | + | ||
89 | + @project = Project.find(params['project']) | ||
90 | + @issues = case params[:status].to_i | ||
91 | + when 1 then @project.issues | ||
92 | + when 2 then @project.issues.closed | ||
93 | + when 3 then @project.issues.opened.assigned(current_user) | ||
94 | + else @project.issues.opened | ||
95 | + end | ||
96 | + | ||
97 | + @issues = @issues.where("title LIKE ? OR content LIKE ?", "%#{terms}%", "%#{terms}%") unless terms.blank? | ||
98 | + | ||
99 | + render :partial => 'issues' | ||
100 | + end | ||
101 | + | ||
102 | + protected | ||
82 | 103 | ||
83 | def issue | 104 | def issue |
84 | @issue ||= @project.issues.find(params[:id]) | 105 | @issue ||= @project.issues.find(params[:id]) |
app/controllers/keys_controller.rb
1 | class KeysController < ApplicationController | 1 | class KeysController < ApplicationController |
2 | + layout "profile" | ||
2 | respond_to :js | 3 | respond_to :js |
3 | 4 | ||
4 | def index | 5 | def index |
@@ -24,7 +25,7 @@ class KeysController < ApplicationController | @@ -24,7 +25,7 @@ class KeysController < ApplicationController | ||
24 | 25 | ||
25 | respond_to do |format| | 26 | respond_to do |format| |
26 | format.html { redirect_to keys_url } | 27 | format.html { redirect_to keys_url } |
27 | - format.js { render :nothing => true } | 28 | + format.js { render :nothing => true } |
28 | end | 29 | end |
29 | end | 30 | end |
30 | end | 31 | end |
app/controllers/notes_controller.rb
1 | class NotesController < ApplicationController | 1 | class NotesController < ApplicationController |
2 | - before_filter :project | 2 | + before_filter :project |
3 | 3 | ||
4 | # Authorize | 4 | # Authorize |
5 | before_filter :add_project_abilities | 5 | before_filter :add_project_abilities |
6 | - before_filter :authorize_write_note!, :only => [:create] | 6 | + before_filter :authorize_write_note!, :only => [:create] |
7 | 7 | ||
8 | respond_to :js | 8 | respond_to :js |
9 | 9 | ||
@@ -15,10 +15,9 @@ class NotesController < ApplicationController | @@ -15,10 +15,9 @@ class NotesController < ApplicationController | ||
15 | notify if params[:notify] == '1' | 15 | notify if params[:notify] == '1' |
16 | end | 16 | end |
17 | 17 | ||
18 | - | ||
19 | respond_to do |format| | 18 | respond_to do |format| |
20 | format.html {redirect_to :back} | 19 | format.html {redirect_to :back} |
21 | - format.js | 20 | + format.js |
22 | end | 21 | end |
23 | end | 22 | end |
24 | 23 | ||
@@ -30,11 +29,11 @@ class NotesController < ApplicationController | @@ -30,11 +29,11 @@ class NotesController < ApplicationController | ||
30 | @note.destroy | 29 | @note.destroy |
31 | 30 | ||
32 | respond_to do |format| | 31 | respond_to do |format| |
33 | - format.js { render :nothing => true } | 32 | + format.js { render :nothing => true } |
34 | end | 33 | end |
35 | end | 34 | end |
36 | 35 | ||
37 | - protected | 36 | + protected |
38 | 37 | ||
39 | def notify | 38 | def notify |
40 | @project.users.reject { |u| u.id == current_user.id } .each do |u| | 39 | @project.users.reject { |u| u.id == current_user.id } .each do |u| |
app/controllers/profile_controller.rb
1 | class ProfileController < ApplicationController | 1 | class ProfileController < ApplicationController |
2 | + layout "profile" | ||
2 | def show | 3 | def show |
3 | @user = current_user | 4 | @user = current_user |
4 | end | 5 | end |
@@ -14,7 +15,7 @@ class ProfileController < ApplicationController | @@ -14,7 +15,7 @@ class ProfileController < ApplicationController | ||
14 | end | 15 | end |
15 | 16 | ||
16 | def password_update | 17 | def password_update |
17 | - params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"} | 18 | + params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"} |
18 | @user = current_user | 19 | @user = current_user |
19 | 20 | ||
20 | if @user.update_attributes(params[:user]) | 21 | if @user.update_attributes(params[:user]) |
app/controllers/projects_controller.rb
1 | class ProjectsController < ApplicationController | 1 | class ProjectsController < ApplicationController |
2 | - before_filter :project, :except => [:index, :new, :create] | 2 | + before_filter :project, :except => [:index, :new, :create] |
3 | + layout :determine_layout | ||
3 | 4 | ||
4 | # Authorize | 5 | # Authorize |
5 | before_filter :add_project_abilities | 6 | before_filter :add_project_abilities |
6 | - before_filter :authorize_read_project!, :except => [:index, :new, :create] | ||
7 | - before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] | 7 | + before_filter :authorize_read_project!, :except => [:index, :new, :create] |
8 | + before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] | ||
8 | 9 | ||
9 | before_filter :require_non_empty_project, :only => [:blob, :tree] | 10 | before_filter :require_non_empty_project, :only => [:blob, :tree] |
10 | 11 | ||
11 | def index | 12 | def index |
12 | - @projects = current_user.projects.all | 13 | + source = current_user.projects |
14 | + source = source.tagged_with(params[:tag]) unless params[:tag].blank? | ||
15 | + @projects = source.all | ||
13 | end | 16 | end |
14 | 17 | ||
15 | def new | 18 | def new |
@@ -23,7 +26,7 @@ class ProjectsController < ApplicationController | @@ -23,7 +26,7 @@ class ProjectsController < ApplicationController | ||
23 | @project = Project.new(params[:project]) | 26 | @project = Project.new(params[:project]) |
24 | @project.owner = current_user | 27 | @project.owner = current_user |
25 | 28 | ||
26 | - Project.transaction do | 29 | + Project.transaction do |
27 | @project.save! | 30 | @project.save! |
28 | @project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user) | 31 | @project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user) |
29 | end | 32 | end |
@@ -31,7 +34,7 @@ class ProjectsController < ApplicationController | @@ -31,7 +34,7 @@ class ProjectsController < ApplicationController | ||
31 | respond_to do |format| | 34 | respond_to do |format| |
32 | if @project.valid? | 35 | if @project.valid? |
33 | format.html { redirect_to @project, notice: 'Project was successfully created.' } | 36 | format.html { redirect_to @project, notice: 'Project was successfully created.' } |
34 | - format.js | 37 | + format.js |
35 | else | 38 | else |
36 | format.html { render action: "new" } | 39 | format.html { render action: "new" } |
37 | format.js | 40 | format.js |
@@ -51,10 +54,10 @@ class ProjectsController < ApplicationController | @@ -51,10 +54,10 @@ class ProjectsController < ApplicationController | ||
51 | respond_to do |format| | 54 | respond_to do |format| |
52 | if project.update_attributes(params[:project]) | 55 | if project.update_attributes(params[:project]) |
53 | format.html { redirect_to project, :notice => 'Project was successfully updated.' } | 56 | format.html { redirect_to project, :notice => 'Project was successfully updated.' } |
54 | - format.js | 57 | + format.js |
55 | else | 58 | else |
56 | format.html { render action: "edit" } | 59 | format.html { render action: "edit" } |
57 | - format.js | 60 | + format.js |
58 | end | 61 | end |
59 | end | 62 | end |
60 | end | 63 | end |
@@ -85,13 +88,12 @@ class ProjectsController < ApplicationController | @@ -85,13 +88,12 @@ class ProjectsController < ApplicationController | ||
85 | def wall | 88 | def wall |
86 | @note = Note.new | 89 | @note = Note.new |
87 | @notes = @project.common_notes.order("created_at DESC") | 90 | @notes = @project.common_notes.order("created_at DESC") |
91 | + @notes = @notes.fresh.limit(20) | ||
88 | 92 | ||
89 | - @notes = case params[:view] | ||
90 | - when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day) | ||
91 | - when "all" then @notes.all | ||
92 | - when "day" then @notes.since(Date.today.at_beginning_of_day) | ||
93 | - else @notes.fresh.limit(10) | ||
94 | - end | 93 | + respond_to do |format| |
94 | + format.html | ||
95 | + format.js { respond_with_notes } | ||
96 | + end | ||
95 | end | 97 | end |
96 | 98 | ||
97 | # | 99 | # |
@@ -105,7 +107,7 @@ class ProjectsController < ApplicationController | @@ -105,7 +107,7 @@ class ProjectsController < ApplicationController | ||
105 | 107 | ||
106 | if params[:commit_id] | 108 | if params[:commit_id] |
107 | @commit = @repo.commits(params[:commit_id]).first | 109 | @commit = @repo.commits(params[:commit_id]).first |
108 | - else | 110 | + else |
109 | @commit = @repo.commits(@ref || "master").first | 111 | @commit = @repo.commits(@ref || "master").first |
110 | end | 112 | end |
111 | 113 | ||
@@ -114,7 +116,7 @@ class ProjectsController < ApplicationController | @@ -114,7 +116,7 @@ class ProjectsController < ApplicationController | ||
114 | 116 | ||
115 | respond_to do |format| | 117 | respond_to do |format| |
116 | format.html # show.html.erb | 118 | format.html # show.html.erb |
117 | - format.js do | 119 | + format.js do |
118 | # diasbale cache to allow back button works | 120 | # diasbale cache to allow back button works |
119 | response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" | 121 | response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" |
120 | response.headers["Pragma"] = "no-cache" | 122 | response.headers["Pragma"] = "no-cache" |
@@ -132,7 +134,7 @@ class ProjectsController < ApplicationController | @@ -132,7 +134,7 @@ class ProjectsController < ApplicationController | ||
132 | 134 | ||
133 | if @tree.is_a?(Grit::Blob) | 135 | if @tree.is_a?(Grit::Blob) |
134 | send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) | 136 | send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) |
135 | - else | 137 | + else |
136 | head(404) | 138 | head(404) |
137 | end | 139 | end |
138 | rescue | 140 | rescue |
@@ -147,9 +149,17 @@ class ProjectsController < ApplicationController | @@ -147,9 +149,17 @@ class ProjectsController < ApplicationController | ||
147 | end | 149 | end |
148 | end | 150 | end |
149 | 151 | ||
150 | - protected | 152 | + protected |
151 | 153 | ||
152 | - def project | 154 | + def project |
153 | @project ||= Project.find_by_code(params[:id]) | 155 | @project ||= Project.find_by_code(params[:id]) |
154 | end | 156 | end |
157 | + | ||
158 | + def determine_layout | ||
159 | + if @project && !@project.new_record? | ||
160 | + "project" | ||
161 | + else | ||
162 | + "application" | ||
163 | + end | ||
164 | + end | ||
155 | end | 165 | end |
app/controllers/snippets_controller.rb
1 | class SnippetsController < ApplicationController | 1 | class SnippetsController < ApplicationController |
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | - before_filter :project | 3 | + before_filter :project |
4 | + layout "project" | ||
4 | 5 | ||
5 | # Authorize | 6 | # Authorize |
6 | before_filter :add_project_abilities | 7 | before_filter :add_project_abilities |
7 | before_filter :authorize_read_snippet! | 8 | before_filter :authorize_read_snippet! |
8 | - before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort] | 9 | + before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort] |
9 | 10 | ||
10 | respond_to :html | 11 | respond_to :html |
11 | 12 | ||
@@ -13,7 +14,7 @@ class SnippetsController < ApplicationController | @@ -13,7 +14,7 @@ class SnippetsController < ApplicationController | ||
13 | @snippets = @project.snippets | 14 | @snippets = @project.snippets |
14 | end | 15 | end |
15 | 16 | ||
16 | - def new | 17 | + def new |
17 | @snippet = @project.snippets.new | 18 | @snippet = @project.snippets.new |
18 | end | 19 | end |
19 | 20 |
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +class TagsController < ApplicationController | ||
2 | + def index | ||
3 | + @tags = Project.tag_counts.order('count DESC') | ||
4 | + @tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank? | ||
5 | + | ||
6 | + respond_to do |format| | ||
7 | + format.html | ||
8 | + format.json { render json: @tags.limit(8).map {|t| t.name}} | ||
9 | + end | ||
10 | + end | ||
11 | +end |
app/controllers/team_members_controller.rb
1 | class TeamMembersController < ApplicationController | 1 | class TeamMembersController < ApplicationController |
2 | - before_filter :project | 2 | + before_filter :project |
3 | + layout "project" | ||
3 | 4 | ||
4 | # Authorize | 5 | # Authorize |
5 | before_filter :add_project_abilities | 6 | before_filter :add_project_abilities |
6 | before_filter :authorize_read_project! | 7 | before_filter :authorize_read_project! |
7 | - before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update] | 8 | + before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update] |
8 | 9 | ||
9 | def show | 10 | def show |
10 | @team_member = project.users_projects.find(params[:id]) | 11 | @team_member = project.users_projects.find(params[:id]) |
@@ -26,7 +27,7 @@ class TeamMembersController < ApplicationController | @@ -26,7 +27,7 @@ class TeamMembersController < ApplicationController | ||
26 | 27 | ||
27 | respond_to do |format| | 28 | respond_to do |format| |
28 | format.js | 29 | format.js |
29 | - format.html do | 30 | + format.html do |
30 | unless @team_member.valid? | 31 | unless @team_member.valid? |
31 | flash[:alert] = "User should have at least one role" | 32 | flash[:alert] = "User should have at least one role" |
32 | end | 33 | end |
@@ -41,7 +42,7 @@ class TeamMembersController < ApplicationController | @@ -41,7 +42,7 @@ class TeamMembersController < ApplicationController | ||
41 | 42 | ||
42 | respond_to do |format| | 43 | respond_to do |format| |
43 | format.html { redirect_to root_path } | 44 | format.html { redirect_to root_path } |
44 | - format.js { render :nothing => true } | 45 | + format.js { render :nothing => true } |
45 | end | 46 | end |
46 | end | 47 | end |
47 | end | 48 | end |
app/helpers/application_helper.rb
@@ -4,6 +4,14 @@ module ApplicationHelper | @@ -4,6 +4,14 @@ module ApplicationHelper | ||
4 | "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" | 4 | "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" |
5 | end | 5 | end |
6 | 6 | ||
7 | + def body_class(default_class = nil) | ||
8 | + main = content_for(:body_class).blank? ? | ||
9 | + default_class : | ||
10 | + content_for(:body_class) | ||
11 | + | ||
12 | + [main, cookies[:view_style]].join(" ") | ||
13 | + end | ||
14 | + | ||
7 | def commit_name(project, commit) | 15 | def commit_name(project, commit) |
8 | if project.commit.id == commit.id | 16 | if project.commit.id == commit.id |
9 | "master" | 17 | "master" |
@@ -23,18 +31,33 @@ module ApplicationHelper | @@ -23,18 +31,33 @@ module ApplicationHelper | ||
23 | end | 31 | end |
24 | 32 | ||
25 | def last_commit(project) | 33 | def last_commit(project) |
26 | - if project.repo_exists? | 34 | + if project.repo_exists? |
27 | time_ago_in_words(project.commit.committed_date) + " ago" | 35 | time_ago_in_words(project.commit.committed_date) + " ago" |
28 | - else | 36 | + else |
29 | "Never" | 37 | "Never" |
30 | end | 38 | end |
39 | + rescue | ||
40 | + "Never" | ||
41 | + end | ||
42 | + | ||
43 | + def grouped_options_refs | ||
44 | + options = [ | ||
45 | + ["Branch", @repo.heads.map(&:name) ], | ||
46 | + [ "Tag", @project.tags ] | ||
47 | + ] | ||
48 | + | ||
49 | + grouped_options_for_select(options, @ref) | ||
50 | + end | ||
51 | + | ||
52 | + def markdown(text) | ||
53 | + RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe | ||
31 | end | 54 | end |
32 | 55 | ||
33 | def search_autocomplete_source | 56 | def search_autocomplete_source |
34 | projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } | 57 | projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } |
35 | default_nav = [ | 58 | default_nav = [ |
36 | - { :label => "Keys", :url => keys_path }, | ||
37 | - { :label => "Projects", :url => projects_path }, | 59 | + { :label => "Keys", :url => keys_path }, |
60 | + { :label => "Projects", :url => projects_path }, | ||
38 | { :label => "Admin", :url => admin_root_path } | 61 | { :label => "Admin", :url => admin_root_path } |
39 | ] | 62 | ] |
40 | 63 | ||
@@ -42,10 +65,10 @@ module ApplicationHelper | @@ -42,10 +65,10 @@ module ApplicationHelper | ||
42 | 65 | ||
43 | if @project && !@project.new_record? | 66 | if @project && !@project.new_record? |
44 | project_nav = [ | 67 | project_nav = [ |
45 | - { :label => "#{@project.code} / Issues", :url => project_issues_path(@project) }, | ||
46 | - { :label => "#{@project.code} / Wall", :url => wall_project_path(@project) }, | ||
47 | - { :label => "#{@project.code} / Tree", :url => tree_project_path(@project) }, | ||
48 | - { :label => "#{@project.code} / Commits", :url => project_commits_path(@project) }, | 68 | + { :label => "#{@project.code} / Issues", :url => project_issues_path(@project) }, |
69 | + { :label => "#{@project.code} / Wall", :url => wall_project_path(@project) }, | ||
70 | + { :label => "#{@project.code} / Tree", :url => tree_project_path(@project) }, | ||
71 | + { :label => "#{@project.code} / Commits", :url => project_commits_path(@project) }, | ||
49 | { :label => "#{@project.code} / Team", :url => team_project_path(@project) } | 72 | { :label => "#{@project.code} / Team", :url => team_project_path(@project) } |
50 | ] | 73 | ] |
51 | end | 74 | end |
app/helpers/commits_helper.rb
1 | module CommitsHelper | 1 | module CommitsHelper |
2 | def diff_line(line, line_new = 0, line_old = 0) | 2 | def diff_line(line, line_new = 0, line_old = 0) |
3 | full_line = html_escape(line.gsub(/\n/, '')) | 3 | full_line = html_escape(line.gsub(/\n/, '')) |
4 | - color = if line[0] == "+" | 4 | + color = if line[0] == "+" |
5 | full_line = "<span class=\"old_line\"> </span><span class=\"new_line\">#{line_new}</span> " + full_line | 5 | full_line = "<span class=\"old_line\"> </span><span class=\"new_line\">#{line_new}</span> " + full_line |
6 | "#DFD" | 6 | "#DFD" |
7 | - elsif line[0] == "-" | 7 | + elsif line[0] == "-" |
8 | full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\"> </span> " + full_line | 8 | full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\"> </span> " + full_line |
9 | "#FDD" | 9 | "#FDD" |
10 | - else | 10 | + else |
11 | full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line | 11 | full_line = "<span class=\"old_line\">#{line_old}</span><span class=\"new_line\">#{line_new}</span> " + full_line |
12 | "none" | 12 | "none" |
13 | end | 13 | end |
app/helpers/dashboard_helper.rb
1 | module DashboardHelper | 1 | module DashboardHelper |
2 | + def dashboard_feed_path(project, object) | ||
3 | + case object.class.name.to_s | ||
4 | + when "Issue" then project_issues_path(project, project.issues.find(object.id)) | ||
5 | + when "Grit::Commit" then project_commit_path(project, project.repo.commits(object.id).first) | ||
6 | + when "Note" | ||
7 | + then | ||
8 | + note = object | ||
9 | + case note.noteable_type | ||
10 | + when "Issue" then project_issue_path(project, note.noteable_id) | ||
11 | + when "Snippet" then project_snippet_path(project, note.noteable_id) | ||
12 | + when "Commit" then project_commit_path(project, :id => note.noteable_id) | ||
13 | + else wall_project_path(project) | ||
14 | + end | ||
15 | + else "#" | ||
16 | + end | ||
17 | + rescue | ||
18 | + "#" | ||
19 | + end | ||
20 | + | ||
21 | + def dashboard_feed_title(object) | ||
22 | + title = case object.class.name.to_s | ||
23 | + when "Note" then markdown(object.note) | ||
24 | + when "Issue" then object.title | ||
25 | + when "Grit::Commit" then object.safe_message | ||
26 | + else "" | ||
27 | + end | ||
28 | + "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " | ||
29 | + end | ||
2 | end | 30 | end |
app/helpers/projects_helper.rb
app/helpers/snippets_helper.rb
1 | module SnippetsHelper | 1 | module SnippetsHelper |
2 | + def lifetime_select_options | ||
3 | + options = [ | ||
4 | + ['forever', nil], | ||
5 | + ['1 day', "#{Date.current + 1.day}"], | ||
6 | + ['1 week', "#{Date.current + 1.week}"], | ||
7 | + ['1 month', "#{Date.current + 1.month}"] | ||
8 | + ] | ||
9 | + options_for_select(options) | ||
10 | + end | ||
2 | end | 11 | end |
app/models/ability.rb
@@ -17,14 +17,14 @@ class Ability | @@ -17,14 +17,14 @@ class Ability | ||
17 | :read_issue, | 17 | :read_issue, |
18 | :read_snippet, | 18 | :read_snippet, |
19 | :read_team_member, | 19 | :read_team_member, |
20 | - :read_note | 20 | + :read_note |
21 | ] if project.readers.include?(user) | 21 | ] if project.readers.include?(user) |
22 | 22 | ||
23 | rules << [ | 23 | rules << [ |
24 | :write_project, | 24 | :write_project, |
25 | :write_issue, | 25 | :write_issue, |
26 | :write_snippet, | 26 | :write_snippet, |
27 | - :write_note | 27 | + :write_note |
28 | ] if project.writers.include?(user) | 28 | ] if project.writers.include?(user) |
29 | 29 | ||
30 | rules << [ | 30 | rules << [ |
@@ -32,13 +32,13 @@ class Ability | @@ -32,13 +32,13 @@ class Ability | ||
32 | :admin_issue, | 32 | :admin_issue, |
33 | :admin_snippet, | 33 | :admin_snippet, |
34 | :admin_team_member, | 34 | :admin_team_member, |
35 | - :admin_note | 35 | + :admin_note |
36 | ] if project.admins.include?(user) | 36 | ] if project.admins.include?(user) |
37 | 37 | ||
38 | rules.flatten | 38 | rules.flatten |
39 | end | 39 | end |
40 | 40 | ||
41 | - class << self | 41 | + class << self |
42 | [:issue, :note, :snippet].each do |name| | 42 | [:issue, :note, :snippet].each do |name| |
43 | define_method "#{name}_abilities" do |user, subject| | 43 | define_method "#{name}_abilities" do |user, subject| |
44 | if subject.author == user | 44 | if subject.author == user |
@@ -48,7 +48,7 @@ class Ability | @@ -48,7 +48,7 @@ class Ability | ||
48 | :"admin_#{name}" | 48 | :"admin_#{name}" |
49 | ] | 49 | ] |
50 | else | 50 | else |
51 | - subject.respond_to?(:project) ? | 51 | + subject.respond_to?(:project) ? |
52 | project_abilities(user, subject.project) : [] | 52 | project_abilities(user, subject.project) : [] |
53 | end | 53 | end |
54 | end | 54 | end |
app/models/issue.rb
@@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base | @@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base | ||
10 | validates_presence_of :assignee_id | 10 | validates_presence_of :assignee_id |
11 | validates_presence_of :author_id | 11 | validates_presence_of :author_id |
12 | 12 | ||
13 | + delegate :name, | ||
14 | + :email, | ||
15 | + :to => :author, | ||
16 | + :prefix => true | ||
17 | + | ||
13 | validates :title, | 18 | validates :title, |
14 | :presence => true, | 19 | :presence => true, |
15 | :length => { :within => 0..255 } | 20 | :length => { :within => 0..255 } |
16 | - | ||
17 | - validates :content, | ||
18 | - :presence => true, | ||
19 | - :length => { :within => 0..2000 } | 21 | + |
22 | + #validates :content, | ||
23 | + #:presence => true, | ||
24 | + #:length => { :within => 0..2000 } | ||
20 | 25 | ||
21 | scope :critical, where(:critical => true) | 26 | scope :critical, where(:critical => true) |
22 | scope :non_critical, where(:critical => false) | 27 | scope :non_critical, where(:critical => false) |
@@ -30,7 +35,7 @@ class Issue < ActiveRecord::Base | @@ -30,7 +35,7 @@ class Issue < ActiveRecord::Base | ||
30 | def today? | 35 | def today? |
31 | Date.today == created_at.to_date | 36 | Date.today == created_at.to_date |
32 | end | 37 | end |
33 | - | 38 | + |
34 | def new? | 39 | def new? |
35 | today? && created_at == updated_at | 40 | today? && created_at == updated_at |
36 | end | 41 | end |
app/models/key.rb
@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base | @@ -8,7 +8,7 @@ class Key < ActiveRecord::Base | ||
8 | validates :key, | 8 | validates :key, |
9 | :presence => true, | 9 | :presence => true, |
10 | :uniqueness => true, | 10 | :uniqueness => true, |
11 | - :length => { :within => 0..1024 } | 11 | + :length => { :within => 0..1600 } |
12 | 12 | ||
13 | before_save :set_identifier | 13 | before_save :set_identifier |
14 | after_save :update_gitosis | 14 | after_save :update_gitosis |
@@ -17,11 +17,11 @@ class Key < ActiveRecord::Base | @@ -17,11 +17,11 @@ class Key < ActiveRecord::Base | ||
17 | def set_identifier | 17 | def set_identifier |
18 | self.identifier = "#{user.identifier}_#{Time.now.to_i}" | 18 | self.identifier = "#{user.identifier}_#{Time.now.to_i}" |
19 | end | 19 | end |
20 | - | 20 | + |
21 | def update_gitosis | 21 | def update_gitosis |
22 | Gitosis.new.configure do |c| | 22 | Gitosis.new.configure do |c| |
23 | c.update_keys(identifier, key) | 23 | c.update_keys(identifier, key) |
24 | - | 24 | + |
25 | projects.each do |project| | 25 | projects.each do |project| |
26 | c.update_project(project.path, project.gitosis_writers) | 26 | c.update_project(project.path, project.gitosis_writers) |
27 | end | 27 | end |
app/models/note.rb
@@ -7,18 +7,23 @@ class Note < ActiveRecord::Base | @@ -7,18 +7,23 @@ class Note < ActiveRecord::Base | ||
7 | belongs_to :author, | 7 | belongs_to :author, |
8 | :class_name => "User" | 8 | :class_name => "User" |
9 | 9 | ||
10 | - attr_protected :author, :author_id | 10 | + delegate :name, |
11 | + :email, | ||
12 | + :to => :author, | ||
13 | + :prefix => true | ||
14 | + | ||
15 | + attr_protected :author, :author_id | ||
11 | 16 | ||
12 | validates_presence_of :project | 17 | validates_presence_of :project |
13 | 18 | ||
14 | validates :note, | 19 | validates :note, |
15 | :presence => true, | 20 | :presence => true, |
16 | - :length => { :within => 0..255 } | 21 | + :length => { :within => 0..5000 } |
17 | 22 | ||
18 | - validates :attachment, | ||
19 | - :file_size => { | ||
20 | - :maximum => 10.megabytes.to_i | ||
21 | - } | 23 | + validates :attachment, |
24 | + :file_size => { | ||
25 | + :maximum => 10.megabytes.to_i | ||
26 | + } | ||
22 | 27 | ||
23 | scope :common, where(:noteable_id => nil) | 28 | scope :common, where(:noteable_id => nil) |
24 | 29 |
app/models/project.rb
@@ -9,6 +9,8 @@ class Project < ActiveRecord::Base | @@ -9,6 +9,8 @@ class Project < ActiveRecord::Base | ||
9 | has_many :notes, :dependent => :destroy | 9 | has_many :notes, :dependent => :destroy |
10 | has_many :snippets, :dependent => :destroy | 10 | has_many :snippets, :dependent => :destroy |
11 | 11 | ||
12 | + acts_as_taggable | ||
13 | + | ||
12 | validates :name, | 14 | validates :name, |
13 | :uniqueness => true, | 15 | :uniqueness => true, |
14 | :presence => true, | 16 | :presence => true, |
@@ -20,7 +22,7 @@ class Project < ActiveRecord::Base | @@ -20,7 +22,7 @@ class Project < ActiveRecord::Base | ||
20 | :format => { :with => /^[a-zA-Z0-9_\-]*$/, | 22 | :format => { :with => /^[a-zA-Z0-9_\-]*$/, |
21 | :message => "only letters, digits & '_' '-' allowed" }, | 23 | :message => "only letters, digits & '_' '-' allowed" }, |
22 | :length => { :within => 0..255 } | 24 | :length => { :within => 0..255 } |
23 | - | 25 | + |
24 | validates :description, | 26 | validates :description, |
25 | :length => { :within => 0..2000 } | 27 | :length => { :within => 0..2000 } |
26 | 28 | ||
@@ -57,13 +59,13 @@ class Project < ActiveRecord::Base | @@ -57,13 +59,13 @@ class Project < ActiveRecord::Base | ||
57 | c.update_project(path, gitosis_writers) | 59 | c.update_project(path, gitosis_writers) |
58 | end | 60 | end |
59 | end | 61 | end |
60 | - | 62 | + |
61 | def destroy_gitosis_project | 63 | def destroy_gitosis_project |
62 | Gitosis.new.configure do |c| | 64 | Gitosis.new.configure do |c| |
63 | c.destroy_project(self) | 65 | c.destroy_project(self) |
64 | end | 66 | end |
65 | end | 67 | end |
66 | - | 68 | + |
67 | def add_access(user, *access) | 69 | def add_access(user, *access) |
68 | opts = { :user => user } | 70 | opts = { :user => user } |
69 | access.each { |name| opts.merge!(name => true) } | 71 | access.each { |name| opts.merge!(name => true) } |
@@ -102,12 +104,12 @@ class Project < ActiveRecord::Base | @@ -102,12 +104,12 @@ class Project < ActiveRecord::Base | ||
102 | def url_to_repo | 104 | def url_to_repo |
103 | "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" | 105 | "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" |
104 | end | 106 | end |
105 | - | 107 | + |
106 | def path_to_repo | 108 | def path_to_repo |
107 | GITOSIS["base_path"] + path + ".git" | 109 | GITOSIS["base_path"] + path + ".git" |
108 | end | 110 | end |
109 | 111 | ||
110 | - def repo | 112 | + def repo |
111 | @repo ||= Grit::Repo.new(path_to_repo) | 113 | @repo ||= Grit::Repo.new(path_to_repo) |
112 | end | 114 | end |
113 | 115 | ||
@@ -119,32 +121,52 @@ class Project < ActiveRecord::Base | @@ -119,32 +121,52 @@ class Project < ActiveRecord::Base | ||
119 | repo rescue false | 121 | repo rescue false |
120 | end | 122 | end |
121 | 123 | ||
124 | + def last_activity | ||
125 | + updates(1).first | ||
126 | + rescue | ||
127 | + nil | ||
128 | + end | ||
129 | + | ||
130 | + def last_activity_date | ||
131 | + last_activity.try(:created_at) | ||
132 | + end | ||
133 | + | ||
134 | + def updates(n = 3) | ||
135 | + [ | ||
136 | + fresh_commits(n), | ||
137 | + issues.last(n), | ||
138 | + notes.fresh.limit(n) | ||
139 | + ].compact.flatten.sort do |x, y| | ||
140 | + y.created_at <=> x.created_at | ||
141 | + end[0...n] | ||
142 | + end | ||
143 | + | ||
122 | def commit(commit_id = nil) | 144 | def commit(commit_id = nil) |
123 | if commit_id | 145 | if commit_id |
124 | repo.commits(commit_id).first | 146 | repo.commits(commit_id).first |
125 | - else | 147 | + else |
126 | repo.commits.first | 148 | repo.commits.first |
127 | end | 149 | end |
128 | end | 150 | end |
129 | 151 | ||
130 | - def heads | 152 | + def heads |
131 | @heads ||= repo.heads | 153 | @heads ||= repo.heads |
132 | end | 154 | end |
133 | 155 | ||
134 | - def fresh_commits | ||
135 | - commits = heads.map do |h| | ||
136 | - repo.commits(h.name, 10) | 156 | + def fresh_commits(n = 10) |
157 | + commits = heads.map do |h| | ||
158 | + repo.commits(h.name, n) | ||
137 | end.flatten.uniq { |c| c.id } | 159 | end.flatten.uniq { |c| c.id } |
138 | 160 | ||
139 | commits.sort! do |x, y| | 161 | commits.sort! do |x, y| |
140 | y.committed_date <=> x.committed_date | 162 | y.committed_date <=> x.committed_date |
141 | end | 163 | end |
142 | 164 | ||
143 | - commits[0..10] | 165 | + commits[0...n] |
144 | end | 166 | end |
145 | 167 | ||
146 | def commits_since(date) | 168 | def commits_since(date) |
147 | - commits = heads.map do |h| | 169 | + commits = heads.map do |h| |
148 | repo.log(h.name, nil, :since => date) | 170 | repo.log(h.name, nil, :since => date) |
149 | end.flatten.uniq { |c| c.id } | 171 | end.flatten.uniq { |c| c.id } |
150 | 172 | ||
@@ -165,7 +187,7 @@ class Project < ActiveRecord::Base | @@ -165,7 +187,7 @@ class Project < ActiveRecord::Base | ||
165 | unless owner.can_create_project? | 187 | unless owner.can_create_project? |
166 | errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it") | 188 | errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it") |
167 | end | 189 | end |
168 | - rescue | 190 | + rescue |
169 | errors[:base] << ("Cant check your ability to create project") | 191 | errors[:base] << ("Cant check your ability to create project") |
170 | end | 192 | end |
171 | 193 |
app/models/snippet.rb
@@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base | @@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base | ||
13 | validates :title, | 13 | validates :title, |
14 | :presence => true, | 14 | :presence => true, |
15 | :length => { :within => 0..255 } | 15 | :length => { :within => 0..255 } |
16 | - | 16 | + |
17 | validates :file_name, | 17 | validates :file_name, |
18 | :presence => true, | 18 | :presence => true, |
19 | :length => { :within => 0..255 } | 19 | :length => { :within => 0..255 } |
@@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base | @@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base | ||
22 | :presence => true, | 22 | :presence => true, |
23 | :length => { :within => 0..10000 } | 23 | :length => { :within => 0..10000 } |
24 | 24 | ||
25 | + scope :fresh, order("created_at DESC") | ||
26 | + scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) | ||
25 | 27 | ||
26 | def self.content_types | 28 | def self.content_types |
27 | - [ | 29 | + [ |
28 | ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java", | 30 | ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java", |
29 | ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb", | 31 | ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb", |
30 | ".js", ".sh", ".coffee", ".yml", ".md" | 32 | ".js", ".sh", ".coffee", ".yml", ".md" |
@@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base | @@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base | ||
34 | def colorize | 36 | def colorize |
35 | system_colorize(content, file_name) | 37 | system_colorize(content, file_name) |
36 | end | 38 | end |
39 | + | ||
40 | + def expired? | ||
41 | + expires_at && expires_at < Time.current | ||
42 | + end | ||
37 | end | 43 | end |
38 | # == Schema Information | 44 | # == Schema Information |
39 | # | 45 | # |
@@ -47,5 +53,6 @@ end | @@ -47,5 +53,6 @@ end | ||
47 | # created_at :datetime | 53 | # created_at :datetime |
48 | # updated_at :datetime | 54 | # updated_at :datetime |
49 | # file_name :string(255) | 55 | # file_name :string(255) |
56 | +# expires_at :datetime | ||
50 | # | 57 | # |
51 | 58 |
app/models/user.rb
@@ -5,7 +5,7 @@ class User < ActiveRecord::Base | @@ -5,7 +5,7 @@ class User < ActiveRecord::Base | ||
5 | :recoverable, :rememberable, :trackable, :validatable | 5 | :recoverable, :rememberable, :trackable, :validatable |
6 | 6 | ||
7 | # Setup accessible (or protected) attributes for your model | 7 | # Setup accessible (or protected) attributes for your model |
8 | - attr_accessible :email, :password, :password_confirmation, :remember_me, | 8 | + attr_accessible :email, :password, :password_confirmation, :remember_me, |
9 | :name, :projects_limit, :skype, :linkedin, :twitter | 9 | :name, :projects_limit, :skype, :linkedin, :twitter |
10 | 10 | ||
11 | has_many :users_projects, :dependent => :destroy | 11 | has_many :users_projects, :dependent => :destroy |
app/views/admin/mailer/preview.html.haml
1 | %p This is page with preview for all system emails that are sent to user | 1 | %p This is page with preview for all system emails that are sent to user |
2 | -%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system | 2 | +%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system |
3 | 3 | ||
4 | #accordion | 4 | #accordion |
5 | %h3 | 5 | %h3 |
6 | %a New user | 6 | %a New user |
7 | - %div | 7 | + %div |
8 | %iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"} | 8 | %iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"} |
9 | %h3 | 9 | %h3 |
10 | %a New issue | 10 | %a New issue |
11 | - %div | 11 | + %div |
12 | %iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"} | 12 | %iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"} |
13 | - %h3 | 13 | + %h3 |
14 | %a Commit note | 14 | %a Commit note |
15 | %div | 15 | %div |
16 | %iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"} | 16 | %iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"} |
17 | %h3 | 17 | %h3 |
18 | %a Issue note | 18 | %a Issue note |
19 | - %div | 19 | + %div |
20 | %iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"} | 20 | %iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"} |
21 | %h3 | 21 | %h3 |
22 | %a Wall note | 22 | %a Wall note |
23 | - %div | 23 | + %div |
24 | %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} | 24 | %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} |
25 | 25 | ||
26 | - | ||
27 | -:javascript | 26 | +:javascript |
28 | $(function() { | 27 | $(function() { |
29 | $( "#accordion" ).accordion(); }); | 28 | $( "#accordion" ).accordion(); }); |
app/views/admin/projects/index.html.haml
app/views/admin/projects/show.html.haml
1 | %p#notice= notice | 1 | %p#notice= notice |
2 | 2 | ||
3 | .span-8.colborder | 3 | .span-8.colborder |
4 | - %h2= @admin_project.name | 4 | + %h2= @admin_project.name |
5 | 5 | ||
6 | %p | 6 | %p |
7 | %b Name: | 7 | %b Name: |
@@ -22,16 +22,16 @@ | @@ -22,16 +22,16 @@ | ||
22 | 22 | ||
23 | .span-14 | 23 | .span-14 |
24 | 24 | ||
25 | - %h2 Team | 25 | + %h2 Team |
26 | 26 | ||
27 | %table.round-borders | 27 | %table.round-borders |
28 | %tr | 28 | %tr |
29 | %th Name | 29 | %th Name |
30 | - %th Added | 30 | + %th Added |
31 | %th Web | 31 | %th Web |
32 | %th Git | 32 | %th Git |
33 | %th Admin | 33 | %th Admin |
34 | - %th | 34 | + %th |
35 | 35 | ||
36 | - @admin_project.users_projects.each do |tm| | 36 | - @admin_project.users_projects.each do |tm| |
37 | %tr | 37 | %tr |
app/views/admin/team_members/index.html.haml
1 | - @admin_team_members.group_by(&:project).sort.each do |project, members| | 1 | - @admin_team_members.group_by(&:project).sort.each do |project, members| |
2 | %h3= link_to project.name, [:admin, project] | 2 | %h3= link_to project.name, [:admin, project] |
3 | %table | 3 | %table |
4 | - %tr | 4 | + %thead |
5 | %th Name | 5 | %th Name |
6 | %th Email | 6 | %th Email |
7 | %th Read | 7 | %th Read |
8 | %th Git | 8 | %th Git |
9 | %th Manage | 9 | %th Manage |
10 | - %th Added | ||
11 | - %th | 10 | + %th Added |
11 | + %th | ||
12 | %th | 12 | %th |
13 | %th | 13 | %th |
14 | - members.each do |tm| | 14 | - members.each do |tm| |
app/views/admin/team_members/show.html.haml
app/views/admin/users/_form.html.haml
app/views/admin/users/index.html.haml
app/views/admin/users/new.html.haml
app/views/admin/users/show.html.haml
@@ -19,28 +19,27 @@ | @@ -19,28 +19,27 @@ | ||
19 | = @admin_user.skype | 19 | = @admin_user.skype |
20 | %p | 20 | %p |
21 | %b LinkedIn: | 21 | %b LinkedIn: |
22 | - = @admin_user.linkedin | 22 | + = @admin_user.linkedin |
23 | %p | 23 | %p |
24 | %b Twitter: | 24 | %b Twitter: |
25 | = @admin_user.twitter | 25 | = @admin_user.twitter |
26 | 26 | ||
27 | - | ||
28 | .clear | 27 | .clear |
29 | = link_to 'Edit', edit_admin_user_path(@admin_user) | 28 | = link_to 'Edit', edit_admin_user_path(@admin_user) |
30 | \| | 29 | \| |
31 | = link_to 'Back', admin_users_path | 30 | = link_to 'Back', admin_users_path |
32 | 31 | ||
33 | .span-14 | 32 | .span-14 |
34 | - %h2 Projects | 33 | + %h2 Projects |
35 | 34 | ||
36 | %table.round-borders | 35 | %table.round-borders |
37 | %tr | 36 | %tr |
38 | %th Name | 37 | %th Name |
39 | - %th Added | 38 | + %th Added |
40 | %th Web | 39 | %th Web |
41 | %th Git | 40 | %th Git |
42 | %th Admin | 41 | %th Admin |
43 | - %th | 42 | + %th |
44 | 43 | ||
45 | - @admin_user.users_projects.each do |tm| | 44 | - @admin_user.users_projects.each do |tm| |
46 | - project = tm.project | 45 | - project = tm.project |
app/views/commits/_commits.html.haml
1 | - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| | 1 | - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| |
2 | - .day-commits-table | ||
3 | - .day-header | 2 | + %div{ :class => "commits-date ui-box ui-box-small ui-box-big" } |
3 | + .day-commits-table | ||
4 | %h3= day.stamp("28 Aug, 2010") | 4 | %h3= day.stamp("28 Aug, 2010") |
5 | - %ul | ||
6 | - - commits.each do |commit| | ||
7 | - %li{ :class => "commit", :url => project_commit_path(@project, :id => commit.id) } | ||
8 | - - if commit.author.email | ||
9 | - = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
10 | - - else | ||
11 | - = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" | ||
12 | - %p | ||
13 | - %strong | ||
14 | - = truncate(commit.safe_message, :length => 60) | ||
15 | - = link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right" | ||
16 | - = link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right" | ||
17 | - %span | ||
18 | - %span.author | ||
19 | - = commit.author | ||
20 | - = time_ago_in_words(commit.committed_date) | ||
21 | - ago | ||
22 | -= more_commits_link if @commits.size > 99 | 5 | + .data |
6 | + - commits.each do |commit| | ||
7 | + %a{ :class => "commit", :href => project_commit_path(@project, :id => commit.id) } | ||
8 | + %span.commit-info | ||
9 | + %data.commit-button | ||
10 | + = truncate(commit.id.to_s, :length => 16) | ||
11 | + %i | ||
12 | + %data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"} | ||
13 | + Browse Code | ||
14 | + - if commit.author_email | ||
15 | + = image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
16 | + - else | ||
17 | + = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" | ||
18 | + %span.commit-title | ||
19 | + %strong | ||
20 | + = truncate(commit.safe_message, :length => 60) | ||
21 | + %span.commit-author | ||
22 | + %strong= commit.author_name | ||
23 | + = time_ago_in_words(commit.committed_date) | ||
24 | + ago |
app/views/commits/_diff.html.haml
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | .diff_file_header | 8 | .diff_file_header |
9 | - if diff.deleted_file | 9 | - if diff.deleted_file |
10 | %strong{:id => "#{diff.b_path}"}= diff.a_path | 10 | %strong{:id => "#{diff.b_path}"}= diff.a_path |
11 | - - else | 11 | + - else |
12 | = link_to tree_file_project_path(@project, @commit.id, diff.b_path) do | 12 | = link_to tree_file_project_path(@project, @commit.id, diff.b_path) do |
13 | %strong{:id => "#{diff.b_path}"}= diff.b_path | 13 | %strong{:id => "#{diff.b_path}"}= diff.b_path |
14 | %br/ | 14 | %br/ |
@@ -19,5 +19,5 @@ | @@ -19,5 +19,5 @@ | ||
19 | .diff_file_content_image | 19 | .diff_file_content_image |
20 | %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | 20 | %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} |
21 | - else | 21 | - else |
22 | - %p | 22 | + %p |
23 | %center No preview for this file type | 23 | %center No preview for this file type |
app/views/commits/_index.html.haml
app/views/commits/_text_file.html.haml
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | - line_new = 0 | 2 | - line_new = 0 |
3 | - lines_arr = diff.diff.lines.to_a | 3 | - lines_arr = diff.diff.lines.to_a |
4 | - lines_arr.each do |line| | 4 | - lines_arr.each do |line| |
5 | + - next if line.match(/^--- \/dev\/null/) | ||
5 | - next if line.match(/^--- a/) | 6 | - next if line.match(/^--- a/) |
6 | - next if line.match(/^\+\+\+ b/) | 7 | - next if line.match(/^\+\+\+ b/) |
7 | - if line.match(/^@@ -/) | 8 | - if line.match(/^@@ -/) |
@@ -12,10 +13,10 @@ | @@ -12,10 +13,10 @@ | ||
12 | = diff_line(line, line_new, line_old) | 13 | = diff_line(line, line_new, line_old) |
13 | - if line[0] == "+" | 14 | - if line[0] == "+" |
14 | - line_new += 1 | 15 | - line_new += 1 |
15 | - - elsif | 16 | + - elsif |
16 | - line[0] == "-" | 17 | - line[0] == "-" |
17 | - line_old += 1 | 18 | - line_old += 1 |
18 | - - else | 19 | + - else |
19 | - line_new += 1 | 20 | - line_new += 1 |
20 | - line_old += 1 | 21 | - line_old += 1 |
21 | 22 |
app/views/commits/index.html.haml
1 | -%div | ||
2 | - %h3 | ||
3 | - .left | ||
4 | - = form_tag project_commits_path(@project), :method => :get do | ||
5 | - = select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" | ||
6 | - | ||
7 | - .left.prepend-1 | ||
8 | - = form_tag project_commits_path(@project), :method => :get do | ||
9 | - = select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" | ||
10 | - = text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"] | ||
11 | - .clear | ||
12 | - - if params[:path] | ||
13 | - %h3{:style => "color:#555"} /#{params[:path]} | ||
14 | - %div{:id => dom_id(@project)} | ||
15 | - = render "commits" | 1 | +- content_for(:body_class, "project-page commits-page") |
2 | + | ||
3 | +-#%a.right.button{:href => "#"} Download | ||
4 | +-#-if can? current_user, :admin_project, @project | ||
5 | + %a.right.button.blue{:href => "#"} EDIT | ||
6 | +%h2.icon | ||
7 | + %span | ||
8 | + %d | ||
9 | + = link_to project_commits_path(@project) do | ||
10 | + = @project.name | ||
11 | + - if params[:path] | ||
12 | + \/ | ||
13 | + %a{:href => "#"}= params[:path].split("/").join(" / ") | ||
14 | + | ||
15 | +.right= render :partial => "projects/refs", :locals => { :destination => project_commits_path(@project) } | ||
16 | + | ||
17 | +%div{:id => dom_id(@project)} | ||
18 | + #commits_list= render "commits" | ||
19 | +.clear | ||
20 | +.loading{ :style => "display:none;"} | ||
21 | + %center= image_tag "ajax-loader.gif" | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | +:javascript | ||
26 | + $(function(){ | ||
27 | + CommitsList.init("#{@ref}", 20); | ||
28 | + }); |
app/views/commits/show.html.haml
1 | %h3 | 1 | %h3 |
2 | - = "[ #{@commit.committer} ] #{truncate(@commit.safe_message)}" | 2 | + = "[ #{@commit.author_name} ] #{truncate(@commit.safe_message, :length => 70)}" |
3 | -#= link_to 'Back', project_commits_path(@project), :class => "button" | 3 | -#= link_to 'Back', project_commits_path(@project), :class => "button" |
4 | %table.round-borders | 4 | %table.round-borders |
5 | %tr | 5 | %tr |
@@ -7,33 +7,21 @@ | @@ -7,33 +7,21 @@ | ||
7 | %td= @commit.id | 7 | %td= @commit.id |
8 | %tr | 8 | %tr |
9 | %td Author | 9 | %td Author |
10 | - %td= @commit.author | ||
11 | - %tr | ||
12 | - %td Commiter | ||
13 | - %td= @commit.committer | 10 | + %td= @commit.author_name |
14 | %tr | 11 | %tr |
15 | %td Commited Date | 12 | %td Commited Date |
16 | - %td= @commit.committed_date | 13 | + %td= @commit.committed_date.stamp("21 Aug 2011, 11:15pm") |
17 | %tr | 14 | %tr |
18 | %td Message | 15 | %td Message |
19 | - %td= @commit.safe_message | 16 | + %td |
17 | + %pre.commit_message | ||
18 | + = preserve @commit.safe_message | ||
20 | %tr | 19 | %tr |
21 | %td Tree | 20 | %td Tree |
22 | %td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id) | 21 | %td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id) |
23 | .clear | 22 | .clear |
24 | 23 | ||
25 | -#tabs | ||
26 | - %ul | ||
27 | - %li | ||
28 | - %a{ :href => "#tabs-1" } Diff | ||
29 | - %li | ||
30 | - %a{ :href => "#tabs-2" } Comments | ||
31 | - %span{ :class => "notes_count" }= @notes.count | ||
32 | - %hr | ||
33 | - #tabs-1 | ||
34 | - = render "commits/diff" | ||
35 | - #tabs-2 | ||
36 | - = render "notes/notes" | 24 | +%br |
37 | 25 | ||
38 | -:javascript | ||
39 | - $(function() { $( "#tabs" ).tabs(); }); | 26 | += render "commits/diff" |
27 | += render "notes/notes" |
app/views/commits/show.js.haml
1 | --#:plain | ||
2 | - $("#side-commit-preview").remove(); | ||
3 | - var side = $("<div id='side-commit-preview'></div>"); | ||
4 | - side.html("#{escape_javascript(render "commits/show")}"); | ||
5 | - $("##{dom_id(@project)}").parent().append(side); | ||
6 | - $("##{dom_id(@project)}").addClass("span-14"); | ||
7 | -:plain | ||
8 | - $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | 1 | += render "notes/load" |
app/views/dashboard/index.html.haml
1 | -timeline | 1 | +- content_for(:body_class, "dashboard-page") |
2 | + | ||
3 | +#dashboard-content.dashboard-content.content | ||
4 | + %aside | ||
5 | + %h4 | ||
6 | + - if current_user.can_create_project? | ||
7 | + %a.button-small.button-green{:href => new_project_path} New Repository | ||
8 | + Your Repositories | ||
9 | + %ol.project-list | ||
10 | + - @projects.each do |project| | ||
11 | + %li | ||
12 | + %a{:href => project_path(project)} | ||
13 | + %span.arrow → | ||
14 | + %span.project-name= project.name | ||
15 | + %span.time | ||
16 | + %strong Last activity: | ||
17 | + = project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never" | ||
18 | + #news-feed.news-feed | ||
19 | + %h2.icon | ||
20 | + %span> | ||
21 | + Dashboard | ||
22 | + - @active_projects.first(3).each do |project| | ||
23 | + .project-box.project-updates.ui-box.ui-box-small.ui-box-big | ||
24 | + %h3= project.name | ||
25 | + .data | ||
26 | + - project.updates.each do |update| | ||
27 | + %a.project-update{:href => dashboard_feed_path(project, update)} | ||
28 | + = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 | ||
29 | + %span.update-title | ||
30 | + = dashboard_feed_title(update) | ||
31 | + %span.update-author | ||
32 | + %strong= update.author_name | ||
33 | + authored | ||
34 | + = time_ago_in_words(update.created_at) | ||
35 | + ago | ||
36 | + %br | ||
37 | + / .project-update | ||
38 | + / .project-updates | ||
39 | + / #news-feed | ||
40 | +/ #dashboard-content |
app/views/devise/confirmations/new.html.erb
@@ -9,4 +9,4 @@ | @@ -9,4 +9,4 @@ | ||
9 | <div><%= f.submit "Resend confirmation instructions" %></div> | 9 | <div><%= f.submit "Resend confirmation instructions" %></div> |
10 | <% end %> | 10 | <% end %> |
11 | 11 | ||
12 | -<%= render :partial => "devise/shared/links" %> | ||
13 | \ No newline at end of file | 12 | \ No newline at end of file |
13 | +<%= render :partial => "devise/shared/links" %> |
app/views/devise/passwords/edit.html.erb
@@ -13,4 +13,4 @@ | @@ -13,4 +13,4 @@ | ||
13 | <div><%= f.submit "Change my password" %></div> | 13 | <div><%= f.submit "Change my password" %></div> |
14 | <% end %> | 14 | <% end %> |
15 | 15 | ||
16 | -<%= render :partial => "devise/shared/links" %> | ||
17 | \ No newline at end of file | 16 | \ No newline at end of file |
17 | +<%= render :partial => "devise/shared/links" %> |
app/views/devise/passwords/new.html.erb
1 | -<h2>Forgot your password?</h2> | ||
2 | - | ||
3 | -<div class="span-12 colborder"> | ||
4 | - <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> | ||
5 | - <%= devise_error_messages! %> | ||
6 | - | ||
7 | - <div><%= f.label :email %><br /> | ||
8 | - <%= f.email_field :email %></div> | ||
9 | - | ||
10 | - <div><%= f.submit "Send me reset password instructions", :class => "lbutton vm" %></div> | ||
11 | - <% end %> | ||
12 | -</div> | ||
13 | -<div> | ||
14 | - <%= render :partial => "devise/shared/links" %> | ||
15 | -</div> | 1 | +<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :class => "login-box", :method => :post }) do |f| %> |
2 | + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> | ||
3 | + <%= devise_error_messages! %> | ||
4 | + <%= f.email_field :email, :placeholder => "Email", :class => "text top" %> | ||
5 | + <br/> | ||
6 | + <%= f.submit "Reset password", :class => "grey-button" %> | ||
7 | + <div class="right"> <%= render :partial => "devise/shared/links" %></div> | ||
8 | +<% end %> |
app/views/devise/sessions/new.html.erb
1 | -<h2>Sign in</h2> | 1 | +<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> |
2 | + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> | ||
3 | + <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> | ||
4 | + <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> | ||
2 | 5 | ||
3 | -<div class="span-12 colborder"> | ||
4 | - <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> | ||
5 | - <div><%= f.label :email %><br /> | ||
6 | - <%= f.text_field :email %></div> | ||
7 | - | ||
8 | - <div><%= f.label :password %><br /> | ||
9 | - <%= f.password_field :password %></div> | ||
10 | - | ||
11 | - <% if devise_mapping.rememberable? -%> | ||
12 | - <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> | ||
13 | - <% end -%> | ||
14 | - <br/> | ||
15 | - <div><%= f.submit "Sign in", :class => "lbutton vm" %></div> | ||
16 | - <% end %> | ||
17 | -</div> | ||
18 | -<div> | ||
19 | - <%= render :partial => "devise/shared/links" %> | ||
20 | -</div> | 6 | + <% if devise_mapping.rememberable? -%> |
7 | + <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> | ||
8 | + <% end -%> | ||
9 | + <br/> | ||
10 | + <%= f.submit "Sign in", :class => "grey-button" %> | ||
11 | + <div class="right"> <%= render :partial => "devise/shared/links" %></div> | ||
12 | +<% end %> |
app/views/devise/shared/_links.erb
@@ -22,4 +22,4 @@ | @@ -22,4 +22,4 @@ | ||
22 | <%- resource_class.omniauth_providers.each do |provider| %> | 22 | <%- resource_class.omniauth_providers.each do |provider| %> |
23 | <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> | 23 | <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> |
24 | <% end -%> | 24 | <% end -%> |
25 | -<% end -%> | ||
26 | \ No newline at end of file | 25 | \ No newline at end of file |
26 | +<% end -%> |
app/views/devise/unlocks/new.html.erb
@@ -9,4 +9,4 @@ | @@ -9,4 +9,4 @@ | ||
9 | <div><%= f.submit "Resend unlock instructions" %></div> | 9 | <div><%= f.submit "Resend unlock instructions" %></div> |
10 | <% end %> | 10 | <% end %> |
11 | 11 | ||
12 | -<%= render :partial => "devise/shared/links" %> | ||
13 | \ No newline at end of file | 12 | \ No newline at end of file |
13 | +<%= render :partial => "devise/shared/links" %> |
app/views/issues/_form.html.haml
@@ -7,10 +7,10 @@ | @@ -7,10 +7,10 @@ | ||
7 | 7 | ||
8 | .span-8 | 8 | .span-8 |
9 | = f.label :title | 9 | = f.label :title |
10 | - = f.text_field :title, :style => "width:450px" | ||
11 | - .span-8 | ||
12 | - = f.label :content | ||
13 | - = f.text_area :content, :style => "width:450px; height:130px" | 10 | + = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 |
11 | + -#.span-8 | ||
12 | + -#= f.label :content | ||
13 | + -#= f.text_area :content, :style => "width:450px; height:130px" | ||
14 | .span-8.append-bottom | 14 | .span-8.append-bottom |
15 | = f.label :assignee_id | 15 | = f.label :assignee_id |
16 | = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) | 16 | = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) |
app/views/issues/_issues.html.haml
1 | %table.round-borders#issues-table | 1 | %table.round-borders#issues-table |
2 | - %tr | 2 | + %thead |
3 | - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" | 3 | - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" |
4 | - %th | 4 | + %th |
5 | %th Assignee | 5 | %th Assignee |
6 | %th ID | 6 | %th ID |
7 | %th Title | 7 | %th Title |
8 | %th Closed? | 8 | %th Closed? |
9 | - %th | ||
10 | 9 | ||
11 | - @issues.critical.each do |issue| | 10 | - @issues.critical.each do |issue| |
12 | = render(:partial => 'show', :locals => {:issue => issue}) | 11 | = render(:partial => 'show', :locals => {:issue => issue}) |
app/views/issues/_show.html.haml
1 | %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } | 1 | %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } |
2 | - - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" | 2 | + - if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0") |
3 | %td | 3 | %td |
4 | = image_tag "move.png" , :class => [:handle, :left] | 4 | = image_tag "move.png" , :class => [:handle, :left] |
5 | %td | 5 | %td |
6 | = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" | 6 | = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" |
7 | - = truncate issue.assignee.name, :lenght => 20 | 7 | + = issue.assignee.name |
8 | %td ##{issue.id} | 8 | %td ##{issue.id} |
9 | %td | 9 | %td |
10 | - = html_escape issue.title | 10 | + = truncate(html_escape(issue.title), :length => 200) |
11 | + %br | ||
11 | %br | 12 | %br |
12 | - if issue.critical | 13 | - if issue.critical |
13 | %span.tag.high critical | 14 | %span.tag.high critical |
14 | - if issue.today? | 15 | - if issue.today? |
15 | %span.tag.today today | 16 | %span.tag.today today |
17 | + | ||
18 | + .right | ||
19 | + - if can?(current_user, :admin_issue, @project) || issue.author == current_user | ||
20 | + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true | ||
21 | + - if can?(current_user, :admin_issue, @project) || issue.author == current_user | ||
22 | + | ||
23 | + = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" | ||
24 | + | ||
16 | -#- if issue.author == current_user | 25 | -#- if issue.author == current_user |
17 | -#%span.tag.yours yours | 26 | -#%span.tag.yours yours |
18 | -#- if issue.notes.count > 0 | 27 | -#- if issue.notes.count > 0 |
@@ -21,13 +30,8 @@ | @@ -21,13 +30,8 @@ | ||
21 | -#notes | 30 | -#notes |
22 | %td | 31 | %td |
23 | - if can? current_user, :write_issue, @project | 32 | - if can? current_user, :write_issue, @project |
24 | - = form_for([@project, issue], :remote => true) do |f| | 33 | + = form_for([@project, issue], :remote => true) do |f| |
25 | = f.check_box :closed, :onclick => "$(this).parent().submit();" | 34 | = f.check_box :closed, :onclick => "$(this).parent().submit();" |
26 | = hidden_field_tag :status_only, true | 35 | = hidden_field_tag :status_only, true |
27 | - - else | 36 | + - else |
28 | = check_box_tag "closed", 1, issue.closed, :disabled => true | 37 | = check_box_tag "closed", 1, issue.closed, :disabled => true |
29 | - %td | ||
30 | - - if can?(current_user, :admin_issue, @project) || issue.author == current_user | ||
31 | - = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "lbutton positive", :remote => true | ||
32 | - - if can?(current_user, :admin_issue, @project) || issue.author == current_user | ||
33 | - = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{issue.id}" |
app/views/issues/index.html.haml
1 | %div | 1 | %div |
2 | - - if can? current_user, :write_issue, @project | ||
3 | - .left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" | ||
4 | - .right | ||
5 | - = form_tag project_issues_path(@project), :method => :get do | ||
6 | - .span-2 | ||
7 | - = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues" | ||
8 | - = label_tag "open_issues","Open" | ||
9 | - .span-2 | ||
10 | - = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues" | ||
11 | - = label_tag "closed_issues","Closed" | ||
12 | - .span-2 | ||
13 | - = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues" | ||
14 | - = label_tag "my_issues","To Me" | ||
15 | - | ||
16 | - .span-2 | ||
17 | - = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues" | ||
18 | - = label_tag "all_issues","All" | 2 | + .top_panel_issues |
3 | + - if can? current_user, :write_issue, @project | ||
4 | + %div{:class => "left", :style => "margin-right: 10px;" } | ||
5 | + = link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" | ||
6 | + = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do | ||
7 | + = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } | ||
8 | + = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } | ||
9 | + | ||
10 | + .right.issues_filter | ||
11 | + = form_tag project_issues_path(@project), :method => :get do | ||
12 | + .left | ||
13 | + = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status" | ||
14 | + = label_tag "open_issues","Open" | ||
15 | + .left | ||
16 | + = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status" | ||
17 | + = label_tag "closed_issues","Closed" | ||
18 | + .left | ||
19 | + = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status" | ||
20 | + = label_tag "my_issues","To Me" | ||
21 | + .left | ||
22 | + = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status" | ||
23 | + = label_tag "all_issues","All" | ||
19 | 24 | ||
20 | #issues-table-holder= render "issues" | 25 | #issues-table-holder= render "issues" |
21 | %br | 26 | %br |
22 | :javascript | 27 | :javascript |
23 | - $('.delete-issue').live('ajax:success', function() { | ||
24 | - $(this).closest('tr').fadeOut(); }); | ||
25 | - | 28 | + var href = $('.issue_search').parent().attr('action'); |
29 | + var last_terms = ''; | ||
30 | + | ||
31 | + $('.issue_search').keyup(function() { | ||
32 | + var terms = $(this).val(); | ||
33 | + var project_id = $('#project_id').val(); | ||
34 | + var status = $('.status:checked').val(); | ||
35 | + if (terms != last_terms) { | ||
36 | + last_terms = terms; | ||
37 | + | ||
38 | + if (terms.length >= 2 || terms.length == 0) { | ||
39 | + $.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) { | ||
40 | + $('#issues-table').html(response); | ||
41 | + setSortable(); | ||
42 | + }); | ||
43 | + } | ||
44 | + } | ||
45 | + }); | ||
46 | + | ||
47 | + $('.delete-issue').live('ajax:success', function() { | ||
48 | + $(this).closest('tr').fadeOut(); updatePage();}); | ||
49 | + | ||
26 | function setSortable(){ | 50 | function setSortable(){ |
27 | $('#issues-table>tbody').sortable({ | 51 | $('#issues-table>tbody').sortable({ |
28 | axis: 'y', | 52 | axis: 'y', |
app/views/issues/show.html.haml
1 | %h2 | 1 | %h2 |
2 | - = "Issue ##{@issue.id} - #{@issue.title}" | ||
3 | - | ||
4 | -.span-15 | ||
5 | - = simple_format html_escape(@issue.content) | 2 | + %strong |
3 | + Issue | ||
4 | + = "##{@issue.id}" | ||
5 | + – | ||
6 | + = html_escape(@issue.title) | ||
7 | +.left.width-65p | ||
6 | .issue_notes= render "notes/notes" | 8 | .issue_notes= render "notes/notes" |
7 | -.span-8.right | 9 | + |
10 | + .loading{ :style => "display:none;"} | ||
11 | + %center= image_tag "ajax-loader.gif" | ||
12 | +.right.width-30p | ||
8 | .span-8 | 13 | .span-8 |
9 | - - if @issue.closed | ||
10 | - %center.success Closed | ||
11 | - - else | ||
12 | - %center.error Open | ||
13 | %table.round-borders | 14 | %table.round-borders |
14 | %tr | 15 | %tr |
15 | - %td Title: | ||
16 | - %td | ||
17 | - = truncate html_escape(@issue.title) | ||
18 | - %tr | ||
19 | - %td Project | ||
20 | - %td | ||
21 | - %strong= @issue.project.name | ||
22 | - %tr | ||
23 | - %td Author: | 16 | + %td Author: |
24 | %td | 17 | %td |
25 | = image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" | 18 | = image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" |
26 | = @issue.author.name | 19 | = @issue.author.name |
27 | %tr | 20 | %tr |
28 | - %td Assignee: | 21 | + %td Assignee: |
29 | %td | 22 | %td |
30 | = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" | 23 | = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" |
31 | = @issue.assignee.name | 24 | = @issue.assignee.name |
25 | + %tr | ||
26 | + %td Tags | ||
27 | + %td | ||
28 | + - if @issue.critical | ||
29 | + %span.tag.high critical | ||
30 | + - else | ||
31 | + %span.tag.normal normal | ||
32 | + | ||
33 | + - if @issue.today? | ||
34 | + %span.tag.today today | ||
32 | %tr | 35 | %tr |
33 | %td Closed? | 36 | %td Closed? |
34 | %td | 37 | %td |
35 | - - if can? current_user, :write_issue, @project | ||
36 | - = form_for([@project, @issue]) do |f| | 38 | + - if can? current_user, :write_issue, @issue |
39 | + = form_for([@project, @issue]) do |f| | ||
37 | = f.check_box :closed, :onclick => "$(this).parent().submit();" | 40 | = f.check_box :closed, :onclick => "$(this).parent().submit();" |
38 | = hidden_field_tag :status_only, true | 41 | = hidden_field_tag :status_only, true |
39 | - - else | 42 | + - else |
40 | = check_box_tag "closed", 1, @issue.closed, :disabled => true | 43 | = check_box_tag "closed", 1, @issue.closed, :disabled => true |
41 | 44 | ||
42 | 45 | ||
46 | + - if can?(current_user, :write_issue, @issue) | ||
47 | + .clear | ||
48 | + %br | ||
49 | + = link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true | ||
50 | + .right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}" | ||
43 | .clear | 51 | .clear |
44 | - |
app/views/issues/show.js.haml
app/views/issues/update.js.haml
@@ -2,11 +2,11 @@ | @@ -2,11 +2,11 @@ | ||
2 | - if @issue.valid? | 2 | - if @issue.valid? |
3 | :plain | 3 | :plain |
4 | $("##{dom_id(@issue)}").fadeOut(); | 4 | $("##{dom_id(@issue)}").fadeOut(); |
5 | -- else | 5 | +- else |
6 | - if @issue.valid? | 6 | - if @issue.valid? |
7 | :plain | 7 | :plain |
8 | $("#edit_issue_dialog").dialog("close"); | 8 | $("#edit_issue_dialog").dialog("close"); |
9 | - $.ajax({type: "GET", url: location.href, dataType: "script"}); | 9 | + updatePage(); |
10 | - else | 10 | - else |
11 | :plain | 11 | :plain |
12 | $("#edit_issue_dialog").empty(); | 12 | $("#edit_issue_dialog").empty(); |
app/views/keys/index.html.haml
@@ -10,6 +10,6 @@ | @@ -10,6 +10,6 @@ | ||
10 | = render(:partial => 'show', :locals => {:key => key}) | 10 | = render(:partial => 'show', :locals => {:key => key}) |
11 | 11 | ||
12 | :javascript | 12 | :javascript |
13 | - $('.delete-key').live('ajax:success', function() { | ||
14 | - $(this).closest('tr').fadeOut(); }); | 13 | + $('.delete-key').live('ajax:success', function() { |
14 | + $(this).closest('tr').fadeOut(); }); | ||
15 | 15 |
app/views/layouts/_flash.html.haml
@@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
6 | %h4= text | 6 | %h4= text |
7 | :javascript | 7 | :javascript |
8 | $(function(){ | 8 | $(function(){ |
9 | - $("#flash_container").slideDown("slow"); | ||
10 | - $("#flash_container").click(function(){ | ||
11 | - $(this).slideUp("slow"); | 9 | + $("#flash_container").slideDown("slow"); |
10 | + $("#flash_container").click(function(){ | ||
11 | + $(this).slideUp("slow"); | ||
12 | }); | 12 | }); |
13 | setTimeout("hideFlash()",2000); | 13 | setTimeout("hideFlash()",2000); |
14 | }); | 14 | }); |
app/views/layouts/_head_panel.html.erb
1 | -<div id="header-panel"> | ||
2 | - <div class="container"> | ||
3 | - <div class="span-24"> | ||
4 | - <div class="span-10"> | ||
5 | - <%#= image_tag "git.png", :height => 40, :class => "left" %> | ||
6 | - <%#= link_to "gitlab", root_path, :id => "logo" %> | ||
7 | - <span class="search-holder"> | ||
8 | - <%= text_field_tag "search", nil, :placeholder => "Search" %> | ||
9 | - </span> | ||
10 | - </div> | ||
11 | - <div class="right"> | ||
12 | - <%= link_to truncate(@project.name, :length => 20), project_path(@project), :class => "current button" if @project && !@project.new_record? %> | ||
13 | - <%= link_to 'Projects', projects_path, :class => current_page?(projects_path) ? "current button" : "button" %> | ||
14 | - <%= link_to('Admin', admin_root_path, :class => admin_namespace? ? "current button" : "button" ) if current_user.is_admin? %> | ||
15 | - <%= link_to profile_path, :class => ((controller.controller_name == "keys" || controller.controller_name == "profile") ? "current button" : "button") do %> | ||
16 | - <%= image_tag gravatar_icon(current_user.email) %> | ||
17 | - <%= current_user.name.split(" ").first %> | ||
18 | - <% end %> | ||
19 | - <%= link_to 'Logout', destroy_user_session_path, :style => "border-left: 1px solid #666;", :class => "button", :method => :delete %> | ||
20 | - </div> | 1 | +<!-- Page Header --> |
2 | +<header> | ||
3 | + <h1 class="logo"> | ||
4 | + <a href="/">GITLAB</a> | ||
5 | + </h1> | ||
6 | + <div class="account-box"> | ||
7 | + <%= link_to profile_path, :class => "pic" do %> | ||
8 | + <%= image_tag gravatar_icon(current_user.email) %> | ||
9 | + <% end %> | ||
10 | + | ||
11 | + <a href="#" class="arrow-up"></a> | ||
12 | + | ||
13 | + <div class="account-links"> | ||
14 | + <%= link_to profile_path, :class => "username" do %> | ||
15 | + <%#= current_user.name %> | ||
16 | + Your profile | ||
17 | + <% end %> | ||
18 | + <%= link_to "Fluid layout", url_for( :view_style => 'fluid' ) if cookies[:view_style] == "collapsed"%> | ||
19 | + <%= link_to "Fixed layout", url_for( :view_style => 'collapsed' ) unless cookies[:view_style] == "collapsed"%> | ||
20 | + <%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %> | ||
21 | </div> | 21 | </div> |
22 | + </div><!-- .account-box --> | ||
23 | + | ||
24 | + <div class="search"> | ||
25 | + <%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %> | ||
22 | </div> | 26 | </div> |
23 | -</div> | 27 | + <!-- .login-top --> |
28 | + <nav> | ||
29 | + <%= link_to dashboard_path, :class => current_page?(root_path) ? "current dashboard" : "dashboard" do %> | ||
30 | + <span></span>Dashboard | ||
31 | + <% end %> | ||
32 | + <%= link_to projects_path, :class => current_page?(projects_path) ? "current project" : "project" do %> | ||
33 | + <span></span>Projects | ||
34 | + <% end %> | ||
35 | + <%= link_to((current_user.is_admin? ? admin_root_path : "#"), :class => (admin_namespace? ? "current admin" : "admin")) do %> | ||
36 | + <span></span>Admin | ||
37 | + <% end %> | ||
38 | + </nav> | ||
24 | 39 | ||
40 | +</header> | ||
41 | +<!-- eo Page Header --> | ||
25 | 42 | ||
26 | <% if current_user %> | 43 | <% if current_user %> |
27 | <%= javascript_tag do %> | 44 | <%= javascript_tag do %> |
@@ -0,0 +1,26 @@ | @@ -0,0 +1,26 @@ | ||
1 | +!!! | ||
2 | +%html | ||
3 | + %head | ||
4 | + %title | ||
5 | + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} | ||
6 | + = stylesheet_link_tag "application" | ||
7 | + = javascript_include_tag "application" | ||
8 | + = csrf_meta_tags | ||
9 | + = javascript_tag do | ||
10 | + REQ_URI = "#{request.env["REQUEST_URI"]}"; | ||
11 | + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; | ||
12 | + %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} | ||
13 | + #container | ||
14 | + = render :partial => "layouts/flash" | ||
15 | + = render :partial => "layouts/head_panel" | ||
16 | + .project-container | ||
17 | + .project-sidebar | ||
18 | + .fixed | ||
19 | + %aside | ||
20 | + = link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil | ||
21 | + = link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil | ||
22 | + = link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil | ||
23 | + = link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil | ||
24 | + | ||
25 | + .project-content | ||
26 | + = yield |
app/views/layouts/application.html.haml
@@ -2,28 +2,16 @@ | @@ -2,28 +2,16 @@ | ||
2 | %html | 2 | %html |
3 | %head | 3 | %head |
4 | %title | 4 | %title |
5 | - GitLab #{" - #{@project.name}" if @project && !@project.new_record?} | ||
6 | - = stylesheet_link_tag 'blueprint/screen', :media => "screen, projection" | ||
7 | - = stylesheet_link_tag 'blueprint/print', :media => "print" | ||
8 | - = stylesheet_link_tag 'blueprint/plugins/buttons/screen', :media => "screen, projection" | ||
9 | - = stylesheet_link_tag 'blueprint/plugins/link-icons/screen', :media => "screen, projection" | ||
10 | - = stylesheet_link_tag 'jquery_ui/jquery-ui-1.8.16.custom', :media => "screen, projection" | 5 | + GitLab |
11 | = stylesheet_link_tag "application" | 6 | = stylesheet_link_tag "application" |
12 | = javascript_include_tag "application" | 7 | = javascript_include_tag "application" |
13 | = csrf_meta_tags | 8 | = csrf_meta_tags |
14 | - %link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/ | ||
15 | = javascript_tag do | 9 | = javascript_tag do |
16 | REQ_URI = "#{request.env["REQUEST_URI"]}"; | 10 | REQ_URI = "#{request.env["REQUEST_URI"]}"; |
17 | REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; | 11 | REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; |
18 | - %body#thebody | ||
19 | - = render :partial => "layouts/flash" | ||
20 | - - if user_signed_in? | 12 | + %body{ :class => body_class, :id => yield(:boyd_id)} |
13 | + #container | ||
14 | + = render :partial => "layouts/flash" | ||
21 | = render :partial => "layouts/head_panel" | 15 | = render :partial => "layouts/head_panel" |
22 | - .top_bar.container | ||
23 | - = render :partial => "projects/top_menu" if @project && !@project.new_record? | ||
24 | - = render :partial => "projects/projects_top_menu" if (controller.controller_name == "projects" && ["index", "new", "create"].include?(controller.action_name)) && !admin_namespace? | ||
25 | - = render :partial => "profile/top_menu" if ["keys", "profile"].include?(controller.controller_name) | ||
26 | - = render :partial => "admin/top_menu" if admin_namespace? | ||
27 | - #content-container.container | ||
28 | - .span-24 | ||
29 | - = yield | 16 | + = render :partial => "layouts/page_title" |
17 | + = yield |
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +!!! | ||
2 | +%html | ||
3 | + %head | ||
4 | + %title | ||
5 | + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} | ||
6 | + = stylesheet_link_tag "application" | ||
7 | + = javascript_include_tag "application" | ||
8 | + = csrf_meta_tags | ||
9 | + = javascript_tag do | ||
10 | + REQ_URI = "#{request.env["REQUEST_URI"]}"; | ||
11 | + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; | ||
12 | + %body.login-page | ||
13 | + = render :partial => "layouts/flash" | ||
14 | + = yield |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +!!! | ||
2 | +%html | ||
3 | + %head | ||
4 | + %title | ||
5 | + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} | ||
6 | + = stylesheet_link_tag "application" | ||
7 | + = javascript_include_tag "application" | ||
8 | + = csrf_meta_tags | ||
9 | + = javascript_tag do | ||
10 | + REQ_URI = "#{request.env["REQUEST_URI"]}"; | ||
11 | + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; | ||
12 | + %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} | ||
13 | + #container | ||
14 | + = render :partial => "layouts/flash" | ||
15 | + = render :partial => "layouts/head_panel" | ||
16 | + .project-container | ||
17 | + .project-sidebar | ||
18 | + .fixed | ||
19 | + %aside | ||
20 | + = link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil | ||
21 | + = link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil | ||
22 | + = link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do | ||
23 | + Keys | ||
24 | + - unless current_user.keys.empty? | ||
25 | + %span{ :class => "number" }= current_user.keys.count | ||
26 | + | ||
27 | + .project-content | ||
28 | + = yield |
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +!!! | ||
2 | +%html | ||
3 | + %head | ||
4 | + %title | ||
5 | + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} | ||
6 | + = stylesheet_link_tag "application" | ||
7 | + = javascript_include_tag "application" | ||
8 | + = csrf_meta_tags | ||
9 | + = javascript_tag do | ||
10 | + REQ_URI = "#{request.env["REQUEST_URI"]}"; | ||
11 | + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; | ||
12 | + %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} | ||
13 | + #container | ||
14 | + = render :partial => "layouts/flash" | ||
15 | + = render :partial => "layouts/head_panel" | ||
16 | + .project-container | ||
17 | + .project-sidebar | ||
18 | + .fixed | ||
19 | + %input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo} | ||
20 | + %aside | ||
21 | + = link_to "History", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil | ||
22 | + = link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil | ||
23 | + = link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil | ||
24 | + = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do | ||
25 | + Team | ||
26 | + - if @project.users_projects.count > 0 | ||
27 | + %span{ :class => "number" }= @project.users_projects.count | ||
28 | + = link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do | ||
29 | + Issues | ||
30 | + - if @project.issues.opened.count > 0 | ||
31 | + %span{ :class => "number" }= @project.issues.opened.count | ||
32 | + = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do | ||
33 | + Wall | ||
34 | + - if @project.common_notes.count > 0 | ||
35 | + %span{ :class => "number" }= @project.common_notes.count | ||
36 | + = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do | ||
37 | + Snippets | ||
38 | + - if @project.snippets.count > 0 | ||
39 | + %span{ :class => "number" }= @project.snippets.non_expired.count | ||
40 | + - if @commit | ||
41 | + = 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 | ||
42 | + | ||
43 | + .project-content | ||
44 | + = yield |
app/views/notes/_form.html.haml
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | 10 | ||
11 | %div | 11 | %div |
12 | = f.label :note | 12 | = f.label :note |
13 | - %cite (255 symbols only) | 13 | + %cite |
14 | %br | 14 | %br |
15 | = f.text_area :note, :size => 255 | 15 | = f.text_area :note, :size => 255 |
16 | 16 | ||
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | 22 | ||
23 | = check_box_tag :notify, 1, true | 23 | = check_box_tag :notify, 1, true |
24 | = label_tag :notify, "Notify project team about your note" | 24 | = label_tag :notify, "Notify project team about your note" |
25 | - | 25 | + |
26 | .clear | 26 | .clear |
27 | %br | 27 | %br |
28 | = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note" | 28 | = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note" |
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +- unless @notes.blank? | ||
2 | + | ||
3 | + - if params[:last_id] && params[:first_id] | ||
4 | + :plain | ||
5 | + NoteList.replace(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | ||
6 | + | ||
7 | + | ||
8 | + - elsif params[:last_id] | ||
9 | + :plain | ||
10 | + NoteList.prepend(#{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | ||
11 | + | ||
12 | + - elsif params[:first_id] | ||
13 | + :plain | ||
14 | + NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | ||
15 | + | ||
16 | + - else | ||
17 | + :plain |
app/views/notes/_notes.html.haml
1 | -- if controller.action_name == "wall" | ||
2 | - %ul#notes-list= render "notes/notes_list" | ||
3 | - | ||
4 | -- else | ||
5 | - %ul#notes-list= render "notes/notes_list" | ||
6 | - %br | ||
7 | - %br | ||
8 | - - if can? current_user, :write_note, @project | ||
9 | - = render "notes/form" | 1 | +- if can? current_user, :write_note, @project |
2 | + = render "notes/form" | ||
3 | +.clear | ||
4 | +%hr | ||
5 | +%ul#notes-list= render "notes/notes_list" | ||
10 | 6 | ||
11 | :javascript | 7 | :javascript |
12 | - $('.delete-note').live('ajax:success', function() { | ||
13 | - $(this).closest('li').fadeOut(); }); | 8 | + $('.delete-note').live('ajax:success', function() { |
9 | + $(this).closest('li').fadeOut(); }); | ||
14 | 10 | ||
15 | $("#new_note").live("ajax:before", function(){ | 11 | $("#new_note").live("ajax:before", function(){ |
16 | - $("#submit_note").attr("disabled", "disabled"); | 12 | + $("#submit_note").attr("disabled", "disabled"); |
17 | }) | 13 | }) |
18 | 14 | ||
19 | $("#new_note").live("ajax:complete", function(){ | 15 | $("#new_note").live("ajax:complete", function(){ |
20 | - $("#submit_note").removeAttr("disabled"); | 16 | + $("#submit_note").removeAttr("disabled"); |
21 | }) | 17 | }) |
22 | - | ||
23 | 18 | ||
24 | -- if ["issues", "projects"].include?(controller.controller_name) | ||
25 | - :javascript | ||
26 | - $(function(){ | ||
27 | - var int =self.setInterval("updatePage()", 20000); | 19 | + $(function(){ |
20 | + $("#note_note").live("click", function(){ | ||
21 | + $(this).css("height", "100px"); | ||
22 | + $('.attach_holder').show(); | ||
28 | }); | 23 | }); |
24 | + | ||
25 | + NoteList.init("wall", #{@notes.last.try(:id) || 0}, #{@notes.first.try(:id) || 0}); | ||
26 | + }); |
app/views/notes/_show.html.haml
1 | -%li{:id => dom_id(note)} | ||
2 | - %div.note_author | ||
3 | - = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
4 | - %div.note_content.left | ||
5 | - = simple_format(html_escape(note.note)) | ||
6 | - - if note.attachment.url | ||
7 | - Attachment: | ||
8 | - = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" | ||
9 | - %br | ||
10 | - %span.author= note.author.name | ||
11 | - %cite.ago | 1 | +%li{:id => dom_id(note), :class => "note"} |
2 | + = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
3 | + %div.note-author | ||
4 | + %strong= note.author_name | ||
5 | + %cite.cgray | ||
12 | = time_ago_in_words(note.updated_at) | 6 | = time_ago_in_words(note.updated_at) |
13 | ago | 7 | ago |
14 | - %br | ||
15 | - - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) | ||
16 | - = link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative" | 8 | + - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) |
9 | + = link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note right" | ||
10 | + | ||
11 | + %div.note-title | ||
12 | + = markdown(note.note) | ||
13 | + - if note.attachment.url | ||
14 | + .right | ||
15 | + %span.file | ||
16 | + = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" | ||
17 | .clear | 17 | .clear |
app/views/notes/create.js.haml
1 | - if @note.valid? | 1 | - if @note.valid? |
2 | :plain | 2 | :plain |
3 | $("#new_note .errors").remove(); | 3 | $("#new_note .errors").remove(); |
4 | - updatePage(); | ||
5 | $('#note_note').val(""); | 4 | $('#note_note').val(""); |
5 | + NoteList.prepend(#{@note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => @note})}"); | ||
6 | - else | 6 | - else |
7 | :plain | 7 | :plain |
8 | $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); | 8 | $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); |
9 | 9 | ||
10 | -:plain | 10 | +:plain |
11 | $("#submit_note").removeAttr("disabled"); | 11 | $("#submit_note").removeAttr("disabled"); |
app/views/notify/new_issue_email.html.haml
@@ -10,9 +10,9 @@ | @@ -10,9 +10,9 @@ | ||
10 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 10 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
11 | %td{:align => "left", :style => "padding: 20px 0 0;"} | 11 | %td{:align => "left", :style => "padding: 20px 0 0;"} |
12 | %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 12 | %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} |
13 | - = link_to project_issue_url(@project, @issue) do | 13 | + = link_to project_issue_url(@project, @issue) do |
14 | = "Issue ##{@issue.id.to_s}" | 14 | = "Issue ##{@issue.id.to_s}" |
15 | - = truncate(@issue.title, :length => 45) | 15 | + = truncate(@issue.title, :length => 45) |
16 | %br | 16 | %br |
17 | %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 17 | %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} |
18 | = @issue.content | 18 | = @issue.content |
app/views/notify/new_user_email.html.haml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 4 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
5 | %td{:align => "left", :style => "padding: 20px 0 0;"} | 5 | %td{:align => "left", :style => "padding: 20px 0 0;"} |
6 | %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 6 | %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} |
7 | - Hi #{@user.name}! | 7 | + Hi #{@user.name}! |
8 | %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 8 | %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} |
9 | Administrator created account for you. Now you are a member of company gitlab application. | 9 | Administrator created account for you. Now you are a member of company gitlab application. |
10 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 10 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
app/views/notify/note_issue_email.html.haml
@@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
4 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 4 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
5 | %td{:align => "left", :style => "padding: 20px 0 0;"} | 5 | %td{:align => "left", :style => "padding: 20px 0 0;"} |
6 | %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 6 | %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} |
7 | - New comment - | ||
8 | - = link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do | 7 | + New comment - |
8 | + = link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do | ||
9 | = "Issue ##{@issue.id.to_s}" | 9 | = "Issue ##{@issue.id.to_s}" |
10 | - = truncate(@issue.title, :length => 35) | 10 | + = truncate(@issue.title, :length => 35) |
11 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 11 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
12 | %tr | 12 | %tr |
13 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 13 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
app/views/notify/note_wall_email.html.haml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 4 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
5 | %td{:align => "left", :style => "padding: 20px 0 0;"} | 5 | %td{:align => "left", :style => "padding: 20px 0 0;"} |
6 | %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 6 | %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} |
7 | - New message on | 7 | + New message on |
8 | = link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}") | 8 | = link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}") |
9 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 9 | %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} |
10 | %tr | 10 | %tr |
app/views/projects/_form.html.haml
@@ -21,10 +21,15 @@ | @@ -21,10 +21,15 @@ | ||
21 | %td | 21 | %td |
22 | = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? | 22 | = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? |
23 | %tr | 23 | %tr |
24 | - %td | 24 | + %td |
25 | .left= f.label :code | 25 | .left= f.label :code |
26 | %cite.right http://yourserver/ | 26 | %cite.right http://yourserver/ |
27 | %td= f.text_field :code, :placeholder => "example" | 27 | %td= f.text_field :code, :placeholder => "example" |
28 | + | ||
29 | + %tr | ||
30 | + %td= f.label :tag_list | ||
31 | + %td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field | ||
32 | + | ||
28 | .field | 33 | .field |
29 | = f.label :description | 34 | = f.label :description |
30 | %br/ | 35 | %br/ |
@@ -39,10 +44,27 @@ | @@ -39,10 +44,27 @@ | ||
39 | = image_tag "ajax-loader.gif", :class => "append-bottom" | 44 | = image_tag "ajax-loader.gif", :class => "append-bottom" |
40 | - if @project.new_record? | 45 | - if @project.new_record? |
41 | %h3.prepend-top Creating project & repository. Please wait for few minutes | 46 | %h3.prepend-top Creating project & repository. Please wait for few minutes |
42 | - - else | 47 | + - else |
43 | %h3.prepend-top Updating project & repository. Please wait for few minutes | 48 | %h3.prepend-top Updating project & repository. Please wait for few minutes |
49 | + | ||
44 | :javascript | 50 | :javascript |
45 | - $('.new_project, .edit_project').bind('ajax:before', function() { | ||
46 | - $(this).find(".form_content").hide(); | 51 | + $('.new_project, .edit_project').bind('ajax:before', function() { |
52 | + $(this).find(".form_content").hide(); | ||
47 | $('.ajax_loader').show(); | 53 | $('.ajax_loader').show(); |
48 | - }); | 54 | + }); |
55 | + | ||
56 | +:javascript | ||
57 | + $(function(){ | ||
58 | + var tag_field = $('#tag_field').tagify(); | ||
59 | + | ||
60 | + tag_field.tagify('inputField').autocomplete({ | ||
61 | + source: '/tags.json' | ||
62 | + }); | ||
63 | + | ||
64 | + | ||
65 | + $('form').submit( function() { | ||
66 | + var tag_field = $('#tag_field') | ||
67 | + tag_field.val( tag_field.tagify('serialize') ); | ||
68 | + return true; | ||
69 | + }); | ||
70 | + }) |
app/views/projects/_list.html.haml
@@ -10,13 +10,18 @@ | @@ -10,13 +10,18 @@ | ||
10 | 10 | ||
11 | - @projects.each do |project| | 11 | - @projects.each do |project| |
12 | %tr{ :class => "project", :url => project_path(project) } | 12 | %tr{ :class => "project", :url => project_path(project) } |
13 | - %td= project.name | 13 | + %td |
14 | + = project.name | ||
15 | + .small-tags | ||
16 | + - project.tag_list.each do |tag| | ||
17 | + = link_to tag, "/tags/#{tag}" | ||
18 | + | ||
14 | %td= truncate project.url_to_repo | 19 | %td= truncate project.url_to_repo |
15 | %td= project.code | 20 | %td= project.code |
16 | %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled | 21 | %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled |
17 | %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled | 22 | %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled |
18 | %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled | 23 | %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled |
19 | - %td | 24 | + %td |
20 | -if can? current_user, :admin_project, project | 25 | -if can? current_user, :admin_project, project |
21 | = link_to 'Edit', edit_project_path(project), :class => "lbutton positive" | 26 | = link_to 'Edit', edit_project_path(project), :class => "lbutton positive" |
22 | %br | 27 | %br |
app/views/projects/_projects_top_menu.html.haml
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | $(".list").toggle(); | 11 | $(".list").toggle(); |
12 | if($(".tile").is(":visible")){ | 12 | if($(".tile").is(":visible")){ |
13 | $.cookie('project_view', 'tile', { expires: 14 }); | 13 | $.cookie('project_view', 'tile', { expires: 14 }); |
14 | - } else { | 14 | + } else { |
15 | $.cookie('project_view', 'list', { expires: 14 }); | 15 | $.cookie('project_view', 'list', { expires: 14 }); |
16 | } | 16 | } |
17 | } | 17 | } |
app/views/projects/_recent_commits.html.haml
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" | 6 | = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" |
7 | %p{:style => "margin-bottom: 3px;"} | 7 | %p{:style => "margin-bottom: 3px;"} |
8 | %strong | 8 | %strong |
9 | - = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) | ||
10 | - | 9 | + = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) |
10 | + | ||
11 | %span | 11 | %span |
12 | %span.author | 12 | %span.author |
13 | = commit.author.name.force_encoding("UTF-8") | 13 | = commit.author.name.force_encoding("UTF-8") |