-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
153 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
/.tmp/ | ||
/.sass-cache/ | ||
/.idea/* | ||
/web/attachments/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
src/ArusEntityAttachmentBundle/Resources/views/Default/add.html.twig
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
src/ArusEntityAttachmentBundle/Resources/views/Default/browse.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% extends 'base.html.twig' %} | ||
|
||
|
||
{% block body %} | ||
<div class="mod mod-attachment-browse"> | ||
|
||
<a href="{{ url('attachment_homepage') }}" class="btn btn-default pull-right" style="margin-right:20px;">Back</a> | ||
|
||
<h2 class="page-title">Browse attachment</h2> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
{% for id,d in t_dir %} | ||
{% set title = d.0 ~ ' (' ~ d.1 ~ ')' %} | ||
<div class="col-md-1"> | ||
<a href="{{ url('attachment_list',{id:id}) }}"> | ||
<img src="{{ asset("img/folder.png") }}" alt="{{ title }}" title="{{ title }}" /> | ||
<br /> | ||
{{ title }} | ||
</a> | ||
</div> | ||
{% if loop.index%12 == 0 %} | ||
</div> | ||
<div class="col-md-12"> | ||
{%endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
17 changes: 0 additions & 17 deletions
17
src/ArusEntityAttachmentBundle/Resources/views/Default/delete.html.twig
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
src/ArusEntityAttachmentBundle/Resources/views/Default/edit_limited.html.twig
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 28 additions & 128 deletions
156
src/ArusEntityAttachmentBundle/Resources/views/Default/list.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,29 @@ | ||
<div class="mod mod-attachments panel panel-danger"> | ||
<div class="panel-heading"> | ||
Attachments ({{ t_attachment|length }}) | ||
<a href="#" class="pull-right btn btn-warning btn-xs attachment-add">Add attachment</a> | ||
{% extends 'base.html.twig' %} | ||
|
||
|
||
{% block body %} | ||
<div class="mod mod-attachment-list"> | ||
|
||
<a href="{{ url('attachment_browse') }}" class="btn btn-default pull-right" style="margin-right:20px;">Back</a> | ||
|
||
<h2 class="page-title">Browse attachment / {{ project.getName() }}</h2> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
{% for a in t_attachment %} | ||
{% set title = a.getTitle() %} | ||
<div class="col-md-2 preview"> | ||
<a href="{{ attachments_path }}{{ project.getId() }}/{{ a.getFilename() }}" data-featherlight="image" title="{{ a.getTitle() }}"><img src="{{ attachments_path }}{{ project.getId() }}/{{ a.getFilename() }}" title="{{ a.getTitle() }}" /></a> | ||
<br /> | ||
<a href="{{ url(t_entity_type[a.getEntity().getType()]~'_show',{'id':a.getEntity().getId()}) }}" target="_blank">{{ title }}</a> | ||
({{ t_size[a.getId()] }}) | ||
</div> | ||
{% if loop.index%12 == 0 %} | ||
</div> | ||
<div class="col-md-12"> | ||
{%endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="panel-body"> | ||
{% for alt in t_attachment %} | ||
{{ include('ArusEntityAttachmentBundle:Default:unit.html.twig') }} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
if( $('.panel-info') ) { | ||
window.setTimeout( function(){$('.mod-attachments .panel-body').css('height', $('.panel-info .panel-body').css('height'))}, 300 ); | ||
window.setTimeout( function(){$('.mod-attachments .panel-body').css('max-height', $('.panel-info .panel-body').css('height'))}, 300 ); | ||
} | ||
}); | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
$('.attachment-confirm').unbind(); | ||
$('.attachment-confirm').on('click', function(e) { | ||
e.preventDefault(); | ||
obj = $(this); | ||
url = obj.attr('href'); | ||
$.ajax({ | ||
url: url, | ||
method: 'POST' | ||
}).done(function(){ | ||
reloadBlock( '.mod-attachments', '{{ url('attachment_getlist',{'entity_id':entity_id}) }}' ); | ||
}); | ||
}); | ||
$('.attachment-cancel').unbind(); | ||
$('.attachment-cancel').on('click', function(e) { | ||
e.preventDefault(); | ||
obj = $(this); | ||
url = obj.attr('href'); | ||
$.ajax({ | ||
url: url, | ||
method: 'POST' | ||
}).done(function(){ | ||
reloadBlock( '.mod-attachments', '{{ url('attachment_getlist',{'entity_id':entity_id}) }}' ); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
$('#modalAttachmentAdd').unbind(); | ||
$('.attachment-add').on('click', function(e) { | ||
e.preventDefault(); | ||
$('#modalAttachmentAdd').modal(); | ||
$('#modalAttachmentAdd').on('click','#confirm-save',function(e){ | ||
e.preventDefault(); | ||
form = $('#modalAttachmentAdd form'); | ||
$.post( form.attr('action'), form.serialize(), function(data) { | ||
$('#modalAttachmentAdd').find('.close').click(); | ||
reloadBlock( '.mod-attachments', '{{ url('attachment_getlist',{'entity_id':entity_id}) }}' ); | ||
}); | ||
}); | ||
}); | ||
$('#modalAttachmentAdd').on('shown.bs.modal', function () { | ||
$('#modalAttachmentAdd form').find('#arus_entity_attachment_add_descr').focus(); | ||
}); | ||
$('#modalAttachmentAdd').on('hide.bs.modal',function(){ | ||
$('#modalAttachmentAdd form')[0].reset(); | ||
}); | ||
}); | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
$('#modalAttachmentEdit').unbind(); | ||
$('.attachment-edit').on('click', function(e) { | ||
e.preventDefault(); | ||
obj = $(this); | ||
url = obj.attr('href'); | ||
level = parseInt( obj.parent().parent().find('.attachment-level').html() ); | ||
$('#modalAttachmentEdit').modal(); | ||
form = $('#modalAttachmentEdit form'); | ||
form.attr( 'action', url ); | ||
form.find('#arus_entity_attachment_edit_limited_level_'+level).prop('checked',true); | ||
form.find('#arus_entity_attachment_edit_limited_descr').val( obj.parent().parent().find('.attachment-descr').html() ); | ||
form.find('#arus_entity_attachment_edit_limited_entity_id').val( obj.attr('data-entity-id') ); | ||
$('#modalAttachmentEdit').on('click','#confirm-save',function(e){ | ||
form = $('#modalAttachmentEdit form'); | ||
$.post( form.attr('action'), form.serialize(), function(data) { | ||
$('#modalAttachmentEdit').find('.close').click(); | ||
reloadBlock( '.mod-attachments', '{{ url('attachment_getlist',{'entity_id':entity_id}) }}' ); | ||
}); | ||
}); | ||
}); | ||
$('#modalAttachmentEdit').on('shown.bs.modal', function () { | ||
$('#modalAttachmentEdit form').find('#arus_entity_attachment_edit_limited_descr').focus(); | ||
}); | ||
$('#modalAttachmentEdit').on('hide.bs.modal',function(){ | ||
$('#modalAttachmentEdit form')[0].reset(); | ||
}); | ||
}); | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
$('#modalAttachmentDelete').unbind(); | ||
$('.attachment-delete').on('click', function(e) { | ||
e.preventDefault(); | ||
obj = $(this); | ||
url = obj.attr('href'); | ||
$('#modalAttachmentDelete').modal(); | ||
$('#modalAttachmentDelete').on('click','#confirm-delete',function(e){ | ||
e.preventDefault(); | ||
$.ajax({ | ||
url: url, | ||
method: 'DELETE' | ||
}).done(function(){ | ||
$('#modalAttachmentDelete').find('.close').click(); | ||
reloadBlock( '.mod-attachments', '{{ url('attachment_getlist',{'entity_id':entity_id}) }}' ); | ||
}); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
{% endblock %} |
Oops, something went wrong.