Commit 2be5e6d4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of github.com:gitlabhq/gitlabhq

parents 35f0566e f2e1c8b7
...@@ -33,6 +33,11 @@ $ -> ...@@ -33,6 +33,11 @@ $ ->
# Bottom tooltip # Bottom tooltip
$('.has_bottom_tooltip').tooltip(placement: 'bottom') $('.has_bottom_tooltip').tooltip(placement: 'bottom')
# Flash
if (flash = $("#flash-container")).length > 0
flash.click -> $(@).slideUp("slow")
flash.slideDown "slow"
setTimeout (-> flash.slideUp("slow")), 3000
# Disable form buttons while a form is submitting # Disable form buttons while a form is submitting
$('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) -> $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
......
...@@ -68,7 +68,7 @@ table a code { ...@@ -68,7 +68,7 @@ table a code {
} }
/** FLASH message **/ /** FLASH message **/
#flash_container { #flash-container {
height: 50px; height: 50px;
position: fixed; position: fixed;
z-index: 10001; z-index: 10001;
...@@ -79,6 +79,8 @@ table a code { ...@@ -79,6 +79,8 @@ table a code {
background: white; background: white;
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
text-align: center;
display: none;
h4 { h4 {
color: #666; color: #666;
......
...@@ -32,11 +32,10 @@ class Note < ActiveRecord::Base ...@@ -32,11 +32,10 @@ class Note < ActiveRecord::Base
delegate :name, to: :project, prefix: true delegate :name, to: :project, prefix: true
delegate :name, :email, to: :author, prefix: true delegate :name, :email, to: :author, prefix: true
validates :project, presence: true validates :note, :project, presence: true
validates :note, presence: true, length: { within: 0..5000 }
validates :attachment, file_size: { maximum: 10.megabytes.to_i } validates :attachment, file_size: { maximum: 10.megabytes.to_i }
mount_uploader :attachment, AttachmentUploader mount_uploader :attachment, AttachmentUploader
# Scopes # Scopes
scope :common, ->{ where(noteable_id: nil) } scope :common, ->{ where(noteable_id: nil) }
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
- if file.text? - if file.text?
= render "commits/text_file", diff: diff, index: i = render "commits/text_file", diff: diff, index: i
- elsif file.image? - elsif file.image?
- old_file = (@commit.prev_commit.tree / diff.old_path) - old_file = (@commit.prev_commit.tree / diff.old_path) if !@commit.prev_commit.nil?
- if diff.renamed_file || diff.new_file || diff.deleted_file - if diff.renamed_file || diff.new_file || diff.deleted_file
.diff_file_content_image .diff_file_content_image
.image{class: image_diff_class(diff)} .image{class: image_diff_class(diff)}
......
- if alert || notice - if text = alert || notice
- text = alert || notice #flash-container
%div{style: "display:none", id: "flash_container"} %h4= text
%center
%h4= text
:javascript
$(function(){
$("#flash_container").slideDown("slow");
$("#flash_container").click(function(){
$(this).slideUp("slow");
});
setTimeout("hideFlash()",3000);
});
function hideFlash(){
$("#flash_container").slideUp("slow");
}
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
%html{ lang: "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body.ui_basic.login-page %body.ui_basic.login-page
= render partial: "layouts/flash" = render "layouts/flash"
.container= yield .container= yield
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment