Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Form Templatization #3897

Conversation

areeshatariq
Copy link
Contributor

Description:

HTML Templatization of User form using Template::Toolkit

Related issues and discussion: #2416

@areeshatariq areeshatariq added the Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. label Jul 19, 2020
@areeshatariq areeshatariq self-assigned this Jul 19, 2020
@@ -38,9 +38,28 @@
use Storable qw/dclone/;
use Log::Any qw($log);

use Template;
use Data::Dumper;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it in here?

my $type = param('type') || 'add';
my $action = param('action') || 'display';


# Initialize the Template module
my $tt = Template->new({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the initialisation of $tt and $template_data_ref is now done several times in Display.pm and some .pl files in the same way. Would it make sense to introduce a new ProductOpener::Template module with methods that know how to do just that? It could reduce duplicated code and avoid errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hangy : maybe we can just make the $tt in Display.pm an exported variable. Then it's initialize once at module startup, and that's it.

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants