gitlabhq/app/views/projects/_form.html.haml
2012-01-18 01:19:57 +02:00

68 lines
2.1 KiB
Plaintext

= form_for(@project, :remote => true) do |f|
%div.form_content
- unless @project.new_record?
%h2.icon
%span
= @project.name
.clear
- if @project.errors.any?
%ul.errors_holder
- @project.errors.full_messages.each do |msg|
%li= msg
%table
%tr
%td= f.label :name
%td= f.text_field :name, :placeholder => "Example Project"
%tr
%td
.left= f.label :path
%cite.right= "git@#{GIT_HOST["host"]}:"
%td
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
%tr
%td
.left= f.label :code
%cite.right= "http://#{GIT_HOST["host"]}/"
%td= f.text_field :code, :placeholder => "example"
- unless @project.new_record? || @project.heads.empty?
%tr
%td= f.label :default_branch, "Default Branch"
%td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")
-#%tr
%td= f.label :tag_list
%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"
%br
%div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
%center
= image_tag "ajax-loader.gif", :class => "append-bottom"
- if @project.new_record?
%h3.prepend-top Creating project & repository. Please wait for few minutes
- else
%h3.prepend-top Updating project & repository. Please wait for few minutes
.merge-tabs
= f.submit 'Save', :class => "grey-button"
 
- unless @project.new_record?
.right
= link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "red-button"
:javascript
$(function(){
$('.new_project, .edit_project').bind('ajax:before', function() {
$(this).find(".form_content").hide();
$('.ajax_loader').show();
});
taggifyForm();
$('form #project_default_branch').chosen();
})