<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LoginViewControl.aspx.cs" Inherits="LoginViewControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>Kontrolka LoginStatus</title>
	<link href="chapterStyles.css" type="text/css" rel="stylesheet"  />
	<style type="text/css" >
	#left { width: 360px;  position: absolute; top: 3px; left: 12px;}
	#right { background: white; margin-top: 5px; margin-left: 370px;
			padding: 5px ; position: absolute; top: 8px; left: 0px;
			border: 1px solid black; width: 175px; height: 200px;text-align:center;}
dl { margin: 0; padding: 0; width: 350px;}
dt { background-color: #EDECEA; padding: 5px 5px; margin-top: 10px;
   font-weight: bold; text-align: center; 
   border: 1px solid black;}
dd { margin: 0; background-color: #DDD9CD; padding: 10px 5px;}
.bookImage { text-align: center; padding: 5px;}
.publisher { text-align: center; font-style: italic; }
.listHeading { margin: 0; width: 350px; border-bottom: 1px solid #DDD9CD;
            font-size: 15px; text-align: center;}

	</style>
</head>
<body>
	<form id="form1" runat="server">

			<div id="left">
         <asp:Repeater ID="rptArtists" runat="server" DataSourceID="dsBooks">
            <HeaderTemplate>
               <dl>
            </HeaderTemplate>
            <ItemTemplate>
               <dt><%# Eval("Title") %></dt>
               <dd class="bookImage">
                  <asp:Image ID="imgBook" runat="server"
                     ImageUrl='<%# String.Format("images/{0}.gif",Eval("ISBN")) %>'  
                     AlternateText='<%# Eval("Title")%>' />  
               </dd>
               <dd class="publisher">
                  <%# Eval("PublisherName") %> (<%# Eval("YearPublished") %>)
               </dd>

            </ItemTemplate>
            <FooterTemplate>
               </dl>
            </FooterTemplate>
         </asp:Repeater>
         </div>

      <asp:SqlDataSource ID="dsBooks" runat="server"
          ProviderName="System.Data.OleDb" 
          ConnectionString="<%$ ConnectionStrings:Books %>"
          SelectCommand="SELECT TOP 1 ISBN,Title,PublisherName,BriefDescription,YearPublished FROM Publishers INNER JOIN Books ON Publishers.PublisherId=Books.PublisherId ORDER BY ISBN ASC" /> 			
			
			
			<div id="right">	
            <asp:LoginView ID="logView" runat="server">
               <AnonymousTemplate>
                 <strong>For more features</strong><br />
                 <asp:LoginStatus ID="logStat" runat="server"
                    LoginImageUrl="images/btn_login.gif"
                    LogoutImageUrl="images/btn_logout.gif"
                    LogoutAction="Refresh" />
               </AnonymousTemplate>
               <LoggedInTemplate>
                  <strong>Rate this book</strong><br />
                  <asp:RadioButtonList ID="radList" runat="server">
                     <asp:ListItem Selected="true">No Rating</asp:ListItem>
                     <asp:ListItem><img src='images/stars1.gif'/></asp:ListItem>
                     <asp:ListItem><img src='images/stars2.gif'/></asp:ListItem>
                     <asp:ListItem><img src='images/stars3.gif'/></asp:ListItem>
                     <asp:ListItem><img src='images/stars4.gif'/></asp:ListItem>
                     <asp:ListItem><img src='images/stars5.gif'/></asp:ListItem>
                  </asp:RadioButtonList>
                  <p><asp:Button ID="btnRate" runat="server" Text="Rate Book" /></p>			         
               </LoggedInTemplate>
               <RoleGroups>
                  <asp:RoleGroup Roles="Administrator">
                     <ContentTemplate>
                        <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit this book" />
                     </ContentTemplate>
                  </asp:RoleGroup>
               </RoleGroups>
            </asp:LoginView>		

			
  
			</div>

	</form>
</body>
</html>
