List sort by number for citation confidence level (#583)

* Fix confidence level sort in list views

-based on the date-sort code.

Fixes #10506

* Fix confidence level tooltip

-Stop run on text.

Resolves #10506
This commit is contained in:
Sam Manzi 2018-03-22 15:40:53 +11:00 committed by GitHub
parent 0d1aef889e
commit f1e28c1e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View File

@ -199,10 +199,10 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Conveys the submitter's quantitative evaluation of the credibility of a piece of information, based upon its supporting evidence. It is not intended to eliminate the receiver's need to evaluate the evidence for themselves.
Very Low =Unreliable evidence or estimated data
Low =Questionable reliability of evidence (interviews, census, oral genealogies, or potential for bias for example, an autobiography)
High =Secondary evidence, data officially recorded sometime after event
Very High =Direct and primary evidence used, or by dominance of the evidence </property>
/Very Low =Unreliable evidence or estimated data.
/Low =Questionable reliability of evidence (interviews, census, oral genealogies, or potential for bias for example, an autobiography).
/High =Secondary evidence, data officially recorded sometime after event.
/Very High =Direct and primary evidence used, or by dominance of the evidence.</property>
<property name="hexpand">True</property>
<property name="model">confidence_model</property>
<child>

View File

@ -114,6 +114,11 @@ class CitationBaseModel:
def citation_page(self, data):
return data[COLUMN_PAGE]
def citation_sort_confidence(self, data):
if data[COLUMN_CONFIDENCE]:
return str(data[COLUMN_CONFIDENCE])
return ''
def citation_confidence(self, data):
return _(conf_strings[data[COLUMN_CONFIDENCE]])

View File

@ -81,7 +81,7 @@ class CitationListModel(CitationBaseModel, FlatBaseModel):
self.citation_page,
self.citation_id,
self.citation_sort_date,
self.citation_confidence,
self.citation_sort_confidence,
self.citation_private,
self.citation_tags,
self.citation_sort_change,

View File

@ -147,7 +147,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.citation_page,
self.citation_id,
self.citation_sort_date,
self.citation_confidence,
self.citation_sort_confidence,
self.citation_private,
self.citation_tags,
self.citation_sort_change,