Commit ed63d28e7a3d319d10c1477e12ec8f64bdabe3bd

Authored by user
2 parents c3eac16f c359eadf

Merge branch 'master' of https://github.com/gitlabhq/gitlabhq into admin-panel-disign

@@ -39,7 +39,7 @@ group :development, :test do @@ -39,7 +39,7 @@ group :development, :test do
39 gem 'capybara' 39 gem 'capybara'
40 gem 'autotest' 40 gem 'autotest'
41 gem 'autotest-rails' 41 gem 'autotest-rails'
42 - # gem 'ruby-debug19', :require => 'ruby-debug' 42 + gem 'ruby-debug19', :require => 'ruby-debug'
43 gem 'awesome_print' 43 gem 'awesome_print'
44 gem 'database_cleaner' 44 gem 'database_cleaner'
45 gem 'launchy' 45 gem 'launchy'
@@ -50,6 +50,7 @@ GEM @@ -50,6 +50,7 @@ GEM
50 acts_as_list (0.1.4) 50 acts_as_list (0.1.4)
51 addressable (2.2.6) 51 addressable (2.2.6)
52 ansi (1.4.1) 52 ansi (1.4.1)
  53 + archive-tar-minitar (0.5.2)
53 arel (2.2.1) 54 arel (2.2.1)
54 autotest (4.4.6) 55 autotest (4.4.6)
55 ZenTest (>= 4.4.1) 56 ZenTest (>= 4.4.1)
@@ -77,6 +78,7 @@ GEM @@ -77,6 +78,7 @@ GEM
77 coffee-script-source 78 coffee-script-source
78 execjs 79 execjs
79 coffee-script-source (1.1.3) 80 coffee-script-source (1.1.3)
  81 + columnize (0.3.4)
80 daemons (1.1.4) 82 daemons (1.1.4)
81 database_cleaner (0.7.0) 83 database_cleaner (0.7.0)
82 devise (1.5.0) 84 devise (1.5.0)
@@ -113,6 +115,8 @@ GEM @@ -113,6 +115,8 @@ GEM
113 letter_opener (0.0.2) 115 letter_opener (0.0.2)
114 launchy 116 launchy
115 libv8 (3.3.10.4) 117 libv8 (3.3.10.4)
  118 + linecache19 (0.5.12)
  119 + ruby_core_source (>= 0.1.4)
116 mail (2.3.0) 120 mail (2.3.0)
117 i18n (>= 0.4.0) 121 i18n (>= 0.4.0)
118 mime-types (~> 1.16) 122 mime-types (~> 1.16)
@@ -168,6 +172,16 @@ GEM @@ -168,6 +172,16 @@ GEM
168 activesupport (~> 3.0) 172 activesupport (~> 3.0)
169 railties (~> 3.0) 173 railties (~> 3.0)
170 rspec (~> 2.7.0) 174 rspec (~> 2.7.0)
  175 + ruby-debug-base19 (0.11.25)
  176 + columnize (>= 0.3.1)
  177 + linecache19 (>= 0.5.11)
  178 + ruby_core_source (>= 0.1.4)
  179 + ruby-debug19 (0.11.6)
  180 + columnize (>= 0.3.1)
  181 + linecache19 (>= 0.5.11)
  182 + ruby-debug-base19 (>= 0.11.19)
  183 + ruby_core_source (0.1.5)
  184 + archive-tar-minitar (>= 0.5.2)
171 rubypython (0.5.3) 185 rubypython (0.5.3)
172 blankslate (>= 2.1.2.3) 186 blankslate (>= 2.1.2.3)
173 ffi (~> 1.0.7) 187 ffi (~> 1.0.7)
@@ -254,6 +268,7 @@ DEPENDENCIES @@ -254,6 +268,7 @@ DEPENDENCIES
254 rails-footnotes (~> 3.7.5) 268 rails-footnotes (~> 3.7.5)
255 rdiscount 269 rdiscount
256 rspec-rails 270 rspec-rails
  271 + ruby-debug19
