fixes
This commit is contained in:
parent
72372527b5
commit
bc33331889
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
static
|
/static
|
||||||
data
|
data
|
||||||
*.pyc
|
*.pyc
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
|
@ -146,7 +146,7 @@ ul.clearing-thumbs li {
|
||||||
.admin-menu {
|
.admin-menu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
right: 65px;
|
right: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-menu a {
|
.admin-menu a {
|
||||||
|
@ -163,7 +163,7 @@ table thead, table tbody, table tfoot {
|
||||||
border: 0.125rem solid #e6e6e6;
|
border: 0.125rem solid #e6e6e6;
|
||||||
box-shadow: 0 0 3.125rem rgba(0, 0, 0, 0.18);
|
box-shadow: 0 0 3.125rem rgba(0, 0, 0, 0.18);
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
background-image: url("http://media.yardhouse.com/images/site/searchicon.png");
|
background-image: url("/static/png/searchicon.png");
|
||||||
background-position: 4px center;
|
background-position: 4px center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-color: #111111;
|
background-color: #111111;
|
||||||
|
@ -172,7 +172,7 @@ table thead, table tbody, table tfoot {
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
top: 13px;
|
top: 13px;
|
||||||
right: 110px;
|
right: 65px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
|
BIN
camp/static/png/searchicon.png
Normal file
BIN
camp/static/png/searchicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -52,7 +52,7 @@ class GalleryAdmin(GalleryAdminDefault):
|
||||||
|
|
||||||
class ContentAdmin(admin.ModelAdmin):
|
class ContentAdmin(admin.ModelAdmin):
|
||||||
save_on_top = True
|
save_on_top = True
|
||||||
list_display = ('__str__', 'datestart', 'shortname', 'type')
|
list_display = ('id', '__str__', 'datestart', 'shortname', 'type')
|
||||||
list_filter = ['datestart', 'type']
|
list_filter = ['datestart', 'type']
|
||||||
search_fields = ['title', 'body', 'header', 'shortname']
|
search_fields = ['title', 'body', 'header', 'shortname']
|
||||||
inlines = [ContentParentsInline, FileInline, LinkInline]
|
inlines = [ContentParentsInline, FileInline, LinkInline]
|
||||||
|
|
|
@ -110,7 +110,7 @@ class Content(models.Model):
|
||||||
@property
|
@property
|
||||||
def formatted_teaser(self):
|
def formatted_teaser(self):
|
||||||
if self.teaser:
|
if self.teaser:
|
||||||
value = self.teaser
|
value = markdownify(self.teaser)
|
||||||
elif self.header:
|
elif self.header:
|
||||||
value = ox.strip_tags(ox.decode_html(markdownify(self.header)))[:100]
|
value = ox.strip_tags(ox.decode_html(markdownify(self.header)))[:100]
|
||||||
else:
|
else:
|
||||||
|
@ -124,7 +124,7 @@ class Content(models.Model):
|
||||||
@property
|
@property
|
||||||
def image_url(self):
|
def image_url(self):
|
||||||
if self.image:
|
if self.image:
|
||||||
if self.image.startswith('http'):
|
if self.image.startswith('http') or self.image.startswith('/'):
|
||||||
return self.image
|
return self.image
|
||||||
return settings.IMAGE_PREFIX + self.image
|
return settings.IMAGE_PREFIX + self.image
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<h4 class="sidebar-h4"> Past Events </h4>
|
<h4 class="sidebar-h4"> Past Events </h4>
|
||||||
{% include "event_preview.html" with events=past_events %}
|
{% include "event_preview.html" with events=past_events %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<a href="index/">more</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -16,7 +16,7 @@ from photologue.models import Photo, Gallery
|
||||||
|
|
||||||
from .models import Content, ContentContent
|
from .models import Content, ContentContent
|
||||||
|
|
||||||
# Create your views here.
|
ITEMS_PER_PAGE = 30
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
@ -73,7 +73,7 @@ def section_list(request, section):
|
||||||
content = limit_content(content, q)
|
content = limit_content(content, q)
|
||||||
|
|
||||||
page = request.GET.get('page', 1)
|
page = request.GET.get('page', 1)
|
||||||
paginator = Paginator(content, 5)
|
paginator = Paginator(content, ITEMS_PER_PAGE)
|
||||||
try:
|
try:
|
||||||
content = paginator.page(page)
|
content = paginator.page(page)
|
||||||
except PageNotAnInteger:
|
except PageNotAnInteger:
|
||||||
|
@ -103,7 +103,7 @@ def event(request):
|
||||||
|
|
||||||
upcoming_events = base.filter(datestart__gt=now).order_by('-datestart')
|
upcoming_events = base.filter(datestart__gt=now).order_by('-datestart')
|
||||||
ongoing_events = base.filter(datestart__lt=now, dateend__gte=now).order_by('-datestart')
|
ongoing_events = base.filter(datestart__lt=now, dateend__gte=now).order_by('-datestart')
|
||||||
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now))[:10]
|
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now)).order_by('-datestart')[:10]
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'upcoming_events': upcoming_events,
|
'upcoming_events': upcoming_events,
|
||||||
|
@ -178,7 +178,7 @@ def search(request):
|
||||||
q = request.GET.get('q')
|
q = request.GET.get('q')
|
||||||
content = limit_content(content, q)
|
content = limit_content(content, q)
|
||||||
page = request.GET.get('page', 1)
|
page = request.GET.get('page', 1)
|
||||||
paginator = Paginator(content, 5)
|
paginator = Paginator(content, ITEMS_PER_PAGE)
|
||||||
try:
|
try:
|
||||||
content = paginator.page(page)
|
content = paginator.page(page)
|
||||||
except PageNotAnInteger:
|
except PageNotAnInteger:
|
||||||
|
@ -199,7 +199,7 @@ def search(request):
|
||||||
|
|
||||||
class GalleryListViews(ListView):
|
class GalleryListViews(ListView):
|
||||||
queryset = Gallery.objects.on_site().is_public()
|
queryset = Gallery.objects.on_site().is_public()
|
||||||
paginate_by = 20
|
paginate_by = ITEMS_PER_PAGE
|
||||||
template_name = 'gallery_list.html'
|
template_name = 'gallery_list.html'
|
||||||
|
|
||||||
def get_or_none(classmodel, **kwargs):
|
def get_or_none(classmodel, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user