From a1f3400990cda39659965683c8778f305b098111 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 4 Jan 2017 03:24:41 +0000 Subject: [PATCH] stop decorating an octet stream in code file view --- codepot/src/codepot/views/code_file.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index e3c05e09..2821b2dc 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -11,12 +11,15 @@ $is_special_stream = FALSE; if (array_key_exists('properties', $file) && count($file['properties']) > 0) { + $octet_stream = TRUE; foreach ($file['properties'] as $pn => $pv) { if ($pn == 'svn:mime-type') { if ($pv == 'application/octet-stream') { + $octet_stream = TRUE; + $lower_fileext = strtolower($fileext); if (in_array ($lower_fileext, array ('png', 'jpg', 'jpeg', 'gif', 'tif', 'bmp', 'ico'))) { @@ -58,6 +61,7 @@ } } } + if ($octet_stream) $is_special_stream = TRUE; } ?> @@ -904,12 +908,15 @@ if ($login['settings'] != NULL && print ''; - print '
'; - print '
LOC
'; - /* TODO: show this if it's enabled in the user settings */ - $graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$hex_headpath}{$revreq}"); - print ""; - print '
'; + if (!$is_special_stream) + { + print '
'; + print '
LOC
'; + /* TODO: show this if it's enabled in the user settings */ + $graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$hex_headpath}{$revreq}"); + print ""; + print '
'; + } } ?>