<%@ Page Title="友情链接" Language="C#" MasterPageFile="~/Masters/Sys.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="yueyaCMS.Admin.FriendLink.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"><style type="text/css">
    #masonry_container{min-height:600px}
    #masonry{position:relative;padding:0;margin:0 auto}
    #masonry .thumbnail{float:left;width:235px;margin:20px;padding:0;border-width:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175)}
    #masonry .thumbnail:hover{border:solid 1px #ff6a00;}
    #masonry .thumbnail .imgs{padding:10px;height:200px;line-height:200px;overflow:hidden}
    #masonry .thumbnail .imgs img{margin-bottom:5px;width:100%}
    #masonry .thumbnail .caption{background-color:#fff;padding-top:0;font-size:13px;padding-top:5px;border-top:solid 1px #eee;background-color:#efefef}
    #masonry .thumbnail .caption .title{font-size:13px;font-weight:bold;margin:5px 0;text-align:left}
    #masonry .thumbnail .caption .author{font-size:11px;text-align:right}
    #masonry .thumbnail .caption .author span{ float:left; line-height:2;margin-left:5px;background: #9FC3C3; border-radius:5px; color:white;padding:0px 5px;color:white; margin-left:0px; letter-spacing:1px;}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<ul class="breadcrumb">
<li><i class="icon-tags"></i> 您当前的位置：<a href="/Admin/Site/Default.aspx">系统首页</a></li>
<li><span class="divider">/</span> 友情链接管理</li>
</ul>

 <form id="form1" runat="server">

     <div id="myModal" class="modal hide fade" style="width:350px;left:60%;">
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>添加友情链接</h3>
    </div>
    <div class="modal-body" style="padding:0px 15px;">
         <p>
              <div class="input-prepend">
                  <span class="add-on"><i class="icon-edit"></i> 网站名称</span>
                  <asp:TextBox ID="TextBox1" runat="server" />
              </div>
          </p>


          <p>
              <div class="input-prepend">
                  <span class="add-on"><i class="icon-globe"></i> 链接地址</span>
                  <asp:TextBox ID="TextBox2" runat="server" ToolTip="无需连接请填写“#”" Text="#" />
              </div>
          </p>

          <p>
              <div class="input-prepend">
                  <span class="add-on"><i class="icon-list-alt"></i> 显示位置</span>
                  <asp:TextBox ID="TextBox3" runat="server" ToolTip="-1代表按默认排序显示" Text="-1" />
              </div>
          </p>

           <p>
              <div class="input-prepend input-append">
                  <span class="add-on"><i class="icon-picture"></i> 网站LOGO</span>
                  <a href="javascript:;" onclick="showImgUpload();" class="btn btn-success">上传</a>
                  <asp:FileUpload ID="ImgUpload" runat="server" style="display:none;" />
              </div>
          </p>
    </div>
    <div class="modal-footer">
    <a href="#" class="btn" onclick="showModal(0);">关闭</a>
    <asp:Button ID="Button2" runat="server" CssClass="btn btn-primary" Text="确认添加" onclick="Button1_Click" />
    </div>
    </div>


    <div><a href="Default.aspx" class="btn btn-warning">查看全部</a>&nbsp;&nbsp;<a href="javascript:void(0)" class="btn btn-success" onclick="showModal(1);">添加友链</a></div>
    

        <div id="masonry_container">
<div id="masonry"><% Int32 i = 1; foreach (var v in DBView){ %>
<div class="thumbnail">
<div class="imgs"><a href="<%=v.SiteLogo%>" target="_blank"><img src="<%=v.SiteLogo %>" /></a></div>
<div class="caption">
<div class="title"><a href="<%=v.FriendLink %>" target="_blank"><%=v.FriendName %></a></div>
<div class="author"><span>显示第<b><%=v.ShowIndex %></b>位</span><a href="<%=v.SiteLogo %>" target="_blank" class="btn btn-mini btn-warning">预览</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="if(confirm('是否确认删除？')){window.location.href='/Admin/FriendLink/Default.aspx?action=del&id=<%=v.ID %>';}" class="btn btn-mini">删除</a></div>
</div>
</div><% i++; } %>
</div>
</div>
     <script src="/Scripts/imagesloaded.pkgd.min.js"></script>
<script src="/Scripts/masonry.pkgd.min.js"></script>

    <script type="text/javascript">
        function showImgUpload()
        {
            $("#<%=ImgUpload.ClientID%>").click();
        }
        function showModal(_s) {
            if (_s == 0) { $("#myModal").modal("hide"); }
            else {
                $("#myModal").modal({ show: true, backdrop: true });
            }
        }
        $(function () {
            var masonryNode = $('#masonry');
            masonryNode.imagesLoaded(function () {
                masonryNode.masonry({ itemSelector: '.thumbnail', isFitWidth: true });
            });
        });
    </script></form>
</asp:Content>
