2011-10-09 00:36:38 +03:00
|
|
|
= form_for(@project, :remote => true) do |f|
|
|
|
|
%div.form_content
|
2011-10-17 00:07:10 +03:00
|
|
|
- unless @project.new_record?
|
2011-11-15 12:34:30 +04:00
|
|
|
%h2.icon
|
2011-11-08 12:23:13 -05:00
|
|
|
%span
|
|
|
|
= @project.name
|
2011-11-29 20:10:48 +02:00
|
|
|
.clear
|
2011-10-09 00:36:38 +03:00
|
|
|
- if @project.errors.any?
|
|
|
|
#error_explanation
|
|
|
|
%h2
|
|
|
|
= pluralize(@project.errors.count, "error")
|
|
|
|
prohibited this project from being saved:
|
|
|
|
%ul
|
|
|
|
- @project.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
2011-11-08 12:23:13 -05:00
|
|
|
%table
|
2011-10-09 00:36:38 +03:00
|
|
|
%tr
|
|
|
|
%td= f.label :name
|
|
|
|
%td= f.text_field :name, :placeholder => "Example Project"
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
.left= f.label :path
|
2011-12-04 01:44:59 +02:00
|
|
|
%cite.right= "git@#{GIT_HOST["host"]}:"
|
2011-10-09 00:36:38 +03:00
|
|
|
%td
|
|
|
|
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
|
|
|
|
%tr
|
2011-10-26 18:46:25 +05:00
|
|
|
%td
|
2011-10-09 00:36:38 +03:00
|
|
|
.left= f.label :code
|
2011-12-04 01:44:59 +02:00
|
|
|
%cite.right= "http://#{GIT_HOST["host"]}/"
|
2011-10-18 11:21:44 +03:00
|
|
|
%td= f.text_field :code, :placeholder => "example"
|
2011-11-04 10:11:14 +02:00
|
|
|
|
2011-12-08 00:22:46 +02:00
|
|
|
- unless @project.new_record? || @project.heads.empty?
|
2011-12-07 23:56:57 +02:00
|
|
|
%tr
|
|
|
|
%td= f.label :default_branch, "Default Branch"
|
|
|
|
%td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")
|
|
|
|
|
2011-12-15 08:42:24 +02:00
|
|
|
-#%tr
|
2011-11-04 10:11:14 +02:00
|
|
|
%td= f.label :tag_list
|
|
|
|
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
|
2011-11-08 12:23:13 -05:00
|
|
|
%tr
|
|
|
|
%td= f.label :description
|
|
|
|
%td= f.text_area :description, :placeholder => "project description", :style => "height:50px"
|
2011-11-04 10:11:14 +02:00
|
|
|
|
2011-11-08 12:23:13 -05:00
|
|
|
%br
|
2011-10-09 00:36:38 +03:00
|
|
|
%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
|
2011-10-26 18:46:25 +05:00
|
|
|
- else
|
2011-10-09 00:36:38 +03:00
|
|
|
%h3.prepend-top Updating project & repository. Please wait for few minutes
|
2011-12-15 21:42:33 +02:00
|
|
|
|
|
|
|
.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"
|
|
|
|
|
2011-11-04 10:11:14 +02:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function(){
|
2012-01-07 12:53:01 +02:00
|
|
|
$('.new_project, .edit_project').bind('ajax:before', function() {
|
|
|
|
$(this).find(".form_content").hide();
|
|
|
|
$('.ajax_loader').show();
|
|
|
|
});
|
|
|
|
|
2011-11-07 20:38:54 +02:00
|
|
|
taggifyForm();
|
2012-01-07 12:53:01 +02:00
|
|
|
|
2011-12-07 23:56:57 +02:00
|
|
|
$('form #project_default_branch').chosen();
|
2011-11-15 12:34:30 +04:00
|
|
|
})
|