info page template is ready
|
@ -3,9 +3,11 @@
|
|||
<head>
|
||||
<title>Packages</title>
|
||||
<script src="/sorttable.js"></script>
|
||||
<link rel="stylesheet" href="/plt-theme/jquery-ui-1.10.3.custom.min.css" />
|
||||
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
|
||||
<script src="/index.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="breadcrumb">
|
||||
|
@ -14,6 +16,24 @@
|
|||
<span id="logout">jay.mccarthy@gmail.com | <a href="/upload">upload</a> | <a href="/update">update</a> | <a href="/account/logout">logout</a> </span>
|
||||
</div>
|
||||
<p id="search_menu"></p>
|
||||
|
||||
<div id="package_info">
|
||||
<span class="field">Package Name: <span id="pi_name">XXX</span></span>
|
||||
<span class="field">Ring: <span id="pi_ring">XXX</span></span>
|
||||
<span class="field">Authors: <span id="pi_authors">XXX</span></span>
|
||||
<span class="field">Source: <span id="pi_source">XXX</span></span>
|
||||
<span class="field">Checksum: <span id="pi_checksum">XXX</span></span>
|
||||
<span class="field">Last Update: <span id="pi_last_update">XXX</span></span>
|
||||
<span class="field">Last Checked: <span id="pi_last_checked">XXX</span></span>
|
||||
<span class="field">Last Edit: <span id="pi_last_edit">XXX</span></span>
|
||||
<span class="field">Description: <span id="pi_description">XXX</span></span>
|
||||
<span class="field">Tags: <span id="pi_tags">XXX</span></span>
|
||||
XXX Add a tag
|
||||
XXX Version exceptions
|
||||
|
||||
<div class="install">Install this package with:<br><br><tt>raco pkg install <span id="pi_name_inst">XXX</span></tt><br><br>or, with the 'File|Install Package...' menu option in DrRacket.</div>
|
||||
</div>
|
||||
|
||||
<table class="packages sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -1,10 +1,23 @@
|
|||
// xxx display curation if allowed
|
||||
// xxx display curation if allowed -- http://localhost:8001/#(!:conflicts:)(ring:2)
|
||||
// xxx logout
|
||||
// xxx what user am i
|
||||
// xxx upload
|
||||
// xxx update
|
||||
// xxx show info about a package (make sure url is same as in atom feed)
|
||||
|
||||
$( document ).ready(function() {
|
||||
$("#package_info").dialog({
|
||||
autoOpen: false,
|
||||
position: { my: "center", at: "center", of: "#search_menu" },
|
||||
modal: true });
|
||||
|
||||
var active_info = false;
|
||||
var target_pkg = false;
|
||||
function update_info( pkgi ) {
|
||||
console.log( pkgi );
|
||||
change_hash( "[" + pkgi['name'] + "]" );
|
||||
active_info = pkgi; };
|
||||
|
||||
var search_terms = { };
|
||||
|
||||
function parse_hash ( h ) {
|
||||
|
@ -16,6 +29,9 @@ $( document ).ready(function() {
|
|||
if ( ! h.charAt(end) ) { break; } }
|
||||
search_terms[ h.substring(1, end) ] = true;
|
||||
h = h.substring(end+1); }
|
||||
else if ( h.charAt(0) == "[" ) {
|
||||
target_pkg = h.substring(1, h.length - 1 );
|
||||
h = ""; }
|
||||
else {
|
||||
h = ""; } } }
|
||||
|
||||
|
@ -123,6 +139,10 @@ $( document ).ready(function() {
|
|||
$.each(o, function(key, value) { names.push(key) });
|
||||
return names; }
|
||||
|
||||
function open_info ( i ) {
|
||||
update_info( i );
|
||||
$( "#package_info" ).dialog( "open" ); }
|
||||
|
||||
$.getJSON( "/pkgs-all.json", function( resp ) {
|
||||
var names = object_keys(resp);
|
||||
var snames = names.sort(function(a,b) {
|
||||
|
@ -142,8 +162,7 @@ $( document ).ready(function() {
|
|||
$('<td>').html( $('<a>', { text: value['name'],
|
||||
href: "javascript:void(0)",
|
||||
click: function () {
|
||||
// XXX open up a subwindow
|
||||
console.log(value); } } ) ),
|
||||
open_info ( value ); } } ) ),
|
||||
$('<td>').append( $.map( value['authors'], function ( author, i ) {
|
||||
return addfilterlink ( author, "author:" + author, "possible" ); } ) ),
|
||||
$('<td>').text( value['description'] ),
|
||||
|
@ -151,4 +170,7 @@ $( document ).ready(function() {
|
|||
return addfilterlink ( tag, tag, "possible" ); } ) ))
|
||||
.appendTo('#packages_table'); });
|
||||
|
||||
evaluate_search(); }); });
|
||||
evaluate_search();
|
||||
|
||||
if ( target_pkg && resp[target_pkg] ) {
|
||||
open_info ( resp[target_pkg] ) } }); });
|
||||
|
|
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 212 B |
After Width: | Height: | Size: 208 B |
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 4.4 KiB |