Merge branch 'dev'

This commit is contained in:
gitlabhq 2011-11-08 12:26:28 -05:00
commit faa87e61bf
23 changed files with 194 additions and 142 deletions

View file

@ -42,8 +42,10 @@ replace:
prepend: prepend:
function(id, html) { function(id, html) {
if(id != this.last_id) {
this.last_id = id; this.last_id = id;
$("#notes-list").prepend(html); $("#notes-list").prepend(html);
}
}, },
getNew: getNew:

View file

@ -276,6 +276,9 @@ input.ssh_project_url {
/** FORM INPUTS **/ /** FORM INPUTS **/
.user_new, .user_new,
.new_key,
.new_issue,
.new_note,
.edit_user, .edit_user,
.new_project, .new_project,
.new_snippet, .new_snippet,
@ -676,6 +679,30 @@ body.project-page table .commit {
} }
} }
#notes-list .note .delete-note { display:none; }
#notes-list .note:hover .delete-note { display:block; }
#issues-table-holder .issue .action-links {
display:none;
a {
margin-left:10px;
}
}
.issue-number {
float: left;
border-radius: 5px;
text-shadow: none;
background: rgba(0, 0, 0, 0.12);
text-align: center;
padding: 14px 8px;
width: 40px;
margin-right: 10px;
color: #444;
}
#issues-table-holder .issue:hover .action-links { display:block; }
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note img{float: left; margin-right: 10px;} body.project-page #notes-list .note img{float: left; margin-right: 10px;}
@ -683,3 +710,14 @@ body.project-page #notes-list .note span.note-title{display: block;}
body.project-page #notes-list .note span.note-title{margin-bottom: 10px} body.project-page #notes-list .note span.note-title{margin-bottom: 10px}
body.project-page #notes-list .note span.note-author{color: #999; font-weight: normal; font-style: italic;} body.project-page #notes-list .note span.note-author{color: #999; font-weight: normal; font-style: italic;}
body.project-page #notes-list .note span.note-author strong{font-weight: bold; font-style: normal;} body.project-page #notes-list .note span.note-author strong{font-weight: bold; font-style: normal;}
/** NEW PROJECT **/
.new-project-hodler {
.icon span {
background-position: -31px -70px;
}
td {
border-bottom: 1px solid #DEE2E3;
}
}

View file

