<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ScorecardView.ascx.cs"
    Inherits="Zap.BI.Portal.Controls.UserControls.ResourceControls.Scorecards.ScorecardView" %>

<zapWeb:QueryParameterContainer runat="server" ID="filterPane" HasSlicer="False" />

<%--Inner Content--%>
<%--Expression Template Instance Editor Stack--%>
<zapWeb:TemplateInstanceStack runat="server" ID="TemplateInstanceStack" />

<div class="horizontalDesignPlaceholder" style="overflow: hidden;">
    <div runat="server" id="cubeSelection">
        <asp:Label ID="cubeLabel" CssClass="ui-form-label-inline" runat="server" />
        <asp:DropDownList ID="cubeDropDownList" CssClass="cubeDropDownList ui-input-box" runat="server" />
    </div>
    <div style="margin: 4px 0 0 102px;">
        <zapWeb:QueryPlaceholder ID="layersPlaceholder" runat="server" PlaceholderGuid="{437170E2-6577-4aff-B899-04C725CB1B48}"
            AutoResize="true" Name="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Label_KpiSlicesPlaceholder %>"
            Description="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Description_KpiSlicesPlaceholder %>"
            HelpText="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, HelpText_KpiSlicesPlaceholder %>" />
    </div>
    <div style="margin: 4px 0 0 62px;">
        <zapWeb:QueryPlaceholder ID="itemFiltersPlaceholder" runat="server" PlaceholderGuid="{A5F32080-82D5-4ee9-B769-E309C921F551}"
            AutoResize="true" Name="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Label_RowFilterPlaceholder %>"
            Description="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Description_RowFilterPlaceholder %>"
            HelpText="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, HelpText_RowFilterPlaceholder %>" />
    </div>
    <div style="float: left;">
        <zapWeb:DesignPlaceholderBin ID="queryPlaceholderBin" runat="server" />
    </div>
    <div style="margin: 4px 0 0 24px;">
        <zapWeb:QueryPlaceholder ID="filtersPlaceholder" runat="server" PlaceholderGuid="{4C71F669-FAAB-4464-A09E-AAC12A07B62A}"
            AutoResize="true" Name="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Label_ScorecardFilterPlaceholder %>"
            Description="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Description_ScorecardFilterPlaceholder %>" />
    </div>
</div>

<div runat="server" id="sidePlaceholderOuter" class="verticalDesignPlaceholder">
    <zapWeb:ScorecardPlaceholder ID="scorecardItemPlaceholder" runat="server" PlaceholderGuid="{1F0B72F9-9676-4df7-B4C2-E56D68BFC1F7}"
        AutoResize="true" VerticallyOrientated="true" Name="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Label_ScorecardItemsPlaceholder %>"
        Description="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Description_ScorecardItemsPlaceholder %>"
        HelpText="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, HelpText_ScorecardItemsPlaceholder %>" />
</div>

