github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/team_dashboard.html (about)

     1  {{ define "title" }}{{.Team.Name}} ยท Dashboard{{ end }}
     2  
     3  {{ define "content" }}
     4  
     5  	<div class="subhead">
     6  		<div class="container">
     7  			<ul class="nav nav-tabs pull-right">
     8  				<li class="active">
     9  					<a href="/dashboard/team/{{.Team.Slug}}">Dashboard</a>
    10  				</li>
    11  				<li>
    12  					<a href="/account/team/{{.Team.Slug}}/profile">Team Settings</a>
    13  				</li>
    14  			</ul> <!-- ./nav -->
    15  			<h1 class="user">
    16  				<img src="{{.Team.Image}}">
    17  				<span>{{.Team.Name}}</span>
    18  			</h1>
    19  		</div><!-- ./container -->
    20  	</div><!-- ./subhead -->
    21  
    22  	<div class="container">
    23  		<div class="row">
    24  			<div class="col-xs-8" role="main">
    25  				<div class="alert alert-feed">
    26  					<ul class="thumbnails pull-right">
    27  						<li>
    28  							<a class="thumbnail" href="/dashboard">
    29  								<img src="{{.User.Image}}" />
    30  							</a>
    31  						</li>
    32  						{{ range .Teams }}
    33  						<li>
    34  							<a class="thumbnail" href="/dashboard/team/{{.Slug}}">
    35  								<img src="{{.Image}}" />
    36  							</a>
    37  						</li>
    38  						{{ end }}
    39  					</ul>
    40  					<span class="label">switch dashboard</span>
    41  					<span>Recent Builds</span>
    42  				</div><!-- ./alert -->
    43  
    44  				{{ if .Commits }}
    45  				<ul class="commit-list">
    46  					{{ range $commit := .Commits }}
    47  					<li>
    48  						<a href="/{{$commit.Slug}}/commit/{{$commit.Hash}}?branch={{$commit.Branch}}" class="btn btn-{{$commit.Status}}"></a>
    49  						<h3>
    50  							<a href="/{{$commit.Slug}}">{{$commit.Owner}} / {{$commit.Name}}</a>
    51  							<small class="timeago" title="{{$commit.CreatedString}}"></small>
    52  							{{ if $commit.PullRequest }}
    53  								<p>opened pull request <a href="/{{$commit.Slug}}/commit/{{$commit.Hash}}?branch={{$commit.Branch}}"># {{$commit.PullRequest}}</a></p>
    54  							{{ else }}
    55  								<p>commit <a href="/{{$commit.Slug}}/commit/{{$commit.Hash}}?branch={{$commit.Branch}}">{{$commit.HashShort}}</a> to <a href="/{{$commit.Slug}}?branch={{$commit.Branch}}">{{$commit.Branch}}</a> branch</p>
    56  							{{ end }}
    57  						</h3>
    58  					</li>
    59  					{{ end }}
    60  				</ul>
    61  				{{ end }}
    62  			</div><!-- ./col-xs-8 -->
    63  
    64  			<div class="col-xs-4" style="padding-left:20px;">
    65  				<ul class="nav nav-pills nav-stacked nav-repos">
    66  					{{ range $repo := .Repos }}
    67  					<li>
    68  						<a href="/{{$repo.Slug}}">
    69  							<span>{{$repo.Owner}} / </span>
    70  							<span>{{$repo.Name}}</span>
    71  						</a>
    72  					</li>
    73  					{{ end }}
    74  				</ul>
    75  			</div><!-- ./col-xs-4 -->
    76  		</div><!-- ./row -->
    77  	</div><!-- ./container -->
    78  {{ end }}
    79  
    80  {{ define "script" }}
    81  	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.1.0/jquery.timeago.js"></script>
    82  	<script>
    83  		$(document).ready(function() {
    84  			$(".timeago").timeago();
    85  		});
    86  	</script>
    87  
    88  	<script>
    89  		if (window.localStorage) {
    90  			// get the last visited date from local storage
    91  			var lastVisited = localStorage["lastVisited"];
    92  			if (lastVisited == "null" || lastVisited == NaN || !lastVisited) {
    93  				lastVisited = Date.parse("1970-01-01T00:00:00Z");
    94  			} else {
    95  				lastVisited = Date.parse(lastVisited);
    96  			}
    97  
    98  			// get created dates for repositories
    99  			var commits = $(".timeago")
   100              	$('.timeago').each(function(){
   101  				var date = Date.parse($(this).attr("title"));
   102  				if (date > lastVisited) {
   103  					$(this).parent().parent().append('<span style="position: absolute;left: -60px;background: #f7f7f7;padding: 5px 10px;color: #999;border-radius: 5px;top: 26px;">New</span>');
   104  				}
   105  
   106  				// update the last visited date
   107  				localStorage["lastVisited"] = Date();
   108  			});
   109  		}
   110  	</script>
   111  {{ end }}