1 {% extends
"base.html" %}
13 $(document).on('click', '.open-DeleteDialog', function () {
14 deleteUrl = $(this).data('id').split('#');
15 if (deleteUrl[
0] == 'portfolio') {
16 label = '
<label class=
"alert-danger">Deleting a portfolio will remove all albums in portfolio
<br/>and photos in the album as well. It cannot be undone!!
</label>';
17 } else if (deleteUrl[
0] == 'album') {
18 label = '
<label class=
"alert-danger">Deleting an album will remove all photos in the album as well.
<br/>It cannot be undone!!
</label>';
22 $('#deleteLabel').html('
<span style=
"font-size:1.5em" class=
"glyphicon glyphicon-warning-sign"></span> delete ' + deleteUrl[
0])
23 $('#delFormLabel').html(label)
24 deleteUrl = '/' + deleteUrl.join('/')
26 $(document).on('click', '#submitDelete', function () {
29 data: $('#delForm').serialize(),
31 success: function(data){
32 var response = '
<p><label>Response: ' + data + '
</label></p><button class=
"btn btn-primary" id=
"deleteResponse" type=
"button">Ok
</button>';
33 $(
"#delForm").replaceWith(response)
35 error: function(error) {
41 $(document).on('click', '#deleteResponse', function () {
42 $('#deleteDialog').modal('toggle')
49 {% include 'menu.html' %}
50 {% include 'flash.html' %}
51 <div class=
"modal fade" id=
"deleteDialog" tabindex=
"-1" role=
"dialog" aria-labelledby=
"deleteLabel" aria-hidden=
"true">
52 <div class=
"modal-dialog">
53 <div class=
"modal-content">
54 <div class=
"modal-header">
55 <button type=
"button" class=
"close" data-dismiss=
"modal" aria-label=
"Close"><span aria-hidden=
"true">×
</span></button>
56 <h4 class=
"modal-title" id=
"deleteLabel"/>
58 <div class=
"modal-body">
59 <div class=
"container">
60 <form id=
"delForm" method=
"DELETE" action=
"#">
61 {{ deleteform.hidden_tag() }}
62 <span id=
"delFormLabel"></span><br/>
63 <button class=
"btn btn-primary" id=
"submitDelete" type=
"button">Delete
</button>
70 <div class=
"container">
71 <div class=
"row well well-sm">
72 <h4 class=
"form-signin-heading center">User Information
</h4>
73 <div class=
"col-xs-4 col-sm-6 col-md-6">
74 <form class=
"form-signin" method=
"POST" action=
"/user/{{user.username}}">
75 <!--<h3 class="form-signin-heading center">User Information</h3>-->
76 {{ form.hidden_tag() }}
77 {{ wtf.form_field(form.name, value=user.name) }}
78 {{ wtf.form_field(form.email, value=user.email) }}
79 {{ wtf.form_field(form.username, value=user.username) }}
80 {{ wtf.form_field(form.update,
class=
"btn btn-lg btn-primary btn-block") }}
83 <div class=
"col-xs-4 col-sm-6 col-md-6">
84 <form class=
"form-signin" method=
"POST" action=
"/user/{{user.username}}">
85 {{ pwform.hidden_tag() }}
86 {{ wtf.form_field(pwform.passwordcur,
placeholder=
"Current password") }}
87 {{ wtf.form_field(pwform.password,
placeholder=
"New Password") }}
88 {{ wtf.form_field(pwform.passwordchk,
placeholder=
"Password check") }}
89 {{ wtf.form_field(pwform.pwchange,
class=
"btn btn-lg btn-primary btn-block") }}
93 <div class=
"row well well-sm">
94 <h4 class=
"form-signin-heading center">Your Portfolios and Albums
</h4>
95 <table class=
"table table-hover table-responsive">
96 <thead class=
"thead-inverse">
107 {% for p in private %}
110 <td>{{p['portfolio']['name']}}
</td>
111 <td>{{p['portfolio']['visible']}}
</td>
112 <td>{{p['portfolio']['public']}}
</td>
113 <td>{{p['portfolio']['usercount']}}
</td>
115 <div class=
"btn-group">
116 <a role=
"button" class=
"btn btn-info btn-xs" href=
"{{ url_for('portfolio', id=p['portfolio']['id']) }}">
117 Edit
<span class=
"glyphicon glyphicon-edit"></span>
119 <a role=
"button" data-id=
"portfolio#{{p['portfolio']['id']}}" class=
"btn btn-danger btn-xs open-DeleteDialog" data-toggle=
"modal" data-target=
"#deleteDialog" href=
"#">
120 Delete
<span class=
"glyphicon glyphicon-remove"></span>
125 {% for a in p['albums'] %}
128 <td>{{p['portfolio']['name']}}
<span class=
"glyphicon glyphicon-arrow-right"></span> {{a.name}}
</td>
129 <td>{{a.visible}}
</td>
130 <td>{{a.public}}
</td>
131 <td>{{a.usercount}}
</td>
133 <div class=
"btn-group">
134 <a role=
"button" class=
"btn btn-info btn-xs" href=
"{{ url_for('album', id=a.id) }}">
135 Edit
<span class=
"glyphicon glyphicon-edit"></span>
137 <a role=
"button" data-id=
"album#{{a.id}}" class=
"btn btn-danger btn-xs open-DeleteDialog" data-toggle=
"modal" data-target=
"#deleteDialog" href=
"#">
138 Delete
<span class=
"glyphicon glyphicon-remove"></span>
148 <div class=
"row well well-sm">
149 <h4 class=
"form-signin-heading center">Albums by other users
</h4>
150 <table class=
"table table-hover table-responsive">
151 <thead class=
"thead-inverse">
160 {% for a in albums %}
162 <td>{{a['album'].name}}
</td><td>{{a['album'].portfolio.name}}
</td>
163 <td>{{a['album'].portfolio.owner.name}}
</td><td>{{a['acl'].name}}
</td>
169 </div> <!-- /container -->