diff --git a/modules/opencase_reporting/config/install/views.view.reporting_actors.yml b/modules/opencase_reporting/config/install/views.view.reporting_actors.yml index 4488704..b9e428f 100644 --- a/modules/opencase_reporting/config/install/views.view.reporting_actors.yml +++ b/modules/opencase_reporting/config/install/views.view.reporting_actors.yml @@ -3,6 +3,8 @@ status: true dependencies: config: - search_api.index.opencase_reporting_actors + content: + - 'block_content:basic:944ff38d-5931-4439-91d5-f53b5ad7aac7' module: - csv_serialization - rest @@ -398,7 +400,43 @@ display: footer: { } empty: { } relationships: { } - arguments: { } + arguments: + 'null': + id: 'null' + table: views + field: 'null' + relationship: none + group_type: group + admin_label: '' + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: true + title: '{{ "now"|date("Y/m/d") }}-{{ raw_arguments.null }} ' + default_argument_type: query_parameter + default_argument_options: + query_param: title + fallback: Report + multiple: and + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + must_not_be: false + plugin_id: 'null' display_extenders: { } use_ajax: true cache_metadata: @@ -406,6 +444,7 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - user.permissions tags: { } @@ -454,7 +493,43 @@ display: type: none options: offset: 0 - arguments: { } + arguments: + 'null': + id: 'null' + table: views + field: 'null' + relationship: none + group_type: group + admin_label: '' + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: true + title: '{{ raw_arguments.null }}' + default_argument_type: query_parameter + default_argument_options: + query_param: title + fallback: New+Report + multiple: and + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + must_not_be: false + plugin_id: 'null' auth: - cookie cache_metadata: @@ -463,6 +538,7 @@ display: - 'languages:language_content' - 'languages:language_interface' - request_format + - url - user.permissions tags: { } page_1: @@ -477,11 +553,36 @@ display: type: none defaults: cache: false + header: false + menu: + type: tab + title: Reporting + description: '' + expanded: false + parent: '' + weight: 0 + context: '0' + menu_name: main + header: + entity_block_content: + id: entity_block_content + table: views + field: entity_block_content + relationship: none + group_type: group + admin_label: '' + empty: true + tokenize: false + target: 944ff38d-5931-4439-91d5-f53b5ad7aac7 + view_mode: default + bypass_access: false + plugin_id: entity cache_metadata: max-age: -1 contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - user.permissions tags: { } diff --git a/modules/opencase_reporting/css/opencase-reporting.css b/modules/opencase_reporting/css/opencase-reporting.css new file mode 100644 index 0000000..2082a72 --- /dev/null +++ b/modules/opencase_reporting/css/opencase-reporting.css @@ -0,0 +1,16 @@ +.facet-item label { + display: inline; + padding-left: 5px; +} + +li.facet-item { + list-style-type: none; +} + +#opencase_reporting_buttons { + margin-bottom: 20px; +} + +#opencase_reporting_buttons #download-data{ + float: right; +} diff --git a/modules/opencase_reporting/js/opencase-reporting.js b/modules/opencase_reporting/js/opencase-reporting.js new file mode 100644 index 0000000..c916e54 --- /dev/null +++ b/modules/opencase_reporting/js/opencase-reporting.js @@ -0,0 +1,3 @@ +jQuery('#opencase_reporting_buttons #download_data').click(function() { + location.href = location.href + "&_format=csv"; +}); diff --git a/modules/opencase_reporting/opencase_reporting.libraries.yml b/modules/opencase_reporting/opencase_reporting.libraries.yml new file mode 100644 index 0000000..0bd96b7 --- /dev/null +++ b/modules/opencase_reporting/opencase_reporting.libraries.yml @@ -0,0 +1,7 @@ +opencase-reporting-lib: + version: 1.x + css: + theme: + css/opencase-reporting.css: {} + js: + js/opencase-reporting.js: {} diff --git a/modules/opencase_reporting/opencase_reporting.links.action.yml b/modules/opencase_reporting/opencase_reporting.links.action.yml deleted file mode 100644 index 19540de..0000000 --- a/modules/opencase_reporting/opencase_reporting.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.opencase_report.create_new: - route_name: view.reporting_actors.page_1 - title: 'Create a new report' - appears_on: - - view.opencase_saved_reports.page_1 diff --git a/modules/opencase_reporting/opencase_reporting.module b/modules/opencase_reporting/opencase_reporting.module index c4d338b..2d3b018 100644 --- a/modules/opencase_reporting/opencase_reporting.module +++ b/modules/opencase_reporting/opencase_reporting.module @@ -23,6 +23,14 @@ function opencase_reporting_help($route_name, RouteMatchInterface $route_match) } } +/** + * Implements hook_page_attachments + * + * Add the opencase library to every page + */ +function opencase_reporting_page_attachments(array &$page) { + $page['#attached']['library'][] = 'opencase_reporting/opencase-reporting-lib'; +} /** * Implements hook_uninstall().