first commit
This commit is contained in:
43
templates/articles/password-view.php
Normal file
43
templates/articles/password-view.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<div class="article-password" id="article-password-<?= $this -> article['id'];?>">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?= \S::lang( 'ten-artykul-jest-chroniony-podaj-haslo-aby-odblokowac-zawartosc-artykulu' );?>
|
||||
<form metho="POST" id="form-<?= $this -> article['id'];?>">
|
||||
<input type="password" name="password" id="password-<?= $this -> article['id'];?>" required="required">
|
||||
<input type="submit" class="btn btn-success" id="submit-<?= $this -> article['id'];?>" value="<?= \S::lang( 'odblokuj' );?>">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( click_event, '#submit-<?= $this -> article['id'];?>', function(e)
|
||||
{
|
||||
if ( $.trim( $( "#password-<?= $this -> article['id'];?>" ).val() ) !== '' )
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var password = $( '#password-<?= $this -> article['id'];?>' ).val();
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/ajax.php',
|
||||
data:
|
||||
{
|
||||
a: 'article_unlock',
|
||||
password: password,
|
||||
article_id: <?= $this -> article['id'];?>
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user