<%@ Page Language="C#" AutoEventWireup="true" CodeFile="View.aspx.cs" Inherits="Calendar_View" 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">
    <meta name="format-detection" content="telephone=no">
    <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>
    <script type="text/javascript">
        $(document).ready(function () {
            Dialog.setMessage('<asp:Literal runat="server" Text="<%$ Resources:Dialog, Title%>" />', '<asp:Literal runat="server" Text="<%$ Resources:Dialog, OK%>" />', '<asp:Literal runat="server" Text="<%$ Resources:Dialog, Cancel%>" />');
            Dialog.setUseBrowserConfirm(<%=AppSetting.UseBrowserConfirm%>);
        });

        function EditAppointment() {
            var url = location.href;
            location.href = url.replace("View.aspx", "Edit.aspx");
        }

        function ConfirmDelete() {
            Dialog.confirm({
                content: '<asp:Literal runat="server" Text="<%$ Resources:, Msg01%>" />',
                ok: function () {
                    __doPostBack("DeleteButton", "");
                }
            });
        }

        function GotoList() {
            location.href = "Monthly.aspx?cid=<%=_calId%>&sdate=<%=_sdate%>";
        }
    </script>

    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <CompositeScript>
                <Scripts>
                    <asp:ScriptReference Path="~/libs/tabs/common.js" />
                    <asp:ScriptReference Path="~/libs/tabs/dialog.js" />
                </Scripts>
            </CompositeScript>
        </asp:ScriptManager>

        <div class="container-fluid">
            <div class="row" id="toolBar" data-spy="affix">
                <div class="col-xs-12" style="padding-top:2px;padding-bottom:2px;">
                    <button type="button" id="editToolButton" runat="server" class="btn btn-primary" onclick="EditAppointment()"><span class="fa-solid fa-pen"></span></button>
                    <button type="button" id="deleteToolButton" runat="server" class="btn btn-primary" onclick="ConfirmDelete()"><span class="fa-solid fa-trash-can"></span></button>                    
                    <span>&nbsp;</span>
                    <button type="button" id="closeToolButton" class="btn btn-primary" onclick="GotoList();"><span class="fa-solid fa-bars"></span></button>
                </div>
            </div>
        </div>

        <div class="container-fluid" style="padding-top:40px">
            <div class="panel panel-default">
                <div class="panel-heading"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="L01">약속</asp:Localize></div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-12"><h4><asp:Literal ID="SubjectLabel" runat="server" Mode="Encode"></asp:Literal></h4></div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize2" runat="server" meta:resourcekey="L02">장소</asp:Localize></div>
                        <div class="col-xs-9"><asp:Literal ID="PlaceLabel" runat="server" Mode="Encode"></asp:Literal></div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize3" runat="server" meta:resourcekey="L03">작성자</asp:Localize></div>
                        <div class="col-xs-9">
                            <asp:Label ID="WriterLabel" runat="server" ></asp:Label>
                            &nbsp;&nbsp;<asp:Label ID="WriteDateLabel" runat="server" ></asp:Label>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize4" runat="server" meta:resourcekey="L04">시작</asp:Localize></div>
                        <div class="col-xs-9"><asp:Label ID="BeginDateLabel" runat="server" Text=""></asp:Label></div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize5" runat="server" meta:resourcekey="L05">종료</asp:Localize></div>
                        <div class="col-xs-9"><asp:Label ID="EndDateLabel" runat="server" Text=""></asp:Label></div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize6" runat="server" meta:resourcekey="L06">되풀이</asp:Localize></div>
                        <div class="col-xs-9"><asp:Label ID="RecurLabel" runat="server" Text="-"></asp:Label></div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize7" runat="server" meta:resourcekey="L07">미리알림</asp:Localize></div>
                        <div class="col-xs-9"><asp:Label ID="AlertLabel" runat="server" Text="-"></asp:Label></div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3"><asp:Localize ID="Localize8" runat="server" meta:resourcekey="L08">상태</asp:Localize></div>
                        <div class="col-xs-9"><asp:Label ID="BusyStatusLabel" runat="server" Text="-"></asp:Label></div>
                    </div>                    
                    <div id="MemoPanel">
                        <div class="row">
                            <div class="col-xs-12"><asp:Localize ID="Localize9" runat="server" meta:resourcekey="L09">메모</asp:Localize></div>
                        </div>
                        <div class="well well-sm" style="margin: 5px 5px 0px 5px;">
                            <asp:Label runat="server" ID="MemoLabel" Mode="Encode" />
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel panel-default collapse" id="AttendeePanel" runat="server">
                <div class="panel-heading"><asp:Localize ID="Localize10" runat="server" meta:resourcekey="L10">참석자</asp:Localize></div>
                <div class="panel-body">
                    <asp:Repeater ID="AttendeeListView" runat="server">
                        <HeaderTemplate>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <div class="row">
                                <div class="col-xs-8"><%# Eval("Name") %> (<%# Eval("Email") %>)</div>
                                <div class="col-xs-4 text-right"><%# GetAttendeeStatusString((TABS.MailCarrier.WebSDK.Calendar.Attendee.AttendeeStatus)Eval("Status"))%></div>
                            </div>
                        </ItemTemplate>
                        <FooterTemplate>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
            </div>
        </div>

        <div style="display:none">
            <asp:LinkButton ID="DeleteButton" runat="server" OnClick="DeleteButton_Click" Text="" /> 
        </div>
    </form>
</body>
</html>
