<script>
    function pro_st_show_ku()
    {
        $("#pro_st_edit_ku").toggle();
    }
</script>
<% unless @project.repositories.any? %>
    <p class="nodata">温馨提示：<%= l(:label_repository_no_data) %></p>
<% end %>
<%= str = error_messages_for 'repository' %>
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->

<%# 新建版本库 %>
<% if @gitlab_rep.nil? %>
    <div >
      <a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ku();"></a>
      <a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
        <% course_tag = @project.project_type %>
        <% if User.current.allowed_to?(:manage_repository, @project) %>
            <!--newrepo_project_repository_path(@project, :course => course_tag) -->
            <%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %></p>
        <% end %>
      </a>
      <div class="cl"></div>

      <%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
          <div id="pro_st_edit_ku" class="pro_st_edit_ku">
            <ul>
              <li style="display: none">
                <label class="label02"><%=l(:label_scm)%>：</label>
                <%= select_tag('repository_scm',
                               options_for_select(["Git"],@repository.class.name.demodulize),
                               :data => {:remote => true, :method => 'get'}) %>
                <% if @repository && ! @repository.class.scm_available %>
                    <span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
                <% end %>
              </li>
              <li >
                <input type="text" style="display: none"/> <!--阻止表单自动填充 -->
                <input type="password" style="display: none"/> <!--阻止表单自动填充 -->
                <span class="f14"><span class="c_red">*</span><%=l(:label_repository_name)%>：</span>
                <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
                <%# unless @repository.identifier_frozen? %>
                    <span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
                <%# end %>
              </li>
              <div class="cl"></div>
            </ul>
            <a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl  "><%=l(:lable_project_rep_create) %></a>
            <a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl "><%=l(:button_cancel)%></a>
          </div><!--pro_st_edit_issues end-->
      <% end %>
    </div>
<% else %>
    <%= render :partial => 'projects/settings/rep_gitlab', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
<% end %>




