Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 14, 2011
0 parents commit 0cb0407
Show file tree
Hide file tree
Showing 9 changed files with 244 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
App_Data/*
Binary file added Bin/Microsoft.Web.Helpers.dll
Binary file not shown.
Binary file added Bin/NuGet.Core.dll
Binary file not shown.
81 changes: 81 additions & 0 deletions Default.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@using Microsoft.Web.Helpers
@{
Layout = "_Layout.cshtml";
}

@section script {
<script type="text/javascript">
$(function () {
function getStats() {
$.post('stats', {}, function (stats) {
$('#loading').fadeOut('slow');
$('#stats').fadeIn('slow');
update('downloads', stats.TotalDownloads);
update('unique', stats.UniqueCount);
update('total', stats.TotalCount);
setTimeout(getStats, 500);
}, 'json');
}
function update(element, value) {
var currentValue = parseInt($('#' + element).html())
if (currentValue != value) {
$('#' + element).html(value).hide().fadeIn('slow')
}
}
getStats();
});
</script>
}

<div id="header">
<img id="logo" src="http://download.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=nuget&DownloadId=162974&Build=17601" alt="NuGet Logo" />
<span id="header-text">statistics</span>
<div class="clear">
</div>

<div id="loading">
<img src="@Href("loading.gif")" alt="Loading" />
<span class="loading">Populating...</span>
</div>
<div class="clear">
</div>
</div>

<div style="margin-left:20%">
<div id="left">
<table id="stats">
<tr>
<td id="downloads">
</td>
<td class="words">
downloads.
</td>
</tr>
<tr>
<td id="unique">
</td>
<td class="words">
unique packages.
</td>
</tr>
<tr>
<td id="total">
</td>
<td class="words">
total packages.
</td>
</tr>
</table>
</div>

<div id="right">
@Twitter.Search("#nuget")
</div>

</div>
134 changes: 134 additions & 0 deletions Site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
body
{
font-family: Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, Sans-Serif;
color: #232323;
background-color: #fff;
}

/* Styles for basic forms
-----------------------------------------------------------*/

fieldset
{
border:1px solid #ddd;
padding:0 1.4em 1.4em 1.4em;
margin:0 0 1.5em 0;
}

legend
{
font-size:1.2em;
font-weight: bold;
}

textarea
{
min-height: 75px;
}

.editor-label
{
margin: 1em 0 0 0;
}

.editor-field
{
margin:0.5em 0 0 0;
}


/* Styles for validation helpers
-----------------------------------------------------------*/
.field-validation-error
{
color: #ff0000;
}

.field-validation-valid
{
display: none;
}

.input-validation-error
{
border: 1px solid #ff0000;
background-color: #ffeeee;
}

.validation-summary-errors
{
font-weight: bold;
color: #ff0000;
}

.validation-summary-valid
{
display: none;
}

#downloads, #unique, #total
{
font-size:72px;
font-weight:bold;
text-align:right;
}

#stats
{
display:none;
}

#stats td
{
padding:3px;
}

.words
{
font-size:15px;
}

#header
{
margin-left:30%;
margin-bottom:2%;
}

#header-text
{
font-size:20px;
font-weight:bold;
float:left;
margin-top:20px;
}

#loading
{
margin-top:20px;
margin-left:15%;
font-size:15px;
font-weight:bold;
}

#logo
{
float:left;
}

#left
{
height:300px;
width:500px;
float:left;
}

#right
{
float:left;
height:300px;
}

.clear
{
clear:both;
}
13 changes: 13 additions & 0 deletions Stats.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@using NuGet

@{
var repo = new DataServicePackageRepository(new Uri("http://packages.nuget.org/v1/FeedService.svc"));
var packages = repo.GetPackages().ToList();

Response.Write(Json.Encode(new
{
TotalCount = packages.Count,
UniqueCount = packages.GroupBy(p => p.Id).Count(),
TotalDownloads = packages.GroupBy(p => p.Id).Select(g => g.First().DownloadCount).Sum(),
}));
}
13 changes: 13 additions & 0 deletions _Layout.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>@Page.Title</title>
<link href="@Href("Site.css")" rel="stylesheet" type="text/css" />
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
@RenderSection("script", required: false)
</head>

<body>
@RenderBody()
</body>
</html>
Binary file added loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

# WebMatrix 1.0

0 comments on commit 0cb0407

Please sign in to comment.