Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/css/Web_Basic-Ash.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ div#nav ul.lang li {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Basic-Blue.css
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ div#header::after {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Basic-Cypress.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ div#nav ul.lang li {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Basic-Lilac.css
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ div#nav ul.lang li {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Basic-Peach.css
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ div#nav ul.lang li {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Basic-Spruce.css
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ div#nav ul.lang li {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Mainz.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ div#nav ul.lang li {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
4 changes: 2 additions & 2 deletions data/css/Web_Nebraska.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ p#user_header {
float: left;
list-style: none;
}
li:not(:first-child) {
padding-right: 8px;
.nav li:not(:first-child) {
padding-right: 0px;
padding-left: 8px;
}
.rtl, .rtl li {
Expand Down
147 changes: 145 additions & 2 deletions gramps/plugins/webreport/media.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Gramps - a GTK+/GNOME based genealogy program
#
Expand Down Expand Up @@ -53,8 +52,11 @@
# Gramps module
# ------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.lib import Date, Media
from gramps.gen.lib import Date, Media, Note, NoteType, Name
from gramps.gen.display.name import displayer as _nd
from gramps.gen.display.place import displayer as _pd
from gramps.gen.plug.report import Bibliography
from gramps.gen.utils.db import get_referents
from gramps.gen.utils.file import media_path_full
from gramps.gen.utils.thumbnails import run_thumbnailer
from gramps.gen.utils.image import image_size
Expand Down Expand Up @@ -677,6 +679,147 @@ def mediapage(self, report, the_lang, the_title, media_handle, info):
)
table += trow

def show_referent(mref, header):
for mlist in mref.get_media_list():
note_list = mlist.get_note_list()
with Html("div", class_="subsection narrative") as section:
section += Html("h5", header, inline=True)
with Html("ol") as listn:
section += listn
for notehandle in note_list:
note = self.r_db.get_note_from_handle(notehandle)
note_text = self.get_note_format(note, True)
note_text = note.text
listn += Html("li", note_text)
return section

# get media reference notes
note = Note()
note.set_type(NoteType.MEDIAREF)
mediaref = self._(note.get_type().xml_str())

# add section title
mediadetail += Html("h4", mediaref, inline=True)

idx = 0
for referents in "Person", "Family", "Event", "Place", "Source", "Citation":
refs = get_referents(media.handle, self.r_db, (referents,))
message = ""
if referents == "Person":
for refl in refs:
if not refl:
continue
for ref in refl:
idx += 1
mref = self.r_db.get_person_from_handle(ref)
name_format = self.report.options["name_format"]
primary_name = mref.get_primary_name()
nname = Name(primary_name)
nname.set_display_as(name_format)
surname = _nd.display_name(nname)
message = self._(
"%(idx)s - for people: %(people)s"
% {"people": surname, "idx": str(idx)}
)
result = show_referent(mref, message)
if result:
mediadetail += result
elif referents == "Family":
for refl in refs:
if not refl:
continue
for ref in refl:
idx += 1
mref = self.r_db.get_family_from_handle(ref)
family = self.report.get_family_name(mref)
message = self._(
"%(idx)s - for family: %(family)s"
% {"family": family, "idx": str(idx)}
)
result = show_referent(mref, message)
if result:
mediadetail += result
elif referents == "Event":
for refl in refs:
if not refl:
continue
for ref in refl:
idx += 1
mref = self.r_db.get_event_from_handle(ref)
event = self._(mref.get_type().xml_str())
ref_name = ""
for reference in self.r_db.find_backlink_handles(ref):
ref_class, ref_handle = reference
if ref_class == "Person":
person = self.r_db.get_person_from_handle(
ref_handle
)
ref_name = self.report.get_person_name(person)
elif ref_class == "Family":
family = self.r_db.get_family_from_handle(
ref_handle
)
ref_name = self.report.get_family_name(family)
message = self._(
"%(idx)s - for event: %(event)s: %(name)s"
% {"event": event, "name": ref_name, "idx": str(idx)}
)
result = show_referent(mref, message)
if result:
mediadetail += result
elif referents == "Place":
for refl in refs:
if not refl:
continue
for ref in refl:
idx += 1
mref = self.r_db.get_place_from_handle(ref)
p_name = _pd.display(self.r_db, mref, fmt=0)
message = self._(
"%(idx)s - for place: %(place)s"
% {"place": p_name, "idx": str(idx)}
)
result = show_referent(mref, message)
if result:
mediadetail += result
elif referents == "Source":
for refl in refs:
if not refl:
continue
for ref in refl:
idx += 1
mref = self.r_db.get_source_from_handle(ref)
s_name = mref.get_title()
message = self._(
"%(idx)s - for source: %(source)s"
% {"source": s_name, "idx": str(idx)}
)
result = show_referent(mref, message)
if result:
mediadetail += result
else:
for refl in refs:
if not refl:
continue
for ref in refl:
idx += 1
mref = self.r_db.get_citation_from_handle(ref)
c_name = mref.get_page()
s_handle = mref.get_reference_handle()
srce = self.r_db.get_source_from_handle(s_handle)
s_name = srce.get_title()
message = self._(
"%(idx)s - for citation: %(citation)s from %(source)s"
% {
"citation": c_name,
"source": s_name,
"idx": str(idx),
}
)
result = show_referent(mref, message)
if result:
mediadetail += result

# get media notes
notelist = self.display_note_list(media.get_note_list(), Media)
if notelist is not None:
Expand Down