<div id="FeedWrapper" class="FeedWrapper">
    <h1 id="ChannelName"><%= feed?feed.channelName:'New Feed' %> </h1>
    <i  hx-get="/feedsdash/<%= guild.id %>" hx-target="#PopUpContainer" hx-trigger="click" class="close material-symbols-outlined" id="close_bt2">
        cancel
    </i> 
    <form>
        <section class="costumMessageSection">
            <p id="CostumMessage" class="message CostumMessage">Costum message:</p>
            <textarea 
            id="CostumMessageI"  
            name="costummessage"
            class='message CostumMessageI'  
            cols="40" 
            rows="5"><%=feed?feed.CostumMessage:'' %></textarea>
        </section>
        <section class="dcSection">
            <p id='DCchannel' class="channel labeldc">Discord Channel:</p>
            <select id ="DCchannelID" name="DCchannelID" class='channel dc'>
                <% guild.guildTextChannels = guild.guildTextChannels.sort((a, b) => {return a.name.localeCompare(b.name);});%> 
                <% guild.guildTextChannels.forEach((c)=>{%>
                    <option value="<%= c.id %>" <% if(feed?.ChannelId==c.id) {%> selected <% } %> ><%= c.name%></option>
                <%}) %>
            </select>
        </section>
        <section class="ytChannelSection">
            <p id="YTchannel" class="channel labelyt">Youtube Channel:</p>
            <input id ="YTchannelID" class='channel yt' name="ytchannel" value="<%= feed?`https://www.youtube.com/@${feed.channelName}`:`` %>" \>
        </section>
        <section class="buttonsSection">
            <%if(feed){%> 
                <button id="delete2" class="button"  
                    hx-delete=<%=`/feedchange/${feed._id}/${guild.id}`%>
                    hx-trigger="click"
                    hx-target="#PopUpContainer">
                    Delete
                </button>
                <%}%>
            <button id="change2" class="button" 
            hx-trigger="click"
            hx-target="#PopUpContainer"
            hx-put=<%= feed?`/feedchange/${feed._id}/${guild.id}`:`/newfeed/${guild.id}` %> 
            <%if(!feed){%> 
                style="left:50% !important;"
            <%}%>\
            type="submit">
            <%= !feed?"Add":"Change" %>
            </button>
            
        </section>
    </form>
</div>