view.ctp 4.95 KB
Newer Older
1
<?php
Aroop "FinlayDaG33k" Roelofs's avatar
Aroop "FinlayDaG33k" Roelofs committed
2
  use Admiral\Admiral\Permission;
3
  $this->pageTitle = $project->name;
4
5
?>

6

7
8
9
10
11
12
<div class="container">
  <div class="row mt-4">
    <div class="col-6">
      <?php if(!empty($project->thumbnail) && $project->thumbnail != '#'): ?>
        <?= $this->Html->image($project->thumbnail,['class'=>'img-fluid fadein']); ?>
      <?php else: ?>
13
        <?= $this->Html->image("placeholders/1920x1080.png",['class'=>'img-fluid fadein']); ?>
14
15
16
17
18
19
20
21
      <?php endif; ?>
    </div>
    <div class="col-6">
      <div class="row">
        <div class="col-12">
          <h4><?= h($project->name); ?></h4>
          <hr>
          <p>
22
            <?= h($project->projects_description->description); ?>
23
24
25
26
27
28
29
30
31
32
33
34
          </p>
        </div>
      </div>
      <div class="row">
        <div class="col-8">
          <table class="table table-borderless">
            <tbody>
              <tr>
                <th class="p-0">Latest Versions</th>
                <td class="p-0">
                  <ul class="list-unstyled mb-0">
                    <?php if(!empty($project->latest['public'])): ?>
35
                      <li>
36
                        <?= h($project->latest['public']->version); ?>
37
38
                        (public)
                      </li>
39
40
                    <?php endif; ?>
                    <?php if(!empty($project->latest['testing'])): ?>
41
                      <li>
42
                        <?= h($project->latest['testing']->version); ?>
43
44
                        (testing)
                      </li>
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
                    <?php endif; ?>
                  </ul>
                </div>
                </td>
              </tr>
              <tr>
                <th class="p-0">License</th>
                <td class="p-0">
                  <?php if(empty($project->license)): ?>
                    Unknown
                  <?php else: ?>
                    <?= h($project->license); ?>
                  <?php endif; ?>
                </td>
              </tr>
              <tr>
                <th class="p-0">Source</th>
                <td class="p-0">
                  <?php if(!empty($project->source) && $project->source != '#'): ?>
64
                    <a href="<?= h($project->source); ?>" target="_blank">View Source</a>
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
                  <?php else: ?>
                    Unavailable
                  <?php endif;?>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
  <div class="row mt-2">
    <div class="col-12">
      <h4>Version History</h4>
      <hr>
      <table class="table table-borderless">
        <thead>
          <th>Version</th>
          <th>Date</th>
          <th>Description</th>
          <th>Changelog</th>
          <th>Download</th>
        </thead>
        <tbody>
89
          <?php foreach($project->releases as $release): ?>
90
91
92
93
94
95
96
97
98
99
            <tr>
              <td><?= h($release->version); ?></td>
              <td><?= h($release->date->i18nFormat('MMM dd, yyyy kk:mm:ss')); ?></td>
              <td><?= h($release->description); ?></td>
              <td>
                <a class="btn btn-primary rounded-0 text-white" data-action="changelog" data-version="<?= h($release->version); ?>" data-release="<?= h($release->id); ?>">
                  <i class="fas fa-eye"></i>
                </a>
              </td>
              <td>
100
101
102
103
104
105
106
107
108
109
              <?php if(file_exists(WWW_ROOT . 'uploads' .DS . 'distfiles/' . $project->name . '-' . $release->version . '-win.zip')): ?>
                  <a class="btn btn-success rounded-0" href="/uploads/distfiles/<?= h($project->name); ?>-<?= h($release->version); ?>-win.zip" target="_blank" data-action="download" data-version="<?= h($release->version); ?>" data-release="<?= h($release->id); ?>">
                    <i class="fab fa-windows"></i>
                  </a>
                <?php endif; ?>
                <?php if(file_exists(WWW_ROOT . 'uploads' .DS . 'distfiles/' . $project->name . '-' . $release->version . '-linux.zip')): ?>
                  <a class="btn btn-success rounded-0" href="/uploads/distfiles/<?= h($project->name); ?>-<?= h($release->version); ?>-linux.zip" target="_blank" data-action="download" data-version="<?= h($release->version); ?>" data-release="<?= h($release->id); ?>">
                    <i class="fab fa-linux"></i>
                  </a>
                <?php endif; ?>
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
              </td>
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
    </div>
  </div>
</div>

<div class="modal" tabindex="-1" role="dialog" id="changelogModal">
  <div class="modal-dialog modal-lg modal-dialog-centered">
    <div class="modal-content rounded-0">
      <!-- Modal Header -->
      <div class="modal-header">
        <h4 class="modal-title">
          Changelog for version <span></span> of <?= h($project->name); ?>
        </h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- Modal body -->
      <div class="modal-body">
        <ul></ul>
      </div>
    </div>
  </div>
</div>