diff --git a/expo/models.py b/expo/models.py index ea73cd4..180f272 100644 --- a/expo/models.py +++ b/expo/models.py @@ -21,7 +21,7 @@ logging.basicConfig(level=logging.DEBUG, #This class is for adding fields and methods which all of our models will have. class TroggleModel(models.Model): new_since_parsing = models.BooleanField(default=False, editable=False) - + non_public = models.BooleanField(default=False) def object_name(self): return self._meta.object_name diff --git a/expo/templatetags/wiki_markup.py b/expo/templatetags/wiki_markup.py index eeacced..adba198 100644 --- a/expo/templatetags/wiki_markup.py +++ b/expo/templatetags/wiki_markup.py @@ -47,6 +47,9 @@ def wiki_to_html(value, autoescape=None): @register.filter() @stringfilter def wiki_to_html_short(value, autoescape=None): + """ + This is the tag which turns wiki syntax into html. Aaron wonders why it is called "short." It is long, and it operates on long things. + """ if autoescape: value = conditional_escape(value) #deescape doubly escaped characters @@ -58,10 +61,10 @@ def wiki_to_html_short(value, autoescape=None): #make cave links value = re.sub("\[\[\s*cave:([^\s]+)\s*\s*\]\]", r'\1' % settings.URL_ROOT, value, re.DOTALL) #make people links + value = re.sub("\[\[\s*person:(.+)\]\]",r'\1' % settings.URL_ROOT, value, re.DOTALL) - + #make qm links. this takes a little doing qmMatchPattern="\[\[\s*cave:([^\s]+)\s*\s*\QM:(\d*)-(\d*)([ABCDX]?)\]\]" - def qmrepl(matchobj): """ A function for replacing wikicode qm links with html qm links. diff --git a/expo/views_caves.py b/expo/views_caves.py index 10355d6..b2fb170 100644 --- a/expo/views_caves.py +++ b/expo/views_caves.py @@ -24,7 +24,11 @@ def caveindex(request): return render_response(request,'caveindex.html', {'caves': caves, 'notablecaves':notablecaves}) def cave(request, cave_id='', offical_name=''): - return render_response(request,'cave.html', {'cave': getCave(cave_id),}) + cave=getCave(cave_id) + if cave.non_public: + return render_response(request,'nonpublic.html', {'instance': cave}) + else: + return render_response(request,'cave.html', {'cave': cave}) def qm(request,cave_id,qm_id,year,grade=None): year=int(year)