2011-10-08 23:36:38 +02:00
|
|
|
= form_for(@project, :remote => true) do |f|
|
|
|
|
%div.form_content
|
2011-10-16 23:07:10 +02:00
|
|
|
- unless @project.new_record?
|
2011-10-08 23:36:38 +02:00
|
|
|
%h1 Edit Project
|
|
|
|
- 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
|
|
|
|
%table.round-borders
|
|
|
|
%tr
|
|
|
|
%td= f.label :name
|
|
|
|
%td= f.text_field :name, :placeholder => "Example Project"
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
.left= f.label :path
|
|
|
|
%cite.right git@yourserver:
|
|
|
|
%td
|
|
|
|
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
|
|
|
|
%tr
|
2011-10-26 15:46:25 +02:00
|
|
|
%td
|
2011-10-08 23:36:38 +02:00
|
|
|
.left= f.label :code
|
|
|
|
%cite.right http://yourserver/
|
2011-10-18 10:21:44 +02:00
|
|
|
%td= f.text_field :code, :placeholder => "example"
|
2011-11-04 09:11:14 +01:00
|
|
|
|
|
|
|
%tr
|
|
|
|
%td= f.label :tag_list
|
|
|
|
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
|
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
.field
|
|
|
|
= f.label :description
|
|
|
|
%br/
|
|
|
|
= f.text_area :description, :style => "height:140px;width:932px;"
|
|
|
|
.clear
|
|
|
|
%hr.prepend-top
|
|
|
|
.actions
|
|
|
|
= f.submit :class => "lbutton vm"
|
|
|
|
|
|
|
|
%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 15:46:25 +02:00
|
|
|
- else
|
2011-10-08 23:36:38 +02:00
|
|
|
%h3.prepend-top Updating project & repository. Please wait for few minutes
|
2011-11-04 09:11:14 +01:00
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
:javascript
|
2011-10-26 15:46:25 +02:00
|
|
|
$('.new_project, .edit_project').bind('ajax:before', function() {
|
|
|
|
$(this).find(".form_content").hide();
|
2011-10-08 23:36:38 +02:00
|
|
|
$('.ajax_loader').show();
|
2011-10-26 15:46:25 +02:00
|
|
|
});
|
2011-11-04 09:11:14 +01:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function(){
|
|
|
|
var tag_field = $('#tag_field').tagify();
|
|
|
|
|
2011-11-05 13:57:40 +01:00
|
|
|
|
|
|
|
tag_field.tagify('inputField').autocomplete({
|
|
|
|
source: '/tags/autocomplete.json',
|
|
|
|
position: { of: tag_field.tagify('containerDiv') },
|
|
|
|
close: function(event, ui) { tag_field.tagify('add'); },
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2011-11-04 09:11:14 +01:00
|
|
|
$('form').submit( function() {
|
|
|
|
var tag_field = $('#tag_field')
|
|
|
|
tag_field.val( tag_field.tagify('serialize') );
|
|
|
|
return true;
|
|
|
|
});
|
2011-11-05 13:57:40 +01:00
|
|
|
|
|
|
|
|
2011-11-04 09:11:14 +01:00
|
|
|
})
|