<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Folders.aspx.cs" Inherits="Mail_Folders" meta:resourcekey="Page" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../libs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../libs/fontawesome/css/all.min.css" >
    <script type="text/javascript" src="../libs/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="../libs/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <div class="container-fluid">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th style="font-size:larger">
                            <div class="row">
                                <div class="col-xs-10">
                                    <asp:Localize ID="Localize1" runat="server" meta:resourcekey="Localize1">폴더 선택</asp:Localize> <asp:Label ID="UsageLabel" runat="server" CssClass="small"></asp:Label>
                                </div>
                                <div class="col-xs-2 text-right">
                                    <button type="button" id="closeToolButton" class="btn btn-primary" onclick="history.back();"><span class="fa-solid fa-xmark"></span></button>
                                </div>
                            </div>
                        </th>
                    </tr>
	            </thead>
                <tbody>
                    <asp:Repeater ID="FolderRepeater" runat="server" DataSourceID="FolderDataSource">
                        <ItemTemplate>
                            <tr>
		                        <td>
                                    <div class="row" style='padding-left:<%# GetIndent((int)Eval("Indent")) %>px;' onclick="<%# GetClickEventFunction((Guid)Eval("ID"), (string)Eval("FolderName"), Eval("Items"))%>">
                                        <div class="col-xs-9">
                                            <%# GetFolderInfoEx((Guid)Eval("ID"), (string)Eval("FolderName"), (int)Eval("NewMsgCount"), (int)Eval("MsgCount"), Eval("Items"))%>
                                        </div>
                                        <div class="col-xs-3 text-right">
                                            <%# GetSpaceUsage((Guid)Eval("ID"), (long)Eval("SpaceUsed"))%>
                                        </div>
                                    </div>
                                </td>
	                        </tr>
                        </ItemTemplate>
                    </asp:Repeater>
	            </tbody>
            </table>
        </div>

        <asp:ObjectDataSource ID="FolderDataSource" runat="server" TypeName="MailFolderDataSource" SelectMethod="GetFolders" >
            <SelectParameters>
                <asp:Parameter Name="allMails" Type="Boolean" DefaultValue="true" />
                <asp:Parameter Name="unreadMails" Type="Boolean" DefaultValue="true" />
                <asp:Parameter Name="flaggedMails" Type="Boolean" DefaultValue="true" />
                <asp:Parameter Name="readRecipients" Type="Boolean" DefaultValue="true" />
                <asp:Parameter Name="sendApproval" Type="Boolean" DefaultValue="true" />
                <asp:Parameter Name="spamNotification" Type="Boolean" DefaultValue="true" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </form>
</body>
</html>
