-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
account.html
138 lines (133 loc) · 5.98 KB
/
account.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<include x-path="inc/meta.html" />
<title>@{{ user.username }} - Nyssa Package Manager</title>
</head>
<body class="has-head-color no-foot-color">
<include x-path="inc/header.html" />
<section class="container py-6">
<div class="columns is-justify-content-center">
<div class="column is-one-quarter">
<div class="mb-4">
<a class="button is-warning is-light" href="/logout">Log Out</a>
<a class="button is-default is-light" href="/change-password">Change Password</a>
</div>
<article class="message is-info">
<div class="message-header">
<p>About: Revert to version</p>
</div>
<div class="message-body">
When you revert a package to another version, all versions higher than that version will
become unavailable in search results and that version will be the default for new installations,
but users who have installed them or wrote applications depending on them will still be able
to download it.<br/><br/>
However, this means you won't be able to upload new versions of the application to replace the
reverted versions.
</div>
</article>
</div>
<div class="column is-three-quarters pl-6">
<div class="title">My Packages</div>
<div class="notification is-primary" x-if="message">
<button class="delete"></button>
{{ message }}
</div>
<div class="mb-4" x-if="result.packages">
Showing result {{ result.start|plus_one }} to {{ result.end }} of {{ result.total }} (page {{ result.page }} of {{ result.pages }})
</div>
<div class="search-result">
<div class="search-item" x-for="result.packages" x-value="package">
<div class="title">
<a href="/view/{{ package.name }}">
{{ package.name }}
<code x-if="package.deleted_at"><small> - Archived</small></code>
</a>
</div>
<div class="subtitle">
Latest Version: <span>{{ package.version }}</span>, Last Published: <span>{{ package.created_at }}</span>, Total Downloads: <span>{{ package.downloads|format_number }}</span>
</div>
<div class="content">
<div class="tags mb-2">
<a href="/search?q={{ v.version }}" class="tag is-light" x-for="package.versions" x-value="v">v{{ v.version }}</a>
</div>
<div>
<span x-if="package.description">
{{ package.description|strip_line }}
</span>
<em x-not="package.description">No description.</em>
</div>
<div class="tags mt-4" x-if="package.tags">
<a href="/search?q={{ tag }}" class="tag is-light" x-for="package.tags" x-value="tag">{{ tag }}</a>
</div>
<div class="mt-2" x-if="package.versions|can_revert">
<form class="revert-form field is-horizontal" method="post" action="/revert">
<input type="hidden" name="name" value="{{ package.name }}" />
<div class="field-label is-small">
<label class="label">Revert to version:</label>
</div>
<div class="field-body is-narrow">
<div class="field has-addons">
<div class="control">
<div class="select is-small">
<select name="version" class="input">
<option value="{{ v.version }}" x-for="package.versions" x-value="v">{{ v.version }}</option>
</select>
</div>
</div>
<div class="control">
<button class="button is-warning is-small">Revert</button>
</div>
<div class="control">
<a class="button is-danger is-small" href="/archive/{{ package.name }}" x-not="package.deleted_at">Archive</a>
</div>
</div>
</div>
</form>
</div>
<div class="mt-2" x-not="package.versions|can_revert">
<a class="button is-danger is-small" href="/archive/{{ package.name }}" x-not="package.deleted_at">Archive</a>
</div>
</div>
</div>
<div class="has-text-centered" x-not="result.packages">
No package found matching the term "{{ query }}"
</div>
</div>
<nav class="pagination mt-6" role="navigation" aria-label="pagination" x-if="result.packages">
<ul class="pagination-list">
<li x-for="pages" x-value="p">
<a x-if="p.active" class="pagination-link is-current" aria-label="Goto page {{ p.page }}">{{ p.page }}</a>
<a x-not="p.active" href="/search?q={{ query }}&page={{ p.page }}" class="pagination-link" aria-label="Goto page {p.page}">{{ p.page }}</a>
</li>
</ul>
</nav>
</div>
</div>
</section>
<include x-path="inc/footer.html" />
<script>
function revertFormSubmit(event) {
event.preventDefault();
}
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('form.revert-form').forEach(function(el) {
el.addEventListener('submit', function(e) {
e.preventDefault()
e.stopPropagation()
if(confirm('Are you sure you want to revert the package "' +el.name.value+ '" to version "' +el.version.value+ '"')) {
el.submit()
}
})
})
var ex = document.querySelector('.notification .delete')
if(ex) {
ex.addEventListener('click', function() {
var el = document.querySelector('.notification')
el.parentElement.removeChild(el)
})
}
})
</script>
</body>
</html>