Changeset 1181636
- Timestamp:
- 06/16/2015 05:49:27 AM (11 years ago)
- Location:
- tabulate/trunk
- Files:
-
- 2 added
- 3 edited
-
README.md (modified) (4 diffs)
-
src/Shortcode.php (added)
-
tabulate.php (modified) (3 diffs)
-
templates/data_table.html (added)
-
templates/table.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tabulate/trunk/README.md
r1181512 r1181636 31 31 negations of all of these). Multiple filters are conjunctive (i.e. with a 32 32 logical *and*). 33 1. Access can be granted to *read*, *create*, *update*, *delete*, and *import*33 2. Access can be granted to *read*, *create*, *update*, *delete*, and *import* 34 34 records in any or all tables. (This can be done by anyone with the 35 35 *promote_users* capability.) 36 2. CSV data can be imported, with the UI supporting column mapping, data36 3. CSV data can be imported, with the UI supporting column mapping, data 37 37 validation, and previewing prior to final import. If an imported row has a 38 38 value for the Primary Key, the existing row will be overwritten. 39 3. Data can be exported to CSV, including after filters have been applied.40 4. A quick-jump navigation box (located top right of every page) can be39 4. Data can be exported to CSV, including after filters have been applied. 40 5. A quick-jump navigation box (located top right of every page) can be 41 41 activated by installing the [WP REST API](https://wordpress.org/plugins/json-rest-api/) 42 42 plugin. 43 5. Records in tables with *date* columns can be viewed in a calendar.44 6. Entity Relationship Diagrams (drawn with [GraphViz](http://graphviz.org/))43 6. Records in tables with *date* columns can be viewed in a calendar. 44 7. Entity Relationship Diagrams (drawn with [GraphViz](http://graphviz.org/)) 45 45 can be automatically generated, with any specified subset of tables. Foreign 46 46 keys are displayed as directed edges. This feature is only available if the 47 47 [TFO Graphviz plugin](https://wordpress.org/plugins/tfo-graphviz/) is installed. 48 7. All data modifications are recorded, along with optional comments that users48 8. All data modifications are recorded, along with optional comments that users 49 49 can provide when updating data. 50 9. The `[tabulate]` shortcode can be used to embed tables, lists, and row-counts 51 into WordPress content. For more details, see the [FAQ section](https://wordpress.org/plugins/tabulate/faq/). 50 52 51 53 ## Installation … … 63 65 ## Frequently Asked Questions 64 66 65 ### How should issues be reported? 67 ### How does one use the shortcode? 68 69 A [Shortcode](http://codex.wordpress.org/Shortcode) is a WordPress method of 70 embedding content into posts and pages. Tabulate provides one short code, 71 `[tabulate]`, which can be used to add tables, lists, and record-counts to your 72 content. Its parameters are as follows: 73 74 `table` — The name of the table in question. Required. No default. 75 76 `format` — One of `table`, `list`, or `count`. Optional. Defaults to `table`. 77 78 Do note that if a table is not accessible to the browsing user then nothing will 79 be displayed. (This currently means that anonymous users can not view any 80 Tabulate data, because there is no way to grant them access; this will be fixed 81 soon.) 82 83 ### Where should issues be reported? 66 84 67 85 Please log all bugs, feature requests, and other issues in the GitHub issue 68 tracker :https://github.com/tabulate/tabulate/issues86 tracker at https://github.com/tabulate/tabulate/issues 69 87 70 88 ### What modifications does Tabulate make to the database? … … 80 98 81 99 ### Where is the developers' documentation? 100 82 101 For information about the development of Tabulate or integrating other plugins 83 102 with it please see … … 95 114 https://github.com/tabulate/tabulate/commits/master 96 115 97 Prior to version 1, changes are not being l sited here (there are too many of116 Prior to version 1, changes are not being listed here (there are too many of 98 117 them, and nothing is stable yet). 99 118 -
tabulate/trunk/tabulate.php
r1181537 r1181636 3 3 * Plugin Name: Tabulate 4 4 * Description: Manage relational tabular data within the WP admin area, using the full power of your MySQL database. 5 * Version: 0.1 5.05 * Version: 0.16.0 6 6 * Author: Sam Wilson 7 7 * Author URI: http://samwilson.id.au/ … … 10 10 */ 11 11 12 define( 'TABULATE_VERSION', '0.1 5.0' );12 define( 'TABULATE_VERSION', '0.16.0' ); 13 13 define( 'TABULATE_SLUG', 'tabulate' ); 14 14 … … 42 42 add_filter( 'json_endpoints', array( $jsonController, 'register_routes' ) ); 43 43 } ); 44 45 // Shortcode. 46 $shortcode = new \WordPress\Tabulate\Shortcode( $wpdb ); 47 add_shortcode(TABULATE_SLUG, array( $shortcode, 'run' ) ); -
tabulate/trunk/templates/table.html
r1160146 r1181636 103 103 </div> 104 104 105 <table class='wp-list-table widefat'> 106 <thead> 107 <tr> 108 <th> </th> 109 {% for column in table.get_columns %} 110 <th>{{column.get_title}}</th> 111 {% endfor %} 112 </tr> 113 </thead> 114 <tbody> 115 {% for record in records %} 116 <tr> 117 <td> 118 <a href="{{ record.get_url() }}" class="">Edit</a> 119 </td> 120 {% for column in table.get_columns %} 121 <td class="type-{{ column.type }} {% if column.is_foreign_key %}is-foreign-key{% endif %}"> 122 123 {% if column.is_foreign_key %} 124 125 <a href="{{ record.get_referenced_record(column.get_name).get_url }}"> 126 {{ attribute(record, column.get_name~'FKTITLE') }} 127 </a> 128 129 {% elseif column.is_boolean %} 130 {% if attribute(record, column.get_name) is sameas(true) %} 131 Yes 132 {% elseif attribute(record, column.get_name) is sameas(false) %} 133 No 134 {% else %} 135 136 {% endif %} 137 138 {% else %} 139 {{ attribute(record, column.get_name) }} 140 141 {% endif %} 142 </td> 143 {% endfor %} 144 </tr> 145 {% endfor %} 146 </tbody> 147 </table> 105 {% include 'data_table.html' with { links:true } %} 148 106 149 107 {%endblock%}
Note: See TracChangeset
for help on using the changeset viewer.