Merge branch 'master' of https://github.com/dubcanada/gitlabhq into dubcanada-master

This commit is contained in:
Dmitriy Zaporozhets 2012-03-25 17:04:07 +03:00
commit b1d89f732c
12 changed files with 186 additions and 46 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View file

@ -37,6 +37,12 @@ init:
$('.attach_holder').show();
});
$("#note_attachment").change(function(e){
var val = $('.input-file').val();
var filename = val.replace(/^.*[\\\/]/, '');
$(".file_name").text(filename);
});
},

View file

@ -293,8 +293,14 @@ nav.main_menu {
background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
@include shade;
.count {
color:#aaa;
margin-left:3px;
margin-left:3px;
color: #332;
background: white;
padding: 1px 6px 2px;
font-weight: bold;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
}
.label {
background:$hover;
@ -345,8 +351,8 @@ nav.main_menu {
img.avatar {
float:left;
margin-right:15px;
width:40px;
margin-right:10px;
width:35px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
@ -372,7 +378,7 @@ img.lil_av {
.wll {
background-color: #FFF;
padding: 10px 5px;
padding: 6px 10px;
min-height: 20px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
@ -998,6 +1004,41 @@ p.time {
margin: 2px;
}
/* Issues Changed */
/* Could probably rewrite this, a bit sloppy */
.well {
.issue_status.span2 {
width:116px;
.alert-message {
width:34px;
margin: 0 0 0 auto;
.error {
width: 40px;
}
}
}
pre {
background: white !important;
code {
background: none !important;
}
}
}
/* Fix for readme code (stopped it from being yellow) */
.readme {
pre {
background: white !important;
code {
background: none !important;
}
}
}
.highlight_word {
background:#EEDC94;
}
@ -1040,3 +1081,58 @@ p.time {
border-bottom:2px solid $style_color;
}
}
// Fixes alignment on notes.
.new_note {
label {
text-align:left;
}
}
.issue_notes {
.input-file {
font: 500px monospace;
opacity:0;
filter: alpha(opacity=0);
position: absolute;
z-index: 1;
top:0;
right:0;
padding:0;
margin: 0;
}
.file_upload {
position: absolute;
right:14px;
top:7px;
height: 30px;
}
div.attachments {
position:relative;
width: 350px;
height: 30px;
overflow:hidden;
margin:0 0 5px !important;
}
.file_name {
line-height:30px;
width:240px;
height:28px;
overflow:hidden;
}
}
// Fix issue with notes & lists creating a bunch of bottom borders.
li.note {
.note-title {
li {
border-bottom:none !important;
}
.file {
padding-left:20px;
background:url("icon-attachment.png") no-repeat left center;
}
}
}

View file

@ -48,3 +48,13 @@
}
}
/** Fix for Search Dropdown Border **/
.chzn-container {
.chzn-search {
input:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
}
}

View file

@ -24,6 +24,10 @@ class Issue < ActiveRecord::Base
validates :title,
:presence => true,
:length => { :within => 0..255 }
validates :description,
:presence => true,
:length => { :within => 0..2000 }
scope :critical, where(:critical => true)
scope :non_critical, where(:critical => false)
@ -57,6 +61,7 @@ end
#
# id :integer not null, primary key
# title :string(255)
# description :text
# assignee_id :integer
# author_id :integer
# project_id :integer

View file

@ -9,12 +9,18 @@
%li= msg
.clearfix
= f.label :title
.input= f.text_area :title, :maxlength => 255, :class => "xxlarge"
= f.label :title, "Issue Subject"
.input= f.text_field :title, :maxlength => 255
.clearfix
= f.label :description, "Issue Details"
.input
= f.text_area :description, :maxlength => 2000, :class => "xxlarge"
%p.hint Markdown is enabled.
.clearfix
= f.label :assignee_id
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Assign to user" })
.clearfix
= f.label :critical, "Critical"
@ -26,7 +32,10 @@
.input= f.check_box :closed
.actions
= f.submit 'Save', :class => "primary btn"
- if @issue.new_record?
= f.submit 'Submit new issue', :class => "primary btn"
-else
= f.submit 'Save changes', :class => "primary btn"
- if request.xhr?
= link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn"

View file

@ -1,5 +1,9 @@
%h3
Issue ##{@issue.id}
.back_link
= link_to project_issues_path(@project) do
&larr; To issues list
%h3
#{@issue.title}
%small
created at
= @issue.created_at.stamp("Aug 21, 2011")
@ -17,33 +21,33 @@
%br
- if @issue.upvotes > 0
.upvotes#upvotes= "+#{pluralize @issue.upvotes, 'upvote'}"
.back_link
= link_to project_issues_path(@project) do
&larr; To issues list
%hr
- if @issue.closed
.alert-message.error Closed
- else
.alert-message.success Open
%div.well.prettyprint
%div
%cite.cgray Created by
= image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"
%strong.author= link_to_issue_author(@issue)
%cite.cgray and currently assigned to
= image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
%strong.author= link_to_issue_assignee(@issue)
%hr
%div.well
%div.row
%div.issue_meta.span13
%cite.cgray Created by
= image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"
%strong.author= link_to_issue_author(@issue)
%cite.cgray and currently assigned to
= image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
%strong.author= link_to_issue_assignee(@issue)
%div= simple_format @issue.title
%div.issue_status.span2
- if @issue.closed
.alert-message.error Closed
- else
.alert-message.success Open
%hr
%div
- if @project.description.present?
= markdown @issue.description
.issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue"

View file

@ -1,5 +1,5 @@
= form_for [@project, @note], :remote => "true", :multipart => true do |f|
%h3 Leave a note
%h3 Leave a comment
-if @note.errors.any?
.alert-message.block-message.error
- @note.errors.full_messages.each do |msg|
@ -8,6 +8,7 @@
= f.hidden_field :noteable_id
= f.hidden_field :noteable_type
= f.text_area :note, :size => 255
%p.hint Markdown is enabled.
.row
.span4
@ -21,11 +22,14 @@
= label_tag :notify_author do
= check_box_tag :notify_author, 1 , @note.noteable_type == "Commit"
%span Commit author
.span4
.span8
%h5 Attachment:
.clearfix
= f.label :attachment, "Any file, < 10 MB"
.input= f.file_field :attachment, :class => "input-file"
.attachments.breadcrumb
%div.file_name File name...
%button.file_upload.btn.primary Upload File
.input= f.file_field :attachment, :class => "input-file"
%span Any file less then 10 MB
= f.submit 'Add note', :class => "btn primary", :id => "submit_note"
= f.submit 'Add Comment', :class => "btn primary", :id => "submit_note"

View file

@ -12,6 +12,6 @@
= markdown(note.note)
- if note.attachment.url
.right
%span.file
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
%div.file
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
.clear

View file

@ -0,0 +1,5 @@
class AddDescriptionToIssues < ActiveRecord::Migration
def change
add_column :issues, :description, :text
end
end

View file

@ -27,6 +27,7 @@ ActiveRecord::Schema.define(:version => 20120323221339) do
create_table "issues", :force => true do |t|
t.string "title"
t.text "description"
t.integer "assignee_id"
t.integer "author_id"
t.integer "project_id"

View file

@ -107,13 +107,13 @@
z-index: 1010;
}
.chzn-container-single .chzn-search input {
background: #fff url('chosen-sprite.png') no-repeat 100% -22px;
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
background: #fff url('chosen-sprite.png') no-repeat 100% -21px;
background: url('chosen-sprite.png') no-repeat 100% -21px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('chosen-sprite.png') no-repeat 100% -21px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -21px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -21px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -21px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
background: url('chosen-sprite.png') no-repeat 100% -21px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
margin: 1px 0;
padding: 4px 20px 4px 5px;
outline: 0;