257 sass-rails (~> 3.1.0) 272 sass-rails (~> 3.1.0)
258 seed-fu (~> 2.1.0) 273 seed-fu (~> 2.1.0)
259 shoulda (~> 3.0.0.beta2) 274 shoulda (~> 3.0.0.beta2)
app/assets/stylesheets/style.scss
@@ -74,7 +74,6 @@ $blue_link: "#2fa0bb"; @@ -74,7 +74,6 @@ $blue_link: "#2fa0bb";
74 /* eo Vars */ 74 /* eo Vars */
75 75
76 html{ -webkit-font-smoothing:antialiased; } 76 html{ -webkit-font-smoothing:antialiased; }
77 -*{text-shadow: 0 1px 0 white}  
78 body{font-size: 12px; background-color: #eee;} 77 body{font-size: 12px; background-color: #eee;}
79 a{text-decoration: none; font-weight: bold; color: #666} 78 a{text-decoration: none; font-weight: bold; color: #666}
80 a:hover{color: #333} 79 a:hover{color: #333}
@@ -494,13 +493,55 @@ header .account-links a:last-child{ @@ -494,13 +493,55 @@ header .account-links a:last-child{
494 border-bottom: 0; 493 border-bottom: 0;
495 } 494 }
496 495
497 -#no_ssh_key_defined {  
498 - border:1px solid #ee8801;  
499 - margin:20px;  
500 - padding:20px;  
501 - background:#ffe3f0;  
502 - h2{margin:0;}  
503 - p {margin:10px 0 0;} 496 +.big-message{
  497 + background-image: -webkit-gradient(linear, 0 48, 0 0, color-stop(0.041, #eccb40), to(#ffee4d));
  498 + background-image: -webkit-linear-gradient(90deg, #eccb40 4.1%, #ffee4d);
  499 + background-image: -moz-linear-gradient(90deg, #eccb40 4.1%, #ffee4d);
  500 + background-image: -o-linear-gradient(90deg, #eccb40 4.1%, #ffee4d);
  501 + text-align: center;
  502 + font-weight: bold;
  503 + padding: 10px 20px;
  504 + text-shadow: 0 1px 0 rgba(255,255,255,.3);
  505 + color: #333;
  506 + color: rgba(0,0,0,.7);
  507 + font-size: 14px;
  508 + box-shadow: 0 1px 2px rgba(0,0,0,.7);
  509 + z-index: 100000;
  510 + margin-bottom: 2px;
  511 +}
  512 +
  513 +.big-message a{color: #000; text-decoration: underline;}
  514 +
  515 +.big-message.error{
  516 + background-color: #722523;
  517 + background-image: -webkit-gradient(linear, 0 49, 0 0, color-stop(0.04, #722523), to(#ad4846));
  518 + background-image: -webkit-linear-gradient(90deg, #9b403f 4%, #c16765);
  519 + background-image: -moz-linear-gradient(90deg, #722523 4%, #ad4846);
  520 + background-image: -o-linear-gradient(90deg, #722523 4%, #ad4846);
  521 + color: #2E0D0C;
  522 +}
  523 +
  524 +.big-message.success{
  525 + background-color: #7a9339;
  526 + background-image: -webkit-gradient(linear, 0 48, 0 0, color-stop(0.062, #7a9339), to(#93ae46));
  527 + background-image: -webkit-linear-gradient(90deg, #7a9339 6.2%, #93ae46);
  528 + background-image: -moz-linear-gradient(90deg, #7a9339 6.2%, #93ae46);
  529 + background-image: -o-linear-gradient(90deg, #7a9339 6.2%, #93ae46)
  530 +}
  531 +
  532 +.big-message.success{
  533 + background-color: #7a9339;
  534 + background-image: -webkit-gradient(linear, 0 48, 0 0, color-stop(0.062, #7a9339), to(#93ae46));
  535 + background-image: -webkit-linear-gradient(90deg, #7a9339 6.2%, #93ae46);
  536 + background-image: -moz-linear-gradient(90deg, #7a9339 6.2%, #93ae46);
  537 + background-image: -o-linear-gradient(90deg, #7a9339 6.2%, #93ae46)
  538 +}
  539 +
  540 +.big-message.notice{
  541 + background-image: -webkit-gradient(linear, 0 49, 0 0, color-stop(0.061, #447790), color-stop(0.897, #5da2bf));
  542 + background-image: -webkit-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%);
  543 + background-image: -moz-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%);
  544 + background-image: -o-linear-gradient(90deg, #447790 6.1%, #5da2bf 89.7%)
504 } 545 }
505 546
506 /* eo Account Box */ 547 /* eo Account Box */
@@ -516,12 +557,14 @@ h2.icon span{background: #E3E5EA url('images.png'); height: 32px; width: 32px; @@ -516,12 +557,14 @@ h2.icon span{background: #E3E5EA url('images.png'); height: 32px; width: 32px;
516 /* Dashboard Page */ 557 /* Dashboard Page */
517 html, body { height: 100%; } 558 html, body { height: 100%; }
518 559
  560 +
  561 +
519 body.dashboard-page h2.icon span{ background-position: 9px -69px; } 562 body.dashboard-page h2.icon span{ background-position: 9px -69px; }
520 body.dashboard-page header{margin-bottom: 0} 563 body.dashboard-page header{margin-bottom: 0}
521 -body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; margin-left: 1%} 564 +body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; min-height: 600px; margin-left: 1%}
522 body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; } 565 body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; }
523 body.dashboard-page .news-feed h2{float: left;} 566 body.dashboard-page .news-feed h2{float: left;}
524 -body.dashboard-page aside{ min-height: 700px; width: 420px; float: right; background-color: #f7f7f7; border-left: 1px solid #ccc } 567 +body.dashboard-page aside{ min-height: 700px; position: absolute; top: 0; bottom: 0; right: 0; width: 420px; float: right; background-color: #f7f7f7; border-left: 1px solid #ccc }
525 body.dashboard-page aside h4{margin: 0; border-bottom: 1px solid #ccc; padding: 10px 10px; font-size: 11px; font-weight: bold; text-transform: uppercase;} 568 body.dashboard-page aside h4{margin: 0; border-bottom: 1px solid #ccc; padding: 10px 10px; font-size: 11px; font-weight: bold; text-transform: uppercase;}
526 body.dashboard-page aside h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 2%; margin-top: -4px; display: block;} 569 body.dashboard-page aside h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 2%; margin-top: -4px; display: block;}
527 body.dashboard-page aside .project-list {list-style: none; margin: 0; padding: 0;} 570 body.dashboard-page aside .project-list {list-style: none; margin: 0; padding: 0;}
@@ -563,7 +606,7 @@ body.project-page .page-title{margin-bottom: 0} @@ -563,7 +606,7 @@ body.project-page .page-title{margin-bottom: 0}
563 body.project-page .project-sidebar {width: 220px; left: 0; top: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; float: left; display: inline-block; background: #f7f7f7; padding: 20px 0 20px 2%; margin: 0; } 606 body.project-page .project-sidebar {width: 220px; left: 0; top: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; float: left; display: inline-block; background: #f7f7f7; padding: 20px 0 20px 2%; margin: 0; }
564 607
565 body.project-page input.text.git-url, 608 body.project-page input.text.git-url,
566 -body.projects-page 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;} 609 +body.projects-page 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 0 8px 30px; margin-bottom: 20px; background: white url('images.png') no-repeat 8px -40px; width: 176px}
567 body.projects-page input.text.git-url {margin:10px 0 0 } 610 body.projects-page input.text.git-url {margin:10px 0 0 }
568 .git_url_wrapper { margin-right:50px } 611 .git_url_wrapper { margin-right:50px }
569 612
app/models/note.rb
@@ -27,6 +27,7 @@ class Note < ActiveRecord::Base @@ -27,6 +27,7 @@ class Note < ActiveRecord::Base
27 27
28 scope :common, where(:noteable_id => nil) 28 scope :common, where(:noteable_id => nil)
29 29
  30 + scope :today, where("created_at >= :date", :date => Date.today)
30 scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days)) 31 scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days))
31 scope :since, lambda { |day| where("created_at >= :date", :date => (day)) } 32 scope :since, lambda { |day| where("created_at >= :date", :date => (day)) }
32 scope :fresh, order("created_at DESC") 33 scope :fresh, order("created_at DESC")
app/models/user.rb
@@ -30,7 +30,7 @@ class User < ActiveRecord::Base @@ -30,7 +30,7 @@ class User < ActiveRecord::Base
30 scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) } 30 scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) }
31 31
32 def identifier 32 def identifier
33 - email.gsub "@", "_" 33 + email.gsub /[@.]/, "_"
34 end 34 end
35 35
36 def is_admin? 36 def is_admin?
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 + - line.force_encoding(Encoding::UTF_8)
5 - next if line.match(/^--- \/dev\/null/) 6 - next if line.match(/^--- \/dev\/null/)
6 - next if line.match(/^--- a/) 7 - next if line.match(/^--- a/)
7 - next if line.match(/^\+\+\+ b/) 8 - next if line.match(/^\+\+\+ b/)
app/views/layouts/_head_panel.html.erb
@@ -48,9 +48,7 @@ @@ -48,9 +48,7 @@
48 <% end %> 48 <% end %>
49 49
50 <% if current_user.keys.all.empty? %> 50 <% if current_user.keys.all.empty? %>
51 - <div id="no_ssh_key_defined">  
52 - <h2>ATTENTION!</h2>  
53 - <p>No SSH Key is defined. You won't be able to use any Git command!  
54 - <p>Click <%=link_to( 'here', keys_path ) %> to add one! 51 + <div id="no_ssh_key_defined" class="big-message error">
  52 + <p>No SSH Key is defined. You won't be able to use any Git command!. Click <%=link_to( 'here', keys_path ) %> to add one!
55 </div> 53 </div>
56 <% end %> 54 <% end %>
app/views/layouts/project.html.haml
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do 38 = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do
39 Wall 39 Wall
40 - if @project.common_notes.count > 0 40 - if @project.common_notes.count > 0
41 - %span{ :class => "number" }= @project.common_notes.count 41 + %span{ :class => "number" }= @project.common_notes.today.count
42 = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do 42 = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
43 Snippets 43 Snippets
44 - if @project.snippets.count > 0 44 - if @project.snippets.count > 0
lib/commit_ext.rb
@@ -3,13 +3,7 @@ module CommitExt @@ -3,13 +3,7 @@ module CommitExt
3 attr_accessor :refs 3 attr_accessor :refs
4 4
5 def safe_message 5 def safe_message
6 - message.encode("UTF-8",  
7 - :invalid => :replace,  
8 - :undef => :replace,  
9 - :universal_newline => true,  
10 - :replace => "")  
11 - rescue  
12 - "-- invalid encoding for commit message" 6 + message.force_encoding(Encoding::UTF_8)
13 end 7 end
14 8
15 def created_at 9 def created_at
spec/models/note_spec.rb
@@ -12,7 +12,12 @@ describe Note do @@ -12,7 +12,12 @@ describe Note do
12 12
13 it { Factory.create(:note, 13 it { Factory.create(:note,
14 :project => Factory.create(:project)).should be_valid } 14 :project => Factory.create(:project)).should be_valid }
15 - 15 + describe "Scopes" do
  16 + it "should have a today named scope that returns ..." do
  17 + Note.today.where_values.should == ["created_at >= '#{Date.today}'"]
  18 + end
  19 + end
  20 +
16 describe :authorization do 21 describe :authorization do
17 before do 22 before do
18 @p1 = Factory :project 23 @p1 = Factory :project
spec/models/user_spec.rb
@@ -16,7 +16,7 @@ describe User do @@ -16,7 +16,7 @@ describe User do
16 16
17 it "should return valid identifier" do 17 it "should return valid identifier" do
18 user = User.new(:email => "test@mail.com") 18 user = User.new(:email => "test@mail.com")
19 - user.identifier.should == "test_mail.com" 19 + user.identifier.should == "test_mail_com"
20 end 20 end
21 21
22 it "should have authentication token" do 22 it "should have authentication token" do