diff --git a/.gitignore b/.gitignore index 8c626989bb8e79fc3c5ffa6ad0d9461967850579..725f289db55e40875ff36c91214db145cbfa9391 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ log/*.log tmp/ .sass-cache/ coverage/* +backups/* *.swp public/uploads/ .rvmrc diff --git a/CHANGELOG b/CHANGELOG index 172357603cbd31b8319f031a50a82dd45c6a08d3..fe243d65e4bd46fb8ae9e4699c564951e8453770 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ v 2.7.0 - Issue Labels + - Inline diff + - Git HTTP + - API + - UI improved v 2.6.0 - UI polished diff --git a/app/assets/javascripts/note.js b/app/assets/javascripts/note.js index 4d97ffefdcef43cd0f22075f411c54ec41873dea..c45a45d2fcb5ede0cc60fdc10275b682921c8420 100644 --- a/app/assets/javascripts/note.js +++ b/app/assets/javascripts/note.js @@ -25,11 +25,11 @@ init: $(this).closest('li').fadeOut(); }); $("#new_note").live("ajax:before", function(){ - $("#submit_note").attr("disabled", "disabled"); + $(".submit_note").attr("disabled", "disabled"); }) $("#new_note").live("ajax:complete", function(){ - $("#submit_note").removeAttr("disabled"); + $(".submit_note").removeAttr("disabled"); }) $("#note_note").live("focus", function(){ diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss index e2d639065ed6cc15c51e974bf5dfefca0c236d84..b2bc4593a2939d0756da7d71c0241e0a2dddf1a1 100644 --- a/app/assets/stylesheets/gitlab_bootstrap.scss +++ b/app/assets/stylesheets/gitlab_bootstrap.scss @@ -202,6 +202,10 @@ a:focus { color:$style_color; } +.nav-tabs > .active > a { + font-weight:bold; +} + /** COLORS **/ .cgray { color:gray; } .cred { color:#D12F19; } @@ -209,6 +213,7 @@ a:focus { .cblack { color:#111; } .cdark { color:#444 } .cwhite { color:#fff !important } +.bgred { background: #F2DEDE !important} /** COMMON STYLES **/ .left { @@ -299,9 +304,24 @@ table.no-borders { } .event_label { - background: #FCEEC1; - padding: 2px 2px 0; - font-family: monospace; + @extend .label; + background-color: #999; + + &.pushed { + background-color: #3A87AD; + } + + &.opened { + background-color: #468847; + } + + &.closed { + background-color: #B94A48; + } + + &.merged { + background-color: #2A2; + } } img.avatar { @@ -425,7 +445,7 @@ form { */ .ui-box { background:#F9F9F9; - margin-bottom: 40px; + margin-bottom: 25px; @include round-borders-all(4px); border-color: #CCC; @@ -443,6 +463,13 @@ form { background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); + &.small { + line-height: 28px; + font-size: 14px; + line-height:28px; + text-shadow: 0 1px 1px white; + } + form { padding:9px 0; margin:0px; @@ -624,17 +651,10 @@ p { h3.page_title { color:#456; font-size:20px; - font-weight: 600; + font-weight: normal; line-height: 28px; } -pre.logs { - .log { - font-size:12px; - line-height:18px; - } -} - /** * File content holder * @@ -676,10 +696,10 @@ pre.logs { } .file_content { background:#fff; - color:#514721; font-size: 11px; &.wiki { + font-size: 13px; code { padding:0 4px; } @@ -730,6 +750,33 @@ pre.logs { } } + &.logs { + background:#eee; + max-height: 700px; + overflow-y: auto; + + ol { + margin-left:40px; + padding: 10px 0; + border-left: 1px solid #CCC; + margin-bottom:0; + background: white; + li { + color:#888; + p { + margin:0; + color:#333; + line-height:24px; + padding-left: 10px; + } + + &:hover { + background:$hover; + } + } + } + } + /** * Code file */ diff --git a/app/assets/stylesheets/header.scss b/app/assets/stylesheets/header.scss index 5e2e410071b96fd74db4c8611f37869f91516d2b..c3a570036bb15d8eaf1674b59fd43baf2a6ad258 100644 --- a/app/assets/stylesheets/header.scss +++ b/app/assets/stylesheets/header.scss @@ -96,7 +96,7 @@ header { */ .search { float: right; - margin-right: 55px; + margin-right: 50px; .search-input { @extend .span2; @@ -125,11 +125,14 @@ header { display: block; cursor: pointer; img { + -moz-box-shadow: 0 0 5px #ccc; + -webkit-box-shadow: 0 0 5px #ccc; + box-shadow: 0 0 5px #ccc; border-radius: 4px; - right: 0px; + right: 5px; position: absolute; - width: 33px; - height: 33px; + width: 31px; + height: 31px; display: block; top: 0; &:after { diff --git a/app/assets/stylesheets/notes.scss b/app/assets/stylesheets/notes.scss index 39db704b1a95cb7f86b78538a51aa5a5f18c13b5..39e03813a8be9991f9c5a6b8beaa5161a70e6bd7 100644 --- a/app/assets/stylesheets/notes.scss +++ b/app/assets/stylesheets/notes.scss @@ -14,7 +14,8 @@ border-bottom:1px solid #aaa; } -.issue_notes { +.issue_notes, +.wiki_notes { .note_content { float:left; width:400px; diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index ad496238a13957ede4b20c094f95b3f518276670..34f43acf839d1356a8a9b5d7a076e40e5b0553ce 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -82,3 +82,15 @@ } } } + +li.merge_request { + padding:7px 10px; + img.avatar { + width: 32px; + margin-top: 4px; + } + p { + padding: 0px; + padding-bottom: 2px; + } +} diff --git a/app/controllers/admin/mailer_controller.rb b/app/controllers/admin/mailer_controller.rb index 2352e1892047cff8e94dcbde3ad4f5c65d14bf11..ec6d24bdabaa2d1e936c1bc09d92fdaaefe1eeee 100644 --- a/app/controllers/admin/mailer_controller.rb +++ b/app/controllers/admin/mailer_controller.rb @@ -18,6 +18,8 @@ class Admin::MailerController < ApplicationController when "Issue" then @issue = Issue.first render :file => 'notify/note_issue_email', :layout => 'notify' + when "Wiki" then + render :file => 'notify/note_wiki_email', :layout => 'notify' else render :file => 'notify/note_wall_email', :layout => 'notify' end diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 5266b406504715b3fce635fd3c6cf0cc75210e2d..0ff97bf2c326db189c777fecc3c29032350bf427 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -6,7 +6,7 @@ class Admin::ProjectsController < ApplicationController def index @admin_projects = Project.scoped @admin_projects = @admin_projects.search(params[:name]) if params[:name].present? - @admin_projects = @admin_projects.page(params[:page]) + @admin_projects = @admin_projects.page(params[:page]).per(20) end def show @@ -72,6 +72,6 @@ class Admin::ProjectsController < ApplicationController @admin_project = Project.find_by_code(params[:id]) @admin_project.destroy - redirect_to admin_projects_url + redirect_to admin_projects_url, notice: 'Project was successfully deleted.' end end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index a2638d9597c4d2addb9a2d3430fb4dc6535ae108..9e89140e8f1ce37ea6df480b93168f43ab3fd1cf 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -51,6 +51,8 @@ class NotesController < ApplicationController then project.issues.find(params[:target_id]).notes.inc_author.order("created_at DESC").limit(20) when "merge_request" then project.merge_requests.find(params[:target_id]).notes.inc_author.order("created_at DESC").limit(20) + when "wiki" + then project.wikis.find(params[:target_id]).notes.order("created_at DESC").limit(20) end @notes = if params[:last_id] diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 629b6819fb1e25e8523cf2496843c1b67759a856..fb759c371c4f788c914ab010071f0e3c33ebd8dc 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -1,4 +1,17 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController + + # Extend the standard message generation to accept our custom exception + def failure_message + exception = env["omniauth.error"] + if exception.class == OmniAuth::Error + error = exception.message + else + error = exception.error_reason if exception.respond_to?(:error_reason) + error ||= exception.error if exception.respond_to?(:error) + error ||= env["omniauth.error.type"].to_s + end + error.to_s.humanize if error + end def ldap # We only find ourselves here if the authentication to LDAP was successful. diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index 9bcd20c318730b6a7fce2f1cfbbbfdc9f3148db1..06e3564be5679be5e0de45c032f4e7b2fd134553 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -17,6 +17,8 @@ class WikisController < ApplicationController return render_404 unless can?(current_user, :write_wiki, @project) end + @note = @project.notes.new(:noteable => @wiki) + respond_to do |format| if @wiki format.html diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index c673eb3d16132938d4c109b0e1165b6ea022ca0a..2ce940c35cc5e216102d86588c60c3028577b40f 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -46,6 +46,13 @@ class Notify < ActionMailer::Base mail(:to => recipient.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project_name} ") end + def note_wiki_email(recipient_id, note_id) + recipient = User.find(recipient_id) + @note = Note.find(note_id) + @wiki = @note.noteable + mail(:to => recipient.email, :subject => "gitlab | note for wiki | #{@note.project_name}") + end + def new_merge_request_email(merge_request_id) @merge_request = MergeRequest.find(merge_request_id) mail(:to => @merge_request.assignee_email, :subject => "gitlab | new merge request | #{@merge_request.title} ") diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index d3e531f7818c79c76b5fc0c4778102525f3e4038..2581f3be4c9317f021dbcf8a43172e98ba127dc3 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -22,7 +22,6 @@ class MergeRequest < ActiveRecord::Base :should_remove_source_branch validates_presence_of :project_id - validates_presence_of :assignee_id validates_presence_of :author_id validates_presence_of :source_branch validates_presence_of :target_branch @@ -36,6 +35,7 @@ class MergeRequest < ActiveRecord::Base delegate :name, :email, :to => :assignee, + :allow_nil => true, :prefix => true validates :title, @@ -128,7 +128,7 @@ class MergeRequest < ActiveRecord::Base def unmerged_diffs commits = project.repo.commits_between(target_branch, source_branch).map {|c| Commit.new(c)} - diffs = project.repo.diff(commits.first.prev_commit.id, commits.last.id) + diffs = project.repo.diff(commits.first.prev_commit.id, commits.last.id) rescue [] end def last_commit diff --git a/app/models/user.rb b/app/models/user.rb index b87e149ca0fdb8fce5ddbce248ccdaa4188c8934..0836ca4919f680ce655536b617f907a6d177da54 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,6 +15,11 @@ class User < ActiveRecord::Base has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id has_many :keys, :dependent => :destroy + has_many :events, + :class_name => "Event", + :foreign_key => :author_id, + :dependent => :destroy + has_many :recent_events, :class_name => "Event", :foreign_key => :author_id, @@ -80,7 +85,8 @@ class User < ActiveRecord::Base def self.find_for_ldap_auth(omniauth_info) name = omniauth_info.name.force_encoding("utf-8") - email = omniauth_info.email.downcase + email = omniauth_info.email.downcase unless omniauth_info.email.nil? + raise OmniAuth::Error, "LDAP accounts must provide an email address" if email.nil? if @user = User.find_by_email(email) @user diff --git a/app/models/wiki.rb b/app/models/wiki.rb index ecc46fb4efbf8b28047aff3693df281009b59b48..d9ec069d14bf6d6eb2176e4f942ffa8bc0daffc5 100644 --- a/app/models/wiki.rb +++ b/app/models/wiki.rb @@ -1,6 +1,7 @@ class Wiki < ActiveRecord::Base belongs_to :project belongs_to :user + has_many :notes, :as => :noteable, :dependent => :destroy validates :content, :title, :user_id, :presence => true validates :title, :length => 1..250 diff --git a/app/observers/mailer_observer.rb b/app/observers/mailer_observer.rb index 880fd5026a48648e92d0661192a9619078c66997..b6f5217847acec5522768bfc5f7667e430180cb1 100644 --- a/app/observers/mailer_observer.rb +++ b/app/observers/mailer_observer.rb @@ -34,6 +34,7 @@ class MailerObserver < ActiveRecord::Observer case note.noteable_type when "Commit"; Notify.note_commit_email(u.id, note.id).deliver when "Issue"; Notify.note_issue_email(u.id, note.id).deliver + when "Wiki"; Notify.note_wiki_email(u.id, note.id).deliver when "MergeRequest"; Notify.note_merge_request_email(u.id, note.id).deliver when "Snippet"; true else @@ -43,7 +44,7 @@ class MailerObserver < ActiveRecord::Observer end def new_merge_request(merge_request) - if merge_request.assignee != current_user + if merge_request.assignee && merge_request.assignee != current_user Notify.new_merge_request_email(merge_request.id).deliver end end diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml index 7963e18adcdcd11a237d8923b5dab09bbd146a0c..800d3bb288f0af9cedd53a4c8733a020fc1c2a67 100644 --- a/app/views/admin/logs/show.html.haml +++ b/app/views/admin/logs/show.html.haml @@ -1,6 +1,9 @@ -%h4 - %i.icon-file - githost.log -%pre.logs - - Gitlab::Logger.read_latest.each do |line| - %span.log= line +.file_holder#README + .file_title + %i.icon-file + githost.log + .file_content.logs + %ol + - Gitlab::Logger.read_latest.each do |line| + %li + %p= line diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 932fb37ddf617cf045e0b0310b51e9a4af8e57b6..7218eebb62af947c19d9e4da01c04ae8f0e77656 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -13,8 +13,8 @@ %th Team Members %th Post Receive %th Last Commit - %th - %th + %th Edit + %th.cred Danger Zone! - @admin_projects.each do |project| %tr @@ -24,5 +24,5 @@ %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, :disabled => true %td= last_commit(project) %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small" - %td= link_to 'Destroy', [:admin, project], :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" + %td.bgred= link_to 'Destroy', [:admin, project], :confirm => "REMOVE #{project.name}? Are you sure?", :method => :delete, :class => "btn small danger" = paginate @admin_projects, :theme => "admin" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 481bf37bb0b4584a0bd9c01c1847eec1292852a3..5d5320db0e347b27a2093ae9f786c7d488825642 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -27,7 +27,7 @@ %th Projects %th Edit %th Blocked - %th + %th.cred Danger Zone! - @admin_users.each do |user| %tr @@ -41,6 +41,6 @@ = link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success" - else = link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" - %td= link_to 'Destroy', [:admin, user], :confirm => 'USER WILL BE REMOVED! Are you sure?', :method => :delete, :class => "btn small danger" + %td.bgred= link_to 'Destroy', [:admin, user], :confirm => "USER #{user.name} WILL BE REMOVED! Are you sure?", :method => :delete, :class => "btn small danger" = paginate @admin_users, :theme => "admin" diff --git a/app/views/commits/_commits.html.haml b/app/views/commits/_commits.html.haml index c2c9ca624b2d28ff124d870ba6cdc293ac9434a1..c3c7d49ce748cd4f3b3b0e6a9a5166acb79345de 100644 --- a/app/views/commits/_commits.html.haml +++ b/app/views/commits/_commits.html.haml @@ -1,4 +1,6 @@ - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| %div.ui-box - %h5= day.stamp("28 Aug, 2010") + %h5.small + %i.icon-calendar + = day.stamp("28 Aug, 2010") %ul.unstyled= render commits diff --git a/app/views/commits/_head.html.haml b/app/views/commits/_head.html.haml index 8e9195c5b50e414d1acb493afebc74b647848fbf..453ca4eac122a031308509f6c97a9bca8eabf80c 100644 --- a/app/views/commits/_head.html.haml +++ b/app/views/commits/_head.html.haml @@ -13,12 +13,12 @@ %li{:class => "#{branches_tab_class}"} = link_to project_repository_path(@project) do Branches - %span.number= @project.repo.branch_count + %span.badge= @project.repo.branch_count %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"} = link_to tags_project_repository_path(@project) do Tags - %span.number= @project.repo.tag_count + %span.badge= @project.repo.tag_count - if current_page?(project_commits_path(@project)) && current_user.private_token diff --git a/app/views/commits/compare.html.haml b/app/views/commits/compare.html.haml index c02263296f4f0b7f8d2d132c8aa93264e19c5310..66ed8dad595dd768aa8dec1ca91884671131a8c6 100644 --- a/app/views/commits/compare.html.haml +++ b/app/views/commits/compare.html.haml @@ -20,7 +20,7 @@ = "..." = text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge" .actions - = submit_tag "Compare", :class => "btn primary" + = submit_tag "Compare", :class => "btn btn-primary" - unless @commits.empty? diff --git a/app/views/events/_event_issue.html.haml b/app/views/events/_event_issue.html.haml index 13fb20cd3791a3a8837ece752afd0e75d7b8c404..4293be8204efa2c79d687ea5d582276ba8e6796f 100644 --- a/app/views/events/_event_issue.html.haml +++ b/app/views/events/_event_issue.html.haml @@ -1,7 +1,7 @@ = image_tag gravatar_icon(event.author_email), :class => "avatar" %strong #{event.author_name} -%span.event_label= event.action_name - issue +%span.event_label{:class => event.action_name}= event.action_name +issue = link_to project_issue_path(event.project, event.issue) do %strong= truncate event.issue_title at diff --git a/app/views/events/_event_merge_request.html.haml b/app/views/events/_event_merge_request.html.haml index e59a74b9554475c3b113a6ad84244204f4859e12..774921a7f2a7d8c4f9ea75bbd1c48bc767433f11 100644 --- a/app/views/events/_event_merge_request.html.haml +++ b/app/views/events/_event_merge_request.html.haml @@ -2,8 +2,8 @@ .event_icon= image_tag "event_mr_merged.png" = image_tag gravatar_icon(event.author_email), :class => "avatar" %strong #{event.author_name} -%span.event_label= event.action_name - merge request +%span.event_label{:class => event.action_name}= event.action_name +merge request = link_to project_merge_request_path(event.project, event.merge_request) do %strong= truncate event.merge_request_title at diff --git a/app/views/events/_event_push.html.haml b/app/views/events/_event_push.html.haml index 3aadd2266149d48abb868cf61096a822c8923439..59d8962bb161211ad25bbd206c69868c30445163 100644 --- a/app/views/events/_event_push.html.haml +++ b/app/views/events/_event_push.html.haml @@ -2,7 +2,7 @@ .event_icon= image_tag "event_push.png" = image_tag gravatar_icon(event.author_email), :class => "avatar" %strong #{event.author_name} - %span.event_label= event.push_action_name + %span.event_label.pushed= event.push_action_name = event.ref_type = link_to project_commits_path(event.project, :ref => event.ref_name) do %strong= event.ref_name diff --git a/app/views/merge_requests/_form.html.haml b/app/views/merge_requests/_form.html.haml index d69faa142d50e1b8cc27192965ed4e0402be86b0..4f20a06fd258abeeb73674b01c9c1b346076d6c1 100644 --- a/app/views/merge_requests/_form.html.haml +++ b/app/views/merge_requests/_form.html.haml @@ -5,7 +5,8 @@ - @merge_request.errors.full_messages.each do |msg| %li= msg - %h3.padded.cgray 1. Select Branches + %h4.cdark 1. Select Branches + %br .row .span6 @@ -30,14 +31,21 @@ .bottom_commit .mr_target_commit - %h3.padded.cgray 2. Fill info + %h4.cdark 2. Fill info + .clearfix - = f.label :assignee_id, "Assign to", :class => "control-label" - .controls= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px") + .main_box + .top_box_content + = f.label :title do + %strong= "Title *" + .input= f.text_field :title, :class => "input-xxlarge pad", :maxlength => 255, :rows => 5 + .middle_box_content + = f.label :assignee_id do + %i.icon-user + Assign to + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px") .control-group - = f.label :title, :class => "control-label" - .controls= f.text_field :title, :class => "input-xxlarge pad", :maxlength => 255, :rows => 5 .form-actions = f.submit 'Save', :class => "btn-primary btn" diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/merge_requests/_merge_request.html.haml index d9634a4fcc831f2e558911d24334965dfcb4a774..b9a005e08be40a750ee4ad6e1b1e2456c857240b 100644 --- a/app/views/merge_requests/_merge_request.html.haml +++ b/app/views/merge_requests/_merge_request.html.haml @@ -15,12 +15,14 @@ → = merge_request.target_branch = image_tag gravatar_icon(merge_request.author_email), :class => "avatar" + + = link_to project_merge_request_path(merge_request.project, merge_request) do + %p.row_title= truncate(merge_request.title, :length => 80) + %span.update-author - %strong= merge_request.author_name - authored + %small.cdark= "##{merge_request.id}" + authored by #{merge_request.author_name} = time_ago_in_words(merge_request.created_at) ago - if merge_request.upvotes > 0 %span.badge.badge-success= "+#{merge_request.upvotes}" - = link_to project_merge_request_path(merge_request.project, merge_request) do - %p.row_title= truncate(merge_request.title, :length => 80) diff --git a/app/views/merge_requests/edit.html.haml b/app/views/merge_requests/edit.html.haml index 9e4f9327cdc14ad057af98514b11033440e09def..eee148994d71716689fcad21a1b211d1206407fb 100644 --- a/app/views/merge_requests/edit.html.haml +++ b/app/views/merge_requests/edit.html.haml @@ -1,4 +1,4 @@ -%h3 +%h3.page_title = "Edit merge request #{@merge_request.id}" %hr = render 'form' diff --git a/app/views/merge_requests/new.html.haml b/app/views/merge_requests/new.html.haml index efafa45d75899ee3be47e933f841dcb23c54213f..594089995eaae7315be46e608495470b20cf8c02 100644 --- a/app/views/merge_requests/new.html.haml +++ b/app/views/merge_requests/new.html.haml @@ -1,3 +1,3 @@ -%h3 New Merge Request +%h3.page_title New Merge Request %hr = render 'form' diff --git a/app/views/merge_requests/show/_commits.html.haml b/app/views/merge_requests/show/_commits.html.haml index 78fe1a062d336ff2cf090d5e5aafc4f65d04741b..d10e8fd597ad24648447b59507a0249049f04515 100644 --- a/app/views/merge_requests/show/_commits.html.haml +++ b/app/views/merge_requests/show/_commits.html.haml @@ -1,6 +1,8 @@ - if @commits.present? .ui-box - %h5 Commits (#{@commits.count}) + %h5 + %i.icon-list + Commits (#{@commits.count}) .merge-request-commits - if @commits.count > 8 %ul.first_mr_commits.unstyled diff --git a/app/views/merge_requests/show/_mr_box.html.haml b/app/views/merge_requests/show/_mr_box.html.haml index 3027719d94d0493ef9367874344a6b00530053fb..b542dac98e0b8de2bca451ce5d5b68e1805bec9b 100644 --- a/app/views/merge_requests/show/_mr_box.html.haml +++ b/app/views/merge_requests/show/_mr_box.html.haml @@ -13,9 +13,10 @@ = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av" %strong.author= link_to_merge_request_author(@merge_request) - %cite.cgray and currently assigned to - = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av" - %strong.author= link_to_merge_request_assignee(@merge_request) + - if @merge_request.assignee + %cite.cgray and currently assigned to + = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av" + %strong.author= link_to_merge_request_assignee(@merge_request) - if @merge_request.closed diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index 03774d160b9f440f450ce226656b527286ffab46..f5aa14957968e93b0690fac76fedb5854d643d89 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -32,4 +32,4 @@ %span Any file less than 10 MB - = f.submit 'Add Comment', :class => "btn primary", :id => "submit_note" + = f.submit 'Add Comment', :class => "btn primary submit_note", :id => "submit_note" diff --git a/app/views/notes/_per_line_form.html.haml b/app/views/notes/_per_line_form.html.haml index 94c558029d2a1975022550a2f532231b8987da0c..8beaf9b5e0cf4b72c278346c50a707c263af8850 100644 --- a/app/views/notes/_per_line_form.html.haml +++ b/app/views/notes/_per_line_form.html.haml @@ -24,7 +24,7 @@ = check_box_tag :notify_author, 1 , @note.noteable_type == "Commit" %span Commit author .actions - = f.submit 'Add note', :class => "btn primary", :id => "submit_note" + = f.submit 'Add note', :class => "btn primary submit_note", :id => "submit_note" = link_to "Close", "#", :class => "btn hide-button" :javascript diff --git a/app/views/notify/note_wiki_email.html.haml b/app/views/notify/note_wiki_email.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..91270682c6be5085806d6e99dddba2dcee9052aa --- /dev/null +++ b/app/views/notify/note_wiki_email.html.haml @@ -0,0 +1,24 @@ +%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + New comment - + = link_to project_issue_url(@wiki.project, @wiki, :anchor => "note_#{@note.id}") do + = "Wiki ##{@wiki.title.to_s}" + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:style => "padding: 15px 0 15px;", :valign => "top"} + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} + commented on Wiki page: + %br + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %tr + %td{:valign => "top"} + %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } + = markdown(@note.note) + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 9aa287dff079857ea1a26cdca737fca363238baf..e9502430b3475c6f38cbdbd1825d40aee339efc9 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -15,3 +15,5 @@ - if can? current_user, :admin_wiki, @project = link_to project_wiki_path(@project, @wiki), :confirm => "Are you sure you want to delete this page?", :method => :delete do Delete this page + +.wiki_notes#notes= render "notes/notes", :tid => @wiki.id, :tt => "wiki" diff --git a/doc/installation.md b/doc/installation.md index f15eff88fc53dbc53cc3060a342282d2df3c43a8..3dfedfe10adb335c51ce9a7994f6c2d944ebcb9c 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -60,7 +60,7 @@ Also read the [Read this before you submit an issue](https://github.com/gitlabhq sudo apt-get update sudo apt-get upgrade - sudo apt-get install -y wget curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline-gplv2-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server git-core python-dev python-pip libyaml-dev sendmail + sudo apt-get install -y wget curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server git-core python-dev python-pip libyaml-dev sendmail # If you want to use MySQL: sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev @@ -110,7 +110,7 @@ Setup: sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; /home/git/gitolite/src/gl-system-install" sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub - sudo chmod 777 /home/git/gitlab.pub + sudo chmod 0444 /home/git/gitlab.pub sudo -u git -H sed -i 's/0077/0007/g' /home/git/share/gitolite/conf/example.gitolite.rc sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gl-setup -q /home/git/gitlab.pub" @@ -139,6 +139,8 @@ Permissions: cd /home/gitlab sudo -H -u gitlab git clone -b stable git://github.com/gitlabhq/gitlabhq.git gitlab cd gitlab + + sudo -u gitlab mkdir tmp # Rename config files sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml @@ -216,15 +218,15 @@ Application can be started with next command: sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D -Edit /etc/nginx/nginx.conf. Add in **http** section: +Edit /etc/nginx/nginx.conf. In the *http* section add: upstream gitlab { server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket; } server { - listen YOUR_SERVER_IP:80; - server_name gitlab.YOUR_DOMAIN.com; + listen YOUR_SERVER_IP:80; # e.g., listen 192.168.1.1:80; + server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com; root /home/gitlab/gitlab/public; # individual nginx logs for this gitlab vhost @@ -232,26 +234,26 @@ Edit /etc/nginx/nginx.conf. Add in **http** section: error_log /var/log/nginx/gitlab_error.log; location / { - # serve static files from defined root folder;. - # @gitlab is a named location for the upstream fallback, see below - try_files $uri $uri/index.html $uri.html @gitlab; + # serve static files from defined root folder;. + # @gitlab is a named location for the upstream fallback, see below + try_files $uri $uri/index.html $uri.html @gitlab; } # if a file, which is not found in the root folder is requested, # then the proxy pass the request to the upsteam (gitlab unicorn) location @gitlab { proxy_redirect off; + # you need to change this to "https", if you set "ssl" directive to "on" proxy_set_header X-FORWARDED_PROTO http; - proxy_set_header Host gitlab.YOUR_SUBDOMAIN.com:80; + proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://gitlab; } - } -gitlab.YOUR_DOMAIN.com - change to your domain. +Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN** to the IP address and fully-qualified domain name of the host serving GitLab. Restart nginx: diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb index e8d20ad90c20f74d22750110e06b1ee2b55f8433..aff13baf67b647155b33dad9733b6809b1815584 100644 --- a/lib/gitlab/logger.rb +++ b/lib/gitlab/logger.rb @@ -1,14 +1,24 @@ module Gitlab - class Logger + class Logger < ::Logger def self.error(message) - @@logger ||= ::Logger.new(File.join(Rails.root, "log/githost.log")) - message = Time.now.to_s(:long) + " -> " + message - @@logger.error(message) + build.error(message) + end + + def self.info(message) + build.info(message) end def self.read_latest path = Rails.root.join("log/githost.log") - logs = `tail -n 50 #{path}`.split("\n") + logs = File.read(path).split("\n") end + + def self.build + new(File.join(Rails.root, "log/githost.log")) + end + + def format_message(severity, timestamp, progname, msg) + "#{timestamp.to_s(:long)} -> #{severity} -> #{msg}\n" + end end end diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 4fbde37ef3e0a1002868c7c9ee18026f9f7a7b8c..014483d4e8c2074a0975d79053e0e7d2dc22d098 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -159,7 +159,7 @@ namespace :gitlab do print "- Dumping table #{tbl}... " count = 1 File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| - ActiveRecord::Base.connection.select_all("SELECT * FROM #{tbl}").each do |line| + ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line| line.delete_if{|k,v| v.blank?} output = {tbl + '_' + count.to_s => line} file << output.to_yaml.gsub(/^---\n/,'') + "\n" diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 8d750bef5a5de514bc2dd19328f353e203d6a2d2..ac986ccebe382ee3c8ffce3f9e80210877994152 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -13,7 +13,6 @@ describe MergeRequest do it { should validate_presence_of(:title) } it { should validate_presence_of(:author_id) } it { should validate_presence_of(:project_id) } - it { should validate_presence_of(:assignee_id) } end describe "Scope" do diff --git a/spec/requests/wikis_notes_spec.rb b/spec/requests/wikis_notes_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..144d0318bea17d607ff588f68bc786a5dfb8bffc --- /dev/null +++ b/spec/requests/wikis_notes_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe "Wikis" do + let(:project) { Factory :project } + + before do + login_as :user + project.add_access(@user, :read, :write) + end + + describe "add new note", :js => true do + before do + visit project_wiki_path(project, :index) + + fill_in "Title", :with => 'Test title' + fill_in "Content", :with => '[link test](test)' + click_on "Save" + + page.should have_content("Test title") + + fill_in "note_note", :with => "Comment on wiki!" + click_button "Add Comment" + end + + it "should contain the new note" do + page.should have_content("Comment on wiki!") + end + end +end