@ -87,6 +87,17 @@ h2{margin: 1.5em 0}
/* Forms */ /* Forms */
input[type="text"]:focus, input[type="password"]:focus { outline: none; } input[type="text"]:focus, input[type="password"]:focus { outline: none; }
input.text{border: 1px solid #ccc; border-radius: 4px; display: block; padding: 10px} input.text{border: 1px solid #ccc; border-radius: 4px; display: block; padding: 10px}
.form-row{
padding: 0px 0px 10px 0px;
}
.form-row label{
font-weight:bold;
display: inline-block;
padding: 0px 0px 5px 0px;
}
/* eo Forms */ /* eo Forms */
/* Tables */ /* Tables */

View file

@ -47,6 +47,7 @@ class IssuesController < ApplicationController
def create def create
@issue = @project.issues.new(params[:issue]) @issue = @project.issues.new(params[:issue])
@issue.author = current_user @issue.author = current_user
if @issue.save && @issue.assignee != current_user if @issue.save && @issue.assignee != current_user
Notify.new_issue_email(@issue).deliver Notify.new_issue_email(@issue).deliver
end end

View file

@ -1,2 +1,7 @@
module IssuesHelper module IssuesHelper
def sort_class
if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0")
"handle"
end
end
end end

View file

@ -7,41 +7,39 @@
- @admin_user.errors.full_messages.each do |msg| - @admin_user.errors.full_messages.each do |msg|
%li= msg %li= msg
.span-24 .form-row
.span-11.colborder
.field
= f.label :name = f.label :name
%br %br
= f.text_field :name = f.text_field :name
.field .form-row
= f.label :email = f.label :email
%br %br
= f.text_field :email = f.text_field :email
.field .form-row
= f.label :password = f.label :password
%br %br
= f.password_field :password = f.password_field :password
.field .form-row
= f.label :password_confirmation = f.label :password_confirmation
%br %br
= f.password_field :password_confirmation = f.password_field :password_confirmation
.field.prepend-top .form-row
= f.check_box :admin = f.check_box :admin
= f.label :admin = f.label :admin
.span-11
.field.prepend-top .form-row
= f.text_field :projects_limit, :class => "small_input" = f.text_field :projects_limit, :class => "small_input"
= f.label :projects_limit = f.label :projects_limit
.field .form-row
= f.label :skype = f.label :skype
%br %br
= f.text_field :skype = f.text_field :skype
.field .form-row
= f.label :linkedin = f.label :linkedin
%br %br
= f.text_field :linkedin = f.text_field :linkedin
.field .form-row
= f.label :twitter = f.label :twitter
%br %br
= f.text_field :twitter = f.text_field :twitter

View file

@ -21,4 +21,5 @@
%br %br
= paginate @admin_users = paginate @admin_users
= link_to 'New User', new_admin_user_path = link_to 'New User', new_admin_user_path

View file

@ -5,24 +5,21 @@
- @issue.errors.full_messages.each do |msg| - @issue.errors.full_messages.each do |msg|
%li= msg %li= msg
.span-8 .form-row
= f.label :title = f.label :title
= f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255
-#.span-8 .form-row
-#= f.label :content
-#= f.text_area :content, :style => "width:450px; height:130px"
.span-8.append-bottom
= f.label :assignee_id = f.label :assignee_id
= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
.span-1 .form-row
= f.label :critical, "Critical" = f.label :critical, "Critical"
%br %br
= f.check_box :critical = f.check_box :critical
- unless @issue.new_record? - unless @issue.new_record?
.span-2.right .form-row
= f.label :closed = f.label :closed
%br %br
= f.check_box :closed = f.check_box :closed
%hr %hr
.span-6 .form-row
= f.submit 'Save', :class => "lbutton vm" = f.submit 'Save', :class => "lbutton vm"

View file

@ -1,12 +1,3 @@
%table.round-borders#issues-table
%thead
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
%th
%th Assignee
%th ID
%th Title
%th Closed?
- @issues.critical.each do |issue| - @issues.critical.each do |issue|
= render(:partial => 'show', :locals => {:issue => issue}) = render(:partial => 'show', :locals => {:issue => issue})

View file

@ -1,37 +1,26 @@
%tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) }
- if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0")
%td %td
= image_tag "move.png" , :class => [:handle, :left] %strong.issue-number{:class => sort_class}= "##{issue.id}"
%td %span
= image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" = truncate(html_escape(issue.title), :length => fixed_mode? ? 100 : 200)
= issue.assignee.name
%td ##{issue.id}
%td
= truncate(html_escape(issue.title), :length => 200)
%br %br
%br %br
%div.note-author
%strong= issue.assignee.name
%cite.cgray
= time_ago_in_words(issue.updated_at)
ago
- if issue.critical - if issue.critical
%span.tag.high critical %span.tag.high critical
- if issue.today? - if issue.today?
%span.tag.today today %span.tag.today today
.right.action-links
.right - if can? current_user, :write_issue, issue
- if can?(current_user, :admin_issue, @project) || issue.author == current_user - if issue.closed
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true = link_to 'Reopen', project_issue_path(@project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "cgray", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
&nbsp;
= link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}"
-#- if issue.author == current_user
-#%span.tag.yours yours
-#- if issue.notes.count > 0
-#%span.tag.notes
-#= issue.notes.count
-#notes
%td
- if can? current_user, :write_issue, @project
= form_for([@project, issue], :remote => true) do |f|
= f.check_box :closed, :onclick => "$(this).parent().submit();"
= hidden_field_tag :status_only, true
- else - else
= check_box_tag "closed", 1, issue.closed, :disabled => true = link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true
- if can? current_user, :write_issue, issue
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray edit-issue-link", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}"

View file

@ -1,6 +1,7 @@
- if @issue.valid? - if @issue.valid?
:plain :plain
$("#new_issue_dialog").dialog("close"); $("#new_issue_dialog").dialog("close");
$("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue} ))}");
$.ajax({type: "GET", url: location.href, dataType: "script"}); $.ajax({type: "GET", url: location.href, dataType: "script"});
- else - else
:plain :plain

View file

@ -1,4 +1,7 @@
%div %div#issues-table-holder
%table.round-borders#issues-table
%thead
%th
.top_panel_issues .top_panel_issues
- if can? current_user, :write_issue, @project - if can? current_user, :write_issue, @project
%div{:class => "left", :style => "margin-right: 10px;" } %div{:class => "left", :style => "margin-right: 10px;" }
@ -22,7 +25,7 @@
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status" = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status"
= label_tag "all_issues","All" = label_tag "all_issues","All"
#issues-table-holder= render "issues" = render "issues"
%br %br
:javascript :javascript
var href = $('.issue_search').parent().attr('action'); var href = $('.issue_search').parent().attr('action');
@ -37,7 +40,7 @@
if (terms.length >= 2 || terms.length == 0) { if (terms.length >= 2 || terms.length == 0) {
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) { $.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
$('#issues-table').html(response); $('#issues-table tbody').html(response);
setSortable(); setSortable();
}); });
} }

View file

@ -1,3 +1,3 @@
:plain :plain
$('#issues-table-holder').html("#{escape_javascript(render('issues'))}"); $('#issues-table tbody').html("#{escape_javascript(render('issues'))}");
setSortable(); setSortable();

View file

