def translation_title(result): return '%s - %s (%s %s)' % ( xget(result, 'text'), _('Interpretation of'), xget(result, 'aya.sura_name'), xget(result, 'aya.aya_id'), )
def ar_aya_query(context, result_content): fields = xget(context, 'bidi.fields') return build_query( context['params'], SortedDict([ (fields['sura_arabic'], quotes(xget(result_content, 'identifier.sura_arabic_name'))), (fields['aya_id'], xget(result_content, 'aya.id')), ]))
def og_title(context): params = xget(context, 'params') unit = xget(context, 'current.unit') parts = [] if 'query' in params: parts.extend((query_for_title(params['query']), '-')) parts.append(TITLE_SUFFIX[unit].encode('UTF-8')) return ' '.join(parts)
def page_title(context): params = xget(context, 'params') unit = xget(context, 'current.unit') parts = [] if 'query' in params: parts.extend((query_for_title(params['query']), '-')) parts.extend((TITLE_SUFFIX[unit].encode('UTF-8'), '-', _("Alfanous").encode('UTF-8'))) return escape(' '.join(parts))
def page_title(context): params = xget(context, 'params') unit = xget(context, 'current.unit') parts = [] if 'query' in params: parts.extend((query_for_title(params['query']), '-')) parts.extend(( TITLE_SUFFIX[unit].encode('UTF-8'), '-', _("Alfanous").encode('UTF-8') )) return escape(' '.join(parts))
def meta_description(context): params = xget(context, 'params') unit = xget(context, 'current.unit') if 'query' in params: description = get_search_description(params, unit) elif unit == 'word': description = _('Alfanous has the feautre to search in the Quran words, their properties and occurences') elif unit == 'translation': description = _('Alfanous has the feautre to search in the translations of Quran meanings to lot of world languages') else: description = _( 'Alfanous is a functional, dynamic, comprehensive Qur\'an search engine ' 'that has been effectively designed to carry out simple or advanced ' 'Quranic searches.' ) return escape(description)
def linkedin_share(context, result, path, params): unit = xget(context, 'current.unit') return SHARE_PATTERNS['linkedin'] % { 'title': encodeURLComponent(linkedin_title(result)), 'summary': encodeURLComponent(title[unit](result)), 'url': encodeURLComponent(get_share_url(path, params)), }
def facebook_share(context, result, path, params): unit = xget(context, 'current.unit') return SHARE_PATTERNS['facebook'] % { # TODO: We should use OG tags for share title & images. 'title': encodeURLComponent(title[unit](result)), 'url': encodeURLComponent(get_share_url(path, params)), }
def linkedin_title(result): return '%s %s' % ( xget(result, 'identifier.sura_name', 'aya.sura_name'), xget(result, 'aya.id', 'aya.aya_id'), )
def twitter_share(context, result, path, params): unit = xget(context, 'current.unit') return SHARE_PATTERNS['twitter'] % { 'title': encodeURLComponent(title[unit](result)), 'url': encodeURLComponent(get_share_url(path, params)), }
def ar_aya_query(context, result_content): fields = xget(context, 'bidi.fields') return build_query(context['params'], SortedDict([ (fields['sura_arabic'], quotes(xget(result_content, 'identifier.sura_arabic_name'))), (fields['aya_id'], xget(result_content, 'aya.id')), ]))
def aya_title(result): return '%s - (%s,%s)' % ( xget(result, 'aya.text_no_highlight'), xget(result, 'identifier.sura_arabic_name'), xget(result, 'aya.id'), )