diff options
-rwxr-xr-x | css/base.css | 302 | ||||
-rwxr-xr-x | css/main.css | 24 | ||||
-rwxr-xr-x | fossee_stats.info | 7 | ||||
-rwxr-xr-x | fossee_stats.module | 241 | ||||
-rwxr-xr-x | js/main.js | 28 | ||||
-rwxr-xr-x | js/smooth_scroll.js | 26 |
6 files changed, 628 insertions, 0 deletions
diff --git a/css/base.css b/css/base.css new file mode 100755 index 0000000..6976f69 --- /dev/null +++ b/css/base.css @@ -0,0 +1,302 @@ +/* -------------- Form Elements ------------- */ + +fieldset { + background: #f9f8cc; + border: 1px solid #cccccc; + margin-top: 10px; + margin-bottom: 32px !important; + padding: 10px; + position: relative; + border: 1px solid #cccccc !important; + top: 12px; /* Offsets the negative margin of legends */ + -khtml-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +.fieldset-wrapper { + margin-top: 10px; +} +.node-form .vertical-tabs .fieldset-wrapper { + margin-top: 0; +} +.filter-wrapper { + top: 0; + padding: 1em 0 0.2em; + -khtml-border-radius-topright: 0; + -khtml-border-radius-topleft: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.filter-help a { + font-size: 0.857em; + padding: 2px 20px 0; +} +.filter-wrapper .form-item label { + margin-right: 10px; +} +.filter-wrapper .form-item { + padding: 0 0 0.5em 0.5em; +} +.filter-guidelines { + padding: 0 1.5em 0 0.5em; +} +fieldset.collapsed { + background: transparent; + -khtml-border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + border: 10px #dddddd solid; +} +fieldset legend { +width: auto; +border: 1px #1a6f93 solid; +color: black; +font-family: Arial; +font-weight: none; +font-size: 25px; +margin-left: 25px; +padding-right: 5px; +padding-left: 2px; +padding-top: 2px; +padding-bottom: 2px; +background:#f9f7cc; +-moz-border-radius: 10px; +margin-bottom: 10px; + + } +fieldset.collapsed legend { + -khtml-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +fieldset legend a { + color: #3b3b3b; +} +fieldset legend a:hover, +fieldset legend a:focus, +fieldset legend a:active { + color: #000; +} +fieldset .fieldset-wrapper { + padding: 0 15px 15px; +} +fieldset .fieldset-description { + margin-top: 5px; + margin-bottom: 1em; + line-height: 1.4; + color: #3c3c3c; + font-style: italic; +} +input { + margin: 2px 0; + padding: 4px; +} +input, +textarea { + font-size: 0.929em; +} +textarea { + line-height: 1.5; +} +textarea.form-textarea, +select.form-select { + padding: 4px; +} +input.form-text, +textarea.form-textarea, +select.form-select { + border: 1px solid #ccc; +} +input.form-submit:hover, +input.form-submit:focus { + background: #dedede; +} +.password-suggestions ul li { + margin-left: 1.2em; /* LTR */ +} +.form-item { + margin-bottom: 1em; + margin-top: 2px; +} +.form-item label { + font-size: 0.929em; +} +.form-type-radio label, +.form-type-checkbox label { + margin-left: 4px; +} +.form-type-radio .description, +.form-type-checkbox .description { + margin-left: 2px; +} +.form-actions { + padding-top: 10px; +} +/* Contact Form */ +.contact-form #edit-name { + width: 75%; + -khtml-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +.contact-form #edit-mail { + width: 75%; + -khtml-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +.contact-form #edit-subject { + width: 75%; + -khtml-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +.contact-form #edit-message { + width: 76.3%; + -khtml-border-top-left-radius: 4px; + -khtml-border-top-right-radius: 4px; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.contact-form .resizable-textarea .grippie { + width: 76%; + -khtml-border-bottom-left-radius: 4px; + -khtml-border-bottom-right-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; +} + +/* Disabled form elements */ +input.form-button-disabled, +input.form-button-disabled:hover, +input.form-button-disabled:focus, +input.form-button-disabled:active, +.form-disabled input, +.form-disabled select, +.form-disabled textarea { + background: #ededed; + border-color: #bbb; + color: #717171; +} +.form-disabled .grippie { + background-color: #ededed; + border-color: #bbb; +} +.form-disabled label { + color: #717171; +} + +/* Animated throbber */ +html.js input.form-autocomplete { + background-position: 100% 4px; /* LTR */ +} +html.js input.throbbing { + background-position: 100% -16px; /* LTR */ +} + +/* Comment form */ +.comment-form label { + float: left; /* LTR */ + font-size: 0.929em; + width: 120px; +} +.comment-form input, +.comment-form .form-select { + margin: 0; + -khtml-border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +.comment-form .form-type-textarea label { + float: none; +} +.comment-form .form-item, +.comment-form .form-radios, +.comment-form .form-type-checkbox, +.comment-form .form-select { + margin-bottom: 10px; + overflow: hidden; +} +.comment-form .form-type-checkbox, +.comment-form .form-radios { + margin-left: 120px; /* LTR */ +} +.comment-form .form-type-checkbox label, +.comment-form .form-radios label { + float: none; + margin-top: 0; +} +.comment-form input.form-file { + width: auto; +} +.no-sidebars .comment-form .form-text { + width: 800px; +} +.one-sidebar .comment-form .form-text { + width: 500px; +} +.two-sidebars .comment-form .form-text { + width: 320px; +} +.comment-form .form-item .description { + font-size: 0.786em; + line-height: 1.2; + margin-left: 120px; /* LTR */ +} +#content h2.comment-form { + margin-bottom: 0.5em; +} +.comment-form .form-textarea { + -khtml-border-radius-topleft: 4px; + -khtml-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.comment-form fieldset.filter-wrapper .fieldset-wrapper, +.comment-form .text-format-wrapper .form-item { + margin-top: 0; + margin-bottom: 0; +} +.filter-wrapper label { + width: auto; + float: none; +} +.filter-wrapper .form-select { + min-width: 120px; +} +.comment-form fieldset.filter-wrapper .tips { + font-size: 0.786em; +} +#comment-body-add-more-wrapper .form-type-textarea label { + margin-bottom: 0.4em; +} +#edit-actions input { + margin-right: 0.6em; /* LTR */ +} +fieldset p { + margin: 0 0 5px; + text-align: left; +} diff --git a/css/main.css b/css/main.css new file mode 100755 index 0000000..8a36e99 --- /dev/null +++ b/css/main.css @@ -0,0 +1,24 @@ +/* override bootstrap */ +.btn-large { + padding: 8px 19px !important; +} +/* main styles */ +#job-application input[type=text], +#job-application select { + width: 55%; +} +#job-description legend, +#job-application legend { + text-align: center; +} +#quick-links { + position: fixed; + left: 45px; + top: 250px; +} +.sync-msg { + font-size: .8em; +} +.messages.success { + background: lightgreen; +} diff --git a/fossee_stats.info b/fossee_stats.info new file mode 100755 index 0000000..fbd35d1 --- /dev/null +++ b/fossee_stats.info @@ -0,0 +1,7 @@ +name = Fossee stats +description = Fossee stats for FOSSEE . +package = STATISTICS +core = 7.x + +stylesheets[all][] = css/base.css +stylesheets[all][] = css/main.css diff --git a/fossee_stats.module b/fossee_stats.module new file mode 100755 index 0000000..ecc0ac7 --- /dev/null +++ b/fossee_stats.module @@ -0,0 +1,241 @@ +<?php + + function fossee_stats_permission() { + return array( + "access fossee_stats" => array( + "title" => t("Access fossee_stats"), + "description" => t("Allows users to view job postings.") + ), + "manage fossee_stats" => array( + "title" => t("Manage fossee_stats"), + "description" => t("Allows users to manage job postings.") + ), + /* "manage download_application" => array( + "title" => t("Manage Download Portal"), + "description" => t("Allows users to download job applications.") + ),*/ +); + } + + function fossee_stats_menu() { + $items = array(); + $items["fossee-stats"] = array( + "title" => "FOSSEE STATS", + "page callback" => "drupal_get_form", + "page arguments" => array("fossee_stats_form"), + "access arguments" => array("access fossee_stats"), + "type" => MENU_NORMAL_ITEM, + ); + + $items["jobs/ajax"] = array( + "title" => "Ajax callbacks", + "page callback" => "fossee_stats_ajax", + "access arguments" => array("access fossee_stats"), + "type" => MENU_CALLBACK + ); + + return $items; + } + + function fossee_stats_form($form, &$form_state) { + $options_first = _ajax_example_get_first_dropdown_options(); + + // If we have a value for the first dropdown from $form_state['values'] we use + // this both as the default value for the first dropdown and also as a + // parameter to pass to the function that retrieves the options for the + // second dropdown. + if(isset($form_state['values']['foss_type'])){ + $foss_project = isset($form_state['values']['foss_type']) ? $form_state['values']['foss_type'] : key($options_first); + }else{ + $foss_project = ''; + } + //$foss_project=$selected; + $form['foss_type'] = array( + '#type' => 'select', + '#title' => 'FOSS Type', + '#options' => $options_first, + '#default_value' => $foss_project, + // Bind an ajax callback to the change event (which is the default for the + // select form type) of the first dropdown. It will replace the second + // dropdown when rebuilt. + '#ajax' => array( + + // When 'event' occurs, Drupal will perform an ajax request in the + // background. Usually the default value is sufficient (eg. change for + // select elements), but valid values include any jQuery event, + // most notably 'mousedown', 'blur', and 'submit'. + // 'event' => 'change', + 'callback' =>'ajax_example_dependent_dropdown_callback', + 'wrapper' => 'dropdown-second-replace', + ), + ); + if(isset($form_state['values']['foss_sub_project'])){ + $foss_sub_project = isset($form_state['values']['foss_sub_project']) ? $form_state['values']['foss_sub_project'] : key(_ajax_example_get_second_dropdown_options($foss_project)); + }else{ + $foss_sub_project = ''; + } + $form['foss_sub_project'] = array( + '#type' => 'select', + '#title' => t('Foss Sub Project'), + '#options' => _ajax_example_get_second_dropdown_options($foss_project), + // The entire enclosing div created here gets replaced when foss_type + // is changed. + '#prefix' => '<div id="dropdown-second-replace">', + '#suffix' => '</div>', + // When the form is rebuilt during ajax processing, the $selected variable + // will now have the new value and so the options will change. + // '#options' => _ajax_example_get_second_dropdown_options($selected), + '#default_value' => $foss_sub_project, + '#ajax' => array( + + // When 'event' occurs, Drupal will perform an ajax request in the + // background. Usually the default value is sufficient (eg. change for + // select elements), but valid values include any jQuery event, + // most notably 'mousedown', 'blur', and 'submit'. + // 'event' => 'change', + 'callback' =>'ajax_example_dependent_dropdown_callback1', + 'wrapper' => 'dropdown-third-replace', + ), + ); + if(isset($form_state['values']['foss_sub_project']) && isset($form_state['values']['foss_type'])){ + $foss_sub_project_status = isset($form_state['values']['foss_sub_project']) ? $form_state['values']['foss_sub_project'] : ''; + }else{ + $foss_sub_project_status = ''; + } + + $form['foss_sub_project_status'] = array( + '#type' => 'select', + '#title' => t('Status'), + '#options' => _ajax_example_get_third_dropdown_options($foss_sub_project), + // The entire enclosing div created here gets replaced when foss_type + // is changed. + '#prefix' => '<div id="dropdown-third-replace">', + '#suffix' => '</div>', + + // When the form is rebuilt during ajax processing, the $selected variable + // will now have the new value and so the options will change. + // '#options' => _ajax_example_get_second_dropdown_options($selected), + '#default_value' => $foss_sub_project_status, + ); + + $today = date("Y-m-d H:i:s"); + $form['start_date'] = array( + '#type' => 'date_popup', + + '#default_value' => $today, + '#date_type' => DATE_DATETIME, + '#date_format' => 'd/m/Y', + '#date_increment' => 1, + '#date_year_range' => '-3:+3', + ); + $today = date("Y-m-d H:i:s"); + $form['end_date'] = array( + '#type' => 'date_popup', + '#default_value' => $today, + '#date_type' => DATE_DATETIME, + '#date_format' => 'd/m/Y', + '#date_increment' => 1, + '#date_year_range' => '-3:+3', + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Filter'), + ); + $form['reset'] = array( + '#type' => 'submit', + '#value' => t('Reset'), + ); + + return $form; + } + + function _ajax_example_get_first_dropdown_options(){ + $query = db_select('foss_type'); + $query->fields('foss_type', array('id')); + $query->fields('foss_type', array('foss_name')); + $result = $query->execute(); + $options = array(); + $options[''] = "--------------"; + while ($foss_detail = $result->fetchObject()) + { + $options[$foss_detail->id] = $foss_detail->foss_name; + } + return $options; + } + + function _ajax_example_get_second_dropdown_options($foss_project = ''){ + if($foss_project != NULL){ + $query = db_select('foss_type'); + $query->fields('foss_type', array('tbc')); + $query->fields('foss_type', array('lab_migration')); + $query->condition('id',$foss_project); + $result = $query->execute(); + $subproject_detail = $result->fetchObject(); + $options = array(); + + if(($subproject_detail->tbc)!=0&&($subproject_detail->lab_migration)!=0){ + $options[''] = "--------------"; + $options[0] = "Textbook Companion"; + $options[1] = "Lab Migration"; + }else if(($subproject_detail->tbc)!=0&&($subproject_detail->lab_migration)==0){ + $options[''] = "--------------"; + $options[0] = "Textbook Companion"; + }else if(($subproject_detail->tbc)==0&&($subproject_detail->lab_migration)!=0){ + $options[''] = "--------------"; + $options[0] = "Lab Migration"; + }else if(($subproject_detail->tbc)==0&&($subproject_detail->lab_migration)==0) { + $options[0] = "No Sub-Project Available"; + }else { + $options[''] = "--------------"; + } + return $options; + }else{ + $options[''] = "--------------"; + return $options; + } + } + + function _ajax_example_get_third_dropdown_options($foss_sub_project=''){ + $options = array(); + + if($foss_sub_project!=''){ + + if($foss_sub_project==0){ + $options[''] = "----------2"; + $options[0] = "Books In Progress"; + $options[1] = "Completed Books"; + + }else if($foss_sub_project==1){ + $options[''] = "----------"; + $options[0] = "Labs in Progress"; + $options[1] = "Completed Labs"; + }else { + $options[0] = "Not Available"; + } + }else{ + $options[''] = "----------1"; + } + + return $options; + } + + function ajax_example_dependent_dropdown_callback($form, $form_state) { + $form['foss_sub_project']['#value'] = ''; + $form['foss_sub_project_status']['#value'] = ''; + // $commands = array(); + $commands[] = ajax_command_replace("#dropdown-second-replace", drupal_render($form['foss_sub_project'])); + $commands[] = ajax_command_replace("#dropdown-third-replace", drupal_render($form['foss_sub_project_status'])); + return array('#type' => 'ajax', '#commands' => $commands); + //return $form['foss_sub_project']; + } + + function ajax_example_dependent_dropdown_callback1($form, $form_state){ + return $form['foss_sub_project_status']; + } + + + + + + diff --git a/js/main.js b/js/main.js new file mode 100755 index 0000000..47e8925 --- /dev/null +++ b/js/main.js @@ -0,0 +1,28 @@ +$(document).ready(function() { + var basePath = Drupal.settings.basePath; + var modPath = basePath + "jobs/"; + + $shortlist = $(".shortlist"); + $shortlist.click(function (e) { + $(".sync-msg").remove(); + $(this).after("<span class='sync-msg'>Saving...</span>"); + $.ajax({ + url: modPath + "ajax/shortlist/" + $(this).data("aid"), + success: function() { + $(".sync-msg").remove(); + console.log("success"); + } + }); + }); + + + $(this).on('click','#d_app',function (e){ + if($shortlist.prop("checked") == false){ + alert("Please select atleast one resume for download"); + e.preventDefault(); + } + console.log('####'); + + }); + +}); diff --git a/js/smooth_scroll.js b/js/smooth_scroll.js new file mode 100755 index 0000000..d16dc1a --- /dev/null +++ b/js/smooth_scroll.js @@ -0,0 +1,26 @@ +(function($) { + $(document).ready(function() { + $('a[href*=#]:not([href=#])').click(function() { + if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') + || location.hostname == this.hostname) { + + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); + if (target.length) { + $('html,body').animate({ + scrollTop: target.offset().top + }, 1000); + return false; + } + } + }); + $(".quick").click(function() { + $(".quick").removeClass("badge-success"); + $(this).addClass("badge-success"); + setTimeout(function() { + $(".quick").removeClass("badge-success"); + }, 4000); + }); + $('.quick').tooltip(); + }); +})(jQuery); |