mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Fade out apps when revoked or deleted.
This commit is contained in:
@@ -2824,7 +2824,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
@noresponse(VUser(),
|
||||
VModhash(),
|
||||
client=VOAuth2ClientID())
|
||||
def POST_revokeapp(self, form, jquery, client):
|
||||
def POST_revokeapp(self, client):
|
||||
if client:
|
||||
client.revoke(c.user)
|
||||
|
||||
|
||||
@@ -5836,7 +5836,7 @@ tr.gold-accent + tr > td {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.developed-app {
|
||||
.developed-app, .authorized-app {
|
||||
border: solid 1px black;
|
||||
margin-left: 20px;
|
||||
margin-bottom: 0.5em;
|
||||
@@ -5871,9 +5871,10 @@ tr.gold-accent + tr > td {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.edit-app-button {
|
||||
.edit-app-button, .revoke-app-button {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.edit-app { display: none; }
|
||||
|
||||
@@ -5,3 +5,11 @@ $(function() {
|
||||
$(this).parent().parent().find(".edit-app").slideToggle();
|
||||
});
|
||||
});
|
||||
|
||||
function app_revoked(elem, op) {
|
||||
$(elem).closest(".authorized-app").fadeOut();
|
||||
}
|
||||
|
||||
function app_deleted(elem, op) {
|
||||
$(elem).closest(".developed-app").fadeOut();
|
||||
}
|
||||
|
||||
@@ -5,28 +5,35 @@
|
||||
<h1>${_("authorized applications")}</h1>
|
||||
|
||||
%for app in thing.my_apps:
|
||||
<tr>
|
||||
<td>
|
||||
%if app.icon_url:
|
||||
<img src="${ app.icon_url }">
|
||||
<div id="authorized-app-${app._id}" class="authorized-app rounded">
|
||||
%if app.icon_url:
|
||||
<img src="${app.icon_url}">
|
||||
%endif
|
||||
<div class="app-details">
|
||||
<h2>
|
||||
%if app.about_url:
|
||||
<a href="${app.about_url}">${app.name}</a>
|
||||
%else:
|
||||
${app.name}
|
||||
%endif
|
||||
</td>
|
||||
<td><a href="${ app.about_url }">${ app.name }</a></td>
|
||||
<td>${ynbutton(_("revoke access"),
|
||||
_("revoked"),
|
||||
"revokeapp",
|
||||
callback="deleteRow",
|
||||
hidden_data=dict(client_id=app._id))}</td>
|
||||
</tr>
|
||||
</h2>
|
||||
<div class="app-description">${app.description}</div>
|
||||
${ynbutton(_("revoke access"),
|
||||
_("revoked"),
|
||||
"revokeapp",
|
||||
callback="app_revoked",
|
||||
hidden_data=dict(client_id=app._id),
|
||||
_class="revoke-app-button")}
|
||||
</div>
|
||||
</div>
|
||||
%endfor
|
||||
</table>
|
||||
%endif
|
||||
|
||||
%if thing.developed_apps:
|
||||
<h1>${_("developed applications")}</h1>
|
||||
|
||||
%for app in thing.developed_apps:
|
||||
<div class="developed-app rounded">
|
||||
<div id="developed-app-${app._id}" class="developed-app rounded">
|
||||
%if app.icon_url:
|
||||
<img src="${app.icon_url}">
|
||||
%endif
|
||||
@@ -131,6 +138,7 @@
|
||||
${ynbutton(_("delete app"),
|
||||
"deleted",
|
||||
"deleteapp",
|
||||
callback="app_deleted",
|
||||
hidden_data=dict(client_id=app._id))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user