PageRenderTime 26ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/app/views/dashboard/projects/editfile.blade.php

https://gitlab.com/oytunistrator/92five
PHP | 118 lines | 114 code | 3 blank | 1 comment | 7 complexity | b8e31909763115c2f71dfae0bb9ff8e6 MD5 | raw file
  1. @extends('dashboard.default')
  2. @section('head')
  3. <title>92five app - {{trans('92five.addRemoveFiles')}}</title>
  4. @stop
  5. @section('content')
  6. <div id="contentwrapper">
  7. <div class="main_content">
  8. <div class="row-fluid">
  9. <div class="span12 project_detail">
  10. <h2><a href="{{url('/dashboard')}}">{{trans('92five.Dashboard')}}<a> / <a href="{{url('/dashboard',array($parentType.'s'))}}">{{$parentType}}</a> / {{trans('92five.editFiles')}} </h2>
  11. <div class="row-fluid proj_create">
  12. <h3> {{$parentName}} <div class="p-icon-main">
  13. </div></h3>
  14. <div class="row-fluid span12 proj_create_detail">
  15. <div class="row-fluid">
  16. <!-- Left Part -->
  17. <div class="span12 add-proj-form">
  18. <fieldset>
  19. <div class="control-group">
  20. <label>{{trans('92five.addFiles')}}:
  21. <p class="help-block">({{trans('92five.optional')}})</p>
  22. </label>
  23. @if($parentType == 'Task')
  24. <form id='dropzone' action='#'class="dropzone" method=post>
  25. @elseif($parentType == 'Project')
  26. <form id='dropzone' action='add/files' class="dropzone" method=post>
  27. @endif
  28. <input type="hidden" name="project_id" id="project_id" value={{$project_id}}/>
  29. <div class="fallback">
  30. <input name="file" type="file" multiple />
  31. </div>
  32. </form>
  33. </div>
  34. <div class="control-group">
  35. <label> {{trans('92five.filesAttached')}}:</label>
  36. @if($files == null)
  37. <div class='no_file'> [ {{trans('92five.noFilesAttached ')}} ]</div>
  38. @else
  39. <div class="row-fluid ">
  40. @foreach($files as $file)
  41. <div class="row-fluid proj_file_edit_list">
  42. <div class="span9">
  43. <p>{{$file['file_name']}}</p>
  44. <span>{{$file['size']}}. Uploaded on {{new ExpressiveDate($file['uploaded_date'])}} by {{User::where('id',$file['uploaded_by'])->pluck('first_name')}} {{User::where('id',$file['uploaded_by'])->pluck('last_name')}}</span>
  45. </div>
  46. <div class="span3">
  47. <input type=button class="removefile" fileid={{$file['id']}} value="{{trans('92five.remove ')}}" id="removefile">
  48. </div>
  49. </div>
  50. @endforeach
  51. </div>
  52. @endif
  53. </div>
  54. </fieldset>
  55. <div class="submit_button_main">
  56. @if($parentType == 'Task')
  57. <a href="{{url('/dashboard/task/edited',array($project_id))}}" class="submit">{{trans('92five.done ')}}</a>
  58. @elseif($parentType == 'Project')
  59. <a href="{{url('/dashboard/projects/edit/done',array($project_id))}}" class="submit">{{trans('92five.done ')}}</a>
  60. @endif
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. @stop
  72. @section('endjs')
  73. {{ HTML::style('assets/css/dashboard/dropzone.css') }}
  74. {{ HTML::script('assets/js/dashboard/dropzone.js') }}
  75. <script>
  76. $(document).on("click", ".removefile", function() {
  77. var flag;
  78. var fileid = $(this).attr('fileid');
  79. $.ajax({
  80. type: 'GET',
  81. dataType: 'json',
  82. url: 'deletefile/' + fileid,
  83. timeout: 5000,
  84. success: function(data, textStatus) {
  85. //console.log('success');
  86. var url = window.location.href;
  87. var tempurl = url.split('dashboard')[0];
  88. iosOverlay({
  89. text: "File Removed !",
  90. duration: 5e3,
  91. icon: tempurl + 'assets/images/notifications/check.png'
  92. });
  93. flag = true;
  94. },
  95. error: function(xhr, textStatus, errorThrown) {
  96. var url = window.location.href;
  97. var tempurl = url.split('dashboard')[0];
  98. iosOverlay({
  99. text: "Something Went Wrong !",
  100. duration: 5e3,
  101. icon: tempurl + 'assets/images/notifications/cross.png'
  102. });
  103. flag = false;
  104. }
  105. });
  106. if (flag = true)
  107. {
  108. $(this).parents('div.proj_file_edit_list').remove();
  109. }
  110. if (flag = false)
  111. {
  112. }
  113. });
  114. </script>
  115. @stop