From cca4638fbc00db7f4928eb4bd2f30e149cfef31a Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Fri, 22 Apr 2016 13:12:13 -0500 Subject: [PATCH] add load document popup if is admin in the course BT#11017 --- app/Resources/public/css/base.css | 31 +++++-------------- composer.json | 2 +- main/inc/lib/course.lib.php | 22 ++++++------- .../default/user_portal/grid_courses.tpl | 30 ++++++++++++++++-- web/app_dev.php | 0 5 files changed, 47 insertions(+), 38 deletions(-) mode change 100644 => 100755 web/app_dev.php diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index ad57b04f74..077fbd12b8 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -1655,39 +1655,24 @@ div.admin_section h4 { } .document_preview_container { - - -webkit-border-radius: 6px; - -opera-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - - -webkit-box-shadow: 0 2px 5px #C8C8C8; - -opera-box-shadow: 0 2px 5px #C8C8C8; - -moz-box-shadow: 0 2px 5px #C8C8C8; - box-shadow: 0 2px 5px #C8C8C8; - - background-color: #F9F9F9; - + border-radius: 5px; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); + background-color: #FFF; + border: 1px solid #DDD; position: absolute; z-index: 20; margin:5px; padding:5px; - width: 400px; - height:280px; + width: 310px; + height: 200px; overflow-y: auto; - + top: -5px; + left: 25px; } - #course_settings h3 img { margin-left: 25px; } - -.document_preview_container { - font-size: 12px !important; - color: #111 ! important; -} - /* Exercise comment*/ #comments { position:absolute; diff --git a/composer.json b/composer.json index 38e78ce966..a28c75b2d6 100755 --- a/composer.json +++ b/composer.json @@ -85,7 +85,7 @@ "sonata-project/cache-bundle": "~2.1@dev", "sonata-project/cache": "~1.0@dev", "sonata-project/page-bundle": "dev-master", - "sonata-project/core-bundle": "2.3.x-dev", + "sonata-project/core-bundle": "3.x-dev", "sonata-project/formatter-bundle": "~2.4@dev", "sonata-project/datagrid-bundle": "~2.2@dev", diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 966f5f5503..873706ea17 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3401,16 +3401,9 @@ class CourseManager if (api_is_platform_admin()) { $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code']; if ($load_dirs) { - $params['document'] .= '' . - Display::return_icon('folder.png', - get_lang('Documents'), - array('align' => 'absmiddle'), - ICON_SIZE_SMALL - ) . ''; - $params['document'] .= Display::div('', array( - 'id' => 'document_result_' . $course_info['real_id'] . '_' . $course_info['id_session'], - 'class' => 'document_preview_container' - )); + $params['document'] = '' + . Display::returnFontAwesomeIcon('folder-open') . ''; + $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container')); } } @@ -3739,8 +3732,13 @@ class CourseManager if (api_is_platform_admin()) { $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code']; + if($load_dirs){ + $params['document'] = '' + . Display::returnFontAwesomeIcon('folder-open') . ''; + $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container')); + } } - + $course_title_url = ''; $course_title_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0'; @@ -3760,7 +3758,7 @@ class CourseManager if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) { $params['notifications'] = $showNotification; } - + $isSubContent = true; if (empty($user_category_id)) { $isSubContent = false; diff --git a/main/template/default/user_portal/grid_courses.tpl b/main/template/default/user_portal/grid_courses.tpl index 403801ed08..728a8e1eeb 100644 --- a/main/template/default/user_portal/grid_courses.tpl +++ b/main/template/default/user_portal/grid_courses.tpl @@ -31,7 +31,20 @@ {% if item.edit_actions != '' %} -
+
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
{% endif %}
@@ -83,7 +96,20 @@
{% if item.edit_actions != '' %} -
+
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
{% endif %}
diff --git a/web/app_dev.php b/web/app_dev.php old mode 100644 new mode 100755