Browse Source

comletely remove v1 UI files of Gogs

Unknwon 9 years ago
parent
commit
2e30b421b4

+ 0 - 82
config.codekit

@@ -86,15 +86,6 @@
 		"randomFootnoteNumbers": 0,
 		"useCompatibilityMode": 0
 		},
-	"\/public\/css\/bootstrap.min.css": {
-		"fileType": 16,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"inputAbbreviatedPath": "\/public\/css\/bootstrap.min.css",
-		"outputAbbreviatedPath": "No Output Path",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0
-		},
 	"\/public\/css\/dropzone.css": {
 		"fileType": 16,
 		"ignore": 0,
@@ -158,15 +149,6 @@
 		"outputPathIsOutsideProject": 0,
 		"outputPathIsSetByUser": 0
 		},
-	"\/public\/css\/markdown.css": {
-		"fileType": 16,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"inputAbbreviatedPath": "\/public\/css\/markdown.css",
-		"outputAbbreviatedPath": "No Output Path",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0
-		},
 	"\/public\/css\/semantic.min.css": {
 		"fileType": 16,
 		"ignore": 0,
@@ -187,15 +169,6 @@
 		"outputPathIsSetByUser": 0,
 		"processed": 0
 		},
-	"\/public\/css\/todc-bootstrap.min.css": {
-		"fileType": 16,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"inputAbbreviatedPath": "\/public\/css\/todc-bootstrap.min.css",
-		"outputAbbreviatedPath": "No Output Path",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0
-		},
 	"\/public\/img\/404.png": {
 		"fileType": 32768,
 		"ignore": 0,
@@ -229,61 +202,6 @@
 		"outputPathIsSetByUser": 0,
 		"processed": 1
 		},
