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

Changes to 'Basic HTML' format #760

Closed
robocoder opened this issue Jun 7, 2009 · 13 comments
Closed

Changes to 'Basic HTML' format #760

robocoder opened this issue Jun 7, 2009 · 13 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@robocoder
Copy link
Contributor

Drop styling. Developers will apply their own theme anyways.

  • Drop <style>...</style> from output
  • Remove <b></b> tags
  • Drop border and width attributes from <table> definition

Recommended changes:

  • Enclose attribute values in double quotes.
  • Separate header and body using <thead></thead> and <tbody></tbody>
  • Set table id, e.g., id="Actions_getActions"
  • Instead of "Sub DataTable not loaded", add a pseudo-column that contains an integer (idSubtable)

Improvements:

@robocoder
Copy link
Contributor Author

  • Add unit tests to tests/core/DataTable/Renderer.test.php
  • Fix missing </tr> on header row.

@robocoder
Copy link
Contributor Author

Depends on #772

@robocoder
Copy link
Contributor Author

(In [1222]) fixes #760 - changes to Basic HTML format

@robocoder
Copy link
Contributor Author

(In [1223]) refs #760 - use <th> for header

@robocoder
Copy link
Contributor Author

Attachment: Screenshot of data table
datatable.jpg

@robocoder
Copy link
Contributor Author

Attachment: screenshot of graph table
graphtable.jpg

@robocoder
Copy link
Contributor Author

Attachment: Sample code
dataTable.html

@robocoder
Copy link
Contributor Author

The attached example uses the following jquery plugins:

@mattab
Copy link
Member

mattab commented Jun 15, 2009

Reopening:

  • before the html output was a simple debug output; now it seems it will be part of the feature as your examples suggest: it makes it very easy to reuse the data in external apps. As such, we need to add unit test to the output of this table, just like other format are tested in tests/core/DataTable/Renderer.test.php
  • how could we best showcase this new feature? It looks like something that could be very useful to many people integrating Piwik in their project.. I would suggest a short and sweet blog post tutorial explaining how to do so - just an idea :-) but would definitely advertise this to the community
  • could we also include it in misc/?
  • you mention "flot", is it in the screenshots attached to the ticket?

good work!

@mattab
Copy link
Member

mattab commented Jun 15, 2009

  • why do you do the following?
$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');
$value = htmlspecialchars($value);

I would instead suggest to use Piwik_DataTable_Filter_SafeDecodeLabel to keep this logic in one place only.

@robocoder
Copy link
Contributor Author

  • I can't include a test case/tutorial until Subtable arrays may vary in column ordering #772 is fixed because the variance in column order means the tests would pass on one machine and fail on another; similarly, dataTables and graphTable use row/column position/index to select data, not by row/column name
  • flot is used by graphTable, so there isn't a separate screenshot
  • the samples are just a proof-of-concept; Let's create a separate ticket to spec out what a flashy non-flash demo would be
  • why do I... hang on, I copied that snippet of code from another Renderer ;)

@robocoder
Copy link
Contributor Author

Closing in favor of #804; test case will be included in #772

@robocoder
Copy link
Contributor Author

Note: dataTable.html is a proof-of-concept; in practice, the data would be embedded in the page from the server-side so that token_auth is not exposed in the page source

@robocoder robocoder added this to the Piwik 0.4.1 milestone Jul 8, 2014
@robocoder robocoder self-assigned this Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

2 participants