Skip to content

Commit

Permalink
Merge branch 'master' into jpn-app-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Nelson committed Mar 29, 2012
2 parents a80dab9 + f1c3d77 commit e360645
Show file tree
Hide file tree
Showing 9 changed files with 33,311 additions and 9 deletions.
12 changes: 12 additions & 0 deletions aristotle/apps/call_number/media/call_number/js/call_number.js
@@ -0,0 +1,12 @@
function BrowseDisplay(call_number) {
var data = 'number=' + call_number;
alert("IN BROWSE DISPLAY");
$.ajax({
url:'/json/',
data:data,
success: function(response) {

}
});

}
21 changes: 20 additions & 1 deletion aristotle/apps/call_number/views.py
Expand Up @@ -84,6 +84,25 @@ def widget(request):
"""
Returns rendered html snippet of call number browser widget
"""
standalone = False
call_number = 'PS21 .D5185 1978'
if request.method == 'POST':
if request.POST.has_key('standalone'):
standalone = request.POST['standalone']
if request.POST.has_key('call_number'):
call_number = request.POST['call_number']
else:
if request.GET.has_key('standalone'):
standalone = request.GET['standalone']
if request.GET.has_key('call_number'):
call_number = request.GET['call_number']
current = commands.get_record(call_number)

return direct_to_template(request,
'call_number/snippets/widget.html',
{'call_number':'PS21 .D5185 1978'})
{'aristotle_url':settings.DISCOVERY_RECORD_URL,
'current':current,
'next':commands.get_next(current['call_number']),
'previous':commands.get_previous(current['call_number']),

'standalone':standalone})
1 change: 1 addition & 0 deletions aristotle/settings.py
Expand Up @@ -158,5 +158,6 @@
GBS_PREVIEW_URL = "http://www.google.com/intl/en/googlebooks/images/gbs_preview_button1.gif"
try:
from local_settings import *
#! Should load app_settings.py located in each app directory
except ImportError:
pass
24 changes: 20 additions & 4 deletions aristotle/templates/call_number/snippets/widget.html
@@ -1,5 +1,15 @@
{% load i18n %}
{% load call_number_extras %}
{% if standalone %}
<html>
<head>
<link href="{{ STATIC_URL }}css/bootstrap.min.css" rel="stylesheet">
<link href="{{ STATIC_URL }}css/bootstrap.min.responsive" rel="stylesheet">
<link href="{{ STATIC_URL }}css/bootstrap.min.responsive" rel="stylesheet">
<link href="{{ STATIC_URL }}call_number/css/call_number.css" rel="stylesheet" type="text/css" />
</head>
<body>
{% endif %}
{% comment %}START call-number-browser DIV{% endcomment %}
<div id="call-number-browser">
<h2>Browse by call number:</h2>
Expand All @@ -13,7 +23,7 @@ <h2>Browse by call number:</h2>
{% if entity.isbn %}
{{ entity.isbn|google_book_display }}
{% endif %}
<div class="call-number-entity"><a href="{{ aristotle_url }}{{ entity.bib_number }}">{{ entity.title|truncatewords:7 }}</a></div>
<div class="call-number-entity"><a href="{{ aristotle_url }}{{ entity.bib_number }}" target="_top">{{ entity.title|truncatewords:7 }}</a></div>
{% if entity.author %}
<div class="call-number-entity">{% trans entity.author %}
{% comment %}
Expand Down Expand Up @@ -47,7 +57,7 @@ <h2>Browse by call number:</h2>
{% if entity.isbn %}
{{ entity.isbn|google_book_display }}
{% endif %}
<div class="call-number-entity"><a href="{{ aristotle_url }}{{ entity.bib_number }}">{{ entity.title }}</a></div>
<div class="call-number-entity"><a href="{{ aristotle_url }}{{ entity.bib_number }}" target="_top">{{ entity.title }}</a></div>
<div class="call-number-entity">{% trans entity.author %}
{% comment %}
{% for author in entity.author %}
Expand All @@ -67,9 +77,9 @@ <h2>Browse by call number:</h2>
<div id="browse-controls">
{% comment %}START btn-group DIV{% endcomment %}
<div class="btn-group">
<a class="btn btn-mini" href="#">&laquo; Previous</a>
<a class="btn btn-mini" href="#" onclick="BrowseDisplay('{{ previous.0.call_number }}')">&laquo; Previous</a>
<a class="btn btn-mini btn-info" href="#">Expand</a>
<a class="btn btn-mini" href="#">Next &raquo;</a>
<a class="btn btn-mini" href="#" onclick="BrowseDisplay('{{ next.1.call_number }}')">Next &raquo;</a>
{% comment %}END btn-group DIV{% endcomment %}
</div>
{% comment %}END browse-controls DIV{% endcomment %}
Expand All @@ -79,3 +89,9 @@ <h2>Browse by call number:</h2>
<br/>
{% comment %}END call-number-browser DIV{% endcomment %}
</div>
{% if standalone %}
<script src="{{ STATIC_URL }}js/jquery-1.7.1.min.js"></script>
<script src="{{ STATIC_URL }}call_number/js/call_number.js"></script>
</body></html>
{% endif %}

3,184 changes: 3,184 additions & 0 deletions fixures/rda-marc-authority-mapping.html

Large diffs are not rendered by default.

26,014 changes: 26,014 additions & 0 deletions fixures/rda-marc-bibliographic-mapping.html

Large diffs are not rendered by default.

4,027 changes: 4,027 additions & 0 deletions fixures/rda-mods-mapping.html

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions maps/__init__.py
@@ -1,6 +1,10 @@
import sys,os

#sys.path.insert(0, os.path.abspath('C:\\Users\\jernelson\\Development\\frbr-redis-datastore\\'))
#sys.path.insert(0, os.path.abspath('C:\\Users\\jernelson\\Development\\frbr-redis-datastore\\lib\\'))
sys.path.insert(0, os.path.abspath('../frbr-redis-datastore/'))
sys.path.insert(0, os.path.abspath('../frbr-redis-datastore/lib/'))
MAP_ROOT = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.abspath(MAP_ROOT)[0]
FIXURES_ROOT = os.path.join(PROJECT_ROOT,'fixures')
LIB_ROOT = os.path.join(PROJECT_ROOT,'lib')

sys.path.insert(0, PROJECT_ROOT)
sys.path.insert(0, LIB_ROOT)
sys.path.insert(0, FIXURES_ROOT)
25 changes: 25 additions & 0 deletions maps/rda_toolkit_mapper.py
@@ -0,0 +1,25 @@
"""
:mod:`rda_toolkit_mapper` Uses RDA Toolkit Mappings to create SKOS files for
MARC and MODS imports into FRBR-Redis datastore.
"""
__author__ = 'Jeremy Nelson'

import sys,datetime,os
from BeautifulSoup import BeautifulSoup
from lxml import etree
import __init__
print(__init__.LIB_ROOT)
import lib.namespaces as ns

def create_rda_toolkit_skos(raw_html_filename):
full_path = os.path.join(FIXURES,raw_html_filename)
raw_html_file = open(full_path,'rb')
raw_html = raw_html_file.read()
raw_html_file.close()
html_soup = BeautifulSoup(raw_html)



if __name__ == '__main__':
rda_marc_bib_html = 'rda-marc-bibliographic-mapping.html'
create_rda_toolkit_skos(rda_marc_bib_html)

0 comments on commit e360645

Please sign in to comment.