Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Added blog and website to the displayed data in the author profile.
Browse files Browse the repository at this point in the history
Removed Facebook meta info.  Facebook is evil after all.

Fixed typo Stack Oveflow -> Stack Overflow

Updated footer.

Set a few pages to properly populate the search input field.

Added a check for :: in the search input box so it will automatically search module instead of author.
  • Loading branch information
ioncache committed Dec 11, 2010
1 parent 59b8e59 commit fde9db9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
7 changes: 7 additions & 0 deletions htdocs/css/pod.css
Expand Up @@ -89,6 +89,13 @@
color: #681818;
}

#module_details_header {
float: left;
color: #681818;
border-bottom: 1px solid #681818;
padding-bottom: 10px;
}

#module_details_header .module_name {
float: left;
width: 600px;
Expand Down
29 changes: 18 additions & 11 deletions htdocs/index.html
Expand Up @@ -15,13 +15,6 @@
<meta name="keywords" content="Perl,Perl Module,CPAN,Search CPAN" />
<meta name="author" content="The metacpan.org Team" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<!-- <meta property="og:title" content="Metacpan Search Home" />
<meta property="og:site_name" content="search.metacpan.org" />
<meta property="og:url" content="http://search.metacpan.org" />
<meta property="og:type" content="article" />
<meta property="og:image" content="http://search.metacpan.org/images/metacpan_logo.png" />
<meta property="og:description" content="An AJAX based search site for use with http://api.metacpan.org" />
<meta property="fb:admins" content="ioncache" />-->

<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico" />

Expand All @@ -46,7 +39,7 @@
<div id="footer">
<p>
<img src="/images/beta.png" alt="BETA" style="height: 35px; margin-right: 10px;"/>
<span style="position: relative; top: -10px;">This site is currently in beta. View the Github repositories for the <a href="https://github.com/CPAN-API/cpan-api" >API</a> or this <a href="https://github.com/CPAN-API/search-metacpan-org" target="_blank">Search</a> site. Get in touch with us on our <a href="http://groups.google.com/group/cpan-api" target="_blank">Google Group</a>.</span>
<span style="position: relative; top: -10px;">Currently in beta. Find us on Github: <strong>This Search Site</strong> &mdash; <a href="https://github.com/CPAN-API/search-metacpan-org" target="_blank">Repo</a> / <a href="https://github.com/CPAN-API/search-metacpan-org/issues" target="_blank">Bugs</a>&nbsp;&nbsp;|&nbsp;&nbsp;<strong>The API</strong> &mdash; <a href="https://github.com/CPAN-API/cpan-api" >Repo</a> / <a href="https://github.com/CPAN-API/cpan-api/issues" target="_blank">Bugs</a>. Get in touch with us on our <a href="http://groups.google.com/group/cpan-api" target="_blank">Google Group</a>.</span>
</p>
</div>

Expand All @@ -65,7 +58,6 @@
<script type="text/javascript" src="/js/jquery.cookie.min.js"></script>
<script type="text/javascript" src="/js/jquery.themeswitchertool.js"></script>
<script type="text/javascript" src="http://yandex.st/highlightjs/5.15/highlight.min.js"></script>
<!-- <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>-->

