Commit 6fbd2b4f authored by Angie Byron's avatar Angie Byron Committed by Neil Drumm
Browse files

[#1404500] Implement nominations / voting system for the community elections

parent 74d643c6
Loading
Loading
Loading
Loading
+285 −0
Changes for features/association_at_large_elections/association_at_large_elections.features.content.inc: 285 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * Implementation of hook_content_default_fields().
 */
function association_at_large_elections_content_default_fields() {
  $fields = array();

  // Exported field: field_about_me
  $fields['nomination-field_about_me'] = array(
    'field_name' => 'field_about_me',
    'type_name' => 'nomination',
    'display_settings' => array(
      'label' => array(
        'format' => 'above',
        'exclude' => 0,
      ),
      '5' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'teaser' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '4' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '2' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '3' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
    'widget_active' => '1',
    'type' => 'text',
    'required' => '1',
    'multiple' => '0',
    'module' => 'text',
    'active' => '1',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'widget' => array(
      'rows' => '5',
      'size' => 60,
      'default_value' => array(
        '0' => array(
          'value' => '',
          'format' => '1',
          '_error_element' => 'default_value_widget][field_about_me][0][value',
        ),
      ),
      'default_value_php' => NULL,
      'label' => 'About Me',
      'weight' => '-4',
      'description' => 'Tell us about yourself! Your background, how you got into Drupal, etc.',
      'type' => 'text_textarea',
      'module' => 'text',
    ),
  );

  // Exported field: field_experience
  $fields['nomination-field_experience'] = array(
    'field_name' => 'field_experience',
    'type_name' => 'nomination',
    'display_settings' => array(
      'label' => array(
        'format' => 'above',
        'exclude' => 0,
      ),
      '5' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'teaser' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '4' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '2' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '3' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
    'widget_active' => '1',
    'type' => 'text',
    'required' => '1',
    'multiple' => '0',
    'module' => 'text',
    'active' => '1',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'widget' => array(
      'rows' => '5',
      'size' => 60,
      'default_value' => array(
        '0' => array(
          'value' => '',
          'format' => '1',
          '_error_element' => 'default_value_widget][field_experience][0][value',
        ),
      ),
      'default_value_php' => NULL,
      'label' => 'Experience',
      'weight' => '-2',
      'description' => 'Do you have previous board, fundraising, or governance experience? Tell us about your qualifications.',
      'type' => 'text_textarea',
      'module' => 'text',
    ),
  );

  // Exported field: field_motivation
  $fields['nomination-field_motivation'] = array(
    'field_name' => 'field_motivation',
    'type_name' => 'nomination',
    'display_settings' => array(
      'label' => array(
        'format' => 'above',
        'exclude' => 0,
      ),
      '5' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'teaser' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '4' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '2' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '3' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
    'widget_active' => '1',
    'type' => 'text',
    'required' => '1',
    'multiple' => '0',
    'module' => 'text',
    'active' => '1',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'widget' => array(
      'rows' => '5',
      'size' => 60,
      'default_value' => array(
        '0' => array(
          'value' => '',
          'format' => '1',
          '_error_element' => 'default_value_widget][field_motivation][0][value',
        ),
      ),
      'default_value_php' => NULL,
      'label' => 'Motivation',
      'weight' => '-3',
      'description' => 'Why are you applying for a board position? What initiatives do you hope to help drive, or perspectives are you going to try and represent?',
      'type' => 'text_textarea',
      'module' => 'text',
    ),
  );

  // Exported field: field_travel
  $fields['nomination-field_travel'] = array(
    'field_name' => 'field_travel',
    'type_name' => 'nomination',
    'display_settings' => array(
      'label' => array(
        'format' => 'above',
        'exclude' => 0,
      ),
      '5' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'teaser' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '4' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '2' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '3' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
    'widget_active' => '1',
    'type' => 'number_integer',
    'required' => '0',
    'multiple' => '0',
    'module' => 'number',
    'active' => '1',
    'prefix' => '',
    'suffix' => '',
    'min' => '',
    'max' => '',
    'allowed_values' => '0|I am unable to travel to four in-person board meetings per year, regardless of financial sponsorship
1|I am able to travel to four in-person board meetings per year (either self-funded, or with financial sponsorship)
',
    'allowed_values_php' => '',
    'widget' => array(
      'default_value' => array(
        '0' => array(
          'value' => 1,
        ),
      ),
      'default_value_php' => NULL,
      'label' => 'Travel',
      'weight' => '-1',
      'description' => '',
      'type' => 'optionwidgets_onoff',
      'module' => 'optionwidgets',
    ),
  );

  // Translatables
  // Included for use with string extractors like potx.
  t('About Me');
  t('Experience');
  t('Motivation');
  t('Travel');

  return $fields;
}
+30 −0
Changes for features/association_at_large_elections/association_at_large_elections.features.inc: 30 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * Implementation of hook_node_info().
 */
function association_at_large_elections_node_info() {
  $items = array(
    'nomination' => array(
      'name' => t('Nomination'),
      'module' => 'features',
      'description' => t('A nomination for the at-large elections.'),
      'has_title' => '1',
      'title_label' => t('Name'),
      'has_body' => '0',
      'body_label' => '',
      'min_word_count' => '0',
      'help' => '',
    ),
  );
  return $items;
}

/**
 * Implementation of hook_views_api().
 */
function association_at_large_elections_views_api() {
  return array(
    'api' => '2',
  );
}
+129 −0
Changes for features/association_at_large_elections/association_at_large_elections.features.user_permission.inc: 129 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * Implementation of hook_user_default_permissions().
 */
function association_at_large_elections_user_default_permissions() {
  $permissions = array();

  // Exported permission: administer decisions
  $permissions['administer decisions'] = array(
    'name' => 'administer decisions',
    'roles' => array(
      '0' => 'administrator',
    ),
  );

  // Exported permission: administer voting api
  $permissions['administer voting api'] = array(
    'name' => 'administer voting api',
    'roles' => array(
      '0' => 'administrator',
    ),
  );

  // Exported permission: cancel own vote
  $permissions['cancel own vote'] = array(
    'name' => 'cancel own vote',
    'roles' => array(),
  );

  // Exported permission: create decisions
  $permissions['create decisions'] = array(
    'name' => 'create decisions',
    'roles' => array(
      '0' => 'administrator',
      '1' => 'association',
      '2' => 'board',
    ),
  );

  // Exported permission: create nomination content
  $permissions['create nomination content'] = array(
    'name' => 'create nomination content',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
    ),
  );

  // Exported permission: delete any nomination content
  $permissions['delete any nomination content'] = array(
    'name' => 'delete any nomination content',
    'roles' => array(),
  );

  // Exported permission: delete decisions
  $permissions['delete decisions'] = array(
    'name' => 'delete decisions',
    'roles' => array(
      '0' => 'administrator',
      '1' => 'association',
      '2' => 'board',
    ),
  );

  // Exported permission: delete own nomination content
  $permissions['delete own nomination content'] = array(
    'name' => 'delete own nomination content',
    'roles' => array(),
  );

  // Exported permission: edit any nomination content
  $permissions['edit any nomination content'] = array(
    'name' => 'edit any nomination content',
    'roles' => array(),
  );

  // Exported permission: edit own nomination content
  $permissions['edit own nomination content'] = array(
    'name' => 'edit own nomination content',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
    ),
  );

  // Exported permission: inspect all votes
  $permissions['inspect all votes'] = array(
    'name' => 'inspect all votes',
    'roles' => array(),
  );

  // Exported permission: remove voters
  $permissions['remove voters'] = array(
    'name' => 'remove voters',
    'roles' => array(
      '0' => 'administrator',
    ),
  );

  // Exported permission: view decisions
  $permissions['view decisions'] = array(
    'name' => 'view decisions',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
    ),
  );

  // Exported permission: view electoral list
  $permissions['view electoral list'] = array(
    'name' => 'view electoral list',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
    ),
  );

  // Exported permission: vote on decisions
  $permissions['vote on decisions'] = array(
    'name' => 'vote on decisions',
    'roles' => array(
      '0' => 'anonymous user',
      '1' => 'authenticated user',
    ),
  );

  return $permissions;
}
+35 −0
Changes for features/association_at_large_elections/association_at_large_elections.info: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
core = "6.x"
dependencies[] = "decisions"
dependencies[] = "features"
dependencies[] = "number"
dependencies[] = "optionwidgets"
dependencies[] = "profile"
dependencies[] = "ranking"
dependencies[] = "text"
dependencies[] = "views"
dependencies[] = "votingapi"
description = "Supporting functionality for at-large board member elections"
features[content][] = "nomination-field_about_me"
features[content][] = "nomination-field_experience"
features[content][] = "nomination-field_motivation"
features[content][] = "nomination-field_travel"
features[node][] = "nomination"
features[user_permission][] = "administer decisions"
features[user_permission][] = "administer voting api"
features[user_permission][] = "cancel own vote"
features[user_permission][] = "create decisions"
features[user_permission][] = "create nomination content"
features[user_permission][] = "delete any nomination content"
features[user_permission][] = "delete decisions"
features[user_permission][] = "delete own nomination content"
features[user_permission][] = "edit any nomination content"
features[user_permission][] = "edit own nomination content"
features[user_permission][] = "inspect all votes"
features[user_permission][] = "remove voters"
features[user_permission][] = "view decisions"
features[user_permission][] = "view electoral list"
features[user_permission][] = "vote on decisions"
features[views][] = "nominations"
features[views_api][] = "api:2"
name = "Association At-Large Elections"
package = "Features"
+3 −0
Changes for features/association_at_large_elections/association_at_large_elections.module: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

include_once('association_at_large_elections.features.inc');
Loading