<!DOCTYPE html >
<html lang="en">
<head>
  <%include widget_css.html%>
<style>
    .trow {
        width: 80%;
        clear: both;
    }
    .trow.head div {
        font-weight: bold;
        font-size: 15px;
    }
    .trow div {
        float: left;
    }
    .trow div:nth-child(1) {
        width: 2%;
        padding-top: 5px;
        padding-right: 5px;
    }
    .trow div:nth-child(2),
    .trow div:nth-child(4) {
        width:28%;
    }
    .trow div:nth-child(3) {
        width: 40%;
    }
    .trow .txt {
        width: 95%;
    }
</style>
</head>
<body>
    <div class="contentwrapper">
        <h1><%if in.ID%>Modify<%else%>Add<%endif%> External Links Widget</h1>
        <hr class="line" />
        <br />
        <%~if error%><p class="error"><%error%></p><%endif%>
        <%~set NumLinks = 15%>
        <form action="admin.cgi" method="post" enctype= multipart/form-data>
            <input type="hidden" name="do" value="plugin" />
            <input type="hidden" name="plugin" value="Widgets" />
            <input type="hidden" name="func" value="<%if in.ID%>modify<%else%>add<%endif%>" />
            <input type="hidden" name="submit" value="1" />
            <input type="hidden" name="ID" value="<%in.ID || ''%>" />
            <input type="hidden" name="page" value="<%in.page || ''%>" />
            <input type="hidden" name="Type" value="1" />
            <input type="hidden" name="Widget" value="external" />
            <input type="hidden" name="NumLinks" value="<%NumLinks%>" />
            <div class="dtable form<%if in.Type%> auto<%endif%>">
                <div class="drow">
                    <div class="dcell name">Title</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value"><input type="text" name="Title" value="<%in.Title || ''%>" class="txt midtext" /></div>
                </div>
                <div class="drow">
                    <div class="dcell name">Styling CSS</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                        <input type="text" name="TitleStyle" class="txt midtext" value="<%in.TitleStyle || ''%>">
                        <br><small>E.g.: color: #ffffff; background: #000000;</small>
                    </div>
                </div>
                <div class="drow">
                    <div class="dcell name">Links</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                        <div class="trow head">
                            <div>&nbsp;</div>
                            <div>Link</div>
                            <div>Abstracts</div>
                            <div>URL</div>
                        </div>
                        <%loop 1 .. $NumLinks%>
                        <input type="hidden" name="ID-<%row_num%>" value="<%Plugins::Widgets::retrieve_ntag('ID', $row_num)%>">
                        <div class="trow">
                            <div><%row_num%>.</div>
                            <div><input type="text" name="Title-<%row_num%>" class="txt" placeholder="Link Title" value="<%Plugins::Widgets::retrieve_ntag('Title', $row_num)%>"></div>
                            <div><textarea name="Abstract-<%row_num%>" class="txt" style="height: 60px;" placeholder="Abstracts"><%Plugins::Widgets::retrieve_ntag('Abstract', $row_num)%></textarea></div>
                            <div><input type="text" name="URL-<%row_num%>" class="txt" placeholder="URL" value="<%Plugins::Widgets::retrieve_ntag('URL', $row_num)%>"></div>
                        </div>
                        <%endloop%>
                        <div class="trow">
                            <em>Note: Empty link's title to remove a link.</em>
                        </div>
                    </div>
                </div>
                <div class="drow actions">
                    <div class="dcell name"></div>
                    <div class="dcell divider"></div>
                    <div class="dcell value"><input type="submit" name="badd" value="<%if in.ID%>Modify<%else%>Add<%endif%> Widget" class="btn" /></div>
                </div>
            </div>
        </form>
    </div>
</body>
</html>
