From c5c923d66ff1f2d070176564b48778d981194308 Mon Sep 17 00:00:00 2001
From: Nathan Friedly Family tree of <%= link_to @parent.name, @parent %>
+<% if(@parent.mother && @parent.father) %>
+
+ Family Tree: + <%= link_to "Family tree of " + @person.name, {:controller => "families", :action => "show", :id => @person.id } %> +
+Description: <%=h @person.description %> diff --git a/public/javascripts/admin.js b/public/javascripts/admin.js index 765c113..00b18d1 100644 --- a/public/javascripts/admin.js +++ b/public/javascripts/admin.js @@ -1,34 +1,39 @@ $(document).ready(function(){ - // create my word-actions div - $('
') - .appendTo('body'); - var WordActions = $('#word-actions'); - var CPLink = $('#create-person'); - var WAWidth = WordActions.width() + // only bother with this if we're on a page with verses + if($("p.verse:first").length) { - // placeholder for the current selected word - var Word; + // create my word-actions div + $('') + .appendTo('body'); + var WordActions = $('#word-actions'); + var CPLink = $('#create-person'); + var WAWidth = WordActions.width() - // event when a word is clicked - $("p.verse span").live('click',function(){ - if(Word){ - Word.removeClass('active-word'); - } - Word = $(this); - Word.addClass('active-word'); - - // show the actions box - var offset = Word.offset(); - offset.top = offset.top - 2; - offset.left = offset.left - (WAWidth - Word.width())/2; - WordActions.offset(offset); + // placeholder for the current selected word + var Word; - // update the links - CPLink.attr('href', '/people/new?name=' + Word.text().replace(/[^a-z ]/i,'')); - }); + // event when a word is clicked + $("p.verse span").live('click',function(){ + if(Word){ + Word.removeClass('active-word'); + } + Word = $(this); + Word.addClass('active-word'); + + // show the actions box + var offset = Word.offset(); + offset.top = offset.top - 2; + offset.left = offset.left - (WAWidth - Word.width())/2; + WordActions.offset(offset); + + // update the links + CPLink.attr('href', '/people/new?name=' + Word.text().replace(/[^a-z ]/i,'')); + }); + + } - // autocomplete for the parents + // autocomplete for the parents (only runs on pages with #father_name or #mother_name fields) $('#father_name, #mother_name').autocomplete( "/people/parent", // .json or .xml also work { diff --git a/public/stylesheets/biblepeople.css b/public/stylesheets/biblepeople.css index 1070620..7583cb6 100644 --- a/public/stylesheets/biblepeople.css +++ b/public/stylesheets/biblepeople.css @@ -20,6 +20,27 @@ /* family tree styles */ +.parents { + margin-left:0.5em; + border: 1px solid grey; + border-top:0; + float:left; +} + +.parents a { + position:relative; + top: -0.5em; + background-color:white; +} + +.parents a:first-child { + left: -1em; +} + +.parents a:last-child { + right: -1em; +} + .family { float: left; }