Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Site redesign, mostly happy with it so far.

  • Loading branch information...
commit 06f186207f92ba35e8d4527c753ff8390907cab9 1 parent 0087a95
@zk authored
View
7 app/controllers/main_controller.rb
@@ -6,12 +6,13 @@ class MainController < ApplicationController
def index
- num_recent = 7
+ num_recent = 6
+ num_tc = 24
@recently_updated = find_recently_updated(7, nil)
@top_contributors = []
- tc_example_versions = Example.find_by_sql("select count(*), example_versions.user_id from example_versions group by user_id order by count(*) desc")[0, 10]
- tc_examples = Example.find_by_sql("select count(*), examples.user_id from examples group by user_id order by count(*) desc;")[0, 10]
+ tc_example_versions = Example.find_by_sql("select count(*), example_versions.user_id from example_versions group by user_id order by count(*) desc")[0, num_tc]
+ tc_examples = Example.find_by_sql("select count(*), examples.user_id from examples group by user_id order by count(*) desc;")[0, num_tc]
tc_examples.each do |e|
count = e["count(*)"]
View
28 app/views/_recently_updated.html.erb
@@ -4,24 +4,36 @@ recently_updated.each do |u|
<% func = Function.find(u.commentable_id) %>
<div class="recent_comment">
- <span class="user">
- <%= link_to u.user.login, :controller => 'user', :action => 'profile', :login => u.user.login %>
- </span>
- <%= (u.created_at == u.updated_at) ? "commented on" : "updated a comment on" %>
+
+
+ <!-- <%= (u.created_at == u.updated_at) ? "commented on" : "updated a comment on" %> -->
+ on
<a href="<%= func.href %>"><span class="ns"><%= func.namespace.name %>/</span><span class="name"><%= func.name %></span></a>
+ <div class="timestamp">
+ by
+ <span class="user">
+ <%= link_to u.user.login, :controller => 'user', :action => 'profile', :login => u.user.login %>
+ </span>
<%= time_ago_or_time_stamp(u.updated_at) %>
+ </div>
</div>
<% elsif u.instance_of? Example and u.function_id %>
<% func = Function.find(u.function_id) %>
<div class="recent_example">
- <span class="user">
- <%= link_to u.user.login, :controller => 'user', :action => 'profile', :login => u.user.login %>
- </span>
- <%= (u.created_at == u.updated_at) ? "added an example to" : "updated an example on" %>
+
+ <!-- <%= (u.created_at == u.updated_at) ? "added an example to" : "updated an example on" %> -->
+ on
<a href="<%= func.href %>"><span class="ns"><%= func.namespace.name %>/</span><span class="name"><%= func.name %></span></a>
+ <br />
+ <div class="timestamp">
+ by
+ <span class="user">
+ <%= link_to u.user.login, :controller => 'user', :action => 'profile', :login => u.user.login %>
+ </span>
<%= time_ago_or_time_stamp(u.updated_at)%>
+ </div>
</div>
<% elsif u.instance_of? SeeAlso %>
View
32 app/views/examples/view_changes.html.erb
@@ -1,18 +1,22 @@
<script type="text/javascript" charset="utf-8">
- SyntaxHighlighter.all()
+SyntaxHighlighter.all()
</script>
-<h1>Changes for <span class="ns"><%= @example.function.namespace.name %>/</span><%= @example.function.name %></h1>
+<div class="container_16">
+ <div class="grid_16">
+ <h1>Changes for <span class="ns"><%= @example.function.namespace.name %>/</span><%= @example.function.name %></h1>
-<% @versions.each do |v| %>
- <% if v.user_id
- vuser = User.find(v.user_id)%>
- <div class="version">
- <div class="info">
- <img src="<%= grav_url_for(vuser.email, 25) %>" />
- <%= link_to vuser.login, :controller => 'user', :action => 'profile', :login => vuser.login %>
- <%= time_ago_or_time_stamp((v.updated_at || v.created_at)) %>
+ <% @versions.each do |v| %>
+ <% if v.user_id
+ vuser = User.find(v.user_id)%>
+ <div class="version">
+ <div class="info">
+ <img src="<%= grav_url_for(vuser.email, 25) %>" />
+ <%= link_to vuser.login, :controller => 'user', :action => 'profile', :login => vuser.login %>
+ <%= time_ago_or_time_stamp((v.updated_at || v.created_at)) %>
+ </div>
+ <%= render :partial => "/examples/example", :locals => {:e => v, :hide_controls => true}%>
+ </div>
+ <% end %>
+ <% end %>
</div>
- <%= render :partial => "/examples/example", :locals => {:e => v, :hide_controls => true}%>
- </div>
- <% end %>
-<% end %>
+ </div>
View
13 app/views/layouts/_header.html.erb
@@ -34,23 +34,24 @@
<div class="header_content">
<div class="user_area">
<div class="grid_16">
+ <span class="user_area_content">
<% if current_user_session %>
+ <%= image_tag(grav_url_for(current_user.email, 16), :class => 'user_area_gravatar') %>
Logged in as <%= link_to current_user.login, :controller => 'user', :action => 'profile', :login => current_user.login %>
|
<a href="/logout">logout</a>
<% else %>
<a href="/login" id="login">login / sign up</a>
<% end%>
+ </span>
</div>
<div class="clear"></div>
</div>
-
- <div class="grid_8">
- <% if @library %>
- <h1><a href="/">ClojureDocs</a><span class="version">(alpha)</span> :: <a class="lib_name" href="/<%= @library.url_friendly_name %>"><%= @library.name %></a></h1>
- <% else %>
+ <div class="grid_1">
+ <%= image_tag "cd_logo.png", :class => 'cd_logo' %>
+ </div>
+ <div class="grid_7">
<h1><a href="/">ClojureDocs</a><span class="version">(alpha)</span></h1>
- <% end %>
</div>
<div class="grid_8">
<div class="search">
View
4 app/views/layouts/main.html.erb
@@ -125,9 +125,9 @@
<body>
<%= render :partial => '/layouts/header' %>
- <div class="container_16">
+
<%= yield %>
- </div>
+
<div class="clear"></div>
<div class="footer">
View
5 app/views/main/clojure_core_shortdesc.html.erb
@@ -13,7 +13,7 @@
})
})
</script>
-
+<div class="container_16">
<div class="quick_ref">
<div class="grid_3">
<%= render :partial => 'lib_nav', :locals => {:lib => @library} %>
@@ -89,4 +89,5 @@
<!-- <div class="grid_3">
<%= render :partial => '/lib_namespaces' %>
</div> -->
-</div>
+</div>
+<div class="container_16">
View
5 app/views/main/clojure_core_vars_only.html.erb
@@ -3,7 +3,7 @@
$('.toc').makeTOCSideBar()
})
</script>
-
+<div class="container_16">
<div class="quick_ref">
<div class="grid_3">
<%= render :partial => 'lib_nav', :locals => {:lib => @library} %>
@@ -69,4 +69,5 @@
<div class="grid_3">
<%= render :partial => '/lib_namespaces' %>
</div>
-</div>
+</div>
+<div class="container_16">
View
2  app/views/main/function.html.erb
@@ -14,6 +14,7 @@ $(document).ready(function() {
})
})
</script>
+<div class="container_16">
<div class="grid_3">
<%= render :partial => 'lib_nav', :locals => {:lib => @function.namespace.library} %>
<%= render :partial => '/lib_namespaces' %>
@@ -299,5 +300,6 @@ $(document).ready(function() {
&nbsp;
</div>
+<div class="container_16">
View
102 app/views/main/index.html.erb
@@ -1,17 +1,23 @@
<% content_for :title, " - Community powered Clojure Documentation and Examples" %>
-
-<div class="featured">
- <div class="grid_8">
- <div class="grid_8 alpha omega">
+<div class="container_16">
+ <div class="grid_15 prefix_1 suffix_1">
+ <div class="overview">
+ <h2 style="text-align: left">ClojureDocs is a community powered documentation and examples repository for the <a href="http://clojure.org">Clojure programming language</a>.</h2>
+ </div>
+ </div>
+ <div class="grid_16">
+ <div class="grid_7 prefix_1 alpha">
<div class="core_libraries">
- <h2>Core Language</h2>
<div class="library">
<h3><a href="/clojure_core">Clojure Core</a></h3>
<a href="/quickref/Clojure%20Core">Quick Reference</a><br />
<a href="http://clojure.org">http://clojure.org</a><br />
<p>Clojure is a dynamic programming language that targets the Java Virtual Machine (and the CLR).</p>
</div>
- <br />
+ </div>
+ </div>
+ <div class="grid_7 suffix_1 omega">
+ <div class="core_libraries">
<div class="library">
<h3><a href="/clojure_contrib">Clojure Contrib</a></h3>
<a href="http://richhickey.github.com/clojure-contrib/">http://richhickey.github.com/clojure-contrib/</a>
@@ -20,8 +26,48 @@
</div>
</div>
<div class="clear"></div>
- <br />
- <h2>Top Contributors <span class="find_functions_without_examples"><a href="/management/Clojure%20Core">Find vars that need examples.</a></span></h2>
+ </div>
+ <div class="clear"></div>
+ <br />
+ <br />
+</div>
+<div class="other_content">
+<div class="container_16">
+
+ <br />
+ <br />
+ <div class="grid_9">
+ <div class="welcome_message">
+ <h2>Getting started with ClojureDocs</h2>
+ <p>Finding the right tool for the job can be tough, so we&apos;ve outlined a few ways to go about your search below.</p>
+ <ul>
+ <li>Take a look at the <a href="/quickref/Clojure%20Core">Clojure Core quickref</a>, which displays Clojure vars grouped by category.</li>
+ <li>Browse an alphabetical list of vars defined in <a href="/clojure_core">Clojure Core</a> or <a href="/clojure_contrib">Contrib</a>.</li>
+ <li><a href="/search?q=reduce">Search</a> for something.</li>
+ </ul>
+ </div>
+
+ <div class="contribute">
+ <h2>Contribute to ClojureDocs</h2>
+ <p>We need your help to make ClojureDocs a great community resource. Here are a couple of ways you can contribute.</p>
+ <ul>
+ <li>
+ <h3>Give Feedback</h3>
+ <p>Our <a href="http://clojuredocs.uservoice.com">UserVoice Forum</a> allows you to give feedback publicly ('Go to our Feedback Forum') or privately ('Need help? Contact ClojureDocs').</p>
+ <p>We also have a <a href="http://groups.google.com/group/clojuredocsorg">Google Group</a> for announcements and discussions.</p>
+ </li>
+ <li>
+ <h3>Add an Example</h3>
+ <p></p>
+ </li>
+ </ul>
+ <p>The site is currently in alpha and we need your help to make it a great community resource, so please let us know if you've got any feedback on how to make this site better.</p>
+ </div>
+
+ </div>
+ <div class="grid_6 prefix_1">
+ <div class="top_contributors">
+ <h2>Top Contributors</h2>
<ul class="top_contributors">
<% @top_contributors.each do |tc| %>
<li>
@@ -29,11 +75,35 @@
</li>
<% end %>
</ul>
+
<div class="clear"></div>
- <br />
+ <span class="find_functions_without_examples"><a href="/management/Clojure%20Core">Find vars that need examples.</a></span>
+ </div>
+ <%= image_tag "curly_bracket.png", :class => "curly" %>
+ <div class="recently_updated_panel">
<h2>Recently Updated <a href="/feed/recent_updates" alt="All recent updates RSS feed"><%= image_tag 'browser-rss.png'%></a></h2>
<%= render :partial => '/recently_updated', :locals => {:recently_updated => @recently_updated}%>
+ </div>
+ </div>
+ <div class="grid_8 suffix_1">
+
+ </div>
+ <div class="grid_1 suffix_1">
+ <h2 style="font-size: 160px; line-height: 180px">}</h2>
+ </div>
+
+ <div class="grid_7">
+ <div class="feedback_callout">
+ <h2>Have Feedback?</h2>
+ <ul>
+ <li>Use the feedback tab at the right side of the page.</li>
+ <li>Google Group</li>
+ </ul>
+ <p>There are a couple ways to contact us: The quickest and easiest is to use the 'Feedback' tab on the right side of any ClojureDocs page. It's linked to our <a href="http://clojuredocs.uservoice.com">UserVoice Forum</a>, and allows you to give feedback publicly ('Go to our Feedback Forum') or privately ('Need help? Contact ClojureDocs').
+ <p>We also have a <a href="http://groups.google.com/group/clojuredocsorg">Google Group</a> for announcements and discussions.</p>
+ </div>
</div>
+
<div class="grid_8">
<div class="news">
<h2>News</h2>
@@ -42,13 +112,7 @@
<p>Also, we&#39;ve put together an <a href="/examples_style_guide">examples style guide</a>. Please take a look before adding new examples, as following these conventions will help to keep formatting uniform across examples.</p>
</div>
</div>
- <div class="welcome_message">
- <h2>New to ClojureDocs?</h2>
- <p>ClojureDocs is a community powered documentation and examples repository for the <a href="http://clojure.org">Clojure programming language</a>.</p>
- <p>The site is currently in alpha and we need your help to make it a great community resource, so please let us know if you've got any feedback on how to make this site better.</p>
- <p>There are a couple ways to contact us: The quickest and easiest is to use the 'Feedback' tab on the right side of any ClojureDocs page. It's linked to our <a href="http://clojuredocs.uservoice.com">UserVoice Forum</a>, and allows you to give feedback publicly ('Go to our Feedback Forum') or privately ('Need help? Contact ClojureDocs').
- <p>We also have a <a href="http://groups.google.com/group/clojuredocsorg">Google Group</a> for announcements and discussions.</p>
- </div>
+
<br />
<h2>Other Libs</h2>
<div class="grid_4 alpha">
@@ -122,7 +186,7 @@
</div>
</div>
- <div class="clear"></div>
-</div>
-<div class="clear"></div>
+<div class="clear"></div>
+</div>
+</div>
View
3  app/views/main/lib.html.erb
@@ -9,6 +9,8 @@
})
</script>
+<div class="container_16">
+
<div class="grid_3">
<%= render :partial => 'lib_nav', :locals => {:lib => @library} %>
<%= render :partial => '/lib_namespaces' %>
@@ -73,4 +75,5 @@
</div>
<div class="grid_3">
&nbsp;
+</div>
</div>
View
22 app/views/main/libs.html.erb
@@ -1,11 +1,15 @@
-<div class="libraries">
-<% @libs.each do |l| %>
- <h2>
- <%= link_to l.name, :controller => 'main', :action => 'lib', :lib => l.url_friendly_name %>
- </h2>
- <div class="lib_link">
- <a href="<%= l.site_url %>"><%= l.site_url %></a>
- <p class="description"><%= l.description %></a>
+<div class="container_16">
+ <div class="grid_16">
+ <div class="libraries">
+ <% @libs.each do |l| %>
+ <h2>
+ <%= link_to l.name, :controller => 'main', :action => 'lib', :lib => l.url_friendly_name %>
+ </h2>
+ <div class="lib_link">
+ <a href="<%= l.site_url %>"><%= l.site_url %></a>
+ <p class="description"><%= l.description %></a>
+ </div>
+ <% end %>
+ </div>
</div>
-<% end %>
</div>
View
3  app/views/main/search.html.erb
@@ -33,7 +33,7 @@ $(document).ready(function() {
$('.linktext').quickCopy()
})
</script>
-
+<div class="container_16">
<div class="search_results">
<div class="grid_11 suffix_1">
@@ -141,4 +141,5 @@ $(document).ready(function() {
Please see <a href="http://www.sphinxsearch.com/docs/current.html#extended-syntax">this page</a> for a full listing of search options.
</div>
</div>
+</div>
</div>
View
2  app/views/user/profile.html.erb
@@ -1,3 +1,4 @@
+<div class="container_16">
<div class="profile">
<div class="grid_3">
<img class="profile_image" src="<%= grav_url_for(@user.email, 150)%>" />
@@ -20,4 +21,5 @@
No recent activity for <%= @user.login %>.
<% end %>
</div>
+</div>
</div>
View
5 app/views/user_sessions/new.html.erb
@@ -10,6 +10,7 @@ $(document).ready(function() {
})
</script>
+<div class="container_16">
<div class="grid_16">
<h2 class="section_header">Sign up or log in using OpenID</h2>
</div>
@@ -19,7 +20,6 @@ $(document).ready(function() {
<a href="https://www.google.com/accounts/o8/id" class="provider" id="provider_google">Google</a>
<a href="http://yahoo.com/" class="provider" id="provider_google">Yahoo</a>
<a href="http://myopenid.com" class="provider" id="provider_myopenid">myOpenId</a>
- <a href="http://openid.aol.com" class="provider" id="provider_aol">AOL</a>
<h3>Or enter your OpenID url below:</h3>
<% form_for :user_session, @user_session do |f| %>
<%= f.label :openid_identifier, "OpenID URL"%>
@@ -50,7 +50,7 @@ $(document).ready(function() {
<div class="grid_6">
<div class="why_account">
<h4>Why do I need an account?</h4>
- <p>Most, if not all of the content on ClojureDocs can be accessed without ever logging in to the site. However, if you'd like to add or update comments, examples, and other content feel free to sign up.</p>
+ <p>Most of the content on ClojureDocs can be accessed without ever logging in to the site. However, if you'd like to add or update comments, examples, and other content feel free to sign up.</p>
</div>
<div class="why_openid">
<h4>What's OpenID?</h4>
@@ -63,4 +63,5 @@ $(document).ready(function() {
<p>For a good place to find an OpenID provider, visit the <a href="http://openid.net/get-an-openid">OpenID Foundation website</a>.
</div>
+</div>
</div>
View
BIN  public/favicon.ico
Binary file not shown
View
BIN  public/images/Untitled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/cd_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/curly_bracket.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
14 public/stylesheets/common.css
@@ -1,3 +1,7 @@
+body {
+ /*background-color: #f9f9f9;*/
+}
+
h1, h2, h3, h4, h5, form, fieldset, ul {
padding: 0px;
margin: 0px;
@@ -44,6 +48,7 @@ em {
a {
color: blue;
+
text-decoration: none;
}
@@ -90,12 +95,19 @@ ul li {
color #999;
}
+
/*** Recently Updated Content ***/
.recent_comment, .recent_example, .recent_see_also {
background-repeat: no-repeat;
- background-position: 0px -1px;
+ background-position: -2px -3px;
padding-left: 22px;
margin-bottom: 8px;
+ font-size: 10pt;
+}
+
+.recent_comment .timestamp, .recent_example .timestamp, .recent_see_also .timestamp {
+ font-size: 8pt;
+ color: #888;
}
.recent_comment {
View
109 public/stylesheets/main.css
@@ -10,41 +10,76 @@
.header {
padding-top: 3px;
+ padding-bottom: 3px;
top: 0px;
left: 0px;
z-index: 5000;
height: 60px;
width: 100%;
- margin-bottom: 10px;
- color: white;
- background-color: #444;
- border-bottom: solid orange 2px;
+ margin-bottom: 20px;
+ border-bottom: solid #ccc 1px;
+ background-color: #f8f8f8;
}
.header_content {
padding-bottom: 5px;
+
}
.header a {
- color: #fff;
+ color: black;
}
.header h1 a {
- color: #fff;
}
.header h1 a:hover {
text-decoration: none;
}
+.header .cd_logo {
+ margin-top: 3px;
+ margin-left: 6px;
+}
+
.user_area {
margin: 0px;
padding: 0px;
text-align: right;
- color: #ddd;
+ color: #666666;
+}
+
+.user_area_content {
+ border-left: solid #ccc 1px;
+ border-right: solid #ccc 1px;
+ border-bottom: solid #ccc 1px;
+ padding: 5px;
+ -moz-border-radius: 0px 12px;
+ -webkit-border-bottom-left-radius: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+
+}
+
+.user_area_gravatar {
+ margin-bottom: -3px;
}
.user_area a {
+ color: blue;
+}
+
+.user_area a:visited {
+ color: blue;
+}
+
+.other_content {
+ background-color: #f8f8f8;
+ border-top: solid #ccc 1px;
+ border-bottom: solid #ccc 1px;
+}
+
+.overview {
+ margin-bottom: 20px;
}
.example .content {
@@ -145,6 +180,7 @@
.search .submit_image {
margin-bottom: -4px;
border: none;
+ display: none;
}
.search_results .match {
@@ -526,18 +562,67 @@ fieldset {
.core_libraries {
font-size: 10pt;
background-color: #fafafa;
- padding: 10px;
- border: solid #f3f3f3 1px;
+ padding: 14px;
+ border: solid #ddd 1px;
+ -webkit-box-shadow: inset 0px 0px 7px #ccc;
+ -moz-box-shadow: inset 0px 0px 7px #ccc;
+ border-radius: 12px;
+ -moz-border-radius: 12px;
+ -webkit-border-radius: 12px;
+}
+
+.recently_updated_panel, div.top_contributors {
+ border: solid #ddd 1px;
+ padding: 20px;
+ padding-left: 35px;
+ background-color: #fafafa;
+}
+
+.recently_updated_panel h2 {
+ margin-bottom: 10px;
+}
+
+.curly {
+ margin-left: 40px;
+}
+
+
+.welcome_message, .feedback_callout {
+ margin-bottom: 30px;
+}
+
+.welcome_message h2 {
+/* background-color: #62A632;*/
+/* background-color: #00D8FF;*/
+/* color: #62A632;*/
+ margin-bottom: 10px;
}
-.welcome_message {
- margin-top: 9px;
+.welcome_message ul, .contribute ul {
+ font-size: 12pt;
+ margin-bottom: 20px;
}
-.welcome_message p {
+.welcome_message p, .contribute p {
+ font-size: 11pt;
margin-bottom: 10px;
}
+.welcome_message ul li {
+ list-style-type: circle;
+ margin-left: 30px;
+ margin-bottom: 10px;
+}
+
+.contribute ul li {
+ margin-left: 30px;
+ margin-bottom: 10px;
+}
+
+.contribute ul li h3 {
+ font-weight: normal;
+}
+
.formError {
display: inline;
color: red;
Please sign in to comment.
Something went wrong with that request. Please try again.