Commit 3ddcc442d7facc74b9452094a627c2fb1c0770d1
1 parent
b50f5ce3
test
Showing
5 changed files
with
71 additions
and
66 deletions
Show diff stats
frontend/assets/AdminAsset.php
| @@ -21,7 +21,7 @@ class AdminAsset extends AssetBundle | @@ -21,7 +21,7 @@ class AdminAsset extends AssetBundle | ||
| 21 | 'css/style.css', | 21 | 'css/style.css', |
| 22 | 'css/art_box.css', | 22 | 'css/art_box.css', |
| 23 | '/admin/css/flags32.css', | 23 | '/admin/css/flags32.css', |
| 24 | - 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', | 24 | + //'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', |
| 25 | ]; | 25 | ]; |
| 26 | public $js = [ | 26 | public $js = [ |
| 27 | 'js/script.js', | 27 | 'js/script.js', |
frontend/assets/AppAsset.php
| @@ -19,7 +19,7 @@ class AppAsset extends AssetBundle | @@ -19,7 +19,7 @@ class AppAsset extends AssetBundle | ||
| 19 | public $css = [ | 19 | public $css = [ |
| 20 | '/css/style.css', | 20 | '/css/style.css', |
| 21 | '/admin/css/flags32.css', | 21 | '/admin/css/flags32.css', |
| 22 | - 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', | 22 | + //'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', |
| 23 | '/css/owl.carousel.css' | 23 | '/css/owl.carousel.css' |
| 24 | ]; | 24 | ]; |
| 25 | public $js = [ | 25 | public $js = [ |
frontend/views/accounts/_portfolio_form.php
| @@ -184,6 +184,9 @@ | @@ -184,6 +184,9 @@ | ||
| 184 | 184 | ||
| 185 | <div class="clearfix"></div> | 185 | <div class="clearfix"></div> |
| 186 | 186 | ||
| 187 | + <?php | ||
| 188 | + /* == Project add user block == */ | ||
| 189 | + ?> | ||
| 187 | <div class="add_project_user_wrapper" id="<?= $form->id ?>_project_user"> | 190 | <div class="add_project_user_wrapper" id="<?= $form->id ?>_project_user"> |
| 188 | <p>Добавить пользователя</p> | 191 | <p>Добавить пользователя</p> |
| 189 | <p><?= Html::a('Добавить', false, [ 'class' => 'add_project_user_link' ]) ?></p> | 192 | <p><?= Html::a('Добавить', false, [ 'class' => 'add_project_user_link' ]) ?></p> |
| @@ -195,70 +198,9 @@ | @@ -195,70 +198,9 @@ | ||
| 195 | ?> | 198 | ?> |
| 196 | </div> | 199 | </div> |
| 197 | </div> | 200 | </div> |
| 198 | - <script> | ||
| 199 | - $( | ||
| 200 | - function() | ||
| 201 | - { | ||
| 202 | - $(document).on( | ||
| 203 | - 'click', '.add_project_user_link', function() | ||
| 204 | - { | ||
| 205 | - var component = $(this).parents('.add_project_user_wrapper').attr('id'); | ||
| 206 | - var ids = []; | ||
| 207 | - $.each( | ||
| 208 | - $('#' + component).find('.project_user_wrapper'), function(i, val) | ||
| 209 | - { | ||
| 210 | - if(ids.indexOf($(val).data('id')) < 0) | ||
| 211 | - { | ||
| 212 | - ids.push($(val).data('id')); | ||
| 213 | - } | ||
| 214 | - } | ||
| 215 | - ); | ||
| 216 | - $.fancybox.open( | ||
| 217 | - {href : '/ajax/project-user'}, { | ||
| 218 | - type : 'ajax', maxWidth : 750, | ||
| 219 | - ajax : {dataType : 'html', data : {ids : JSON.stringify(ids)}}, | ||
| 220 | - tpl : {wrap : '<div class="fancybox-wrap" tabIndex="-1" data-model="common\\models\\PortfolioUser" data-component="' + component + '"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>'} | ||
| 221 | - } | ||
| 222 | - ); | ||
| 223 | - } | ||
| 224 | - ); | ||
| 225 | - $(document).on( | ||
| 226 | - 'click', '.user_search_modal_tick', function() | ||
| 227 | - { | ||
| 228 | - var user_id = $(this).parents('.user_search_modal_row').data('key'); | ||
| 229 | - var model = $(this).parents('.fancybox-wrap').data('model'); | ||
| 230 | - var component = $(this).parents('.fancybox-wrap').data('component'); | ||
| 231 | - var result; | ||
| 232 | - $.fancybox.close(); | ||
| 233 | - $.fancybox.showLoading(); | ||
| 234 | - $.get( | ||
| 235 | - '/ajax/user-input', { | ||
| 236 | - id : user_id, model : model, component : component | ||
| 237 | - }, function(data) | ||
| 238 | - { | ||
| 239 | - if(data.result.component !== undefined) | ||
| 240 | - { | ||
| 241 | - $('#' + data.result.component).find('.add_project_user_list') | ||
| 242 | - .append(data.result.html); | ||
| 243 | - } | ||
| 244 | - } | ||
| 245 | - ).always( | ||
| 246 | - function() | ||
| 247 | - { | ||
| 248 | - $.fancybox.hideLoading(); | ||
| 249 | - } | ||
| 250 | - ); | ||
| 251 | - } | ||
| 252 | - ); | ||
| 253 | - $(document).on( | ||
| 254 | - 'click', '.project_user_remove', function() | ||
| 255 | - { | ||
| 256 | - $(this).parents('.project_user_wrapper').remove(); | ||
| 257 | - } | ||
| 258 | - ); | ||
| 259 | - } | ||
| 260 | - ); | ||
| 261 | - </script> | 201 | + <?php |
| 202 | + /* == End of project add user block == */ | ||
| 203 | + ?> | ||
| 262 | 204 | ||
| 263 | </div> | 205 | </div> |
| 264 | 206 |
frontend/views/ajax/users.php
| @@ -58,6 +58,9 @@ | @@ -58,6 +58,9 @@ | ||
| 58 | ], | 58 | ], |
| 59 | [ | 59 | [ |
| 60 | 'attribute' => 'firstname', | 60 | 'attribute' => 'firstname', |
| 61 | + 'content' => function($model, $key, $index, $column) { | ||
| 62 | + return Html::a($model->firstname, ['performer/common', 'performer_id' => $model->id], ['target' => '_blank', 'data-pjax' => 0]); | ||
| 63 | + }, | ||
| 61 | 'filter' => Html::activeInput('text', $model, 'name_search'), | 64 | 'filter' => Html::activeInput('text', $model, 'name_search'), |
| 62 | ], | 65 | ], |
| 63 | [ | 66 | [ |
frontend/web/js/script.js
| @@ -1143,5 +1143,65 @@ $(document).ready( | @@ -1143,5 +1143,65 @@ $(document).ready( | ||
| 1143 | } | 1143 | } |
| 1144 | ) | 1144 | ) |
| 1145 | 1145 | ||
| 1146 | + $(document).on( | ||
| 1147 | + 'click', '.add_project_user_link', function() | ||
| 1148 | + { | ||
| 1149 | + var component = $(this).parents('.add_project_user_wrapper').attr('id'); | ||
| 1150 | + var ids = []; | ||
| 1151 | + $.each( | ||
| 1152 | + $('#' + component).find('.project_user_wrapper'), function(i, val) | ||
| 1153 | + { | ||
| 1154 | + if(ids.indexOf($(val).data('id')) < 0) | ||
| 1155 | + { | ||
| 1156 | + ids.push($(val).data('id')); | ||
| 1157 | + } | ||
| 1158 | + } | ||
| 1159 | + ); | ||
| 1160 | + $.fancybox.open( | ||
| 1161 | + {href : '/ajax/project-user'}, { | ||
| 1162 | + type : 'ajax', | ||
| 1163 | + margin: [50, 20, 30, 20], | ||
| 1164 | + maxWidth : 800, | ||
| 1165 | + ajax : {dataType : 'html', data : {ids : JSON.stringify(ids)}}, | ||
| 1166 | + tpl : {wrap : '<div class="fancybox-wrap" tabIndex="-1" data-model="common\\models\\PortfolioUser" data-component="' + component + '"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>'} | ||
| 1167 | + } | ||
| 1168 | + ); | ||
| 1169 | + } | ||
| 1170 | + ); | ||
| 1171 | + $(document).on( | ||
| 1172 | + 'click', '.user_search_modal_tick', function() | ||
| 1173 | + { | ||
| 1174 | + var user_id = $(this).parents('.user_search_modal_row').data('key'); | ||
| 1175 | + var model = $(this).parents('.fancybox-wrap').data('model'); | ||
| 1176 | + var component = $(this).parents('.fancybox-wrap').data('component'); | ||
| 1177 | + var result; | ||
| 1178 | + $.fancybox.close(); | ||
| 1179 | + $.fancybox.showLoading(); | ||
| 1180 | + $.get( | ||
| 1181 | + '/ajax/user-input', { | ||
| 1182 | + id : user_id, model : model, component : component | ||
| 1183 | + }, function(data) | ||
| 1184 | + { | ||
| 1185 | + if(data.result.component !== undefined) | ||
| 1186 | + { | ||
| 1187 | + $('#' + data.result.component).find('.add_project_user_list') | ||
| 1188 | + .append(data.result.html); | ||
| 1189 | + } | ||
| 1190 | + } | ||
| 1191 | + ).always( | ||
| 1192 | + function() | ||
| 1193 | + { | ||
| 1194 | + $.fancybox.hideLoading(); | ||
| 1195 | + } | ||
| 1196 | + ); | ||
| 1197 | + } | ||
| 1198 | + ); | ||
| 1199 | + $(document).on( | ||
| 1200 | + 'click', '.project_user_remove', function() | ||
| 1201 | + { | ||
| 1202 | + $(this).parents('.project_user_wrapper').remove(); | ||
| 1203 | + } | ||
| 1204 | + ); | ||
| 1205 | + | ||
| 1146 | } | 1206 | } |
| 1147 | ); | 1207 | ); |
| 1148 | \ No newline at end of file | 1208 | \ No newline at end of file |