Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 0cb0407b3760713df08f25a09814b7333c20baab unknown committed Feb 13, 2011
Showing with 244 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. BIN Bin/Microsoft.Web.Helpers.dll
  3. BIN Bin/NuGet.Core.dll
  4. +81 −0 Default.cshtml
  5. +134 −0 Site.css
  6. +13 −0 Stats.cshtml
  7. +13 −0 _Layout.cshtml
  8. BIN loading.gif
  9. +2 −0 robots.txt
1 .gitignore
@@ -0,0 +1 @@
+App_Data/*
BIN Bin/Microsoft.Web.Helpers.dll
Binary file not shown.
BIN Bin/NuGet.Core.dll
Binary file not shown.
81 Default.cshtml
@@ -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 Site.css
@@ -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 Stats.cshtml
@@ -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 _Layout.cshtml
@@ -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>
BIN loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 robots.txt
@@ -0,0 +1,2 @@
+
+# WebMatrix 1.0

0 comments on commit 0cb0407

Please sign in to comment.
Something went wrong with that request. Please try again.