doortts doortts 2017-04-20
code: Show text file line ending type in code browser
@af80f86d502ae3fea343873823ae4f09a6a01a9f
app/views/code/partial_view_file.scala.html
--- app/views/code/partial_view_file.scala.html
+++ app/views/code/partial_view_file.scala.html
@@ -11,12 +11,19 @@
 @import utils.TemplateHelper.CodeBrowser._
 @import java.net.URLEncoder
 @import utils.Markdown
+@import utils.LineEnding
 
 @getRevIdString(revId:String) = @{
     if(project.vcs.equalsIgnoreCase("git")) {
         branchItemName(branch)
     } else {
         revId
+    }
+}
+
+@getLineEndingtype() = @{
+    if(!files.get("isBinary").booleanValue()){
+        LineEnding.findLineEnding(fieldText(files, "data"))
     }
 }
 
@@ -53,6 +60,7 @@
                 </a>
             </span>
             <span id="commitMessage" class="commitMsg">@fieldText(files,"commitMessage")</span>
+            <span>@getLineEndingtype</span>
         </div>
         <div class="pull-right">
             @if(!files.get("isBinary").booleanValue()){
Add a comment
List