<!--Template Definitions-->
<script id="resultsTable" type="text/html">
Expand Down Expand Up @@ -118,7 +110,6 @@
{{distvname}} &mdash; {{release_date}} &mdash; <a href="/#/showsrc/{{name}}">View Source</a>{{#download_url}} &mdash; <a href="{{download_url}}">Download Archive</a>{{/download_url}}
</div>
<div class="author_info"><a href="/#/author/{{author}}">{{authorName}} ({{author}})</a><a href="/#/author/{{author}}"><img src="{{gravatar}}" class="gravatar" alt="" /></a></div>
<div class="separator">&nbsp;</div>
</div>
<div id="pod_html" class="pod" style="float: left;">{{{podHTML}}}</div>
<div class="spacer" style="float: left;"></div>
Expand Down Expand Up @@ -150,6 +141,14 @@
{{#email}}<a href="mailto:{{email}}">{{email}}</a>{{/email}}
</div>
</div>
<div class="left contact_info">
<div class="contact_info_label">
Blog:
</div>
<div class="contact_info_value">
{{#blogURL}}<a href="{{blogURL}}">{{blogURL}}</a>{{/blogURL}}{{#blogFeed}} (<a href="{{blogFeed}}">feed</a>){{/blogFeed}}
</div>
</div>
<div class="left contact_info">
<div class="contact_info_label">
Github:
Expand Down Expand Up @@ -184,7 +183,7 @@
</div>
<div class="left contact_info">
<div class="contact_info_label">
Stack Oveflow:
Stack Overflow:
</div>
<div class="contact_info_value">
{{#stackoverflowProfile}}<a href="{{stackoverflowProfile}}">{{stackoverflowProfile}}</a>{{/stackoverflowProfile}}
Expand All @@ -198,6 +197,14 @@
{{#twitterName}}<a href="http://www.twitter.com/{{twitterName}}">{{twitterName}} &mdash; twitter.com/{{twitterName}}</a>{{/twitterName}}
</div>
</div>
<div class="left contact_info">
<div class="contact_info_label">
Website:
</div>
<div class="contact_info_value">
{{#website}}<a href="{{website}}">{{website}}</a>{{/website}}
</div>
</div>
</div>
</div>
<div class="right" style="text-align: center;">
Expand Down
4 changes: 3 additions & 1 deletion htdocs/js/controllers.js
Expand Up @@ -45,6 +45,7 @@ var Metacpan = Backbone.Controller.extend({
document.title = 'Search results for: ' + query + ' - search.metacpan.org';

SearchBoxView.searchType(type);
SearchBoxView.updateQuery(query);

switch(type) {

Expand All @@ -56,7 +57,6 @@ var Metacpan = Backbone.Controller.extend({
ModuleResultsView.show();
} else {
ModuleResultsView.current(query);
SearchBoxView.updateQuery(query);
$.ajax({
url: 'http://api.metacpan.org/module/_search',
data: { 'q': 'name: "' + query + '"', size: 1000 },
Expand Down Expand Up @@ -104,6 +104,7 @@ var Metacpan = Backbone.Controller.extend({
document.title = query + ' - search.metacpan.org';

SearchBoxView.searchType('module');
SearchBoxView.updateQuery(query);

ModuleDetailsView.show();

Expand Down Expand Up @@ -177,6 +178,7 @@ var Metacpan = Backbone.Controller.extend({
document.title = 'Source: ' + query + ' - search.metacpan.org';

SearchBoxView.searchType('module');
SearchBoxView.updateQuery(query);

SourceDetailsView.show();

Expand Down
28 changes: 11 additions & 17 deletions htdocs/js/views.js
Expand Up @@ -30,7 +30,7 @@ var ModuleResults = Backbone.View.extend({
{ sTitle: '<div class="cell_contents" title="Sort by Release Date" style="width: 68px;">Date</div>', sWidth: '68px' },
{ sTitle: '<div class="cell_contents" title="Sort by Distribution Name" style="width: 187px;">Distribution</div>', sWidth: '187px' },
{ sTitle: '<div class="cell_contents" title="Sort by Author ID" style="width: 126px;">Author</div>', sWidth: '126px' },
{ sTitle: '<div class="cell_contents" title="Sort by Search Score" style="width: 86px;">Score</div>', sWidth: '86px', bSearchable: false }
{ sTitle: '<div class="cell_contents" title="Sort by Search Score" style="width: 86px;">Score</div>', sWidth: '86px', bSearchable: false, sType: 'numeric' }
],
aaSorting: [[ 5, "desc" ]],
bAutoWidth: false,
Expand Down Expand Up @@ -114,17 +114,6 @@ var ModuleDetails = Backbone.View.extend({

render: function() {
this.el.append(ich.moduleDetailsView());
//$(".toggle_pod_source").button().click(function() {
// if ( $("#pod_contents:visible").length ) {
// $("#pod_contents").fadeOut(200, function() {
// $("#source_contents").fadeIn(200);
// });
// } else {
// $("#source_contents").fadeOut(200, function() {
// $("#pod_contents").fadeIn(200);
// });
// }
//});
},

// fades the view in
Expand All @@ -146,15 +135,11 @@ var ModuleDetails = Backbone.View.extend({
distvname: module._source.distvname,
download_url: module._source.download_url,
email: author._source.email,
//fbLike: '<fb:like href="http://search.metacpan.org/#/showpod/' + encodeURIComponent(module._source.name) + '" show_faces="true" width="300" font="trebuchet ms"></fb:like>',
gravatar: author._source.gravatar_url,
name: module._source.name,
podHTML: pod._source.pod,
release_date: module._source.release_date.substr(0,10)
}));
//$("meta[property=og:title]").attr("content", module._source.name);
//$("meta[property=og:url]").attr("content", 'http://search.metacpan.org/#/showpod/' + encodeURIComponent(module._source.name));
//FB.XFBML.parse($("div#fb_box").get(0));
$("#pod_html a.moduleLink").map(function() {
$(this).attr('href', '/#/showpod/' + $(this).attr('href'));
});
Expand Down Expand Up @@ -279,6 +264,9 @@ var SearchBox = Backbone.View.extend({
e.preventDefault;
var type = $("input[name='search_type']:checked").val();
var query = $(this).val();
if ( /::/.test(query) ) {
type = 'module';
}
switch(type) {
case 'module':
MetacpanController.search(type, query);
Expand All @@ -295,6 +283,9 @@ var SearchBox = Backbone.View.extend({
$("#search_button").button().click(function() {
var type = $("input[name='search_type']:checked").val();
var query = $("#search_input").val();
if ( /::/.test(query) ) {
type = 'module';
}
switch(type) {
case 'module':
MetacpanController.search(type, query);
Expand Down Expand Up @@ -403,14 +394,17 @@ var AuthorDetails = Backbone.View.extend({
pauseid: author._source.pauseid,
authorDir: author._source.author_dir,
authorName: author._source.name,
blogFeed: author._source.blog_feed,
blogURL: author._source.blog_url,
email: author._source.email,
githubName: author._source.github_username,
gravatar: author._source.gravatar_url,
irc_nick: author._source.irc_nick,
linkedinProfile: author._source.linkedin_public_profile,
perlmonksName: author._source.perlmonks_username,
stackoverflowProfile: author._source.stackoverflow_public_profile,
twitterName: author._source.twitter_username
twitterName: author._source.twitter_username,
website: author._source.website
}));
$("#author_view_loader").hide();
}).fadeIn(205);
Expand Down

0 comments on commit fde9db9

Please sign in to comment.