summaryrefslogtreecommitdiff
path: root/modules/fahad/staff
diff options
context:
space:
mode:
authorNitesh Kumar Sinha2019-07-02 13:32:41 +0530
committerGitHub2019-07-02 13:32:41 +0530
commit40040427eb696b443a52db952ce6915d3ee72a97 (patch)
tree5dde0580ac282768aeb48226e7d10c2e3f691172 /modules/fahad/staff
parent222f1780ed0f5c3536392df3236284d3a9ab5405 (diff)
parent5f6ba9cf4aee260e4192f194ed14d3bc9dd1b467 (diff)
downloadacadmix_distribution-40040427eb696b443a52db952ce6915d3ee72a97.tar.gz
acadmix_distribution-40040427eb696b443a52db952ce6915d3ee72a97.tar.bz2
acadmix_distribution-40040427eb696b443a52db952ce6915d3ee72a97.zip
Merge pull request #6 from fahad-israr/master
Fahad: Custom Module Added
Diffstat (limited to 'modules/fahad/staff')
-rw-r--r--modules/fahad/staff/composer.json14
-rw-r--r--modules/fahad/staff/config/install/core.entity_form_display.node.staff.default.yml111
-rw-r--r--modules/fahad/staff/config/install/core.entity_view_display.node.staff.default.yml59
-rw-r--r--modules/fahad/staff/config/install/core.entity_view_display.node.staff.teaser.yml33
-rw-r--r--modules/fahad/staff/config/install/field.field.node.staff.body.yml24
-rw-r--r--modules/fahad/staff/config/install/field.field.node.staff.field_designation.yml23
-rw-r--r--modules/fahad/staff/config/install/field.field.node.staff.field_staff_email.yml21
-rw-r--r--modules/fahad/staff/config/install/field.field.node.staff.field_staff_image.yml40
-rw-r--r--modules/fahad/staff/config/install/field.storage.node.field_designation.yml33
-rw-r--r--modules/fahad/staff/config/install/field.storage.node.field_staff_email.yml21
-rw-r--r--modules/fahad/staff/config/install/field.storage.node.field_staff_image.yml33
-rw-r--r--modules/fahad/staff/config/install/node.type.staff.yml20
-rw-r--r--modules/fahad/staff/staff.info.yml5
-rw-r--r--modules/fahad/staff/staff.module35
-rw-r--r--modules/fahad/staff/templates/staff.html.twig1
-rw-r--r--modules/fahad/staff/tests/src/Functional/LoadTest.php46
16 files changed, 519 insertions, 0 deletions
diff --git a/modules/fahad/staff/composer.json b/modules/fahad/staff/composer.json
new file mode 100644
index 0000000..7ecc5b7
--- /dev/null
+++ b/modules/fahad/staff/composer.json
@@ -0,0 +1,14 @@
+{
+ "name": "drupal/staff",
+ "type": "drupal-module",
+ "description": "My Awesome Module",
+ "keywords": ["Drupal"],
+ "license": "GPL-2.0+",
+ "homepage": "https://www.drupal.org/project/staff",
+ "minimum-stability": "dev",
+ "support": {
+ "issues": "https://www.drupal.org/project/issues/staff",
+ "source": "http://cgit.drupalcode.org/staff"
+ },
+ "require": { }
+}
diff --git a/modules/fahad/staff/config/install/core.entity_form_display.node.staff.default.yml b/modules/fahad/staff/config/install/core.entity_form_display.node.staff.default.yml
new file mode 100644
index 0000000..3c57990
--- /dev/null
+++ b/modules/fahad/staff/config/install/core.entity_form_display.node.staff.default.yml
@@ -0,0 +1,111 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.staff.body
+ - field.field.node.staff.field_designation
+ - field.field.node.staff.field_staff_email
+ - field.field.node.staff.field_staff_image
+ - image.style.thumbnail
+ - node.type.staff
+ module:
+ - image
+ - path
+ - text
+ enforced:
+ module:
+ - staff
+id: node.staff.default
+targetEntityType: node
+bundle: staff
+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_designation:
+ weight: 125
+ settings: { }
+ third_party_settings: { }
+ type: options_select
+ region: content
+ field_staff_email:
+ weight: 124
+ settings:
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: email_default
+ region: content
+ field_staff_image:
+ weight: 122
+ settings:
+ progress_indicator: throbber
+ preview_image_style: thumbnail
+ third_party_settings: { }
+ type: image_image
+ 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/staff/config/install/core.entity_view_display.node.staff.default.yml b/modules/fahad/staff/config/install/core.entity_view_display.node.staff.default.yml
new file mode 100644
index 0000000..33d49bc
--- /dev/null
+++ b/modules/fahad/staff/config/install/core.entity_view_display.node.staff.default.yml
@@ -0,0 +1,59 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.staff.body
+ - field.field.node.staff.field_designation
+ - field.field.node.staff.field_staff_email
+ - field.field.node.staff.field_staff_image
+ - node.type.staff
+ module:
+ - image
+ - options
+ - text
+ - user
+ enforced:
+ module:
+ - staff
+id: node.staff.default
+targetEntityType: node
+bundle: staff
+mode: default
+content:
+ body:
+ label: hidden
+ type: text_default
+ weight: 101
+ settings: { }
+ third_party_settings: { }
+ region: content
+ field_designation:
+ weight: 105
+ label: above
+ settings: { }
+ third_party_settings: { }
+ type: list_default
+ region: content
+ field_staff_email:
+ weight: 104
+ label: above
+ settings: { }
+ third_party_settings: { }
+ type: basic_string
+ region: content
+ field_staff_image:
+ weight: 102
+ label: hidden
+ settings:
+ image_style: ''
+ image_link: ''
+ third_party_settings: { }
+ type: image
+ region: content
+ links:
+ weight: 100
+ region: content
+ settings: { }
+ third_party_settings: { }
+hidden:
+ langcode: true
diff --git a/modules/fahad/staff/config/install/core.entity_view_display.node.staff.teaser.yml b/modules/fahad/staff/config/install/core.entity_view_display.node.staff.teaser.yml
new file mode 100644
index 0000000..0e8c256
--- /dev/null
+++ b/modules/fahad/staff/config/install/core.entity_view_display.node.staff.teaser.yml
@@ -0,0 +1,33 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - core.entity_view_mode.node.teaser
+ - field.field.node.staff.body
+ - node.type.staff
+ module:
+ - text
+ - user
+ enforced:
+ module:
+ - staff
+id: node.staff.teaser
+targetEntityType: node
+bundle: staff
+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/staff/config/install/field.field.node.staff.body.yml b/modules/fahad/staff/config/install/field.field.node.staff.body.yml
new file mode 100644
index 0000000..5120564
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.field.node.staff.body.yml
@@ -0,0 +1,24 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.body
+ - node.type.staff
+ module:
+ - text
+ enforced:
+ module:
+ - staff
+id: node.staff.body
+field_name: body
+entity_type: node
+bundle: staff
+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/staff/config/install/field.field.node.staff.field_designation.yml b/modules/fahad/staff/config/install/field.field.node.staff.field_designation.yml
new file mode 100644
index 0000000..9843775
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.field.node.staff.field_designation.yml
@@ -0,0 +1,23 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_designation
+ - node.type.staff
+ module:
+ - options
+ enforced:
+ module:
+ - staff
+id: node.staff.field_designation
+field_name: field_designation
+entity_type: node
+bundle: staff
+label: designation
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings: { }
+field_type: list_string
diff --git a/modules/fahad/staff/config/install/field.field.node.staff.field_staff_email.yml b/modules/fahad/staff/config/install/field.field.node.staff.field_staff_email.yml
new file mode 100644
index 0000000..0ae10fb
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.field.node.staff.field_staff_email.yml
@@ -0,0 +1,21 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_staff_email
+ - node.type.staff
+ enforced:
+ module:
+ - staff
+id: node.staff.field_staff_email
+field_name: field_staff_email
+entity_type: node
+bundle: staff
+label: staff_email
+description: ''
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings: { }
+field_type: email
diff --git a/modules/fahad/staff/config/install/field.field.node.staff.field_staff_image.yml b/modules/fahad/staff/config/install/field.field.node.staff.field_staff_image.yml
new file mode 100644
index 0000000..05ea0cc
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.field.node.staff.field_staff_image.yml
@@ -0,0 +1,40 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_staff_image
+ - node.type.staff
+ module:
+ - image
+ enforced:
+ module:
+ - staff
+id: node.staff.field_staff_image
+field_name: field_staff_image
+entity_type: node
+bundle: staff
+label: staff_image
+description: ''
+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: '500 KB'
+ max_resolution: 600x600
+ min_resolution: ''
+ alt_field: true
+ alt_field_required: true
+ title_field: false
+ title_field_required: false
+ default_image:
+ uuid: ''
+ alt: 'Staff Image'
+ title: ''
+ width: null
+ height: null
+ handler: 'default:file'
+ handler_settings: { }
+field_type: image
diff --git a/modules/fahad/staff/config/install/field.storage.node.field_designation.yml b/modules/fahad/staff/config/install/field.storage.node.field_designation.yml
new file mode 100644
index 0000000..a45bc21
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.storage.node.field_designation.yml
@@ -0,0 +1,33 @@
+uuid: 2bb0e6d9-6746-4705-9233-68b7d5c544cc
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ - options
+ enforced:
+ module:
+ - staff
+id: node.field_designation
+field_name: field_designation
+entity_type: node
+type: list_string
+settings:
+ allowed_values:
+ -
+ value: 'Office Assistant'
+ label: 'Office Assistant'
+ -
+ value: Accountant
+ label: Accountant
+ -
+ value: 'Multi-Tasking Staff'
+ label: 'Multi-Tasking Staff'
+ allowed_values_function: ''
+module: options
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/staff/config/install/field.storage.node.field_staff_email.yml b/modules/fahad/staff/config/install/field.storage.node.field_staff_email.yml
new file mode 100644
index 0000000..4294e72
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.storage.node.field_staff_email.yml
@@ -0,0 +1,21 @@
+uuid: 85c29d4c-a86b-4bc9-ac2e-8713593c0a69
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+ enforced:
+ module:
+ - staff
+id: node.field_staff_email
+field_name: field_staff_email
+entity_type: node
+type: email
+settings: { }
+module: core
+locked: false
+cardinality: -1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/modules/fahad/staff/config/install/field.storage.node.field_staff_image.yml b/modules/fahad/staff/config/install/field.storage.node.field_staff_image.yml
new file mode 100644
index 0000000..12e2600
--- /dev/null
+++ b/modules/fahad/staff/config/install/field.storage.node.field_staff_image.yml
@@ -0,0 +1,33 @@
+uuid: e4c2a11d-de09-411d-872a-9d3e687921c8
+langcode: en
+status: true
+dependencies:
+ module:
+ - file
+ - image
+ - node
+ enforced:
+ module:
+ - staff
+id: node.field_staff_image
+field_name: field_staff_image
+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/fahad/staff/config/install/node.type.staff.yml b/modules/fahad/staff/config/install/node.type.staff.yml
new file mode 100644
index 0000000..76845fd
--- /dev/null
+++ b/modules/fahad/staff/config/install/node.type.staff.yml
@@ -0,0 +1,20 @@
+langcode: en
+status: true
+dependencies:
+ module:
+ - menu_ui
+ enforced:
+ module:
+ - staff
+third_party_settings:
+ menu_ui:
+ available_menus:
+ - main
+ parent: 'main:'
+name: staff
+type: staff
+description: 'Staffs Of IIITT'
+help: ''
+new_revision: true
+preview_mode: 1
+display_submitted: true
diff --git a/modules/fahad/staff/staff.info.yml b/modules/fahad/staff/staff.info.yml
new file mode 100644
index 0000000..f7c4cbf
--- /dev/null
+++ b/modules/fahad/staff/staff.info.yml
@@ -0,0 +1,5 @@
+name: 'staff'
+type: module
+description: 'My Awesome Module'
+core: 8.x
+package: 'Custom'
diff --git a/modules/fahad/staff/staff.module b/modules/fahad/staff/staff.module
new file mode 100644
index 0000000..82bf6bf
--- /dev/null
+++ b/modules/fahad/staff/staff.module
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Contains staff.module.
+ */
+
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Implements hook_help().
+ */
+function staff_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
+ // Main module help for the staff module.
+ case 'help.page.staff':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('My Awesome Module') . '</p>';
+ return $output;
+
+ default:
+ }
+}
+
+/**
+ * Implements hook_theme().
+ */
+function staff_theme() {
+ return [
+ 'staff' => [
+ 'render element' => 'children',
+ ],
+ ];
+}
diff --git a/modules/fahad/staff/templates/staff.html.twig b/modules/fahad/staff/templates/staff.html.twig
new file mode 100644
index 0000000..91e43c8
--- /dev/null
+++ b/modules/fahad/staff/templates/staff.html.twig
@@ -0,0 +1 @@
+<!-- Add you custom twig html here --> \ No newline at end of file
diff --git a/modules/fahad/staff/tests/src/Functional/LoadTest.php b/modules/fahad/staff/tests/src/Functional/LoadTest.php
new file mode 100644
index 0000000..5ad4fa3
--- /dev/null
+++ b/modules/fahad/staff/tests/src/Functional/LoadTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\Tests\staff\Functional;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Simple test to ensure that main page loads with module enabled.
+ *
+ * @group staff
+ */
+class LoadTest extends BrowserTestBase {
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = ['staff'];
+
+ /**
+ * 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);
+ }
+
+}