<div class="resourceContentWrapper">
    <%--Height is to prevent div from wrapping onto next line under side placeholder--%>

    <zapWeb:ZapUpdatePanel runat="server" ID="resourceViewPanel">

        <ContentTemplate>

            <div runat="server" id="ScorecardViewContainer">

                <dx:ASPxTreeList runat="server" ID="ScorecardTree" AutoGenerateColumns="False" EnableCallbacks="False"
                    Width="683px" DataCacheMode="Disabled" EnableDefaultAppearance="False" OnNodeExpanded="Tree1_NodeExpandedToggle"
                    OnNodeCollapsed="Tree1_NodeExpandedToggle">
                    <Settings GridLines="Both" />

                    <Styles EnableDefaultAppearance="false" CssPostfix="SC">

                        <AlternatingNode Enabled="True" />

                    </Styles>

                    <SettingsBehavior AllowFocusedNode="false" FocusNodeOnExpandButtonClick="false" FocusNodeOnLoad="false"
                        ExpandCollapseAction="Button" AllowSort="false" />
                    <SettingsEditing AllowNodeDragDrop="false" />
                    <SettingsSelection Enabled="false" />
                    <SettingsCookies Enabled="false" />
                    <SettingsCustomizationWindow Caption="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, Title_CustomizationWindow %>"
                        PopupHorizontalAlign="LeftSides" PopupVerticalAlign="TopSides" Enabled="True"
                        PopupHorizontalOffset="30" PopupVerticalOffset="30" />

                    <Columns>

                        <dx:TreeListDataColumn Name="Name" FieldName="Name" VisibleIndex="0" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>">

                            <DataCellTemplate>
                                <asp:PlaceHolder runat="server" ID="LinkPlaceholder" OnDataBinding="LinkPlaceholder_DataBinding">
                                    <div class="RowTitleWrapper">
                                        <asp:Label runat="server" ID="RowTitleText" CssClass="RowTitleText" EnableViewState="false" />
                                        <asp:TextBox runat="server" ID="RowTitleTextEdit" CssClass="RowTitleTextEdit" EnableViewState="false" />
                                        <span class="RowLinkWrapper">
                                            <asp:Image runat="server" ID="DrillIntoLink" EnableViewState="false" />
                                            <asp:Image runat="server" ID="RemoveLink" CssClass="RemoveLink" />
                                        </span>
                                    </div>
                                </asp:PlaceHolder>
                            </DataCellTemplate>

                        </dx:TreeListDataColumn>

                        <dx:TreeListTextColumn Name="Actual" FieldName="Actual" VisibleIndex="1" ReadOnly="True"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>" />

                        <dx:TreeListTextColumn Name="Target" FieldName="Target" VisibleIndex="2" ReadOnly="True"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>" />

                        <dx:TreeListDataColumn Name="Status" FieldName="Status" VisibleIndex="3" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>"
                            CellStyle-HorizontalAlign="Center">

                            <DataCellTemplate>
                                <asp:PlaceHolder runat="server" ID="StatusPlaceholder" EnableViewState="false" OnDataBinding="StatusPlaceholder_DataBinding" />
                            </DataCellTemplate>

                        </dx:TreeListDataColumn>

                        <%-- Anchor hidden by default --%>

                        <dx:TreeListTextColumn Name="Anchor" FieldName="Anchor" VisibleIndex="4" ReadOnly="True"
                            Visible="false" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>" />

                        <%-- Variance hidden by default --%>

                        <dx:TreeListTextColumn Name="Variance" FieldName="Variance" VisibleIndex="5" ReadOnly="True"
                            Visible="false" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>" />

                        <dx:TreeListTextColumn Name="Previous" FieldName="Previous" VisibleIndex="6" ReadOnly="True"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>" />

                        <dx:TreeListDataColumn Name="Trend" FieldName="Trend" VisibleIndex="7" ReadOnly="True"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>"
                            CellStyle-HorizontalAlign="Center">

                            <DataCellTemplate>
                                <asp:PlaceHolder runat="server" ID="TrendPlaceholder" EnableViewState="false" OnDataBinding="TrendPlaceholder_DataBinding" />
                            </DataCellTemplate>

                        </dx:TreeListDataColumn>

                        <dx:TreeListDataColumn HeaderStyle-CssClass="WeightColumn" CellStyle-CssClass="WeightColumn"
                            Name="Weight" FieldName="Weight" VisibleIndex="8" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.Scorecards.ScorecardViewText, ToolTip_HeaderReorder %>">

                            <DataCellTemplate>
                                <asp:PlaceHolder runat="server" ID="WeightPlaceholder" OnDataBinding="WeightPlaceholder_DataBinding">
                                    <asp:Label runat="server" ID="WeightLabel" CssClass="WeightLabel" EnableViewState="false" />
                                    <zap:SpinEdit runat="server" ID="WeightEdit" CssClass="WeightEdit" NumberType="Float"
                                        Increment="1" Width="60" ValueChangedDelay="400" />
                                </asp:PlaceHolder>
                            </DataCellTemplate>

                        </dx:TreeListDataColumn>

                    </Columns>

                </dx:ASPxTreeList>

            </div>

        </ContentTemplate>

    </zapWeb:ZapUpdatePanel>

</div>

<zapWeb:ZapUpdatePanel runat="server" ID="HiddenTriggerUpdatePanel" RenderMode="Inline"
    UpdateMode="Conditional" ChildrenAsTriggers="true">

    <ContentTemplate>
        <asp:Button runat="server" ID="ScorecardActionTrigger" CssClass="actionTrigger" OnClick="ActionTrigger_Click"
            EnableViewState="false" Style="display: none;" />
        <asp:HiddenField runat="server" ID="ActionField" EnableViewState="false" />
    </ContentTemplate>

    </zapWeb:ZapUpdatePanel>