summaryrefslogtreecommitdiff
path: root/modules/fahad/clubs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fahad/clubs')
-rw-r--r--modules/fahad/clubs/clubs.info.yml12
-rw-r--r--modules/fahad/clubs/clubs.module35
-rw-r--r--modules/fahad/clubs/composer.json14
-rw-r--r--modules/fahad/clubs/config/install/core.entity_form_display.node.clubs.default.yml133
-rw-r--r--modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.default.yml67
-rw-r--r--modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.teaser.yml33
-rw-r--r--modules/fahad/clubs/config/install/field.field.node.clubs.body.yml24
-rw-r--r--modules/fahad/clubs/config/install/field.field.node.clubs.field_class.yml23
-rw-r--r--modules/fahad/clubs/config/install/field.field.node.clubs.field_club_category.yml31
-rw-r--r--modules/fahad/clubs/config/install/field.field.node.clubs.field_club_department.yml30
-rw-r--r--modules/fahad/clubs/config/install/field.field.node.clubs.field_faculty_incharge.yml30
-rw-r--r--modules/fahad/clubs/config/install/field.field.node.clubs.field_student_volunteer.yml23
-rw-r--r--modules/fahad/clubs/config/install/field.storage.node.field_class.yml23
-rw-r--r--modules/fahad/clubs/config/install/field.storage.node.field_club_category.yml23
-rw-r--r--modules/fahad/clubs/config/install/field.storage.node.field_club_department.yml22
-rw-r--r--modules/fahad/clubs/config/install/field.storage.node.field_faculty_incharge.yml22
-rw-r--r--modules/fahad/clubs/config/install/field.storage.node.field_student_volunteer.yml23
-rw-r--r--modules/fahad/clubs/config/install/node.type.clubs.yml20
-rw-r--r--modules/fahad/clubs/config/install/taxonomy.vocabulary.club_category.yml12
-rw-r--r--modules/fahad/clubs/templates/clubs.html.twig1
-rw-r--r--modules/fahad/clubs/tests/src/Functional/LoadTest.php46
21 files changed, 647 insertions, 0 deletions
diff --git a/modules/fahad/clubs/clubs.info.yml b/modules/fahad/clubs/clubs.info.yml
new file mode 100644
index 0000000..0b76af6
--- /dev/null
+++ b/modules/fahad/clubs/clubs.info.yml
@@ -0,0 +1,12 @@
+name: 'clubs'
+type: module
+description: 'My Awesome Module'
+core: 8.x
+package: 'Custom'
+dependencies:
+ - drupal:path
+ - drupal:text
+ - drupal:user
+ - drupal:node
+ - drupal:taxonomy
+ - drupal:menu_ui \ No newline at end of file
diff --git a/modules/fahad/clubs/clubs.module b/modules/fahad/clubs/clubs.module
new file mode 100644
index 0000000..b317fcb
--- /dev/null
+++ b/modules/fahad/clubs/clubs.module
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Contains clubs.module.
+ */
+
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Implements hook_help().
+ */
+function clubs_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
+ // Main module help for the clubs module.
+ case 'help.page.clubs':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('My Awesome Module') . '</p>';
+ return $output;
+
+ default:
+ }
+}
+
+/**
+ * Implements hook_theme().
+ */
+function clubs_theme() {
+ return [
+ 'clubs' => [
+ 'render element' => 'children',
+ ],
+ ];
+}
diff --git a/modules/fahad/clubs/composer.json b/modules/fahad/clubs/composer.json
new file mode 100644
index 0000000..957e115
--- /dev/null
+++ b/modules/fahad/clubs/composer.json
@@ -0,0 +1,14 @@
+{
+ "name": "drupal/clubs",
+ "type": "drupal-module",
+ "description": "My Awesome Module",
+ "keywords": ["Drupal"],
+ "license": "GPL-2.0+",
+ "homepage": "https://www.drupal.org/project/clubs",
+ "minimum-stability": "dev",
+ "support": {
+ "issues": "https://www.drupal.org/project/issues/clubs",
+ "source": "http://cgit.drupalcode.org/clubs"
+ },
+ "require": { }
+}
diff --git a/modules/fahad/clubs/config/install/core.entity_form_display.node.clubs.default.yml b/modules/fahad/clubs/config/install/core.entity_form_display.node.clubs.default.yml
new file mode 100644
index 0000000..981cd35
--- /dev/null
+++ b/modules/fahad/clubs/config/install/core.entity_form_display.node.clubs.default.yml
@@ -0,0 +1,133 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.clubs.body
+ - field.field.node.clubs.field_class
+ - field.field.node.clubs.field_club_category
+ - field.field.node.clubs.field_club_department
+ - field.field.node.clubs.field_faculty_incharge
+ - field.field.node.clubs.field_student_volunteer
+ - node.type.clubs
+ module:
+ - path
+ - text
+
+ enforced:
+ module:
+ - clubs
+id: node.clubs.default
+targetEntityType: node
+bundle: clubs
+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_class:
+ weight: 124
+ settings:
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: text_textfield
+ region: content
+ field_club_category:
+ weight: 125
+ settings:
+ match_operator: CONTAINS
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: entity_reference_autocomplete
+ region: content
+ field_club_department:
+ weight: 126
+ settings:
+ match_operator: CONTAINS
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: entity_reference_autocomplete
+ region: content
+ field_faculty_incharge:
+ weight: 123
+ settings:
+ match_operator: CONTAINS
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: entity_reference_autocomplete
+ region: content
+ field_student_volunteer:
+ weight: 122
+ settings:
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: text_textfield
+ 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/fahad/clubs/config/install/core.entity_view_display.node.clubs.default.yml b/modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.default.yml
new file mode 100644
index 0000000..2746c1f
--- /dev/null
+++ b/modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.default.yml
@@ -0,0 +1,67 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.clubs.body
+ - field.field.node.clubs.field_class
+ - field.field.node.clubs.field_club_category
+ - field.field.node.clubs.field_club_department
+ - field.field.node.clubs.field_faculty_incharge
+ - field.field.node.clubs.field_student_volunteer
+ - node.type.clubs
+ module:
+ - text
+ - user
+ enforced:
+ module:
+ - clubs
+id: node.clubs.default
+targetEntityType: node
+bundle: clubs
+mode: default
+content:
+ body:
+ label: hidden
+ type: text_default
+ weight: 1
+ settings: { }
+ third_party_settings: { }
+ region: content
+ field_class:
+ weight: 4
+ label: above
+ settings: { }
+ third_party_settings: { }
+ type: text_default
+ region: content
+ field_club_department:
+ weight: 5
+ label: above
+ settings:
+ link: true
+ third_party_settings: { }
+ type: entity_reference_label
+ region: content
+ field_faculty_incharge:
+ weight: 2
+ label: above
+ settings:
+ link: true
+ third_party_settings: { }
+ type: entity_reference_label
+ region: content
+ field_student_volunteer:
+ weight: 3
+ label: above
+ settings: { }
+ third_party_settings: { }
+ type: text_default
+ region: content
+ links:
+ weight: 0
+ region: content
+ settings: { }
+ third_party_settings: { }
+hidden:
+ field_club_category: true
+ langcode: true
diff --git a/modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.teaser.yml b/modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.teaser.yml
new file mode 100644
index 0000000..32ad599
--- /dev/null
+++ b/modules/fahad/clubs/config/install/core.entity_view_display.node.clubs.teaser.yml
@@ -0,0 +1,33 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - core.entity_view_mode.node.teaser
+ - field.field.node.clubs.body
+ - node.type.clubs
+ module:
+ - text
+ - user
+ enforced:
+ module:
+ - clubs
+id: node.clubs.teaser
+targetEntityType: node
+bundle: clubs
+mode: teaser
+content:
+ body:
+ label: hidden
+ type: text_summary_or_trimmed
+ weight: 101
+ settings:
+ trim_length: 600
+ third_party_settings: { }
+ region: content
+ links:
+ weight: 100
+ settings: { }
+ third_party_settings: { }
+ region: content
+hidden:
+ langcode: true
diff --git a/modules/fahad/clubs/config/install/field.field.node.clubs.body.yml b/modules/fahad/clubs/config/install/field.field.node.clubs.body.yml
new file mode 100644
index 0000000..2cb335e
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.field.node.clubs.body.yml
@@ -0,0 +1,24 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.body
+ - node.type.clubs
+ module:
+ - text
+ enforced:
+ module:
+ - clubs
+id: node.clubs.body
+field_name: body
+entity_type: node
+bundle: clubs
+label: Body
+description: ''
+required: false
+translatable: true
+default_value: { }
+default_value_callback: ''
+settings:
+ display_summary: true
+field_type: text_with_summary
diff --git a/modules/fahad/clubs/config/install/field.field.node.clubs.field_class.yml b/modules/fahad/clubs/config/install/field.field.node.clubs.field_class.yml
new file mode 100644
index 0000000..d44cd98
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.field.node.clubs.field_class.yml
@@ -0,0 +1,23 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_class
+ - node.type.clubs
+ module:
+ - text
+ enforced:
+ module:
+ - clubs
+id: node.clubs.field_class
+field_name: field_class
+entity_type: node
+bundle: clubs
+label: class
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings: { }
+field_type: text
diff --git a/modules/fahad/clubs/config/install/field.field.node.clubs.field_club_category.yml b/modules/fahad/clubs/config/install/field.field.node.clubs.field_club_category.yml
new file mode 100644
index 0000000..0a2ebea
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.field.node.clubs.field_club_category.yml
@@ -0,0 +1,31 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_club_category
+ - node.type.clubs
+ - taxonomy.vocabulary.club_category
+ enforced:
+ module:
+ - clubs
+id: node.clubs.field_club_category
+field_name: field_club_category
+entity_type: node
+bundle: clubs
+label: club_category
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings:
+ handler: 'default:taxonomy_term'
+ handler_settings:
+ target_bundles:
+ club_category: club_category
+ sort:
+ field: name
+ direction: asc
+ auto_create: false
+ auto_create_bundle: ''
+field_type: entity_reference
diff --git a/modules/fahad/clubs/config/install/field.field.node.clubs.field_club_department.yml b/modules/fahad/clubs/config/install/field.field.node.clubs.field_club_department.yml
new file mode 100644
index 0000000..15e2472
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.field.node.clubs.field_club_department.yml
@@ -0,0 +1,30 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_club_department
+ - node.type.clubs
+ - node.type.department
+ enforced:
+ module:
+ - clubs
+id: node.clubs.field_club_department
+field_name: field_club_department
+entity_type: node
+bundle: clubs
+label: 'Club Department'
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings:
+ handler: 'default:node'
+ handler_settings:
+ target_bundles:
+ department: department
+ sort:
+ field: _none
+ auto_create: false
+ auto_create_bundle: ''
+field_type: entity_reference
diff --git a/modules/fahad/clubs/config/install/field.field.node.clubs.field_faculty_incharge.yml b/modules/fahad/clubs/config/install/field.field.node.clubs.field_faculty_incharge.yml
new file mode 100644
index 0000000..7eb94be
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.field.node.clubs.field_faculty_incharge.yml
@@ -0,0 +1,30 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_faculty_incharge
+ - node.type.clubs
+ - node.type.fac_page
+ enforced:
+ module:
+ - clubs
+id: node.clubs.field_faculty_incharge
+field_name: field_faculty_incharge
+entity_type: node
+bundle: clubs
+label: faculty_incharge
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings:
+ handler: 'default:node'
+ handler_settings:
+ target_bundles:
+ fac_page: fac_page
+ sort:
+ field: _none
+ auto_create: false
+ auto_create_bundle: ''
+field_type: entity_reference
diff --git a/modules/fahad/clubs/config/install/field.field.node.clubs.field_student_volunteer.yml b/modules/fahad/clubs/config/install/field.field.node.clubs.field_student_volunteer.yml
new file mode 100644
index 0000000..8d42844
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.field.node.clubs.field_student_volunteer.yml
@@ -0,0 +1,23 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_student_volunteer
+ - node.type.clubs
+ module:
+ - text
+ enforced:
+ module:
+ - clubs
+id: node.clubs.field_student_volunteer
+field_name: field_student_volunteer
+entity_type: node
+bundle: clubs
+label: student_volunteer
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings: { }
+field_type: text
diff --git a/modules/fahad/clubs/config/install/field.storage.node.field_class.yml b/modules/fahad/clubs/config/install/field.storage.node.field_class.yml
new file mode 100644
index 0000000..97a82f2
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.storage.node.field_class.yml
@@ -0,0 +1,23 @@
+uuid: 8293a5a2-e4b9-4b58-8e49-1dc73ef8a8b8
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ - text
+ enforced:
+ module:
+ - clubs
+id: node.field_class
+field_name: field_class
+entity_type: node
+type: text
+settings:
+ max_length: 255
+module: text
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/clubs/config/install/field.storage.node.field_club_category.yml b/modules/fahad/clubs/config/install/field.storage.node.field_club_category.yml
new file mode 100644
index 0000000..cece130
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.storage.node.field_club_category.yml
@@ -0,0 +1,23 @@
+uuid: b4c4d850-9c5a-4c72-9fd7-fce06eb39271
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ - taxonomy
+ enforced:
+ module:
+ - clubs
+id: node.field_club_category
+field_name: field_club_category
+entity_type: node
+type: entity_reference
+settings:
+ target_type: taxonomy_term
+module: core
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/clubs/config/install/field.storage.node.field_club_department.yml b/modules/fahad/clubs/config/install/field.storage.node.field_club_department.yml
new file mode 100644
index 0000000..c66f5c3
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.storage.node.field_club_department.yml
@@ -0,0 +1,22 @@
+uuid: c63446e6-d556-4733-950b-296b97f50d1b
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ enforced:
+ module:
+ - clubs
+id: node.field_club_department
+field_name: field_club_department
+entity_type: node
+type: entity_reference
+settings:
+ target_type: node
+module: core
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/clubs/config/install/field.storage.node.field_faculty_incharge.yml b/modules/fahad/clubs/config/install/field.storage.node.field_faculty_incharge.yml
new file mode 100644
index 0000000..d7f2272
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.storage.node.field_faculty_incharge.yml
@@ -0,0 +1,22 @@
+uuid: 35ea0028-c7c7-4200-9e19-318108f6925f
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ enforced:
+ module:
+ - clubs
+id: node.field_faculty_incharge
+field_name: field_faculty_incharge
+entity_type: node
+type: entity_reference
+settings:
+ target_type: node
+module: core
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/clubs/config/install/field.storage.node.field_student_volunteer.yml b/modules/fahad/clubs/config/install/field.storage.node.field_student_volunteer.yml
new file mode 100644
index 0000000..7694eca
--- /dev/null
+++ b/modules/fahad/clubs/config/install/field.storage.node.field_student_volunteer.yml
@@ -0,0 +1,23 @@
+uuid: df0a956d-fbe0-4f92-8e51-b59d7ace8965
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ - text
+ enforced:
+ module:
+ - clubs
+id: node.field_student_volunteer
+field_name: field_student_volunteer
+entity_type: node
+type: text
+settings:
+ max_length: 255
+module: text
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/clubs/config/install/node.type.clubs.yml b/modules/fahad/clubs/config/install/node.type.clubs.yml
new file mode 100644
index 0000000..ced00f4
--- /dev/null
+++ b/modules/fahad/clubs/config/install/node.type.clubs.yml
@@ -0,0 +1,20 @@
+langcode: en
+status: true
+dependencies:
+ module:
+ - menu_ui
+ enforced:
+ module:
+ - clubs
+third_party_settings:
+ menu_ui:
+ available_menus:
+ - main
+ parent: 'main:'
+name: Clubs
+type: clubs
+description: 'College Clubs'
+help: ''
+new_revision: true
+preview_mode: 1
+display_submitted: true
diff --git a/modules/fahad/clubs/config/install/taxonomy.vocabulary.club_category.yml b/modules/fahad/clubs/config/install/taxonomy.vocabulary.club_category.yml
new file mode 100644
index 0000000..aa7456a
--- /dev/null
+++ b/modules/fahad/clubs/config/install/taxonomy.vocabulary.club_category.yml
@@ -0,0 +1,12 @@
+uuid: b7da9ff8-ed69-4737-824e-883e436d8d70
+langcode: en
+status: true
+dependencies:
+ enforced:
+ module:
+ - clubs
+name: 'Club Category'
+vid: club_category
+description: 'Category of the Club'
+hierarchy: 0
+weight: 0
diff --git a/modules/fahad/clubs/templates/clubs.html.twig b/modules/fahad/clubs/templates/clubs.html.twig
new file mode 100644
index 0000000..91e43c8
--- /dev/null
+++ b/modules/fahad/clubs/templates/clubs.html.twig
@@ -0,0 +1 @@
+<!-- Add you custom twig html here --> \ No newline at end of file
diff --git a/modules/fahad/clubs/tests/src/Functional/LoadTest.php b/modules/fahad/clubs/tests/src/Functional/LoadTest.php
new file mode 100644
index 0000000..e78518a
--- /dev/null
+++ b/modules/fahad/clubs/tests/src/Functional/LoadTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\Tests\clubs\Functional;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Simple test to ensure that main page loads with module enabled.
+ *
+ * @group clubs
+ */
+class LoadTest extends BrowserTestBase {
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = ['clubs'];
+
+ /**
+ * 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);
+ }
+
+}