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