Changeset 3196002
- Timestamp:
- 11/24/2024 08:47:17 PM (16 months ago)
- Location:
- tradejournal
- Files:
-
- 6 added
- 1 deleted
- 6 edited
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.jpg (added)
-
assets/screenshot-4.png (added)
-
assets/screenshot-5.png (added)
-
assets/screenshot-6.png (added)
-
tags/1.0.4 (deleted)
-
trunk/assets/css/style.css (modified) (8 diffs)
-
trunk/includes/post-types.php (modified) (2 diffs)
-
trunk/includes/shortcodes.php (modified) (1 diff)
-
trunk/includes/template-functions.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/tradejournal.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tradejournal/trunk/assets/css/style.css
r3185259 r3196002 75 75 /* Responsive styling for mobile devices */ 76 76 @media (max-width: 768px) { 77 .trade-averages-table, 78 .trade-averages-table thead, 79 .trade-averages-table tbody, 80 .trade-averages-table th, 81 .trade-averages-table td, 77 78 .trade-averages-table, 79 .trade-averages-table thead, 80 .trade-averages-table tbody, 81 .trade-averages-table th, 82 .trade-averages-table td, 82 83 .trade-averages-table tr { 83 display: block;84 width: 100%;84 display: block; 85 width: 100%; 85 86 } 86 87 87 88 .trade-averages-table thead tr { 88 display: none; /* Hide the table header */ 89 display: none; 90 /* Hide the table header */ 89 91 } 90 92 91 93 .trade-averages-table tbody tr { 92 margin-bottom: 15px;93 border: 1px solid #ddd;94 padding: 10px;95 background-color: #fff;96 box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);94 margin-bottom: 15px; 95 border: 1px solid #ddd; 96 padding: 10px; 97 background-color: #fff; 98 box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); 97 99 } 98 100 99 101 .trade-averages-table td { 100 display: flex;101 justify-content: space-between;102 padding: 8px 10px;103 text-align: left;104 border: none;105 border-bottom: 1px solid #eee;102 display: flex; 103 justify-content: space-between; 104 padding: 8px 10px; 105 text-align: left; 106 border: none; 107 border-bottom: 1px solid #eee; 106 108 } 107 109 108 110 .trade-averages-table td:before { 109 content: attr(data-label);110 font-weight: bold;111 flex: 1;112 color: #333;111 content: attr(data-label); 112 font-weight: bold; 113 flex: 1; 114 color: #333; 113 115 } 114 116 115 117 .trade-averages-table td:last-child { 116 border-bottom: none;118 border-bottom: none; 117 119 } 118 120 } … … 124 126 125 127 @media (max-width: 768px) { 128 126 129 .tradejournal-table th, 127 130 .tradejournal-table td { 128 display: block; /* Stack columns on smaller screens */ 131 display: block; 132 /* Stack columns on smaller screens */ 129 133 width: 100%; 130 134 } 131 135 132 136 .tradejournal-table th { 133 display: none; /* Hide table headers on small screens */ 137 display: none; 138 /* Hide table headers on small screens */ 134 139 } 135 140 136 141 .tradejournal-table td:before { 137 content: attr( 138 data-label 139 ); /* Show the table header as a label before the content */ 142 content: attr(data-label); 143 /* Show the table header as a label before the content */ 140 144 font-weight: bold; 141 145 display: block; … … 145 149 146 150 .tradejournal-thumbnail { 147 width: 100px; /* Set a fixed width */ 151 width: 100px; 152 /* Set a fixed width */ 148 153 height: auto; 149 border-radius: 5px; /* Optional: rounded corners */ 154 border-radius: 5px; 155 /* Optional: rounded corners */ 150 156 } 151 157 … … 154 160 width: 100%; 155 161 margin: 0 auto; 162 container-type: inline-size; 163 /* Enable container query support */ 156 164 } 157 165 … … 165 173 box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 166 174 transition: box-shadow 0.3s ease; 167 margin-bottom: 20px; /* Vertical space between items */ 175 margin-bottom: 20px; 176 /* Vertical space between items */ 168 177 } 169 178 … … 181 190 182 191 /* For larger screens (3 columns) */ 183 @ media(min-width: 900px) {192 @container (min-width: 900px) { 184 193 .tradejournal-post { 185 width: calc(33.33% - 20px); /* 3 columns with space for gutter */ 194 width: calc(33.33% - 20px); 195 /* 3 columns with space for gutter */ 186 196 } 187 197 } 188 198 189 199 /* For medium screens (2 columns) */ 190 @ media(min-width: 600px) and (max-width: 899px) {200 @container (min-width: 600px) and (max-width: 899px) { 191 201 .tradejournal-post { 192 width: calc(50% - 15px); /* 2 columns with space for gutter */ 202 width: calc(50% - 15px); 203 /* 2 columns with space for gutter */ 193 204 } 194 205 } 195 206 196 207 /* For smaller screens (1 column) */ 197 @ media(max-width: 599px) {208 @container (max-width: 599px) { 198 209 .tradejournal-post { 199 210 width: 100%; … … 202 213 203 214 .tradejournal-post { 204 cursor: pointer; /* Changes the cursor to a hand */ 215 cursor: pointer; 216 /* Changes the cursor to a hand */ 205 217 } 206 218 … … 212 224 padding: 10px; 213 225 border-radius: 5px; 214 font-weight: bold;215 226 color: #fff; 216 227 text-align: center; 217 228 margin-top: 10px; 218 margin: 10px auto; /* Center horizontally */ 219 max-width: 200px; /* Set the max width */ 229 margin: 10px auto; 230 /* Center horizontally */ 231 max-width: 200px; 232 /* Set the max width */ 220 233 } 221 234 222 235 .positive-profit { 223 background-color: #4caf50; /* Green for positive profit */ 236 background-color: #4caf50; 237 /* Green for positive profit */ 224 238 } 225 239 226 240 .negative-profit { 227 background-color: #f44336; /* Red for negative profit */ 241 background-color: #f44336; 242 /* Red for negative profit */ 228 243 } 229 244 230 245 .zero-profit { 231 background-color: #ff9800; /* Orange for zero profit */ 246 background-color: #ff9800; 247 /* Orange for zero profit */ 232 248 } 233 249 234 250 .profit-container strong { 235 margin-right: 5px; /* Adjust the space between PROFIT: and the value */ 251 margin-right: 5px; 252 /* Adjust the space between PROFIT: and the value */ 236 253 } 237 254 238 255 /* Make FooTable always take up 100% width */ 239 .footable, .footable table { 256 .footable, 257 .footable table { 240 258 width: 100% !important; 241 259 max-width: 100% !important; 242 margin: 0 auto; /* Center table if needed */ 243 } 260 margin: 0 auto; 261 /* Center table if needed */ 262 } -
tradejournal/trunk/includes/post-types.php
r3185259 r3196002 12 12 'show_in_menu' => true, 13 13 'menu_icon' => 'dashicons-chart-bar', // Set the icon to dashicons-chart-bar 14 'rewrite' => ['slug' => 'tradejournal'], 14 15 ); 15 16 register_post_type('tradejournal', $args); … … 43 44 ); 44 45 45 register_post_type('tradejournal _wp', $args);46 register_post_type('tradejournal', $args); 46 47 } -
tradejournal/trunk/includes/shortcodes.php
r3185259 r3196002 68 68 69 69 $output .= '<div class="profit-container ' . $profit_class . '">'; 70 $output .= ' <strong>PROFIT: </strong>$' . $total_profit; // Total Profit70 $output .= 'PROFIT: $' . $total_profit; // Total Profit 71 71 $output .= '</div>'; 72 72 -
tradejournal/trunk/includes/template-functions.php
r3185259 r3196002 34 34 $entry_time = esc_html($trade['Entry Time']); 35 35 $qty = esc_html($trade['Qty']); 36 $pnl = esc_html($trade['P&L']); 36 // $pnl = (float)esc_html($trade['P&L']); 37 38 if (isset($trade['P&L']) && is_numeric($trade['P&L'])) { 39 $pnl = (float)esc_html($trade['P&L']); 40 } else { 41 $pnl = 0; 42 } 43 37 44 $side = esc_html($trade['Side']); 38 45 $comment = isset($trade['Comment']) ? esc_html($trade['Comment']) : ''; -
tradejournal/trunk/readme.txt
r3187905 r3196002 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 1.0. 56 Stable tag: 1.0.6 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 15 15 **TradeJournal WP** is a trade journal plugin designed to help traders keep track of their trading performance by importing trades from NinjaTrader CSV files. Currently, it supports only **NinjaTrader**, with plans to support additional platforms in the future. 16 16 17 With TradeJournal WP, you can upload a CSV file containing your trades for a particular day, and the plugin will automatically create a post that logs all trades for that day. NinjaTrader allows you to export trades for a specific day or multiple days in one CSV file, which can then be imported into TradeJournal WP to create detailed trade journal posts.17 With TradeJournal WP, you can upload a CSV file containing your trades for a particular day, and the plugin will automatically create a post that logs all trades for that day. You can also enhance your journal entries by uploading trade screenshots, which are displayed in a beautiful lightbox for easy viewing. NinjaTrader allows you to export trades for a specific day or multiple days in one CSV file, which can then be imported into TradeJournal WP to create detailed trade journal posts. 18 18 19 Key Features: 19 **Key Features:** 20 20 - Import trades from **NinjaTrader CSV** files. 21 21 - Create custom posts for each trading day with detailed trade information. 22 22 - Supports trade data, including instrument, entry/exit times, account, and P&L calculations. 23 - Upload and display **trade screenshots** in posts, with a built-in lightbox for viewing detailed trade images. 23 24 - Display a **monthly trade performance summary** with the `[trade_averages]` shortcode, showing metrics like average profit, win/loss percentage, and total trades. 24 25 - Block-based theme compatibility. … … 66 67 67 68 == Screenshots == 68 69 1. Screenshot of the CSV import screen (coming soon). 70 2. Screenshot of the trade journal post after importing (coming soon). 69 1. **Options Page** - Configure options like merging accounts and setting up trade configurations. 70 2. **CSV Import** - Import trades directly from NinjaTrader CSV files. 71 3. **Edit Trades** - Modify individual trade properties, add screenshots, and configure trade setups. 72 4. **User Guide** - Access the plugin's built-in guide to learn its features and how to use them effectively. 73 5. **Frontend Trade Posts** - View trade journal posts displayed on the frontend. 74 6. **Detailed Post View** - Display individual trade metadata and screenshots in an intuitive layout. 71 75 72 76 == Changelog == 77 78 = 1.0.6 = 79 * Enhancement: Added detailed plugin description and improved documentation. 80 * Enhancement: Added plugin screenshots for better understanding of features and functionality. 81 * Enhancement: Updated the readme file to reflect the latest features and usage instructions. 73 82 74 83 = 1.0.5 = … … 120 129 == Upgrade Notice == 121 130 131 = 1.0.6 = 132 * Enhancement: Added detailed plugin description and improved documentation. 133 * Enhancement: Added plugin screenshots for better understanding of features and functionality. 134 * Enhancement: Updated the readme file to reflect the latest features and usage instructions. 135 122 136 = 1.0.5 = 123 137 - Compatibility update for WordPress 6.7. Recommended for all users to ensure plugin stability with the latest WordPress version. -
tradejournal/trunk/tradejournal.php
r3187905 r3196002 3 3 Plugin Name: TradeJournal WP 4 4 Description: TradeJournal WP imports trades from NinjaTrader CSV files, creating detailed journal entries for each trading day. Includes trade management, P&L calculation, responsive tables, lightbox for screenshots, and compatibility with custom post types and block-based themes. Track performance, analyze setups, and organize screenshots easily within WordPress. 5 Version: 1.0. 55 Version: 1.0.6 6 6 Author: Laith Sinawi 7 7 Author URI: https://sinawiwebdesign.com
Note: See TracChangeset
for help on using the changeset viewer.