Exemple #1
0
def translation_title(result):
  return '%s - %s (%s %s)' % (
    xget(result, 'text'),
    _('Interpretation of'),
    xget(result, 'aya.sura_name'),
    xget(result, 'aya.aya_id'),
  )
Exemple #2
0
def translation_title(result):
    return '%s - %s (%s %s)' % (
        xget(result, 'text'),
        _('Interpretation of'),
        xget(result, 'aya.sura_name'),
        xget(result, 'aya.aya_id'),
    )
Exemple #3
0
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')),
        ]))
Exemple #4
0
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)
Exemple #5
0
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)
Exemple #6
0
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))
Exemple #7
0
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))
Exemple #8
0
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)
Exemple #9
0
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)),
  }
Exemple #10
0
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)
Exemple #11
0
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)),
    }
Exemple #12
0
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)),
  }
Exemple #13
0
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)),
    }
Exemple #14
0
def linkedin_title(result):
    return '%s %s' % (
        xget(result, 'identifier.sura_name', 'aya.sura_name'),
        xget(result, 'aya.id', 'aya.aya_id'),
    )
Exemple #15
0
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)),
  }
Exemple #16
0
def linkedin_title(result):
  return '%s %s' % (
    xget(result, 'identifier.sura_name', 'aya.sura_name'),
    xget(result, 'aya.id', 'aya.aya_id'),
  )
Exemple #17
0
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')),
  ]))
Exemple #18
0
def aya_title(result):
  return '%s - (%s,%s)' % (
    xget(result, 'aya.text_no_highlight'),
    xget(result, 'identifier.sura_arabic_name'),
    xget(result, 'aya.id'),
  )
Exemple #19
0
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)),
    }
Exemple #20
0
def aya_title(result):
    return '%s - (%s,%s)' % (
        xget(result, 'aya.text_no_highlight'),
        xget(result, 'identifier.sura_arabic_name'),
        xget(result, 'aya.id'),
    )