diff options
Diffstat (limited to 'modules/mansimran/fest')
19 files changed, 830 insertions, 0 deletions
diff --git a/modules/mansimran/fest/composer.json b/modules/mansimran/fest/composer.json new file mode 100644 index 0000000..4301ff7 --- /dev/null +++ b/modules/mansimran/fest/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/fest", + "type": "drupal-module", + "description": "Importing fest content type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/fest", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/fest", + "source": "http://cgit.drupalcode.org/fest" + }, + "require": { } +} diff --git a/modules/mansimran/fest/config/install/core.entity_form_display.node.fest.default.yml b/modules/mansimran/fest/config/install/core.entity_form_display.node.fest.default.yml new file mode 100644 index 0000000..10d5212 --- /dev/null +++ b/modules/mansimran/fest/config/install/core.entity_form_display.node.fest.default.yml @@ -0,0 +1,114 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.fest.body + - field.field.node.fest.field_fest_pics + - field.field.node.fest.field_fest_website + - field.field.node.fest.field_fest_youtube_link + - image.style.thumbnail + - node.type.fest + module: + - image + - link + - path + - text + enforced: + module: + - fest +id: node.fest.default +targetEntityType: node +bundle: fest +mode: default +content: + body: + type: text_textarea_with_summary + weight: 121 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + third_party_settings: { } + region: content + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_fest_pics: + weight: 122 + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + type: image_image + region: content + field_fest_website: + weight: 124 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_fest_youtube_link: + weight: 123 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + settings: + display_label: true + weight: 15 + region: content + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 120 + region: content + third_party_settings: { } + sticky: + type: boolean_checkbox + settings: + display_label: true + weight: 16 + region: content + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + region: content + third_party_settings: { } +hidden: { } diff --git a/modules/mansimran/fest/config/install/core.entity_view_display.node.fest.default.yml b/modules/mansimran/fest/config/install/core.entity_view_display.node.fest.default.yml new file mode 100644 index 0000000..0aff7cd --- /dev/null +++ b/modules/mansimran/fest/config/install/core.entity_view_display.node.fest.default.yml @@ -0,0 +1,69 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.fest.body + - field.field.node.fest.field_fest_pics + - field.field.node.fest.field_fest_website + - field.field.node.fest.field_fest_youtube_link + - node.type.fest + module: + - image + - link + - text + - user + enforced: + module: + - fest +id: node.fest.default +targetEntityType: node +bundle: fest +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_fest_pics: + weight: 102 + label: above + settings: + image_style: '' + image_link: '' + third_party_settings: { } + type: image + region: content + field_fest_website: + weight: 104 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_fest_youtube_link: + weight: 103 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/mansimran/fest/config/install/core.entity_view_display.node.fest.teaser.yml b/modules/mansimran/fest/config/install/core.entity_view_display.node.fest.teaser.yml new file mode 100644 index 0000000..e6f0ef4 --- /dev/null +++ b/modules/mansimran/fest/config/install/core.entity_view_display.node.fest.teaser.yml @@ -0,0 +1,39 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.fest.body + - field.field.node.fest.field_fest_pics + - field.field.node.fest.field_fest_website + - field.field.node.fest.field_fest_youtube_link + - node.type.fest + module: + - text + - user + enforced: + module: + - fest +id: node.fest.teaser +targetEntityType: node +bundle: fest +mode: teaser +content: + body: + label: hidden + type: text_summary_or_trimmed + weight: 100 + settings: + trim_length: 600 + third_party_settings: { } + region: content + links: + weight: 101 + region: content + settings: { } + third_party_settings: { } +hidden: + field_fest_pics: true + field_fest_website: true + field_fest_youtube_link: true + langcode: true diff --git a/modules/mansimran/fest/config/install/field.field.node.fest.body.yml b/modules/mansimran/fest/config/install/field.field.node.fest.body.yml new file mode 100644 index 0000000..392d20b --- /dev/null +++ b/modules/mansimran/fest/config/install/field.field.node.fest.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.fest + module: + - text + enforced: + module: + - fest +id: node.fest.body +field_name: body +entity_type: node +bundle: fest +label: Body +description: 'Description of the fest' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_pics.yml b/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_pics.yml new file mode 100644 index 0000000..a5d8788 --- /dev/null +++ b/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_pics.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_fest_pics + - node.type.fest + module: + - image + enforced: + module: + - fest +id: node.fest.field_fest_pics +field_name: field_fest_pics +entity_type: node +bundle: fest +label: 'Fest Pics' +description: 'The Pictures of the fest ' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'png gif jpg jpeg' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: true + alt_field_required: true + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + handler: 'default:file' + handler_settings: { } +field_type: image diff --git a/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_website.yml b/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_website.yml new file mode 100644 index 0000000..44e7715 --- /dev/null +++ b/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_website.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_fest_website + - node.type.fest + module: + - link + enforced: + module: + - fest +id: node.fest.field_fest_website +field_name: field_fest_website +entity_type: node +bundle: fest +label: 'fest website' +description: 'A link to the website of the fest' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_youtube_link.yml b/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_youtube_link.yml new file mode 100644 index 0000000..23751f1 --- /dev/null +++ b/modules/mansimran/fest/config/install/field.field.node.fest.field_fest_youtube_link.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_fest_youtube_link + - node.type.fest + module: + - link + enforced: + module: + - fest +id: node.fest.field_fest_youtube_link +field_name: field_fest_youtube_link +entity_type: node +bundle: fest +label: 'fest youtube link' +description: 'Fest youtube link' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/fest/config/install/field.storage.node.field_fest_pics.yml b/modules/mansimran/fest/config/install/field.storage.node.field_fest_pics.yml new file mode 100644 index 0000000..223dc80 --- /dev/null +++ b/modules/mansimran/fest/config/install/field.storage.node.field_fest_pics.yml @@ -0,0 +1,33 @@ +uuid: b43f2232-6511-4822-86d9-0e0017831edc +langcode: en +status: true +dependencies: + module: + - file + - image + - node + enforced: + module: + - fest +id: node.field_fest_pics +field_name: field_fest_pics +entity_type: node +type: image +settings: + uri_scheme: public + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + target_type: file + display_field: false + display_default: false +module: image +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/fest/config/install/field.storage.node.field_fest_website.yml b/modules/mansimran/fest/config/install/field.storage.node.field_fest_website.yml new file mode 100644 index 0000000..592a4e0 --- /dev/null +++ b/modules/mansimran/fest/config/install/field.storage.node.field_fest_website.yml @@ -0,0 +1,22 @@ +uuid: 829d8806-5365-42f3-a15d-f0b888a9bc2d +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - fest +id: node.field_fest_website +field_name: field_fest_website +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/fest/config/install/field.storage.node.field_fest_youtube_link.yml b/modules/mansimran/fest/config/install/field.storage.node.field_fest_youtube_link.yml new file mode 100644 index 0000000..a85a314 --- /dev/null +++ b/modules/mansimran/fest/config/install/field.storage.node.field_fest_youtube_link.yml @@ -0,0 +1,22 @@ +uuid: 1c1ca56f-3da3-4f65-8da7-babdaeaffa3d +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - fest +id: node.field_fest_youtube_link +field_name: field_fest_youtube_link +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/fest/config/install/migrate_plus.migration.fest_1.yml b/modules/mansimran/fest/config/install/migrate_plus.migration.fest_1.yml new file mode 100644 index 0000000..64317eb --- /dev/null +++ b/modules/mansimran/fest/config/install/migrate_plus.migration.fest_1.yml @@ -0,0 +1,65 @@ +uuid: 7f27a807-6fa9-4d41-bd21-cc6900ab8293 +langcode: en +id: fest_1 +status: true +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - CSV +migration_group: default +label: 'fest_csv_import1' +source: + plugin: csv + path: /home/mansimran/Desktop/mansimran1/fest.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/migrationdata/fest + file_dest: 'public://fest1/' +process: + type: + plugin: default_value + default_value: fest + source_path: + - + plugin: skip_on_empty + method: process + source: pictures + - + plugin: concat + delimiter: / + source: + - constants/file_source + - pictures + title: title + body/value: body + body/format: + plugin: default_value + default_value: basic_html + field_fest_pics: + - + plugin: explode + delimiter: ',' + source: pictures + - + plugin: file_import + # source: '@source_path' + destination: constants/file_dest + field_fest_website/uri: website_link + field_fest_website/title: + plugin: default_value + default_value: 'Website Link' + field_fest_youtube_link/uri: youtube_link + field_fest_youtube_link/title: + plugin: default_value + default_value: 'Youtube Link' +destination: + plugin: 'entity:node' + bundle: fest +migration_dependencies: + required: { } + optional: { }
\ No newline at end of file diff --git a/modules/mansimran/fest/config/install/node.type.fest.yml b/modules/mansimran/fest/config/install/node.type.fest.yml new file mode 100644 index 0000000..974379f --- /dev/null +++ b/modules/mansimran/fest/config/install/node.type.fest.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - fest +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: Fest +type: fest +description: 'About the Fests held in VIT' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/mansimran/fest/config/install/views.view.fests.yml b/modules/mansimran/fest/config/install/views.view.fests.yml new file mode 100644 index 0000000..7501888 --- /dev/null +++ b/modules/mansimran/fest/config/install/views.view.fests.yml @@ -0,0 +1,195 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - node.type.fest + module: + - node + - user + enforced: + module: + - fest +id: fests +label: Fests +module: views +description: 'Fests in VIT' +tag: '' +base_table: node_field_data +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: mini + options: + items_per_page: 5 + offset: 0 + id: 0 + total_pages: null + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + tags: + previous: ‹‹ + next: ›› + style: + type: default + row: + type: 'entity:node' + options: + view_mode: teaser + fields: + title: + id: title + table: node_field_data + field: title + entity_type: node + entity_field: title + label: '' + alter: + alter_text: false + make_link: false + absolute: false + trim: false + word_boundary: false + ellipsis: false + strip_tags: false + html: false + hide_empty: false + empty_zero: false + settings: + link_to_entity: true + plugin_id: field + relationship: none + group_type: group + admin_label: '' + exclude: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_alter_empty: true + click_sort_column: value + type: string + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + filters: + status: + value: '1' + table: node_field_data + field: status + plugin_id: boolean + entity_type: node + entity_field: status + id: status + expose: + operator: '' + group: 1 + type: + id: type + table: node_field_data + field: type + value: + fest: fest + entity_type: node + entity_field: type + plugin_id: bundle + sorts: + created: + id: created + table: node_field_data + field: created + order: DESC + entity_type: node + entity_field: created + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exposed: false + expose: + label: '' + granularity: second + title: Fests + header: { } + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 1 + display_options: + display_extenders: { } + path: fests + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url.query_args + - 'user.node_grants:view' + - user.permissions + tags: { } + diff --git a/modules/mansimran/fest/fest.info.yml b/modules/mansimran/fest/fest.info.yml new file mode 100644 index 0000000..c6d4f6f --- /dev/null +++ b/modules/mansimran/fest/fest.info.yml @@ -0,0 +1,14 @@ +name: 'fest' +type: module +description: 'Importing fest content type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:image + - drupal:link + - drupal:path + - drupal:text + - drupal:file + - drupal:node + - drupal:user + - drupal:menu_ui
\ No newline at end of file diff --git a/modules/mansimran/fest/fest.install b/modules/mansimran/fest/fest.install new file mode 100644 index 0000000..789d440 --- /dev/null +++ b/modules/mansimran/fest/fest.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function fest_uninstall() { + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'fest'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + diff --git a/modules/mansimran/fest/fest.module b/modules/mansimran/fest/fest.module new file mode 100644 index 0000000..8327ed9 --- /dev/null +++ b/modules/mansimran/fest/fest.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains fest.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function fest_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the fest module. + case 'help.page.fest': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Importing fest content type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function fest_theme() { + return [ + 'fest' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/mansimran/fest/templates/fest.html.twig b/modules/mansimran/fest/templates/fest.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/mansimran/fest/templates/fest.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/mansimran/fest/tests/src/Functional/LoadTest.php b/modules/mansimran/fest/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..de3e959 --- /dev/null +++ b/modules/mansimran/fest/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\fest\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group fest + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['fest']; + + /** + * A user with permission to administer site configuration. + * + * @var \Drupal\user\UserInterface + */ + protected $user; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->user = $this->drupalCreateUser(['administer site configuration']); + $this->drupalLogin($this->user); + } + + /** + * Tests that the home page loads with a 200 response. + */ + public function testLoad() { + $this->drupalGet(Url::fromRoute('<front>')); + $this->assertSession()->statusCodeEquals(200); + } + +} |