git » git-arr » commit c648cfb

views: Improve display on mobile browsers

author Alberto Bertogli
2015-11-18 00:05:13 UTC
committer Alberto Bertogli
2015-11-18 00:29:34 UTC
parent cacf2ee2cc9f291e5759b854126d25216ee01cd4

views: Improve display on mobile browsers

This patch moves the pages to HTML5, and adds some simple meta tags and CSS media
constraints so things render better on mobile browsers, while leaving the
desktop unaffected.

It's still not ideal, though.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

static/git-arr.css +9 -4
views/blob.html +3 -3
views/branch.html +3 -3
views/commit.html +3 -3
views/index.html +4 -4
views/summary.html +3 -3
views/tree.html +3 -3

diff --git a/static/git-arr.css b/static/git-arr.css
index 4e0c7ad..2a0f7c1 100644
--- a/static/git-arr.css
+++ b/static/git-arr.css
@@ -69,8 +69,11 @@ table.commits td.date {
     font-style: italic;
     color: gray;
 }
-table.commits td.subject {
-    min-width: 32em;
+
+@media (min-width: 600px) {
+    table.commits td.subject {
+        min-width: 32em;
+    }
 }
 table.commits td.author {
     color: gray;
@@ -146,8 +149,10 @@ div.paginate span.inactive {
 }
 
 /* Directory listing. */
-table.ls td.name {
-    min-width: 20em;
+@media (min-width: 600px) {
+    table.ls td.name {
+        min-width: 20em;
+    }
 }
 table.ls tr.blob td.size {
     color: gray;
diff --git a/views/blob.html b/views/blob.html
index 5e5b960..470808e 100644
--- a/views/blob.html
+++ b/views/blob.html
@@ -1,6 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
 
 % if not dirname.raw:
@@ -17,6 +16,7 @@
 <link rel="stylesheet" type="text/css"
     href="{{relroot}}../../../../../static/syntax.css"/>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<meta name=viewport content="width=device-width, initial-scale=1">
 </head>
 
 <body class="tree">
diff --git a/views/branch.html b/views/branch.html
index 0ca6834..799d040 100644
--- a/views/branch.html
+++ b/views/branch.html
@@ -1,6 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
 
 % relroot = '../' * (len(branch.split('/')) - 1)
@@ -8,6 +7,7 @@
 <title>git &raquo; {{repo.name}} &raquo; {{branch}}</title>
 <link rel="stylesheet" type="text/css" href="{{relroot}}../../../../static/git-arr.css"/>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<meta name=viewport content="width=device-width, initial-scale=1">
 </head>
 
 <body class="branch">
diff --git a/views/commit.html b/views/commit.html
index 1ddc4d8..e21ff04 100644
--- a/views/commit.html
+++ b/views/commit.html
@@ -1,11 +1,11 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
 <title>git &raquo; {{repo.name}} &raquo; commit {{c.id[:7]}}</title>
 <link rel="stylesheet" type="text/css" href="../../../../static/git-arr.css"/>
 <link rel="stylesheet" type="text/css" href="../../../../static/syntax.css"/>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<meta name=viewport content="width=device-width, initial-scale=1">
 </head>
 
 <body class="commit">
diff --git a/views/index.html b/views/index.html
index 7967a7c..c2a5bb8 100644
--- a/views/index.html
+++ b/views/index.html
@@ -1,11 +1,11 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
 <title>git</title>
 <link rel="stylesheet" type="text/css" href="static/git-arr.css"/>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
-<script src="static/git-arr.js"></script>
+<meta name=viewport content="width=device-width, initial-scale=1">
+<script async src="static/git-arr.js"></script>
 </head>
 
 <body class="index" onload="replace_timestamps()">
diff --git a/views/summary.html b/views/summary.html
index c05cca7..5038ef5 100644
--- a/views/summary.html
+++ b/views/summary.html
@@ -1,10 +1,10 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
 <title>git &raquo; {{repo.name}}</title>
 <link rel="stylesheet" type="text/css" href="../../static/git-arr.css"/>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<meta name=viewport content="width=device-width, initial-scale=1">
 </head>
 
 <body class="summary">
diff --git a/views/tree.html b/views/tree.html
index c705b18..12c21b0 100644
--- a/views/tree.html
+++ b/views/tree.html
@@ -1,6 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
 
 % if not dirname.raw:
@@ -15,6 +14,7 @@
 <link rel="stylesheet" type="text/css"
     href="{{relroot}}../../../../../static/git-arr.css"/>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<meta name=viewport content="width=device-width, initial-scale=1">
 </head>
 
 <body class="tree">