Bootstrap: Activities
This commit is contained in:
parent
15b06b0164
commit
0a4222fb98
26 changed files with 324 additions and 365 deletions
|
@ -1,69 +1,29 @@
|
|||
= render "project_head"
|
||||
|
||||
= form_for(@project, :remote => true) do |f|
|
||||
%div
|
||||
%span.entity-info
|
||||
= link_to info_project_path(@project) do
|
||||
.entity-button
|
||||
Info
|
||||
%i
|
||||
%h2= @project.name
|
||||
%hr
|
||||
%table.no-borders
|
||||
-if @project.errors.any?
|
||||
%tr
|
||||
%td{:colspan => 2}
|
||||
#error_explanation
|
||||
- @project.errors.full_messages.each do |msg|
|
||||
%span= msg
|
||||
%br
|
||||
|
||||
%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 :description
|
||||
%td= f.text_area :description, :placeholder => "project description", :style => "height:50px"
|
||||
|
||||
%br
|
||||
|
||||
.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"
|
||||
|
||||
%h3 Edit Project
|
||||
%hr
|
||||
= render "projects/form"
|
||||
%div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
|
||||
%center
|
||||
= image_tag "ajax-loader.gif", :class => "append-bottom"
|
||||
%h3.prepend-top Updating project & repository. Please wait for few minutes
|
||||
|
||||
:javascript
|
||||
$('.edit_project').bind('ajax:before', function() {
|
||||
$(".edit_project").hide();
|
||||
$('.ajax_loader').show();
|
||||
});
|
||||
%h3.prepend-top Saving project & repository. Please wait...
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
$('#project_default_branch').chosen();
|
||||
})
|
||||
$("#project_name").live("change", function(){
|
||||
var slug = slugify($(this).val());
|
||||
$("#project_code").val(slug);
|
||||
$("#project_path").val(slug);
|
||||
});
|
||||
});
|
||||
|
||||
function slugify(text) {
|
||||
return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('.edit_project').live('ajax:before', function() {
|
||||
$(this).hide();
|
||||
$('.ajax_loader').show();
|
||||
});
|
||||
$('form #project_default_branch').chosen();
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue