Overview
The head bar module will provide a header bar above the body of the page.
It used to attract the viewer as the header bar will appear after some seconds as configured.
It used to highlight any special thing in site like.
- Event
- New article
- Contact us
- Social media link
Features
- HTML code could be added.
- Color of the bar and mouse hover of the show icon can be configure from drupal.
- Delaytime can be customized.
Project Page : http://drupal.org/sandbox/j2r/1673526
Git Clone: git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/j2r/1673526.git headbar
Drupal Version 7.x
Reviewed the modules:
- http://drupal.org/node/1670352#comment-6193774
- http://drupal.org/node/1660466#comment-6163194
- http://drupal.org/node/1699468#comment-6272338
- http://drupal.org/node/1679472#comment-6225494
| Comment | File | Size | Author |
|---|---|---|---|
| headbar.jpg | 30.4 KB | j2r |
Comments
Comment #1
sanchi.girotra commented1. Add direct link to your git repository (git clone ...) and detailed description of what your project does in the issue summary refer:http://drupal.org/node/1011698.
2. There is still a master branch, make sure to remove it.
3. Create a proper menu link to access the Header bar settings page as we have to call the menu(admin/config/administration/headbar) directly on the browser to access the settings page.
For doing this,change menu link from "admin/config/administration/headbar " to "admin/config/people/headbar" then header bar settings link will start appearing on configuration page under people tag.
Comment #2
eyal shalevYou should also change your default branch to 7.x-1.x (currently master).
And also edit this issue description to include the new git clone command (will be helpful to new reviewers).
Comment #3
eyal shalevSuggestions:
configure = admin/config/administration/headbar).Questions:
Comment #3.0
j2r commentedadded git clone url
Comment #4
j2r commentedHey sanchi.girotra and Eyal Shalev thanks for review.
Please review the module.
Thanks
J2R
Comment #5
sanchi.girotra commentedHey J2R,
Please see the automated review report here.
Manual Review:
.module file:
Suggestion : You can declare variable as
$form['headbar_text] = array(
'#title' => t('Text'),
'#type' => 'textarea',
'#description' => t('Insert text which will come in the bar'),
'#default_value' => variable_get('headbar_text', 'This text will appear on header bar'),
);
rather than creating and declaring them twice in hook_init() as headbar_text and headbar_admin_settings() as msg_text.This will reduce no of variables declared but without this also project is working fine.
Comment #6
j2r commentedDone all the changes accordingly. Please review the module.
Comment #7
sanchi.girotra commentedChanging the status from needs work to needs review.
Remove error related to master branch by
make sure active branch(git branch) is not master then run
git branch -d master
git push origin :master
Comment #8
bartlantz commentedI tested the module and with one exception it worked as intended. (The close arrow doesn't work in the lastest version of Opera.)
I have the following suggestions:
1. The following internal function should be renamed with an underscore:
headbar_output --> _headbar_output
Naming internal functions with an underscore, tells other devs that this is an internal function and not a call to a hook.
2. Use Drupal.behaviors API instead of jQuery(document).ready()
change the
jQuery(document).ready(function() {
to:
Drupal.behaviors.headbar = {
attach: function (context, settings) {
3. As mentioned above, I tested it in firefox, chrome and opera. The close functionality does not
work on Opera. I do not know the policy on this, perhaps switching to Drupal.behaviors will fix this.
4. You probably want to disable the headbar on admin pages. Or at least offer that option on
the configuration page.
Thanks,
Bart
Comment #9
j2r commentedThanks for the review bartlantz.
I have updated all the 3 changes that you have mansion and now the headbar is working in opera as well. About the point no 4 , Can you suggest a way to check the page is admin page or backend page?
Comment #10
bartlantz commentedHey j2r,
the changes look good! That's great it's working in Opera too!
With point #4, I think you could add something as simple as the following to line #36 in headbar.module:
I only mentioned disabling on admin pages because with the admin menu, you can't see the headbar anyway. So it would seem to make sense to disable it there so that it doesn't interfere with the admin menu.
Thanks,
Bart
Comment #11
j2r commentedDone all the changes accordingly. Please review the module.
Comment #12
a_thakur commentedsome manual review.
All the admin related code should go in a differen file. In this case it would be headbar.admin.inc so the corresponding change in the implementation of hook_menu() would be.
And the function headbar_admin_settings() would go in the file headbar.admin.inc. All the descriptions shoudl end in a full stop.
Would be great in case you could include validation function for the textfield so the user can enter only the correct input.
Happy coding :)
Comment #13
j2r commentedHello a_thakur, Thanks for the review.
Added headbar.admin.inc file and moved all backend code in it and added form validation for delaytime as number and all the field must not be empty.
Please review
Comment #14
j2r commentedDone all the changes accordingly. Please review the module.
Comment #15
Anonymous (not verified) commentedYou might want to change the documentation on headbar_admin_settings_submit function.
Also even if the project is small I would recommend setting up a css folder where you can put your css file and images.
Again about css I would recommend to rewrite this function :
Indeed you could include a lot of css related content directly into the css file.
Comment #16
j2r commentedHey Quentin Albrand thanks for the review.
Done all the changes. Please review.
Comment #17
j2r commentedDone with all the changes. Please review the module.
Comment #18
patrickd commentedI'm sorry for the delay!
There are about 100 other applications waiting for review and only a hand full of active reviewers.
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
Comment #18.0
patrickd commentedAdded some reviewed modules link
Comment #18.1
pjcdawkins commentedChanged git command so it's accessible for non-maintainers.
Comment #19
pjcdawkins commentedAutomatic review
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732.
Manual review
General
There are a few grammatical and typographical errors, for example the module's description makes little sense: "Create a header bar which will appear on the header of the page after extend of time".
You also haven't answered the question in comment #3: "How is this better than using a custom block with javascript configurations?"
headbar.admin.inc
Instead of _headbar_is_empty, you should set #required => TRUE on the form elements you don't want to be left empty.
You also don't need to say "Error: " at the beginning of the strings you pass to form_set_error().
I suggest renaming _headbar_is_numeric() to something like _headbar_validate_delaytime(), to show more clearly that the validation function is specific to that element.
README.txt
This says the configuration page is at admin/config/administration/headbar, but it's actually at admin/config/user-interface/headbar.
headbar.module
_headbar_output() should make use of the Drupal Theme API, probably as a template file for a custom theme hook. See docs at http://drupal.org/node/933976.
Comment #20
j2r commentedThanks for the review pjcdawkins,
Will update all the changes.
Comment #21
j2r commentedHello
Done all the other changes locally. I am littlebit stuck with Drupal Theme API. Can any one help me out how can i shift my html code to theme API.
Thanks.
Comment #22
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #22.0
klausiChanged git command so 7.x-1.x branch is selected...
Comment #23
avpaderno