Skip to content

Instantly share code, notes, and snippets.

@ocharles
Created January 21, 2009 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ocharles/50146 to your computer and use it in GitHub Desktop.
Save ocharles/50146 to your computer and use it in GitHub Desktop.
index bb97d10..c5f53bd 100644
--- a/root/layout.tt
+++ b/root/layout.tt
@@ -1,30 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="expires" content="1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+
<title>[% title %][% " - " IF title %]MusicBrainz.org</title>
<link rel="stylesheet" type="text/css" href="/static/main.css" />
- <script type="text/javascript" src="/static/scripts/jquery/jquery-1.3.min.js"></script>
- [%- page = {
- css = extra_css.split('\s+'),
- js = [
- 'jquery/jquery.cookie.js',
- 'sidebar.js'
- ],
- };
- FOR extra IN extra_js.split('\s+'); page.js.push(extra); END -%]
- [%- FOREACH js IN page.js %]
- <script type="text/javascript" src="/static/scripts/[% js %]"></script>
- [%- END %]
-
- [%- FOREACH css IN page.css %]
- <link rel="stylesheet" type="text/css" href="/static/styles/extra/[% css %]" />
- [%- END %]
+ <script type="text/javascript" src="/static/scripts/jquery/jquery-1.3.min.js"></script>
+ [% page =
+ {
+ css = extra_css.split('\s+')
+ js = extra_js.split('\s+')
+ }
+ %]
+ [% FOREACH js IN page.js %]
+ <script type="text/javascript" src="/static/scripts/[% js %]"></script>
+ [% END %]
+ [% FOREACH css IN page.css %]
+ <link rel="stylesheet" type="text/css" href="/static/styles/extra/[% css %]" />
+ [% END %]
<link rel="search" type="application/opensearchdescription+xml" title="MusicBrainz: Artist" href="[% c.uri_for('/static/search_plugins/opensearch/musicbrainz_artist.xml') %]" />
<link rel="search" type="application/opensearchdescription+xml" title="MusicBrainz: Label" href="[% c.uri_for('/static/search_plugins/opensearch/musicbrainz_label.xml') %]" />
diff --git a/root/layout/sidebar.tt b/root/layout/sidebar.tt
index 246e88a..ad4f130 100644
--- a/root/layout/sidebar.tt
+++ b/root/layout/sidebar.tt
@@ -1,30 +1,13 @@
<div id="sidebar">
- [% INCLUDE "layout/sidebar/toggle.tt" %]
- <span class="toggle">
- [% INCLUDE "layout/sidebar/sites.tt"
- WRAPPER "layout/sidebar/section.tt" title="MusicBrainz sites" %]
-
- [% IF c.user_exists %]
- [% INCLUDE "layout/sidebar/user.tt"
- WRAPPER "layout/sidebar/section.tt" title=c.user.name link="${c.uri_for('/user/')}" %]
- [% ELSE %]
- [% INCLUDE "layout/sidebar/login.tt"
- WRAPPER "layout/sidebar/section.tt" title="Not Logged In"
- link="${c.uri_for('/user/login')}" %]
- [% END %]
-
- [% INCLUDE "layout/sidebar/search.tt"
- WRAPPER "layout/sidebar/section.tt" title="Search" %]
-
- [% INCLUDE "layout/sidebar/top-voters.tt"
- WRAPPER "layout/sidebar/section.tt" title="Top Voters"
- link=c.uri_for('/statistics/top_editors') %]
-
- [% INCLUDE "layout/sidebar/stats.tt"
- WRAPPER "layout/sidebar/section.tt" title="Stats" %]
-
- [% INCLUDE "layout/sidebar/partners.tt"
- WRAPPER "layout/sidebar/section.tt" title="Partners"
- link="http://metabrainz.org/about/supporters.html" %]
- </span>
+ [% INCLUDE "layout/sidebar/sites.tt" WRAPPER "layout/sidebar/section.tt" title="MusicBrainz sites" %]
+ [% IF c.user_exists %]
+ [% INCLUDE "layout/sidebar/user.tt" WRAPPER "layout/sidebar/section.tt" title=c.user.name link="${c.uri_for('/user/')}" %]
+ [% ELSE %]
+ [% INCLUDE "layout/sidebar/login.tt" WRAPPER "layout/sidebar/section.tt" title="Not Logged In" link="${c.uri_for('/user/login')}" %]
+ [% END %]
+ [% INCLUDE "layout/sidebar/search.tt" WRAPPER "layout/sidebar/section.tt" title="Search" %]
+ [% INCLUDE "layout/sidebar/top-voters.tt"
+ WRAPPER "layout/sidebar/section.tt" title="Top Voters" link=c.uri_for('/statistics/top_editors') %]
+ [% INCLUDE "layout/sidebar/stats.tt" WRAPPER "layout/sidebar/section.tt" title="Stats" %]
+ [% INCLUDE "layout/sidebar/partners.tt" WRAPPER "layout/sidebar/section.tt" title="Partners" link="http://metabrainz.org/about/supporters.html" %]
</div>
diff --git a/root/layout/sidebar/search.tt b/root/layout/sidebar/search.tt
index 37ef6c7..dfd76c9 100644
--- a/root/layout/sidebar/search.tt
+++ b/root/layout/sidebar/search.tt
@@ -1,9 +1,8 @@
<div id="sidebar_search">
[% WRAPPER "forms/form.tt" action=c.uri_for('/search/simple')
quiet=1 method="get" moderation=undef form=sidebar_search %]
- [% INCLUDE "forms/input.tt" widget=sidebar_search.field('type') %]
- [% INCLUDE "forms/input.tt" widget=sidebar_search.field('query') %]
-
- <input type="submit" value="Search" class="submit" />
+ [% INCLUDE "forms/widget.tt" widget=sidebar_search.field('type') label="Type" %]
+ [% INCLUDE "forms/widget.tt" widget=sidebar_search.field('query') label="Query" %]
+ [% INCLUDE "forms/submit.tt" label="Search" %]
[% END %]
</div>
diff --git a/root/main/index.tt b/root/main/index.tt
index 5b21b03..4ae4bc2 100644
--- a/root/main/index.tt
+++ b/root/main/index.tt
@@ -41,7 +41,8 @@
Unless you want to be testing the latest and greatest MusicBrainz features
you probably want to go to the <a href="http://musicbrainz.org/">
<img src="[% c.uri_for('/static/images/icon/extlink.gif') %]" alt="External Website" />
- MusicBrainz main server</a>.
+ musicbrainz.org main
+ server</a>.
</p>
[% END %]
[% END %]
@@ -51,7 +52,7 @@
<p>
If you want to edit the MusicBrainz data, you will need to go to the
<a href="http://musicbrainz.org/">
- <img src="[% c.uri_for('/images/icon/extlink.gif') %]" alt="" width="12" /> MusicBrainz main server</a>.
+ <img src="[% c.uri_for('/images/icon/extlink.gif') %]" alt="" width="12" /> MusicBrainz.org main server</a>.
</p>
[% END %]
[% END %]
diff --git a/root/static/scripts/sidebar.js b/root/static/scripts/sidebar.js
index 090f7bd..5841912 100644
--- a/root/static/scripts/sidebar.js
+++ b/root/static/scripts/sidebar.js
@@ -1,54 +1,33 @@
-/**************************************************
- * Adds the show / hide sidebar functionality
- *************************************************/
-// Store selection in cookie, turn on/off the sidebar
-function flipSidebar() {
- $(".toggle").toggle();
- switch($.cookie('sidebar'))
- {
- default:
- case 'on':
- $.cookie('sidebar', 'off');
- $('#content').css("margin-left","0px");
- $('#content').css("margin-top","15px");
- break;
- case 'off':
- $.cookie('sidebar', 'on');
- $('#content').css("margin-left","140px");
- $('#content').css("margin-top","0px");
- }
+/*----------------------------------------------------------------------------\
+| Musicbrainz.org |
+| Copyright (c) 2005 Stefan Kestenholz (keschte) |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including but not limited to the warranties of merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or copyright holders be liable for any claim, damages or other |
+| liability, whether in an action of contract, tort or otherwise, arising |
+| from, out of or in connection with the software or the use or other |
+| dealings in the software. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper credits are given and the original and modified source |
+| code are included. Requires that the final product, software derivate from |
+| the original source or any software utilizing a GPL component, such as |
+| this, is also licensed under the GPL license. |
+| |
+| $Id$
+\----------------------------------------------------------------------------*/
+
+mb.log.scopeStart("Configuring sidebar...");
+mb.log.enter("sidebar.js", "__init");
+if (mb.ui && mb.sidebar) {
+ var obj;
+ if ((obj = mb.ui.get("sidebar-togglecell")) != null) {
+ obj.innerHTML = mb.sidebar.getUI();
+ }
+ mb.sidebar.init();
}
-$(document).ready(function(){
- // Check that the sidebar is turned on in user
- // preferences). Does nothing if it is off.
- if ($('#sidebar').length)
- $('#id_toggle_target').append(' \
- <div id="id_hide_toggle" class="toggle"> \
- <a href="javascript:flipSidebar()"> \
-  Hide Sidebar \
- </a> \
- </div> \
- <div id="id_show_toggle" style="display:none;" class="toggle"> \
- <a href="javascript:flipSidebar()"> \
-  Show Sidebar \
- </a> \
- </div> \
- ');
- // Make show / hide selection persistent
- switch($.cookie('sidebar'))
- {
- default:
- // Set the cookie the first time
- $.cookie('sidebar', 'on');
- break;
- case 'off':
- // Turn on the sidebar, swap toggle text
- $(".toggle").toggle();
- $('#content').css("margin-left","0px");
- $('#content').css("margin-top","15px");
- break;
- // Turn off the sidebar, swap toggle text
- case 'on':
- $('#content').css("margin-top","0px");
- }
-});
+mb.log.exit();
+
diff --git a/root/static/styles/entity.css b/root/static/styles/entity.css
index 212776a..0a724de 100644
--- a/root/static/styles/entity.css
+++ b/root/static/styles/entity.css
@@ -11,7 +11,6 @@
color: #000;
width: 100%;
margin-bottom: 1em;
- margin-top: 8px;
padding-top: 5px;
}
diff --git a/root/static/styles/layout.css b/root/static/styles/layout.css
index 23f7b79..2d67333 100644
--- a/root/static/styles/layout.css
+++ b/root/static/styles/layout.css
@@ -124,27 +124,25 @@ div.status_ok {
margin-bottom: 20pt;
}
-#sidebar .sidebar-toggle {
- border-bottom: 1px solid #000;
- padding: 2pt;
-}
-
#sidebar .sidebar-module {
border-bottom: 1px solid #000;
padding: 6pt;
}
-#sidebar_search { text-align: center; }
-#sidebar_search input,
-#sidebar_search select {
- font-size: 9pt;
- margin-top: 1px;
- margin-left: -2px;
+#sidebar label {
+ font-size: 8pt;
}
-#sidebar_search select { width: 118px; }
-#sidebar_search input { width: 112px; }
-#sidebar_search .submit { width: auto; }
+#sidebar input, #sidebar select {
+ width: 50pt;
+ background: #eee;
+ border: 1px inset;
+ font-size: 8pt;
+}
+
+#sidebar .labelRight {
+ margin-left: 32pt;
+}
#sidebar img {
margin: auto;
@@ -203,11 +201,6 @@ div.status_ok {
padding-left: 5pt;
}
-#sidebar .sidebar-toggle {
- border-bottom: 1px solid #000;
- padding: 2pt;
-}
-
/*
* Content
*/
@@ -274,6 +267,22 @@ table.details th {
/* Nested details tables look dumb */
table.details table.details th { font-weight: normal; }
+#sidebar_search label {
+ float: left;
+ width: 30pt;
+ margin-right: 2pt;
+ text-align: right;
+}
+
+#sidebar_search input,
+#sidebar_search select {
+ width: 50pt;
+}
+
+#sidebar_search .submit {
+ width: auto;
+}
+
.paginator ul {
margin: 0;
}
@@ -455,4 +464,4 @@ table.browse {
table.browse td {
text-align: center;
padding: 0pt 4pt;
-}
+}
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment