Socialify

Folder ..

Viewing repo.html
140 lines (138 loc) • 3.8 KB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
{% extends 'blog/partials/base.html' %} {% block content %} {% load static %}
<style>
  .highlight {
    max-width: 680px;
  }

  table td.linenos {
    padding: 0;
  }
</style>
<img
  style="width: 730px; display: block; margin: 40px auto 20px auto"
  src="https://socialify.thatcomputerscientist.com/luciferreeves/{{repo}}/png?font=KoHo&forks=1&issues=1&language=1&language2=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"
  alt="Socialify"
/>
{% if parent is not None %}
<p>
  <span title="Go to parent directory" style="margin-right: 5px">
    <img
      src="{% static 'images/site/icons/Folder.png' %}"
      alt="Folder"
      style="display: inline-block; vertical-align: middle; height: 16px"
    />
  </span>
  <a
    href="{% if parent == '' %}{% url 'dev_status:repo' repo %}{% else %}{% url 'dev_status:repo-path' repo parent %}{% endif %}"
    >..</a
  >
  {% endif %}
</p>
{% if files and "byteSize" not in files %}
<table id="file-list" width="100%">
  <thead>
    <tr style="margin-bottom: 10px; border-bottom: 1px solid #ddd">
      <th>Name</th>
      <th>Last Commit</th>
      <th>Updated</th>
    </tr>
  </thead>
  <tbody>
    {% for file in files %}
    <tr>
      <td>
        {% if file.type == 'tree' %}
        <span title="Directory" style="margin-right: 5px">
          <img
            src="{% static 'images/site/icons/Folder.png' %}"
            alt="Folder"
            style="display: inline-block; vertical-align: middle; height: 16px"
          />
        </span>
        {% else %}
        <span title="File" style="margin-right: 5px">
          <img
            src="{% static 'images/icons/notepad_file-2.png' %}"
            alt="File"
            style="display: inline-block; vertical-align: middle; height: 16px"
          />
        </span>
        {% endif %}
        <a href="{% url 'dev_status:repo-path' repo file.path %}"
          >{{ file.name }}</a
        >
      </td>
      <td>{{ file.commit.message|truncatechars:50 }}</td>
      <td>{{ file.commit.committedDate }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endif %} {% if "byteSize" in files and not files.isBinary %}
<div
  style="
    background: #272727a3;
    border: 1px solid #434343;
    border-radius: 8px 8px 2px 2px;
  "
>
  <div
    style="
      background: #353535;
      padding: 0px 10px;
      border-radius: 8px 8px 0px 0px;
    "
  >
    <h4 style="margin: 0">
      Viewing
      <a href="{% url 'dev_status:repo-path' repo files.path %}"
        >{{ files.name }}</a
      >
      <pre style="display: inline-block; margin-left: 10px">
{{ files.lines }} lines ({{ files.loc }} loc) • {{ files.size }}</pre
      >
    </h4>
  </div>
  {{files.text|safe}}
</div>
{% endif %} {% if "byteSize" in files and files.isBinary %}

<div
  style="
    background: #272727a3;
    border: 1px solid #434343;
    border-radius: 8px 8px 2px 2px;
  "
>
  <div
    style="
      background: #353535;
      padding: 0px 10px;
      border-radius: 8px 8px 0px 0px;
    "
  >
    <h4 style="margin: 0; margin-left: 10px">
      Viewing
      <a href="{% url 'dev_status:repo-path' repo files.path %}"
        >{{ files.name }}</a
      >
      <pre style="display: inline-block; margin-left: 10px">
{{ files.size }}</pre
      >
    </h4>
  </div>
  {% if files.isImage == True %}
  <img
    src="https://raw.githubusercontent.com/luciferreeves/{{repo}}/{{files.def_branch}}/{{files.path}}"
    style="max-width: 100%; display: block; margin: 40px auto"
    alt="{{files.name}}"
  />
  {% else %}
  <p style="margin: 20px; text-align: center">Binary file, cannot display</p>
  <p style="margin: 20px; text-align: center">
    Download
    <a
      href="https://raw.githubusercontent.com/luciferreeves/{{repo}}/{{files.def_branch}}/{{files.path}}"
      >here</a
    >
  </p>
  {% endif %} {% endif %} {% endblock content %}
</div>