-	"\/public\/img\/bootstrap-colorpicker\/alpha-horizontal.png": {
-		"fileType": 32768,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"initialSize": 3635,
-		"inputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/alpha-horizontal.png",
-		"outputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/alpha-horizontal.png",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0,
-		"processed": 0
-		},
-	"\/public\/img\/bootstrap-colorpicker\/alpha.png": {
-		"fileType": 32768,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"initialSize": 3271,
-		"inputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/alpha.png",
-		"outputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/alpha.png",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0,
-		"processed": 0
-		},
-	"\/public\/img\/bootstrap-colorpicker\/hue-horizontal.png": {
-		"fileType": 32768,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"initialSize": 2837,
-		"inputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/hue-horizontal.png",
-		"outputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/hue-horizontal.png",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0,
-		"processed": 0
-		},
-	"\/public\/img\/bootstrap-colorpicker\/hue.png": {
-		"fileType": 32768,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"initialSize": 2972,
-		"inputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/hue.png",
-		"outputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/hue.png",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0,
-		"processed": 0
-		},
-	"\/public\/img\/bootstrap-colorpicker\/saturation.png": {
-		"fileType": 32768,
-		"ignore": 0,
-		"ignoreWasSetByUser": 0,
-		"initialSize": 8817,
-		"inputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/saturation.png",
-		"outputAbbreviatedPath": "\/public\/img\/bootstrap-colorpicker\/saturation.png",
-		"outputPathIsOutsideProject": 0,
-		"outputPathIsSetByUser": 0,
-		"processed": 0
-		},
 	"\/public\/img\/checkmark.png": {
 		"fileType": 32768,
 		"ignore": 0,

File diff suppressed because it is too large
+ 0 - 0
public/css/bootstrap.css.map


File diff suppressed because it is too large
+ 0 - 6
public/css/bootstrap.min.css


+ 0 - 514
public/css/markdown.css

@@ -1,514 +0,0 @@
-.markdown {
-  overflow: hidden;
-  font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
-  font-size: 16px;
-  line-height: 1.6;
-  word-wrap: break-word;
-  padding: 0 2em 2em !important;
-}
-.markdown > *:first-child {
-  margin-top: 0 !important;
-}
-.markdown > *:last-child {
-  margin-bottom: 0 !important;
-}
-.markdown a:not([href]) {
-  color: inherit;
-  text-decoration: none;
-}
-.markdown .absent {
-  color: #c00;
-}
-.markdown .anchor {
-  position: absolute;
-  top: 0;
-  left: 0;
-  display: block;
-  padding-right: 6px;
-  padding-left: 30px;
-  margin-left: -30px;
-}
-.markdown .anchor:focus {
-  outline: none;
-}
-.markdown h1,
-.markdown h2,
-.markdown h3,
-.markdown h4,
-.markdown h5,
-.markdown h6 {
-  position: relative;
-  margin-top: 1em;
-  margin-bottom: 16px;
-  font-weight: bold;
-  line-height: 1.4;
-}
-.markdown h1 .octicon-link,
-.markdown h2 .octicon-link,
-.markdown h3 .octicon-link,
-.markdown h4 .octicon-link,
-.markdown h5 .octicon-link,
-.markdown h6 .octicon-link {
-  display: none;
-  color: #000;
-  vertical-align: middle;
-}
-.markdown h1:hover .anchor,
-.markdown h2:hover .anchor,
-.markdown h3:hover .anchor,
-.markdown h4:hover .anchor,
-.markdown h5:hover .anchor,
-.markdown h6:hover .anchor {
-  padding-left: 8px;
-  margin-left: -30px;
-  text-decoration: none;
-}
-.markdown h1:hover .anchor .octicon-link,
-.markdown h2:hover .anchor .octicon-link,
-.markdown h3:hover .anchor .octicon-link,
-.markdown h4:hover .anchor .octicon-link,
-.markdown h5:hover .anchor .octicon-link,
-.markdown h6:hover .anchor .octicon-link {
-  display: inline-block;
-}
-.markdown h1 tt,
-.markdown h1 code,
-.markdown h2 tt,
-.markdown h2 code,
-.markdown h3 tt,
-.markdown h3 code,
-.markdown h4 tt,
-.markdown h4 code,
-.markdown h5 tt,
-.markdown h5 code,
-.markdown h6 tt,
-.markdown h6 code {
-  font-size: inherit;
-}
-.markdown h1 {
-  padding-bottom: 0.3em;
-  font-size: 2.25em;
-  line-height: 1.2;
-  border-bottom: 1px solid #eee;
-}
-.markdown h1 .anchor {
-  line-height: 1;
-}
-.markdown h2 {
-  padding-bottom: 0.3em;
-  font-size: 1.75em;
-  line-height: 1.225;
-  border-bottom: 1px solid #eee;
-}
-.markdown h2 .anchor {
-  line-height: 1;
-}
-.markdown h3 {
-  font-size: 1.5em;
-  line-height: 1.43;
-}
-.markdown h3 .anchor {
-  line-height: 1.2;
-}
-.markdown h4 {
-  font-size: 1.25em;
-}
-.markdown h4 .anchor {
-  line-height: 1.2;
-}
-.markdown h5 {
-  font-size: 1em;
-}
-.markdown h5 .anchor {
-  line-height: 1.1;
-}
-.markdown h6 {
-  font-size: 1em;
-  color: #777;
-}
-.markdown h6 .anchor {
-  line-height: 1.1;
-}
-.markdown p,
-.markdown blockquote,
-.markdown ul,
-.markdown ol,
-.markdown dl,
-.markdown table,
-.markdown pre {
-  margin-top: 0;
-  margin-bottom: 16px;
-}
-.markdown hr {
-  height: 4px;
-  padding: 0;
-  margin: 16px 0;
-  background-color: #e7e7e7;
-  border: 0 none;
-}
-.markdown ul,
-.markdown ol {
-  padding-left: 2em;
-}
-.markdown ul.no-list,
-.markdown ol.no-list {
-  padding: 0;
-  list-style-type: none;
-}
-.markdown ul ul,
-.markdown ul ol,
-.markdown ol ol,
-.markdown ol ul {
-  margin-top: 0;
-  margin-bottom: 0;
-}
-.markdown ol ol,
-.markdown ul ol {
-  list-style-type: lower-roman;
-}
-.markdown li > p {
-  margin-top: 16px;
-}
-.markdown dl {
-  padding: 0;
-}
-.markdown dl dt {
-  padding: 0;
-  margin-top: 16px;
-  font-size: 1em;
-  font-style: italic;
-  font-weight: bold;
-}
-.markdown dl dd {
-  padding: 0 16px;
-  margin-bottom: 16px;
-}
-.markdown blockquote {
-  padding: 0 15px;
-  color: #777;
-  border-left: 4px solid #ddd;
-}
-.markdown blockquote > :first-child {
-  margin-top: 0;
-}
-.markdown blockquote > :last-child {
-  margin-bottom: 0;
-}
-.markdown table {
-  display: block;
-  width: 100%;
-  overflow: auto;
-  word-break: normal;
-  word-break: keep-all;
-}
-.markdown table th {
-  font-weight: bold;
-}
-.markdown table th,
-.markdown table td {
-  padding: 6px 13px !important;
-  border: 1px solid #ddd;
-}
-.markdown table tr {
-  background-color: #fff;
-  border-top: 1px solid #ccc;
-}
-.markdown table tr:nth-child(2n) {
-  background-color: #f8f8f8;
-}
-.markdown img {
-  max-width: 100%;
-  box-sizing: border-box;
-}
-.markdown .emoji {
-  max-width: none;
-}
-.markdown span.frame {
-  display: block;
-  overflow: hidden;
-}
-.markdown span.frame > span {
-  display: block;
-  float: left;
-  width: auto;
-  padding: 7px;
-  margin: 13px 0 0;
-  overflow: hidden;
-  border: 1px solid #ddd;
-}
-.markdown span.frame span img {
-  display: block;
-  float: left;
-}
-.markdown span.frame span span {
-  display: block;
-  padding: 5px 0 0;
-  clear: both;
-  color: #333;
-}
-.markdown span.align-center {
-  display: block;
-  overflow: hidden;
-  clear: both;
-}
-.markdown span.align-center > span {
-  display: block;
-  margin: 13px auto 0;
-  overflow: hidden;
-  text-align: center;
-}
-.markdown span.align-center span img {
-  margin: 0 auto;
-  text-align: center;
-}
-.markdown span.align-right {
-  display: block;
-  overflow: hidden;
-  clear: both;
-}
-.markdown span.align-right > span {
-  display: block;
-  margin: 13px 0 0;
-  overflow: hidden;
-  text-align: right;
-}
-.markdown span.align-right span img {
-  margin: 0;
-  text-align: right;
-}
-.markdown span.float-left {
-  display: block;
-  float: left;
-  margin-right: 13px;
-  overflow: hidden;
-}
-.markdown span.float-left span {
-  margin: 13px 0 0;
-}
-.markdown span.float-right {
-  display: block;
-  float: right;
-  margin-left: 13px;
-  overflow: hidden;
-}
-.markdown span.float-right > span {
-  display: block;
-  margin: 13px auto 0;
-  overflow: hidden;
-  text-align: right;
-}
-.markdown code,
-.markdown tt {
-  padding: 0;
-  padding-top: 0.2em;
-  padding-bottom: 0.2em;
-  margin: 0;
-  font-size: 85%;
-  background-color: rgba(0, 0, 0, 0.04);
-  border-radius: 3px;
-}
-.markdown code:before,
-.markdown code:after,
-.markdown tt:before,
-.markdown tt:after {
-  letter-spacing: -0.2em;
-  content: "\00a0";
-}
-.markdown code br,
-.markdown tt br {
-  display: none;
-}
-.markdown del code {
-  text-decoration: inherit;
-}
-.markdown pre > code {
-  padding: 0;
-  margin: 0;
-  font-size: 100%;
-  word-break: normal;
-  white-space: pre;
-  background: transparent;
-  border: 0;
-}
-.markdown .highlight {
-  margin-bottom: 16px;
-}
-.markdown .highlight pre,
-.markdown pre {
-  padding: 16px;
-  overflow: auto;
-  font-size: 85%;
-  line-height: 1.45;
-  background-color: #f7f7f7;
-  border-radius: 3px;
-}
-.markdown .highlight pre {
-  margin-bottom: 0;
-  word-break: normal;
-}
-.markdown pre {
-  word-wrap: normal;
-}
-.markdown pre code,
-.markdown pre tt {
-  display: inline;
-  max-width: initial;
-  padding: 0;
-  margin: 0;
-  overflow: initial;
-  line-height: inherit;
-  word-wrap: normal;
-  background-color: transparent;
-  border: 0;
-}
-.markdown pre code:before,
-.markdown pre code:after,
-.markdown pre tt:before,
-.markdown pre tt:after {
-  content: normal;
-}
-.markdown kbd {
-  display: inline-block;
-  padding: 3px 5px;
-  font-size: 11px;
-  line-height: 10px;
-  color: #555;
-  vertical-align: middle;
-  background-color: #fcfcfc;
-  border: solid 1px #ccc;
-  border-bottom-color: #bbb;
-  border-radius: 3px;
-  box-shadow: inset 0 -1px 0 #bbbbbb;
-}
-.markdown .csv-data td,
-.markdown .csv-data th {
-  padding: 5px;
-  overflow: hidden;
-  font-size: 12px;
-  line-height: 1;
-  text-align: left;
-  white-space: nowrap;
-}
-.markdown .csv-data .blob-num {
-  padding: 10px 8px 9px;
-  text-align: right;
-  background: #fff;
-  border: 0;
-}
-.markdown .csv-data tr {
-  border-top: 0;
-}
-.markdown .csv-data th {
-  font-weight: bold;
-  background: #f8f8f8;
-  border-top: 0;
-}
-/* Author: jmblog */
-/* Project: https://github.com/jmblog/color-themes-for-google-code-prettify */
-/* GitHub Theme */
-/* Pretty printing styles. Used with prettify.js. */
-/* SPAN elements with the classes below are added by prettyprint. */
-/* plain text */
-.pln {
-  color: #333333;
-}
-@media screen {
-  /* string content */
-  .str {
-    color: #dd1144;
-  }
-  /* a keyword */
-  .kwd {
-    color: #333333;
-  }
-  /* a comment */
-  .com {
-    color: #999988;
-    font-style: italic;
-  }
-  /* a type name */
-  .typ {
-    color: #445588;
-  }
-  /* a literal value */
-  .lit {
-    color: #445588;
-  }
-  /* punctuation */
-  .pun {
-    color: #333333;
-  }
-  /* lisp open bracket */
-  .opn {
-    color: #333333;
-  }
-  /* lisp close bracket */
-  .clo {
-    color: #333333;
-  }
-  /* a markup tag name */
-  .tag {
-    color: navy;
-  }
-  /* a markup attribute name */
-  .atn {
-    color: teal;
-  }
-  /* a markup attribute value */
-  .atv {
-    color: #dd1144;
-  }
-  /* a declaration */
-  .dec {
-    color: #333333;
-  }
-  /* a variable name */
-  .var {
-    color: teal;
-  }
-  /* a function name */
-  .fun {
-    color: #990000;
-  }
-}
-/* Use higher contrast and text-weight for printable form. */
-@media print, projection {
-  .str {
-    color: #006600;
-  }
-  .kwd {
-    color: #006;
-    font-weight: bold;
-  }
-  .com {
-    color: #600;
-    font-style: italic;
-  }
-  .typ {
-    color: #404;
-    font-weight: bold;
-  }
-  .lit {
-    color: #004444;
-  }
-  .pun,
-  .opn,
-  .clo {
-    color: #444400;
-  }
-  .tag {
-    color: #006;
-    font-weight: bold;
-  }
-  .atn {
-    color: #440044;
-  }
-  .atv {
-    color: #006600;
-  }
-}
-/* Specify class=linenums on a pre to get line numbering */
-ol.linenums {
-  margin-top: 0;
-  margin-bottom: 0;
-}

File diff suppressed because it is too large
+ 0 - 0
public/css/todc-bootstrap.css.map


File diff suppressed because it is too large
+ 0 - 6
public/css/todc-bootstrap.min.css


BIN
public/img/bootstrap-colorpicker/alpha-horizontal.png


BIN
public/img/bootstrap-colorpicker/alpha.png


BIN
public/img/bootstrap-colorpicker/hue-horizontal.png


BIN
public/img/bootstrap-colorpicker/hue.png


BIN
public/img/bootstrap-colorpicker/saturation.png


+ 0 - 1188
public/js/app.js

@@ -1,1188 +0,0 @@
-var Gogits = {};
-
-(function ($) {
-    // extend jQuery ajax, set csrf token value
-    var ajax = $.ajax;
-    $.extend({
-        ajax: function (url, options) {
-            if (typeof url === 'object') {
-                options = url;
-                url = undefined;
-            }
-            options = options || {};
-            url = options.url;
-            var csrftoken = $('meta[name=_csrf]').attr('content');
-            var headers = options.headers || {};
-            var domain = document.domain.replace(/\./ig, '\\.');
-            if (!/^(http:|https:).*/.test(url) || eval('/^(http:|https:)\\/\\/(.+\\.)*' + domain + '.*/').test(url)) {
-                headers = $.extend(headers, {'X-Csrf-Token': csrftoken});
-            }
-            options.headers = headers;
-            var callback = options.success;
-            options.success = function (data) {
-                if (data.once) {
-                    // change all _once value if ajax data.once exist
-                    $('[name=_once]').val(data.once);
-                }
-                if (callback) {
-                    callback.apply(this, arguments);
-                }
-            };
-            return ajax(url, options);
-        },
-
-        changeHash: function (hash) {
-            if (history.pushState) {
-                history.pushState(null, null, hash);
-            }
-            else {
-                location.hash = hash;
-            }
-        },
-
-        deSelect: function () {
-            if (window.getSelection) {
-                window.getSelection().removeAllRanges();
-            } else {
-                document.selection.empty();
-            }
-        }
-    });
-    $.fn.extend({
-        toggleHide: function () {
-            $(this).addClass("hidden");
-        },
-        toggleShow: function () {
-            $(this).removeClass("hidden");
-        },
-        toggleAjax: function (successCallback, errorCallback) {
-            var url = $(this).data("ajax");
-            var method = $(this).data('ajax-method') || 'get';
-            var ajaxName = $(this).data('ajax-name');
-            var data = {};
-
-            if (ajaxName.endsWith("preview")) {
-                data["mode"] = "gfm";
-                data["context"] = $(this).data('ajax-context');
-            }
-
-            $('[data-ajax-rel=' + ajaxName + ']').each(function () {
-                var field = $(this).data("ajax-field");
-                var t = $(this).data("ajax-val");
-                if (t == "val") {
-                    data[field] = $(this).val();
-                    return true;
-                }
-                if (t == "txt") {
-                    data[field] = $(this).text();
-                    return true;
-                }
-                if (t == "html") {
-                    data[field] = $(this).html();
-                    return true;
-                }
-                if (t == "data") {
-                    data[field] = $(this).data("ajax-data");
-                    return true;
-                }
-                return true;
-            });
-            console.log("toggleAjax:", method, url, data);
-            $.ajax({
-                url: url,
-                method: method.toUpperCase(),
-                data: data,
-                error: errorCallback,
-                success: function (d) {
-                    if (successCallback) {
-                        successCallback(d);
-                    }
-                }
-            })
-        }
-    })
-}(jQuery));
-
-(function ($) {
-
-    Gogits.showTab = function (selector, index) {
-        if (!index) {
-            index = 0;
-        }
-        $(selector).tab("show");
-        $(selector).find("li:eq(" + index + ") a").tab("show");
-    };
-    Gogits.validateForm = function (selector, options) {
-        var $form = $(selector);
-        options = options || {};
-        options.showErrors = function (map, list) {
-            var $error = $form.find('.form-error').addClass('hidden');
-            $('.has-error').removeClass("has-error");
-            $error.text(list[0].message).show().removeClass("hidden");
-            $(list[0].element).parents(".form-group").addClass("has-error");
-        };
-        $form.validate(options);
-    };
-
-    // ----- init elements
-    Gogits.initModals = function () {
-        var modals = $("[data-toggle=modal]");
-        if (modals.length < 1) {
-            return;
-        }
-        $.each(modals, function (i, item) {
-            var hide = $(item).data('modal');
-            $(item).modal(hide ? hide : "hide");
-        });
-    };
-    Gogits.initTooltips = function () {
-        $("body").tooltip({
-            selector: "[data-toggle=tooltip]"
-            //container: "body"
-        });
-    };
-    Gogits.initPopovers = function () {
-        var hideAllPopovers = function () {
-            $('[data-toggle=popover]').each(function () {
-                $(this).popover('hide');
-            });
-        };
-
-        $(document).on('click', function (e) {
-            var $e = $(e.target);
-            if ($e.data('toggle') == 'popover' || $e.parents("[data-toggle=popover], .popover").length > 0) {
-                return;
-            }
-            hideAllPopovers();
-        });
-
-        $("body").popover({
-            selector: "[data-toggle=popover]"
-        });
-    };
-    Gogits.initTabs = function () {
-        var $tabs = $('[data-init=tabs]');
-        $tabs.tab("show");
-        $tabs.find("li:eq(0) a").tab("show");
-    };
-
-    // fix dropdown inside click
-    Gogits.initDropDown = function () {
-        $('.dropdown-menu.no-propagation').on('click', function (e) {
-            e.stopPropagation();
-        });
-    };
-
-
-    // render markdown
-    Gogits.renderMarkdown = function () {
-        var $md = $('.markdown');
-        var $pre = $md.find('pre > code').parent();
-        $pre.addClass('prettyprint linenums');
-        prettyPrint();
-
-        // Set anchor.
-        var headers = {};
-        $md.find('h1, h2, h3, h4, h5, h6').each(function () {
-            var node = $(this);
-            var val = encodeURIComponent(node.text().toLowerCase().replace(/[^\w\- ]/g, '').replace(/[ ]/g, '-'));
-            var name = val;
-            if (headers[val] > 0) {
-                name = val + '-' + headers[val];
-            }
-            if (headers[val] == undefined) {
-                headers[val] = 1;
-            } else {
-                headers[val] += 1;
-            }
-            node = node.wrap('<div id="' + name + '" class="anchor-wrap" ></div>');
-            node.append('<a class="anchor" href="#' + name + '"><span class="octicon octicon-link"></span></a>');
-        });
-    };
-
-    // render code view
-    Gogits.renderCodeView = function () {
-        function selectRange($list, $select, $from) {
-            $list.removeClass('active');
-            if ($from) {
-                var a = parseInt($select.attr('rel').substr(1));
-                var b = parseInt($from.attr('rel').substr(1));
-                var c;
-                if (a != b) {
-                    if (a > b) {
-                        c = a;
-                        a = b;
-                        b = c;
-                    }
-                    var classes = [];
-                    for (i = a; i <= b; i++) {
-                        classes.push('.L' + i);
-                    }
-                    $list.filter(classes.join(',')).addClass('active');
-                    $.changeHash('#L' + a + '-' + 'L' + b);
-                    return
-                }
-            }
-            $select.addClass('active');
-            $.changeHash('#' + $select.attr('rel'));
-        }
-
-        $(document).on('click', '.lines-num span', function (e) {
-            var $select = $(this);
-            var $list = $select.parent().siblings('.lines-code').find('ol.linenums > li');
-            selectRange($list, $list.filter('[rel=' + $select.attr('rel') + ']'), (e.shiftKey ? $list.filter('.active').eq(0) : null));
-            $.deSelect();
-        });
-
-        $('.code-view .lines-code > pre').each(function () {
-            var $pre = $(this);
-            var $lineCode = $pre.parent();
-            var $lineNums = $lineCode.siblings('.lines-num');
-            if ($lineNums.length > 0) {
-                var nums = $pre.find('ol.linenums > li').length;
-                for (var i = 1; i <= nums; i++) {
-                    $lineNums.append('<span id="L' + i + '" rel="L' + i + '">' + i + '</span>');
-                }
-            }
-        });
-
-        $(window).on('hashchange', function (e) {
-            var m = window.location.hash.match(/^#(L\d+)\-(L\d+)$/);
-            var $list = $('.code-view ol.linenums > li');
-            if (m) {
-                var $first = $list.filter('.' + m[1]);
-                selectRange($list, $first, $list.filter('.' + m[2]));
-                $("html, body").scrollTop($first.offset().top - 200);
-                return;
-            }
-            m = window.location.hash.match(/^#(L\d+)$/);
-            if (m) {
-                var $first = $list.filter('.' + m[1]);
-                selectRange($list, $first);
-                $("html, body").scrollTop($first.offset().top - 200);
-            }
-        }).trigger('hashchange');
-    };
-
-    // copy utils
-    Gogits.bindCopy = function (selector) {
-        if ($(selector).hasClass('js-copy-bind')) {
-            return;
-        }
-
-        if ( document.documentElement.classList.contains("is-copy-enabled") ) {
-
-            $(selector).click(function(event) {
-                var $this = $(this);
-
-                var cfrom = $this.attr('data-copy-from');
-                $(cfrom).select();
-                document.execCommand('copy');
-                getSelection().removeAllRanges();
-
-                $this.tipsy("hide").attr('original-title', $this.data('after-title'));
-                setTimeout(function () {
-                    $this.tipsy("show");
-                }, 200);
-                setTimeout(function () {
-                    $this.tipsy('hide').attr('original-title', $this.data('original-title'));
-                }, 2000);
-                
-                this.blur();
-                return;
-            });
-
-            $(selector).addClass("js-copy-bind");
-
-        } else {
-
-            $(selector).zclip({
-                path: Gogits.AppSubUrl + "/js/ZeroClipboard.swf",
-                copy: function () {
-                    var t = $(this).data("copy-val");
-                    var to = $($(this).data("copy-from"));
-                    var str = "";
-                    if (t == "txt") {
-                        str = to.text();
-                    }
-                    if (t == 'val') {
-                        str = to.val();
-                    }
-                    if (t == 'html') {
-                        str = to.html();
-                    }
-                    return str;
-                },
-                afterCopy: function () {
-                    var $this = $(this);
-                    $this.tipsy("hide").attr('original-title', $this.data('after-title'));
-                    setTimeout(function () {
-                        $this.tipsy("show");
-                    }, 200);
-                    setTimeout(function () {
-                        $this.tipsy('hide').attr('original-title', $this.data('original-title'));
-                    }, 2000);
-                }
-            }).addClass("js-copy-bind");
-        }
-    }
-
-    // api working
-    Gogits.getUsers = function (val, $target) {
-        var notEmpty = function (str) {
-          return str && str.length > 0;
-        }
-        $.ajax({
-            url: '/api/v1/users/search?q=' + val,
-            dataType: "json",
-            success: function (json) {
-                if (json.ok && json.data.length) {
-                    var html = '';
-                    $.each(json.data, function (i, item) {
-                        html += '<li><img src="' + item.avatar + '">' + item.username;
-                        if (notEmpty(item.full_name)) {
-                          html += ' (' + item.full_name + ')';
-                        }
-                        html += '</li>';
-                    });
-                    $target.toggleShow();
-                    $target.find('ul').html(html);
-                } else {
-                    $target.toggleHide();
-                }
-            }
-        });
-    }
-
-})(jQuery);
-
-// ajax utils
-(function ($) {
-    Gogits.ajaxDelete = function (url, data, success) {
-        data = data || {};
-        data._method = "DELETE";
-        $.ajax({
-            url: url,
-            data: data,
-            method: "POST",
-            dataType: "json",
-            success: function (json) {
-                if (success) {
-                    success(json);
-                }
-            }
-        })
-    }
-})(jQuery);
-
-
-function initCore() {
-    Gogits.initTooltips();
-    Gogits.initPopovers();
-    Gogits.initTabs();
-    Gogits.initModals();
-    Gogits.initDropDown();
-    Gogits.renderMarkdown();
-    Gogits.renderCodeView();
-}
-
-function initUserSetting() {
-    // ssh confirmation
-    $('#ssh-keys .delete').confirmation({
-        singleton: true,
-        onConfirm: function (e, $this) {
-            Gogits.ajaxDelete("", {"id": $this.data("del")}, function (json) {
-                if (json.ok) {
-                    window.location.reload();
-                } else {
-                    alert(json.err);
-                }
-            });
-        }
-    });
-
-    // profile form
-    (function () {
-        $('#user-setting-username').on("keyup", function () {
-            var $this = $(this);
-            if ($this.val() != $this.attr('title')) {
-                $this.next('.help-block').toggleShow();
-            } else {
-                $this.next('.help-block').toggleHide();
-            }
-        });
-    }())
-}
-
-function initRepository() {
-    // clone group button script
-    (function () {
-        var $clone = $('.clone-group-btn');
-        if ($clone.length) {
-            var $url = $('.clone-group-url');
-            $clone.find('button[data-link]').on("click", function (e) {
-                var $this = $(this);
-                if (!$this.hasClass('btn-primary')) {
-                    $clone.find('.input-group-btn .btn-primary').removeClass('btn-primary').addClass("btn-default");
-                    $(this).addClass('btn-primary').removeClass('btn-default');
-                    $url.val($this.data("link"));
-                    $clone.find('span.clone-url').text($this.data('link'));
-                }
-            }).eq(0).trigger("click");
-            $("#repo-clone").on("shown.bs.dropdown", function () {
-                Gogits.bindCopy("[data-init=copy]");
-            });
-            Gogits.bindCopy("[data-init=copy]:visible");
-        }
-    })();
-
-    // watching script
-    (function () {
-        var $watch = $('#repo-watching'),
-        	watchLink = $watch.attr("data-watch"),
-            // Use $.attr() to work around jQuery not finding $.data("unwatch") in Firefox,
-            // which has a method "unwatch" on `Object` that gets returned instead.
-            unwatchLink = $watch.attr("data-unwatch");
-        $watch.on('click', '.to-watch', function () {
-            if ($watch.hasClass("watching")) {
-                return false;
-            }
-            $.get(watchLink, function (json) {
-                if (json.ok) {
-                    $watch.find('.text-primary').removeClass('text-primary');
-                    $watch.find('.to-watch h4').addClass('text-primary');
-                    $watch.find('.fa-eye-slash').removeClass('fa-eye-slash').addClass('fa-eye');
-                    $watch.removeClass("no-watching").addClass("watching");
-                }
-            });
-            return false;
-        }).on('click', '.to-unwatch', function () {
-            if ($watch.hasClass("no-watching")) {
-                return false;
-            }
-            $.get(unwatchLink, function (json) {
-                if (json.ok) {
-                    $watch.find('.text-primary').removeClass('text-primary');
-                    $watch.find('.to-unwatch h4').addClass('text-primary');
-                    $watch.find('.fa-eye').removeClass('fa-eye').addClass('fa-eye-slash');
-                    $watch.removeClass("watching").addClass("no-watching");
-                }
-            });
-            return false;
-        });
-    })();
-
-    // repo diff counter
-    (function () {
-        var $counter = $('.diff-counter');
-        if ($counter.length < 1) {
-            return;
-        }
-        $counter.each(function (i, item) {
-            var $item = $(item);
-            var addLine = $item.find('span[data-line].add').data("line");
-            var delLine = $item.find('span[data-line].del').data("line");
-            var addPercent = parseFloat(addLine) / (parseFloat(addLine) + parseFloat(delLine)) * 100;
-            $item.find(".bar .add").css("width", addPercent + "%");
-        });
-    }());
-
-    // repo setting form
-    (function () {
-        $('#repo-setting-name').on("keyup", function () {
-            var $this = $(this);
-            if ($this.val() != $this.attr('title')) {
-                $this.next('.help-block').toggleShow();
-            } else {
-                $this.next('.help-block').toggleHide();
-            }
-        });
-    }())
-}
-
-function initInstall() {
-    // database type change
-    (function () {
-        var mysql_default = '127.0.0.1:3306';
-        var postgres_default = '127.0.0.1:5432';
-
-        $('#install-database').on("change", function () {
-            var val = $(this).val();
-            if (val != "SQLite3") {
-                $('.server-sql').show();
-                $('.sqlite-setting').addClass("hide");
-                if (val == "PostgreSQL") {
-                    $('.pgsql-setting').removeClass("hide");
-
-                    // Change the host value to the Postgres default, but only
-                    // if the user hasn't already changed it from the MySQL
-                    // default.
-                    if ($('#database-host').val() == mysql_default) {
-                        $('#database-host').val(postgres_default);
-                    }
-                } else if (val == 'MySQL') {
-                    $('.pgsql-setting').addClass("hide");
-                    if ($('#database-host').val() == postgres_default) {
-                        $('#database-host').val(mysql_default);
-                    }
-                } else {
-                    $('.pgsql-setting').addClass("hide");
-                }
-            } else {
-                $('.server-sql').hide();
-                $('.sqlite-setting').removeClass("hide");
-            }
-        });
-    }());
-
-}
-
-function initIssue() {
-    // close button
-    (function () {
-        var $closeBtn = $('#issue-close-btn');
-        var $openBtn = $('#issue-open-btn');
-        $('#issue-reply-content').on("keyup", function () {
-            if ($(this).val().length) {
-                $closeBtn.val($closeBtn.data("text"));
-                $openBtn.val($openBtn.data("text"));
-            } else {
-                $closeBtn.val($closeBtn.data("origin"));
-                $openBtn.val($openBtn.data("origin"));
-            }
-        });
-    }());
-
-    // store unsend text in session storage.
-    (function() {
-        var $textArea = $("#issue-content,#issue-reply-content");
-        var current = "";
-
-        if ($textArea == null || !('sessionStorage' in window)) {
-            return;
-        }
-
-        var path = location.pathname.split("/");
-        var key = "issue-" + path[1] + "-" + path[2] + "-";
-
-        if (/\/issues\/\d+$/.test(location.pathname)) {
-            key = key + path[4];
-        } else {
-            key = key + "new";
-        }
-
-        if ($textArea.val() !== undefined && $textArea.val() !== "") {
-            sessionStorage.setItem(key, $textArea.val());
-        } else {
-            $textArea.val(sessionStorage.getItem(key) || "");
-
-            if ($textArea.attr("id") == "issue-reply-content") {
-                var $closeBtn = $('#issue-close-btn');
-                var $openBtn = $('#issue-open-btn');
-
-                if ($textArea.val().length) {
-                    $closeBtn.val($closeBtn.data("text"));
-                    $openBtn.val($openBtn.data("text"));
-                } else {
-                    $closeBtn.val($closeBtn.data("origin"));
-                    $openBtn.val($openBtn.data("origin"));
-                }
-            }
-        }
-
-        $textArea.on("keyup", function() {
-            if ($textArea.val() !== current) {
-                sessionStorage.setItem(key, current = $textArea.val());
-            }
-        });
-    }());
-
-    // Preview for images.
-    (function() {
-        var $hoverElement = $("<div></div>");
-        var $hoverImage = $("<img />");
-
-        $hoverElement.addClass("attachment-preview");
-        $hoverElement.hide();
-
-        $hoverImage.addClass("attachment-preview-img");
-
-        $hoverElement.append($hoverImage);
-        $(document.body).append($hoverElement);
-
-        var over = function() {
-            var $this = $(this);
-
-            if ((/\.(png|jpg|jpeg|gif)$/i).test($this.text()) == false) {
-                return;
-            }
-
-            if ($hoverImage.attr("src") != $this.attr("href")) {
-                $hoverImage.attr("src", $this.attr("href"));
-                $hoverImage.load(function() {
-                    var height = this.height;
-                    var width = this.width;
-
-                    if (height > 300) {
-                        var factor = 300 / height;
-
-                        height = factor * height;
-                        width = factor * width;
-                    }
-
-                    $hoverImage.css({"height": height, "width": width});
-
-                    var offset = $this.offset();
-                    var left = offset.left, top = offset.top + $this.height() + 5;
-
-                    $hoverElement.css({"top": top + "px", "left": left + "px"});
-                    $hoverElement.css({"height": height + 16, "width": width + 16});
-                    $hoverElement.show();
-                });
-            } else {
-                $hoverElement.show();
-            }
-        };
-
-        var out = function() {
-            $hoverElement.hide();
-        };
-
-        $(".issue-main .attachments .attachment").hover(over, out);
-    }());
-
-    // Upload.
-    (function() {
-        var $attachedList = $("#attached-list");
-        var $addButton    = $("#attachments-button");
-        var files         = [];
-        var fileInput     = document.getElementById("attachments-input");
-
-        if (fileInput === null) {
-            return;
-        }
-
-        $attachedList.on("click", "span.attachment-remove", function(event) {
-            var $parent = $(this).parent();
-
-            files.splice($parent.data("index"), 1);
-            $parent.remove();
-        });
-
-        var clickedButton;
-
-        $('input[type="submit"],input[type="button"],button.btn-success', fileInput.form).on('click', function() {
-            clickedButton = this;
-
-            var $button = $(this);
-
-            $button.removeClass("btn-success btn-default");
-            $button.addClass("btn-warning");
-
-            $button.html("Submitting&hellip;");
-        });
-
-        fileInput.form.addEventListener("submit", function(event) {
-            event.stopImmediatePropagation();
-            event.preventDefault();
-
-            //var data = new FormData(this);
-
-            // Internet Explorer ... -_-
-            var data = new FormData();
-
-            $.each($("[name]", this), function(i, e) {
-                if (e.name == "attachments" || e.type == "submit") {
-                    return;
-                }
-
-                data.append(e.name, $(e).val());
-            });
-
-            data.append(clickedButton.name, $(clickedButton).val());
-
-            files.forEach(function(file) {
-                data.append("attachments", file);
-            });
-
-            var xhr = new XMLHttpRequest();
-
-            xhr.addEventListener("error", function() {
-                console.log("Issue submit request failed. xhr.status: " + xhr.status);
-            });
-
-            xhr.addEventListener("load", function() {
-                var response = xhr.response;
-
-                if (typeof response == "string") {
-                    try {
-                        response = JSON.parse(response);
-                    } catch (err) {
-                        response = { ok: false, error: "Could not parse JSON" };
-                    }
-                }
-
-                if (response.ok === false) {
-                    $("#submit-error").text(response.error);
-                    $("#submit-error").show();
-
-                    var $button = $(clickedButton);
-
-                    $button.removeClass("btn-warning");
-                    $button.addClass("btn-danger");
-
-                    $button.text("An error occurred!");
-
-                    return;
-                }
-
-                if (!('sessionStorage' in window)) {
-                    return;
-                }
-
-                var path = location.pathname.split("/");
-                var key = "issue-" + path[1] + "-" + path[2] + "-";
-
-                if (/\/issues\/\d+$/.test(location.pathname)) {
-                    key = key + path[4];
-                } else {
-                    key = key + "new";
-                }
-
-                sessionStorage.removeItem(key);
-                window.location.href = response.data;
-            });
-
-            xhr.open("POST", this.action, true);
-            xhr.send(data);
-
-            return false;
-        });
-
-        fileInput.addEventListener("change", function() {
-            for (var index = 0; index < fileInput.files.length; index++) {
-                var file = fileInput.files[index];
-
-                if (files.indexOf(file) > -1) {
-                    continue;
-                }
-
-                var $span = $("<span></span>");
-
-                $span.addClass("label");
-                $span.addClass("label-default");
-
-                $span.data("index", files.length);
-
-                $span.append(file.name);
-                $span.append(" <span class=\"attachment-remove fa fa-times-circle\"></span>");
-
-                $attachedList.append($span);
-
-                files.push(file);
-            }
-
-            this.value = "";
-        });
-
-        $addButton.on("click", function(evt) {
-            fileInput.click();
-            evt.preventDefault();
-        });
-    }());
-
-    // issue edit mode
-    (function () {
-        $("#issue-edit-btn").on("click", function () {
-            $('#issue h1.title,#issue .issue-main > .issue-content .content,#issue-edit-btn').toggleHide();
-            $('#issue-edit-title,.issue-edit-content,.issue-edit-cancel,.issue-edit-save').toggleShow();
-            $('#issue-edit-content').focus();
-        });
-        $('.issue-edit-cancel').on("click", function () {
-            $('#issue h1.title,#issue .issue-main > .issue-content .content,#issue-edit-btn').toggleShow();
-            $('#issue-edit-title,.issue-edit-content,.issue-edit-cancel,.issue-edit-save').toggleHide();
-        });
-    }());
-
-    // issue ajax update
-    (function () {
-        var $cnt = $('#issue-edit-content');
-        $('.issue-edit-save').on("click", function () {
-            $cnt.attr('data-ajax-rel', 'issue-edit-save');
-            $(this).toggleAjax(function (json) {
-                if (json.ok) {
-                    $('.issue-head h1.title').text(json.title);
-                    $('.issue-main > .issue-content .content').html(json.content);
-                    $('.issue-edit-cancel').trigger("click");
-                }
-            });
-            setTimeout(function () {
-                $cnt.attr('data-ajax-rel', 'issue-edit-preview');
-            }, 200)
-        });
-    }());
-
-    // issue ajax preview
-    (function () {
-        $('[data-ajax-name=issue-preview],[data-ajax-name=issue-edit-preview]').on("click", function () {
-            var $this = $(this);
-            $this.toggleAjax(function (resp) {
-                $($this.data("preview")).html(resp);
-            }, function () {
-                $($this.data("preview")).html("no content");
-            })
-        });
-        $('.issue-write a[data-toggle]').on("click", function () {
-            var selector = $(this).parent().next(".issue-preview").find('a').data('preview');
-            $(selector).html("loading...");
-        });
-    }());
-
-    // assignee
-    var is_issue_bar = $('.issue-bar').length > 0;
-    var $a = $('.assignee');
-    if ($a.data("assigned") > 0) {
-        $('.clear-assignee').toggleShow();
-    }
-    $('.assignee', '#issue').on('click', 'li', function () {
-        var uid = $(this).data("uid");
-        if (is_issue_bar) {
-            var assignee = $a.data("assigned");
-            if (uid != assignee) {
-                var text = $(this).text();
-                var img = $("img", this).attr("src");
-
-                $.post($a.data("ajax"), {
-                    issue: $('#issue').data("id"),
-                    assigneeid: uid
-                }, function (json) {
-                    if (json.ok) {
-                        //window.location.reload();
-                        $a.data("assigned", uid);
-
-                        if (uid > 0) {
-                            $('.clear-assignee').toggleShow();
-                            $(".assignee > p").html('<img src="' + img + '"><strong>' + text + '</strong>');
-                        } else {
-                            $('.clear-assignee').toggleHide();
-                            $(".assignee > p").text("No one assigned");
-                        }
-                    }
-                })
-            }
-
-            return;
-        }
-        $('#assignee').val(uid);
-        if (uid > 0) {
-            $('.clear-assignee').toggleShow();
-            $('#assigned').text($(this).find("strong").text())
-        } else {
-            $('.clear-assignee').toggleHide();
-            $('#assigned').text($('#assigned').data("no-assigned"));
-        }
-    });
-
-    // milestone
-
-    $('#issue .dropdown-menu a[data-toggle="tab"]').on("click", function (e) {
-        e.stopPropagation();
-        $(this).tab('show');
-        return false;
-    });
-
-    var $m = $('.milestone');
-    if ($m.data("milestone") > 0) {
-        $('.clear-milestone').toggleShow();
-    }
-    $('.milestone', '#issue').on('click', 'li.milestone-item', function () {
-        var id = $(this).data("id");
-        if (is_issue_bar) {
-            var m = $m.data("milestone");
-            if (id != m) {
-                var text = $(this).text();
-
-                $.post($m.data("ajax"), {
-                    issue: $('#issue').data("id"),
-                    milestoneid: id
-                }, function (json) {
-                    if (json.ok) {
-                        //window.location.reload();
-                        $m.data("milestone", id);
-
-                        if (id > 0) {
-                            $('.clear-milestone').toggleShow();
-                            $(".milestone > .name").html('<a href="' + location.pathname + '?milestone=' + id + '"><strong>' + text + '</strong></a>');
-                        } else {
-                            $('.clear-milestone').toggleHide();
-                            $(".milestone > .name").text("No milestone");
-                        }
-                    }
-                });
-            }
-
-            return;
-        }
-        $('#milestone-id').val(id);
-        if (id > 0) {
-            $('.clear-milestone').toggleShow();
-            $('#milestone').text($(this).find("strong").text())
-        } else {
-            $('.clear-milestone').toggleHide();
-            $('#milestone').text($('#milestone').data("no-milestone"));
-        }
-    });
-
-    // labels
-    var removeLabels = [];
-    $('#label-manage-btn').on("click", function () {
-        var $list = $('#label-list');
-        if ($list.hasClass("managing")) {
-            var ids = [];
-            $list.find('li').each(function (i, item) {
-                var id = $(item).data("id");
-                if (id > 0) {
-                    ids.push(id);
-                }
-            });
-            $.post($list.data("ajax"), {"ids": ids.join(","), "remove": removeLabels.join(",")}, function (json) {
-                if (json.ok) {
-                    window.location.reload();
-                }
-            })
-        } else {
-            $list.addClass("managing");
-            $list.find(".count").hide();
-            $list.find(".del").show();
-            $(this).text("Save Labels");
-            $list.on('click', 'li.label-item', function () {
-                var $this = $(this);
-                $this.after($('.label-change-li').detach().show());
-                $('#label-name-change-ipt').val($this.find('.name').text());
-                var color = $this.find('.color').data("color");
-                $('.label-change-color-picker').colorpicker("setValue", color);
-                $('#label-color-change-ipt,#label-color-change-ipt2').val(color);
-                $('#label-change-id-ipt').val($this.data("id"));
-                return false;
-            });
-        }
-    });
-    var colorRegex = new RegExp("^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$");
-    $('#label-color-ipt2').on('keyup', function () {
-        var val = $(this).val();
-        if (val.length > 7) {
-            $(this).val(val.substr(0, 7));
-        }
-        if (colorRegex.test(val)) {
-            $('.label-color-picker').colorpicker("setValue", val);
-        }
-        return true;
-    });
-    $('#label-color-change-ipt2').on('keyup', function () {
-        var val = $(this).val();
-        console.log(val);
-        if (val.length > 7) {
-            $(this).val(val.substr(0, 7));
-        }
-        if (colorRegex.test(val)) {
-            $('.label-change-color-picker').colorpicker("setValue", val);
-        }
-        return true;
-    });
-    $("#label-list").on('click', '.del', function () {
-        var $p = $(this).parent();
-        removeLabels.push($p.data('id'));
-        $p.remove();
-        return false;
-    });
-    $('.label-selected').each(function (i, item) {
-        var $item = $(item);
-        var color = $item.find('.color').data('color');
-        $item.css('background-color', color);
-    });
-
-    $('.issue-bar .labels .dropdown-menu').on('click', 'li', function (e) {
-        var $labels = $('.issue-bar .labels');
-        var url = $labels.data("ajax");
-        var id = $(this).data('id');
-        var check = $(this).hasClass("checked");
-        var item = this;
-        $.post(url, {id: id, action: check ? 'detach' : "attach", issue: $('#issue').data('id')}, function (json) {
-            if (json.ok) {
-                if (check) {
-                    $("span.check.pull-left", item).remove();
-
-                    $(item).removeClass("checked");
-                    $(item).addClass("no-checked");
-
-                    $("#label-" + id, $labels).remove();
-
-                    if ($labels.children(".label-item").length == 0) {
-                        $labels.append("<p>None yet</p>");
-                    }
-                } else {
-                    $(item).prepend('<span class="check pull-left"><i class="fa fa-check"></i></span>');
-
-                    $(item).removeClass("no-checked");
-                    $(item).addClass("checked");
-
-                    $("p:not([class])", $labels).remove();
-
-                    var $l = $("<p></p>");
-                    var c = $("span.color", item).css("background-color");
-
-                    $l.attr("id", "label-" + id);
-                    $l.attr("class", "label-item label-white");
-                    $l.css("background-color", c);
-
-                    $l.append("<strong>" + $(item).text() + "</strong>");
-                    $labels.append($l);
-                }
-            }
-        });
-        e.stopPropagation();
-        return false;
-    })
-}
-
-function initRelease() {
-// release new ajax preview
-    (function () {
-        $('[data-ajax-name=release-preview]').on("click", function () {
-            var $this = $(this);
-            $this.toggleAjax(function (resp) {
-                $($this.data("preview")).html(resp);
-            }, function () {
-                $($this.data("preview")).html("no content");
-            })
-        });
-        $('.release-write a[data-toggle]').on("click", function () {
-            $('.release-preview-content').html("loading...");
-        });
-    }());
-
-    // release new target selection
-    (function () {
-        $('#release-new-target-branch-list').on('click', 'a', function () {
-            $('#tag-target').val($(this).text());
-            $('#release-new-target-name').text(" " + $(this).text());
-        });
-    }());
-}
-
-function initRepoSetting() {
-    // repo member add
-    $('#repo-collaborator').on('keyup', function () {
-        var $this = $(this);
-        if (!$this.val()) {
-            $this.next().toggleHide();
-            return;
-        }
-        Gogits.getUsers($this.val(), $this.next());
-    }).on('focus', function () {
-        if (!$(this).val()) {
-            $(this).next().toggleHide();
-        }
-    }).next().on("click", 'li', function () {
-        $('#repo-collaborator').val($(this).text());
-    });
-}
-
-function initRepoCreating() {
-    // owner switch menu click
-    (function () {
-        $('#repo-owner-switch .dropdown-menu').on("click", "li", function () {
-            var uid = $(this).data('uid');
-            // set to input
-            $('#repo-owner-id').val(uid);
-            // set checked class
-            if (!$(this).hasClass("checked")) {
-                $(this).parent().find(".checked").removeClass("checked");
-                $(this).addClass("checked");
-            }
-            // set button group to show clicked owner
-            $('#repo-owner-avatar').attr("src", $(this).find('img').attr("src"));
-            $('#repo-owner-name').text($(this).text().trim());
-            console.log("set repo owner to uid :", uid, $(this).text().trim());
-        });
-    }());
-    console.log("init repo-creating scripts");
-}
-
-function initOrganization() {
-    (function(){
-        $('#org-team-add-user').on('keyup', function () {
-            var $this = $(this);
-            if (!$this.val()) {
-                $this.next().toggleHide();
-                return;
-            }
-            Gogits.getUsers($this.val(), $this.next());
-        }).on('focus', function () {
-            if (!$(this).val()) {
-                $(this).next().toggleHide();
-            }
-        }).next().on("click", 'li', function () {
-            $('#org-team-add-user').val($(this).text());
-            $('#org-team-add-user-form').submit();
-        }).toggleHide();
-        console.log("init script : add user to team");
-    }());
-
-    (function(){
-        $('#org-team-add-repo').next().toggleHide();
-        console.log("init script : add repository to team");
-    }());
-
-
-    console.log("init script : organization done");
-}
-
-function initTimeSwitch() {
-    $(".time-since[title]").on("click", function() {
-        var $this = $(this);
-
-        var title = $this.attr("title");
-        var text = $this.text();
-
-        $this.text(title);
-        $this.attr("title", text);
-    });
-}
-
-(function ($) {
-    $(function () {
-        initCore();
-        var body = $("#body");
-        if (body.data("page") == "user") {
-            initUserSetting();
-        }
-        if ($('.repo-nav').length) {
-            initRepository();
-        }
-        if ($('#install-card').length) {
-            initInstall();
-        }
-        if ($('#issue').length) {
-            initIssue();
-        }
-        if ($('#release').length) {
-            initRelease();
-        }
-        if ($('#repo-setting-container').length) {
-            initRepoSetting();
-        }
-        if ($('#repo-create').length) {
-            initRepoCreating();
-        }
-        if ($('#body-nav').hasClass("org-nav")) {
-            initOrganization();
-        }
-
-        initTimeSwitch();
-    });
-})(jQuery);
-
-String.prototype.endsWith = function (suffix) {
-    return this.indexOf(suffix, this.length - suffix.length) !== -1;
-};

File diff suppressed because it is too large
+ 0 - 5
public/js/bootstrap.min.js


File diff suppressed because it is too large
+ 0 - 291
public/js/lib.js


+ 0 - 2
templates/base/alert_old.tmpl

@@ -1,2 +0,0 @@
-{{if .Flash.ErrorMsg}}<div class="alert alert-danger form-error">{{.Flash.ErrorMsg}}</div>{{end}}
-{{if .Flash.SuccessMsg}}<div class="alert alert-success">{{.Flash.SuccessMsg}}</div>{{end}}

+ 0 - 34
templates/base/footer_old.tmpl

@@ -1,34 +0,0 @@
-<div class="wrapper-push"></div>
-</div>
-<footer id="footer">
-    <div class="container footer-wrap">
-    	<div class="row">
-	    	<div class="col-md-6">
-		        <p>© 2014 GoGits · Version: {{AppVer}} ·
-		            Page: <b>{{LoadTimes .PageStartTime}}</b> ·
-		            Template: <b>{{call .TmplLoadTimes}}</b>
-		        </p>
-	        </div>
-
-				{{if .ShowFooterBranding}}
-	    	<div class="col-md-2" style="margin: -5px;">
-		        <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github fa-2x"></i></a>
-	        </div>
-	        {{end}}
-
-	    	<div class="col-md-4">
-	        	<p class="desc">
-	        		<a href="http://gogs.io">Official Website</a>
-	        	</p>
-	        </div>
-    	</div>
-
-    	<div class="row">
-	    	<div class="col-md-6">
-    			Go Version: {{GoVer}}
-    		</div>
-    	</div>
-    </div>
-</footer>
-</body>
-</html>

+ 0 - 40
templates/base/head_old.tmpl

@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<html>
-	<head{{if AppSubUrl}} data-suburl="{{AppSubUrl}}"{{end}}>
-		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-		<link rel="shortcut icon" href="{{AppSubUrl}}/img/favicon.png" />
-        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
-        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
-        <meta name="author" content="Gogs - Go Git Service" />
-		<meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" />
-		<meta name="keywords" content="go, git">
-		<meta name="referrer" content="no-referrer" />
-		<meta name="_csrf" content="{{.CsrfToken}}" />
-		{{if .GoGetImport}}<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">{{end}}
-
-		 <!-- Stylesheets -->
-		{{if CdnMode}}
-		<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
-		<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
-
-		<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
-		<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
-		{{else}}
-		<link href="{{AppSubUrl}}/css/bootstrap.min.css" rel="stylesheet" />
-		<link href="{{AppSubUrl}}/css/font-awesome.min.css" rel="stylesheet" />
-
-		<script src="{{AppSubUrl}}/js/jquery-1.11.3.min.js"></script>
-		<script src="{{AppSubUrl}}/js/bootstrap.min.js"></script>
-		{{end}}
-
-		<link href="{{AppSubUrl}}/css/todc-bootstrap.min.css" rel="stylesheet" />
-		<link href="{{AppSubUrl}}/css/markdown.css" rel="stylesheet" />
-		<link href="{{AppSubUrl}}/css/gogs.css" rel="stylesheet" />
-
-        <script src="{{AppSubUrl}}/js/lib.js"></script>
-        <script src="{{AppSubUrl}}/js/app.js"></script>
-		<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
-	</head>
-	<body>
-		<div id="wrapper">
-		<noscript>Please enable JavaScript in your browser!</noscript>

+ 0 - 49
templates/base/navbar.tmpl

@@ -1,49 +0,0 @@
-<div class="masthead navbar" id="masthead">
-    <div class="container">
-        <nav class="nav">
-            <a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/"><img src="{{AppSubUrl}}/img/favicon.png" alt="Gogs Logo" id="logo"></a>
-            <a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="{{AppSubUrl}}/">Dashboard</a>
-            <a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="http://gogs.io/docs">Help</a>
-            {{if .IsSigned}}
-            {{if .HasAccess}}
-            <!-- <form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
-                <div class="input-group">
-                    <div class="input-group-btn">
-                        <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">{{if .Repository}}This Repository{{else}}All Repositories{{end}} <span class="caret"></span></button>
-                        <ul class="dropdown-menu">
-                            {{if .Repository}}
-                            <li><a href="#">This Repository</a></li>
-                            <li class="divider"></li>
-                            {{end}}
-                            <li><a href="#">All Repositories</a></li>
-                        </ul>
-                    </div>
-                    <input type="search" class="form-control input-sm" name="q" placeholder="search code, commits and issues"/>
-                </div>
-            </form> -->
-            {{end}}
-            <a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="{{AppSubUrl}}/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
-            <a id="nav-avatar" class="nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
-                <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
-            </a>
-            <a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="{{AppSubUrl}}/user/settings"  data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs fa-lg"></i></a>
-            {{if .IsAdmin}}
-            <a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="{{AppSubUrl}}/admin"  data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>
-            {{end}}
-            <div class="navbar-right nav-item pull-right{{if .PageIsNewRepo}} active{{end}}" id="nav-repo-new" data-toggle="tooltip" data-placement="bottom" title="New Repo">
-                <button type="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i></button>
-                <div class="dropdown-menu">
-                    <ul class="list-unstyled">
-                        <li><a href="{{AppSubUrl}}/repo/create"><i class="fa fa-book"></i>Repository</a></li>
-                        <li><a href="{{AppSubUrl}}/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
-                        <!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
-                    </ul>
-                </div>
-            </div>
-            {{else}}
-            <a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="{{AppSubUrl}}/user/login/" rel="nofollow">Sign In</a>
-            <a id="nav-signup" class="nav-item navbar-right" href="{{AppSubUrl}}/user/sign_up/" rel="nofollow">Sign Up</a>
-            {{end}}
-        </nav>
-    </div>
-</div>

+ 0 - 32
templates/org/new.tmpl

@@ -1,32 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container" id="body">
-    <form action="{{AppSubUrl}}/org/create" method="post" class="form-horizontal card" id="org-create">
-        {{.CsrfTokenHtml}}
-        <h3>Create New Organization</h3>
-        {{template "base/alert" .}}
-        <div class="form-group {{if .Err_OrgName}}has-error has-feedback{{end}}">
-            <label class="col-md-2 control-label">Organization<strong class="text-danger">*</strong></label>
-            <div class="col-md-8">
-                <input name="orgname" type="text" class="form-control" placeholder="Type your organization name" value="{{.orgname}}" required="required">
-                <span class="help-block">Great organization names are short and memorable. </span>
-            </div>
-        </div>
-
-        <div class="form-group{{if .Err_Email}} has-error has-feedback{{end}}">
-            <label class="col-md-2 control-label">Email<strong class="text-danger">*</strong></label>
-            <div class="col-md-8">
-                <input name="email" type="text" class="form-control" placeholder="Type organization's email" value="{{.email}}" required="required">
-                <span class="help-block">Organization's Email receives all notifications and confirmations.</span>
-            </div>
-        </div>
-
-        <div class="form-group">
-            <div class="col-md-offset-2 col-md-8">
-                <button type="submit" class="btn btn-lg btn-primary">Create An Organization</button>
-                <a href="{{AppSubUrl}}/" class="text-danger">Cancel</a>
-            </div>
-        </div>
-    </form>
-</div>
-{{template "base/footer" .}}

+ 0 - 42
templates/repo/branch.tmpl

@@ -1,42 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
-    <div id="source">
-        <div class="panel panel-default branch-box info-box">
-            <div class="panel-heading info-head">
-                <h4>Branches</h4>
-            </div>
-            <table class="panel-footer table branch-list table table-hover">
-                <thead>
-                <tr>
-                    <th class="name"></th>
-                    <th class="behind">Behind</th>
-                    <th class="ahead">Ahead</th>
-                    <th class="date">Last Commit</th>
-                    <th class="action"></th>
-                </tr>
-                </thead>
-                <tbody>
-                <tr class="branch-main">
-                    <td class="name" colspan="3">
-                        <a href="#"><strong>BranchName</strong></a>
-                        <button class="btn btn-primary btn-sm">base branch</button>
-                    </td>
-                    <td class="date">3 years ago</td>
-                    <td class="action"></td>
-                </tr>
-                <tr>
-                    <td class="name"><a href="#"><strong>BranchName</strong></a></td>
-                    <td class="behind">102 <span class="graph" style="width: 100%"></span></td>
-                    <td class="ahead"><span class="graph" style="width: 4%"></span>4</td>
-                    <td class="date">3 years ago</td>
-                    <td class="action"><a class="btn btn-info btn-sm" href="#">compare</a></td>
-                </tr>
-                </tbody>
-            </table>
-        </div>
-    </div>
-</div>
-{{template "base/footer" .}}

+ 0 - 126
templates/repo/issue/create.tmpl

@@ -1,126 +0,0 @@
-{{template "base/head_old" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
-    <div id="issue">
-        <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form" enctype="multipart/form-data">
-            {{.CsrfTokenHtml}}
-            {{template "base/alert" .}}
-            <div class="col-md-1">
-                <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/>
-            </div>
-            <div class="col-md-8 panel panel-default">
-                <div class="form-group panel-body">
-                    <input class="form-control input-lg" type="text" name="title" required="required" placeholder="Title" value="{{.title}}" autofocus />
-                </div>
-                <div class="form-group panel-body">
-                    {{if .IsRepositoryOwner}}
-                    <span><strong id="assigned" data-no-assigned="No one">No one</strong> will be assigned</span>
-                    <input type="hidden" name="assigneeid" value="0" id="assignee"/>&nbsp;&nbsp;
-                    <div style="display: inline-block;position: relative">
-                        <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
-                            <i class="fa fa-group"></i>
-                            <span class="caret"></span>
-                        </button>
-                        <div class="dropdown-menu assignee">
-                            <ul class="list-unstyled">
-                                <li data-uid="0" class="clear-assignee hidden"><i class="fa fa-times-circle-o"></i> Clear assignee</li>
-                                {{range .Collaborators}}
-                                <li data-uid="{{.Id}}"><img src="{{.AvatarLink}}"><strong>{{.Name}}</strong> {{.FullName}}</li>
-                                {{end}}
-                            </ul>
-                        </div>
-                    </div>
-                    <span><strong id="milestone" data-no-milestone="No milestone">No milestone</strong></span>
-                    <input type="hidden" name="milestoneid" value="0" id="milestone-id"/>
-                    <div style="display: inline-block;position: relative">
-                        <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
-                            <i class="fa fa-check-square-o"></i>
-                            <span class="caret"></span>
-                        </button>
-                        <div class="dropdown-menu milestone">
-                            <ul class="list-unstyled">
-                                <li data-id="0" class="clear-milestone milestone-item hidden"><i class="fa fa-times-circle-o"></i> Clear milestone </li>
-                                <li class="milestone-list">
-                                    <ul class="nav nav-tabs" data-init="tabs">
-                                        <li class="active"><a href="#milestone-open" data-toggle="tab">Open</a></li>
-                                        <li><a href="#milestone-close" data-toggle="tab">Closed</a></li>
-                                    </ul>
-                                    <div class="tab-content">
-                                        <div class="tab-pane active" id="milestone-open">
-                                            {{if not .OpenMilestones}}
-                                            <p class="milestone-item">Nothing to show</p>
-                                            {{else}}
-                                            <ul class="list-unstyled">
-                                                {{range .OpenMilestones}}
-                                                <li class="milestone-item" data-id="{{.ID}}">
-                                                    <p><strong>{{.Name}}</strong></p>
-                                                    <!-- <p>due to 3 days later</p> -->
-                                                </li>
-                                                {{end}}
-                                            </ul>
-                                            {{end}}
-                                        </div>
-
-                                        <div class="tab-pane" id="milestone-close">
-                                            {{if not .ClosedMilestones}}
-                                            <p class="milestone-item">Nothing to show</p>
-                                            {{else}}
-                                            <ul class="list-unstyled">
-                                                {{range .ClosedMilestones}}
-                                                <li class="milestone-item" data-id="{{.ID}}">
-                                                    <p><strong>{{.Name}}</strong></p>
-                                                    <p>Closed {{TimeSince .ClosedDate $.Lang}}</p>
-                                                </li>
-                                                {{end}}
-                                            </ul>
-                                            {{end}}
-                                        </div>
-                                    </div>
-                                </li>
-                            </ul>
-                        </div>
-                    </div>
-                </div>
-                {{end}}
-                <div class="form-group panel-body">
-                    <div class="md-help pull-right"><!-- todo help link -->
-                        Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
-                    </div>
-                    <ul class="nav nav-tabs" data-init="tabs">
-                        <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
-                        <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-preview" data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
-                    </ul>
-                    <div class="tab-content">
-                        <div class="tab-pane" id="issue-textarea">
-                            <div class="form-group">
-                                <div id="submit-error" class="text-danger"></div>
-                                <textarea class="form-control" name="content" id="issue-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
-                            </div>
-                        </div>
-                        <div class="tab-pane issue-preview-content" id="issue-preview">loading...</div>
-                    </div>
-                </div>
-                {{if .AttachmentsEnabled}}
-                <div id="attached">
-                    <div id="attached-list">
-                        <b>Attachments:</b>
-                    </div>
-                </div>
-                {{end}}
-                <div class="text-right panel-body">
-                    <div class="form-group">
-                        {{if .AttachmentsEnabled}}
-                        <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
-                        <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button>
-                        {{end}}
-                        <input type="hidden" value="id" name="repo-id"/>
-                        <button class="btn-success btn">Create new issue</button>
-                    </div>
-                </div>
-            </div>
-        </form>
-    </div>
-</div>
-{{template "base/footer_old" .}}

+ 0 - 284
templates/repo/issue/view_old.tmpl

@@ -1,284 +0,0 @@
-{{template "base/head_old" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
-    <div id="issue" data-id="{{.Issue.ID}}">
-        <div id="issue-{{.Issue.ID}}" class="issue-whole issue-is-opening">
-            <div class="issue-wrap col-md-10">
-                <div class="issue-head clearfix">
-                    <div class="number pull-right">#{{.Issue.Index}}</div>
-                    <a class="author pull-left" href="{{AppSubUrl}}/{{.Issue.Poster.Name}}"><img class="avatar" src="{{.Issue.Poster.AvatarLink}}" alt="" width="30"/></a>
-                    <h1 class="title pull-left">{{.Issue.Name}}</h1>
-                    <input id="issue-edit-title" class="form-control input-lg pull-left hidden" type="text" value="{{.Issue.Name}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="title"/>
-                    <input type="hidden" value="{{.Issue.ID}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/>
-                    <p class="info pull-left">
-                        {{if .IsIssueOwner}}<a class="btn btn-default pull-right issue-edit" href="#" id="issue-edit-btn">Edit</a>
-                        <a class="btn btn-danger pull-right issue-edit-cancel hidden" href="#">Cancel</a>
-                        <a class="btn btn-primary pull-right issue-edit-save hidden" href="#" data-ajax="{{.RepoLink}}/issues/{{.Issue.Index}}" data-ajax-name="issue-edit-save" data-ajax-method="post">Save</a>{{end}}
-                        <span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span>
-                        <a href="{{AppSubUrl}}/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue
-                        <span class="time">{{TimeSince .Issue.Created $.Lang}}</span> · {{.Issue.NumComments}} comments
-                    </p>
-                </div>
-                <div class="issue-main">
-                    <div class="panel panel-default issue-content">
-                        <div class="panel-body">
-                            <div class="content markdown">
-                                {{Str2html .Issue.RenderedContent}}
-                            </div>
-                            <div class="issue-edit-content hidden">
-                                <div class="form-group">
-                                    <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
-                                    </div>
-                                    <ul class="nav nav-tabs" data-init="tabs">
-                                        <li class="issue-write active"><a href="#issue-edit-textarea" data-toggle="tab">Write</a></li>
-                                        <li class="issue-preview"><a href="#issue-edit-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-edit-preview" data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-edit-preview">Preview</a></li>
-                                    </ul>
-                                    <div class="tab-content">
-                                        <div class="tab-pane active" id="issue-edit-textarea">
-                                            <div class="form-group">
-                                                <input type="hidden" value="1" name="issueIndex">
-                                                <textarea class="form-control" name="content" id="issue-edit-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-edit-preview" data-ajax-val="val" data-ajax-field="text">{{.Issue.Content}}</textarea>
-                                            </div>
-                                        </div>
-                                        <div class="tab-pane issue-preview-content" id="issue-edit-preview">Loading...</div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        {{with $attachments := .Issue.Attachments}}
-                        {{if $attachments}}
-                        <div class="attachments">
-                            <span class="attachment-label label label-info">Attachments:</span>
-
-                            {{range $attachments}}
-                            <a class="attachment label label-default" href="/attachments/{{.UUID}}">{{.Name}}</a>
-                            {{end}}
-                        </div>
-                        {{end}}
-                        {{end}}
-                    </div>
-                    {{range .Comments}}
-                    {{/* 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE, 4 = COMMIT, 5 = PULL */}}
-                    {{if eq .Type 0}}
-                    <div class="issue-child" id="issue-comment-{{.Id}}">
-                        <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
-                        <div class="issue-content panel panel-default">
-                            <div class="panel-heading">
-                                <a href="{{AppSubUrl}}/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created $.Lang}}</span>
-                                <!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a>
-                                <a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> -->
-                                {{if eq .Poster.Id $.Owner.Id}}
-                                <span class="role label label-default pull-right">Owner</span>
-                                {{end}}
-                            </div>
-                            <div class="panel-body markdown">
-                                {{if len .Content}}
-                                {{Str2html .Content}}
-                                {{else}}
-                                <i>No comment entered</i>
-                                {{end}}
-                            </div>
-                            {{with $attachments := .Attachments}}
-                            {{if $attachments}}
-                            <div class="attachments">
-                                <span class="attachment-label label label-info">Attachments:</span>
-
-                                {{range $attachments}}
-                                <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
-                                {{end}}
-                            </div>
-                            {{end}}
-                            {{end}}
-                        </div>
-                    </div>
-                    {{else if eq .Type 1}}
-                    <div class="issue-child issue-opened">
-                        <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a>
-                        <div class="issue-content">
-                            <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
-                        </div>
-                    </div>
-                    {{else if eq .Type 2}}
-                    <div class="issue-child issue-closed">
-                        <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
-                        <div class="issue-content">
-                            <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
-                        </div>
-                    </div>
-                    {{else if eq .Type 4}}
-                    <div class="issue-child issue-reference issue-reference-commit">
-                        <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
-                        <div class="issue-content">
-                            <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-primary">Referenced</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
-                            <p>
-                                <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
-                                {{.ContentHtml}}
-                            </p>
-                        </div>
-                    </div>
-                    {{end}}
-                    {{end}}
-                    <hr class="issue-line"/>
-                    {{if .SignedUser}}<div class="issue-child issue-reply">
-                    <a class="user pull-left" href="{{AppSubUrl}}/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a>
-                    <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post" enctype="multipart/form-data">
-                        {{.CsrfTokenHtml}}
-                        <div class="panel-body">
-                            <div class="form-group">
-                                <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
-                                </div>
-                                <ul class="nav nav-tabs" data-init="tabs">
-                                    <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
-                                    <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-preview"  data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
-                                </ul>
-                                <div class="tab-content">
-                                    <div class="tab-pane" id="issue-textarea">
-                                        <div class="form-group">
-                                            <div id="submit-error" class="text-danger"></div>
-                                            <input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/>
-                                            <textarea class="form-control" name="content" id="issue-reply-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
-                                        </div>
-                                    </div>
-                                    <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div>
-                                </div>
-                            </div>
-                            {{if .AttachmentsEnabled}}
-                            <!-- <div id="attached">
-                                <div id="attached-list">
-                                    <b>Attachments:</b>
-                                </div>
-                            </div> -->
-                            {{end}}
-                            <div class="text-right">
-                                <div class="form-group">
-                                    {{if .AttachmentsEnabled}}
-                                    <!-- <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
-                                    <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button> -->
-                                    {{end}}
-                                    {{if .IsIssueOwner}}{{if .Issue.IsClosed}}
-                                    <input type="submit" class="btn-default btn issue-open" id="issue-open-btn" data-origin="Reopen" data-text="Reopen & Comment" name="change_status" value="Reopen"/>{{else}}
-                                    <input type="submit" class="btn-default btn issue-close" id="issue-close-btn" data-origin="Close" data-text="Close & Comment" name="change_status" value="Close"/>{{end}}{{end}}&nbsp;&nbsp;
-                                    <button class="btn-success btn" id="issue-reply-btn">Comment</button>
-                                </div>
-                            </div>
-                        </div>
-                    </form>
-                </div>{{else}}<div class="alert alert-warning"><a class="btn btn-success btn-lg" href="{{AppSubUrl}}/user/sign_up">Sign up for free</a> to join this conversation. Already have an account? <a href="{{AppSubUrl}}/user/login">Sign in to comment</a></div>{{end}}
-                </div>
-            </div>
-
-            <div class="issue-bar col-md-2">
-                <div class="labels" data-ajax="{{.Issue.Index}}/label">
-                    {{if .IsRepositoryOwner}}
-                    <div class="pull-right action">
-                        <button class="btn btn-default btn-sm" data-toggle="dropdown">
-                            <i class="fa fa-tags"></i>
-                            <span class="caret"></span>
-                        </button>
-                        <div class="dropdown-menu dropdown-menu-right no">
-                            <ul class="list-unstyled">
-                                {{range .Labels}}
-                                <li class="{{if not .IsChecked}}no-{{end}}checked" data-id="{{.ID}}">
-                                    {{if .IsChecked}}<span class="check pull-left"><i class="fa fa-check"></i></span>{{end}}
-                                    <span class="color" style="background-color: {{.Color}}"></span>
-                                    <span class="name">{{.Name}}</span>
-                                </li>
-                                {{end}}
-                            </ul>
-                        </div>
-                    </div>
-                    {{end}}
-                    <h4>Labels</h4>
-                    {{if .Issue.Labels}}
-                    {{range .Issue.Labels}}
-                    <p id="label-{{.ID}}" class="label-item label-white" style="background-color: {{.Color}}"><strong>{{.Name}}</strong></p>
-                    {{end}}
-                    {{else}}
-                    <p>None yet</p>
-                    {{end}}
-                </div>
-                <div class="milestone" data-milestone="{{.Milestone.ID}}" data-ajax="{{.Issue.Index}}/milestone">
-                    <div class="pull-right action">
-                        {{if .IsRepositoryOwner}}
-                        <button class="btn btn-default btn-sm" data-toggle="dropdown">
-                            <i class="fa fa-check-square-o"></i>
-                            <span class="caret"></span>
-                        </button>
-                        <div class="dropdown-menu dropdown-menu-right">
-                            <ul class="list-unstyled">
-                                <li data-id="0" class="clear-milestone milestone-item  hidden"><i class="fa fa-times-circle-o"></i> Clear milestone </li>
-                                <li class="milestone-list">
-                                    <ul class="nav nav-tabs" data-init="tabs">
-                                        <li class="active"><a href="#milestone-open" data-toggle="tab">Open</a></li>
-                                        <li><a href="#milestone-close" data-toggle="tab">Closed</a></li>
-                                    </ul>
-                                    <div class="tab-content">
-                                        <div class="tab-pane active" id="milestone-open">
-                                            {{if not .OpenMilestones}}
-                                            <p class="milestone-item">Nothing to show</p>
-                                            {{else}}
-                                            <ul class="list-unstyled">
-                                                {{range .OpenMilestones}}
-                                                <li class="milestone-item" data-id="{{.ID}}">
-                                                    <p><strong>{{.Name}}</strong></p>
-                                                    <!-- <p>due to 3 days later</p> -->
-                                                </li>
-                                                {{end}}
-                                            </ul>
-                                            {{end}}
-                                        </div>
-
-                                        <div class="tab-pane" id="milestone-close">
-                                            {{if not .ClosedMilestones}}
-                                            <p class="milestone-item">Nothing to show</p>
-                                            {{else}}
-                                            <ul class="list-unstyled">
-                                                {{range .ClosedMilestones}}
-                                                <li class="milestone-item" data-id="{{.ID}}">
-                                                    <p><strong>{{.Name}}</strong></p>
-                                                    <p>Closed {{TimeSince .ClosedDate $.Lang}}</p>
-                                                </li>
-                                                {{end}}
-                                            </ul>
-                                            {{end}}
-                                        </div>
-                                    </div>
-                                </li>
-                            </ul>
-                        </div>
-                        {{end}}
-                    </div>
-                    <h4>Milestone</h4>
-                    {{if .Milestone}}
-                    <p class="completion{{if eq .Milestone.Completeness 0}} hidden{{end}}"><span style="width:{{.Milestone.Completeness}}%">&nbsp;</span></p>
-                    <p class="name"><strong><a href="{{$.RepoLink}}/issues?milestone={{.Milestone.ID}}{{if $.Issue.IsClosed}}&state=closed{{end}}">{{.Milestone.Name}}</a></strong></p>
-                    {{else}}
-                    <p class="name">No milestone</p>
-                    {{end}}
-                </div>
-
-                <div class="assignee" data-assigned="{{if .Issue.Assignee}}{{.Issue.Assignee.Id}}{{else}}0{{end}}" data-ajax="{{.Issue.Index}}/assignee">{{if .IsRepositoryOwner}}
-                    <div class="pull-right action">
-                        <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
-                            <i class="fa fa-group"></i>
-                            <span class="caret"></span>
-                        </button>
-                        <div class="dropdown-menu dropdown-menu-right">
-                            <ul class="list-unstyled">
-                                <li data-uid="0" class="clear-assignee hidden"><i class="fa fa-times-circle-o"></i> Clear assignee</li>
-                                {{range .Collaborators}}
-                                <li data-uid="{{.Id}}"><img src="{{.AvatarLink}}"><strong>{{.Name}}</strong></li>
-                                {{end}}
-                            </ul>
-                        </div>
-                    </div>{{end}}
-                    <h4>Assignee</h4>
-                    <p>{{if .Issue.Assignee}}<img src="{{.Issue.Assignee.AvatarLink}}"><strong>{{.Issue.Assignee.Name}}</strong>{{else}}No one assigned{{end}}</p>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-{{template "base/footer_old" .}}

+ 0 - 10
templates/repo/list.tmpl

@@ -1,10 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container" id="body">
-	<ul>
-	{{range .Repos}}
-		<li>{{.Name}} stars: {{.NumStars}} forks: {{.NumForks}} watches:{{.NumWatchs}}</li>
-	{{end}}
-	</ul>
-</div>
-{{template "base/footer" .}}

+ 0 - 45
templates/repo/toolbar.tmpl

@@ -1,45 +0,0 @@
-<div id="repo-toolbar">
-    <div class="container">
-        <nav class="navbar navbar-toolbar navbar-default" role="navigation">
-            <div class="collapse navbar-collapse">
-                <ul class="nav navbar-nav">
-                    <li class="{{if .IsRepoToolbarSource}}active{{end}}"><a href="{{.RepoLink}}{{if .BranchName}}{{if ne .BranchName `master`}}/src/{{.BranchName}}{{end}}{{end}}">Source</a></li>
-                    {{if not .IsBareRepo}}
-                    <li class="{{if .IsRepoToolbarCommits}}active{{end}}"><a href="{{.RepoLink}}/commits/{{if .BranchName}}{{.BranchName}}{{else}}master{{end}}">Commits</a></li>
-                    <!-- <li class="{{if .IsRepoToolbarBranches}}active{{end}}"><a href="{{.RepoLink}}/branches">Branches</a></li> -->
-                    <!-- <li class="{{if .IsRepoToolbarPulls}}active{{end}}"><a href="{{.RepoLink}}/pulls">Pull Requests</a></li> -->
-                    <li class="{{if .IsRepoToolbarIssues}}active{{end}}"><a href="{{.RepoLink}}/issues">{{if .Repository.NumOpenIssues}}<span class="badge">{{.Repository.NumOpenIssues}}</span> {{end}}Issues <!--<span class="badge">42</span>--></a></li>
-                    {{if .IsRepoToolbarIssues}}
-                    <li class="tmp">{{if .IsRepoToolbarIssuesList}}
-                        <a href="{{.RepoLink}}/issues/new"><button class="btn btn-primary btn-sm">New Issue</button></a>
-                        <a href="{{.RepoLink}}/milestones"><button class="btn btn-success btn-sm">Milestones</button></a>
-                        {{end}}</li>
-                    {{end}}
-                    <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumTags}}<span class="badge">{{.Repository.NumTags}}</span> {{end}}Releases</a></li>
-                    {{if .IsRepoToolbarReleases}}{{if .IsRepositoryOwner}}{{if not .IsRepoReleaseNew}}
-                    <li class="tmp"><a href="{{.RepoLink}}/releases/new"><button class="btn btn-primary btn-sm">New Release</button></a></li>
-                    {{end}}{{end}}{{end}}
-                    <!-- <li class="dropdown">
-                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
-                        <ul class="dropdown-menu">
-                            <li><a href="{{.RepoLink}}/wiki">Wiki</a></li>
-                        </ul>
-                    </li> -->{{end}}
-                </ul>
-                <ul class="nav navbar-nav navbar-right">
-                    {{if not .IsBareRepo}}
-                    <!-- <li class="dropdown">
-                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Statistic <b class="caret"></b></a>
-                        <ul class="dropdown-menu">
-                            <li><a href="#">Graphic</a></li>
-                            <li><a href="#">Pulse</a></li>
-                            <li><a href="#">Network</a></li>
-                        </ul>
-                    </li> -->{{end}}{{if .IsRepositoryAdmin}}
-                    <li class="{{if .IsRepoToolbarSetting}}active{{end}}"><a href="{{.RepoLink}}/settings">Settings</a>
-                    </li>{{end}}
-                </ul>
-            </div>
-        </nav>
-    </div>
-</div>

Some files were not shown because too many files changed in this diff