@ -5,12 +5,12 @@
- @key.errors.full_messages.each do |msg| - @key.errors.full_messages.each do |msg|
%li= msg %li= msg
.span-6 .form-row
= f.label :title = f.label :title
= f.text_field :title, :style => "width:300px" = f.text_field :title, :style => "width:300px"
.span-6 .form-row
= f.label :key = f.label :key
= f.text_area :key, :style => "width:300px; height:130px" = f.text_area :key, :style => "width:300px; height:130px"
.span-6 .form-row
= f.submit 'Save', :class => "lbutton vm" = f.submit 'Save', :class => "lbutton vm"

View file

@ -10,13 +10,16 @@
%div %div
= f.label :note = f.label :note
%cite %cite.cgray markdown supported
%br
%br %br
= f.text_area :note, :size => 255 = f.text_area :note, :size => 255
%div.attach_holder %div.attach_holder
%br
= f.label :attachment = f.label :attachment
%cite (less than 10 MB) %cite.cgray (less than 10 MB)
%br
%br %br
= f.file_field :attachment = f.file_field :attachment

View file

@ -7,11 +7,11 @@
- @user.errors.full_messages.each do |msg| - @user.errors.full_messages.each do |msg|
%li= msg %li= msg
.div .form-row
= f.label :password = f.label :password
%br %br
= f.password_field :password = f.password_field :password
.div .form-row
= f.label :password_confirmation = f.label :password_confirmation
%br %br
= f.password_field :password_confirmation = f.password_field :password_confirmation

View file

@ -16,15 +16,15 @@
- @user.errors.full_messages.each do |msg| - @user.errors.full_messages.each do |msg|
%li= msg %li= msg
.div .form-row
= f.label :skype = f.label :skype
%br %br
= f.text_field :skype = f.text_field :skype
.div .form-row
= f.label :linkedin = f.label :linkedin
%br %br
= f.text_field :linkedin = f.text_field :linkedin
.div .form-row
= f.label :twitter = f.label :twitter
%br %br
= f.text_field :twitter = f.text_field :twitter

View file

@ -1,7 +1,9 @@
= form_for(@project, :remote => true) do |f| = form_for(@project, :remote => true) do |f|
%div.form_content %div.form_content
- unless @project.new_record? - unless @project.new_record?
%h1 Edit Project %h2.icon
%span
= @project.name
- if @project.errors.any? - if @project.errors.any?
#error_explanation #error_explanation
%h2 %h2
@ -10,7 +12,7 @@
%ul %ul
- @project.errors.full_messages.each do |msg| - @project.errors.full_messages.each do |msg|
%li= msg %li= msg
%table.round-borders %table
%tr %tr
%td= f.label :name %td= f.label :name
%td= f.text_field :name, :placeholder => "Example Project" %td= f.text_field :name, :placeholder => "Example Project"
@ -29,15 +31,13 @@
%tr %tr
%td= f.label :tag_list %td= f.label :tag_list
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field %td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
%tr
%td= f.label :description
%td= f.text_area :description, :placeholder => "project description", :style => "height:50px"
.field %br
= f.label :description
%br/
= f.text_area :description, :style => "height:140px;width:932px;"
.clear
%hr.prepend-top
.actions .actions
= f.submit :class => "lbutton vm" = f.submit :class => "button"
%div{ :class => "ajax_loader", :style => "display:none;height:200px;"} %div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
%center %center

View file

@ -1 +0,0 @@
<%= render 'form' %>

View file

@ -0,0 +1,8 @@
.new-project-hodler
.container_4
%h2.icon
%span
New Project
%div.clear
= render 'form'

4
public/.directory Normal file
View file

@ -0,0 +1,4 @@
[Dolphin]
ShowPreview=true
Timestamp=2011,11,6,21,7,47
Version=2

View file

@ -169,6 +169,7 @@ describe "Issues" do
:assignee => @user, :assignee => @user,
:project => project :project => project
visit project_issues_path(project) visit project_issues_path(project)
page.execute_script("$('.action-links').css('display', 'block');")
click_link "Edit" click_link "Edit"
end end

View file

@ -59,7 +59,7 @@
.ui-widget { font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; font-size: 1.1em; } .ui-widget { font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; } .ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #dddddd; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content { border: 1px solid #474D57; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; } .ui-widget-content a { color: #222222; }
.ui-widget-header { color: #222222; font-weight: bold; } .ui-widget-header { color: #222222; font-weight: bold; }
.ui-widget-header a { color: #222222; } .ui-widget-header a { color: #222222; }
@ -445,8 +445,8 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
* http://docs.jquery.com/UI/Dialog#theming * http://docs.jquery.com/UI/Dialog#theming
*/ */
.ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; } .ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background: #F7F7F7; color:#555; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background: #474D57; color:#eee; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0;} .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; text-shadow: none;}
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; background:#eaeaea} .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; background:#eaeaea}
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }