Repository: LMFDB/lmfdb

Issue:
display issue on small screens
@alinabucur and @brianconrey reported the same issue (see screenshot), when displaying q-exp on their MacBooks, I believe Brian was using Safari.

This is also somewhat recreatable on the phone.

<img width="1248" alt="Screen Shot 2019-03-18 at 2 19 46 PM" src="https://user-images.githubusercontent.com/322822/54790664-42c4f280-4c0d-11e9-8c86-faff3c067ee9.png">



Discussion:
This is reproducible on Firefox even on a largish screen (e.g. 1920x1440).  It would be useful to know whether this is Firefox specific or not.  As far as I can tell it is fine on Chrome and Safari.

I don't see an easy way to fix this.

Resolving patch:
diff --git a/lmfdb/classical_modular_forms/main.py b/lmfdb/classical_modular_forms/main.py
--- a/lmfdb/classical_modular_forms/main.py
+++ b/lmfdb/classical_modular_forms/main.py
@@ -702,6 +702,8 @@ def newform_parse(info, query):
     parse_noop(info, query, 'atkin_lehner_string')
     parse_ints(info, query, 'fricke_eigenval')
     parse_bool(info, query, 'is_self_dual')
+    parse_ints(info, query, 'hecke_ring_index')
+    parse_ints(info, query, 'hecke_ring_generator_nbound')
     parse_noop(info, query, 'projective_image', func=str.upper)
     parse_noop(info, query, 'projective_image_type')
     parse_ints(info, query, 'artin_degree', name="Artin degree")
diff --git a/lmfdb/higher_genus_w_automorphisms/main.py b/lmfdb/higher_genus_w_automorphisms/main.py
--- a/lmfdb/higher_genus_w_automorphisms/main.py
+++ b/lmfdb/higher_genus_w_automorphisms/main.py
@@ -22,6 +22,7 @@
 family_label_regex = re.compile(r'(\d+)\.(\d+-\d+)\.(\d+\.\d+-?[^\.]*$)')
 passport_label_regex = re.compile(r'((\d+)\.(\d+-\d+)\.(\d+\.\d+.*))\.(\d+)')
 cc_label_regex = re.compile(r'((\d+)\.(\d+-\d+)\.(\d+)\.(\d+.*))\.(\d+)')
+hgcwa_group = re.compile(r'\[(\d+),(\d+)\]')
 
 def label_is_one_family(lab):
     return family_label_regex.match(lab)
@@ -53,7 +54,11 @@ def tfTOyn(bool):
     else:
         return "No"
 
+# Convert [4,1] to 4.1, then  apply sg_pretty
+def group_display(strg):
+    return sg_pretty(re.sub(hgcwa_group, r'\1.\2', strg))
 
+    
 def sign_display(L):
     sizeL = len(L)
     if sizeL == 1:
@@ -169,7 +174,6 @@ def groups_per_genus(genus):
     groups = group_stats['counts']
 
     # Create isomorphism classes
-    hgcwa_group = re.compile(r'\[(\d+),(\d+)\]')
     iso_classes = []
 
     for group in groups:
@@ -358,11 +362,11 @@ def higher_genus_w_automorphisms_search(info, query):
         parse_bracketed_posints(info,query,'signature',split=False,name='Signature',keepbrackets=True)
         if query.get('signature'):
             query['signature'] = info['signature'] = str(sort_sign(ast.literal_eval(query['signature']))).replace(' ','')
-    parse_gap_id(info,query,'group',name='Group',qfield='group')
-    parse_ints(info,query,'g0',name='Quotient Genus')
-    parse_ints(info,query,'genus',name='Genus')
-    parse_ints(info,query,'dim',name='Dimension of the family')
-    parse_ints(info,query,'group_order', name='Group orders')
+    parse_gap_id(info,query,'group',qfield='group')
+    parse_ints(info,query,'g0')
+    parse_ints(info,query,'genus')
+    parse_ints(info,query,'dim')
+    parse_ints(info,query,'group_order')
     if 'inc_hyper' in info:
         if info['inc_hyper'] == 'exclude':
             query['hyperelliptic'] = False
@@ -379,11 +383,37 @@ def higher_genus_w_automorphisms_search(info, query):
         elif info['inc_full'] == 'only':
             query['full_auto'] = {'$exists': False}
     query['cc.1'] = 1
-
     
-    info['group_display'] = sg_pretty
+    info['group_display'] = group_display
     info['sign_display'] = sign_display
 
+    if 'sort_order' in info:
+        
+        if info['sort_order'] == '':   
+            query['__sort__'] = ['genus', 'group_order', 'g0','dim']
+        elif info['sort_order'] == 'genus':
+            query['__sort__'] = ['genus', 'group_order', 'g0', 'dim']
+        elif info['sort_order'] == 'descgenus':
+            query['__sort__'] = [('genus',-1), 'group_order', 'g0', 'dim']    
+        elif info['sort_order'] == 'g0':
+            query['__sort__'] = ['g0', 'genus', 'group_order', 'dim']
+        elif info['sort_order'] == 'descg0':
+            query['__sort__'] = [('g0',-1), 'genus', 'group_order', 'dim']
+        elif info.get('sort_order') == 'dim':
+            query['__sort__'] = ['dim', 'genus', 'group_order', 'g0']
+        elif info.get('sort_order') == 'descdim':
+            query['__sort__'] = [('dim',-1), 'genus', 'group_order', 'g0']
+        elif info.get('sort_order') == 'group_order':
+            query['__sort__'] = ['group_order', 'genus', 'g0', 'dim']
+        elif info.get('sort_order') == 'descgroup_order':
+            query['__sort__'] = [('group_order',-1), 'genus', 'g0', 'dim']
+            
+
+    else:
+        query['__sort__'] = ['genus', 'group_order',  'g0', 'dim']
+
+
+
 def render_family(args):
     info = {}
     if 'label' in args:
@@ -615,11 +645,11 @@ def render_passport(args):
 
 
         if Lfriends:
-           for Lf in Lfriends:
-              friends = [("Full automorphism " + Lf, Lf),("Family containing this refined passport ",  urlstrng) ]
+            friends = [("Full automorphism " + Lf, Lf) for Lf in Lfriends]
+            friends += [("Family containing this refined passport ",  urlstrng)]
 
         else:
-            friends = [("Family containing this refined passport",  urlstrng) ]
+            friends = [("Family containing this refined passport",  urlstrng)]
 
 
         bread_sign = label_to_breadcrumbs(br_sign)


Test patch: