<%@ Import Namespace="DevProcess.Common.Utils" %>
<%@ Page Language="C#" MasterPageFile="~/2ColMaster.Master" AutoEventWireup="true" CodeBehind="NewProcess.aspx.cs" Inherits="ProcessDefinition.NewProcess" Title="New definition" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">
<h2 style="margin-bottom:8px;">New process library definition</h2>
<asp:Panel ID="pnlOptCreate" runat="server" Visible="false">
<p class="hBlurb ui-state-highlight">This process library definition doesn't exist. Create one by entering the details below.</p>
</asp:Panel>
<dp:ValidatedTextBox ID="txtProcessName" runat="server" LabelText="Name" ValidationGroup="newProc" Columns="40" /><br />
<asp:ObjectDataSource ID="odsItems" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetProcessTypes"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="repositoryName" Type="String"/>
    </SelectParameters>
</asp:ObjectDataSource>

    <table width="100%">
        <tr>
            <td style="width:50%;">

<asp:ListView ID="lstItems" runat="server" ItemPlaceholderID="itemList"
        EnableViewState="False" DataSourceID="odsItems" >

    <LayoutTemplate>
    <label>Select a process library type:</label><br/>
    <ul id="procSelList">
        <asp:PlaceHolder id="itemList" runat="server"/>
    </ul>
    </LayoutTemplate>

    <ItemTemplate>
            <div class='ui-corner-all procSel' ptid='<%#Eval("ProcessTypeId") %>'>
            <h2><a><%#StringHelper.Format("{0:multilinenourl}",Eval("ProcessTypeName")) %></a></h2>
            </div>
    </ItemTemplate>

    <EmptyDataTemplate>

    </EmptyDataTemplate>
</asp:ListView>

<dp:JqHiddenField ID="selectedProcess" runat="server" />
                </td>
                <td style="width:50%;">
                    <h3 id="hMatching" style="display:none;">Possible matches</h3>
                    <ul id="lstMatches"></ul>
                </td>
        </tr>
    </table>


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentOptions" runat="server">
    <ul class='ui-widget-content'>
        <li class="btn"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span><a href="..">Back to library</a></li>
    </ul>

    <ul class='ui-widget-content'>
        <li class="btn"><span class="ui-icon ui-icon-disk"></span><asp:LinkButton ID="btnCreate" ValidationGroup="newProc"  runat="server" Text="Create" OnClick="btnCreate_Click" />
    </ul>
        <ul class='ui-widget-content'>
        <li class="btn"><span class="ui-icon ui-icon-pencil"></span><a href="../ProcessBuilder" id="lnkProcBuilder">Process builder</a></li>
    </ul>    
</asp:Content>
