https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-11-15T19:42:15ZRedmineRedmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=531562013-11-15T19:42:15ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>You should be able to reassign the appropriate css class to each row after drag'n'drop easily using javascript. But using pseudo-classes seems an interesting option to clean up the views.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=531572013-11-15T19:44:35ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Tracker</strong> changed from <i>Defect</i> to <i>Feature</i></li><li><strong>Subject</strong> changed from <i>cycle("odd", "even") instead of css pseudo-classes</i> to <i>Use css pseudo-classes instead of cycle("odd", "even")</i></li><li><strong>Category</strong> set to <i>Code cleanup/refactoring</i></li></ul> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=711682016-05-30T22:49:50ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/16057">use_pseudo_classes.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16057/use_pseudo_classes.patch">use_pseudo_classes.patch</a> added</li></ul><p>I've created a patch that replaces the cycle("odd", "even") with CSS pseudo-classes. The patch passes the tests.</p>
Some remarks regarding this patch:
<ol>
<li>In current version, roadmap and version pages don't have the odd/even classes, but with this patch will have the styles (which is good for consistency in my opinion). </li>
<li>To keep the current style of block "Spent Time" from My Page (total row with "odd" style and time entries with white background), it was required to add two new CSS rules to specifically target that rows.</li>
<li>For drag'n'drop feature (Redmine 3.3.0 <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Drag'n'drop order configuration for statuses, trackers, roles... (Closed)" href="https://www.redmine.org/issues/12909">#12909</a>) it is no longer required to recalculate the odd/even classes using JS.</li>
</ol> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=711692016-05-31T00:48:11ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul><p>Although the patch may break some themes, it makes view files cleaner and can save some processor cycles on web servers.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=714212016-06-09T14:50:44ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>3.4.0</i></li></ul> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=728622016-08-22T22:30:36ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/16556">use_pseudo_classes_v2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16556/use_pseudo_classes_v2.patch">use_pseudo_classes_v2.patch</a> added</li></ul><p>Updated the patch to cleanly apply on the current trunk and also to include the new "cycle("odd", "even")" added in <a class="changeset" title="Adds permission to edit and delete issues by role/tracker (#285)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/15466">r15466</a></p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=748452016-12-03T09:40:40ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>I've committed the patch but it comes with an undesirable change: when displaying issue descriptions on the issue list, we used to get the issue row and its description with the same background color. Now, the issue and the description have their own background with different colors. It kind of breaks the readability of the list. Not sure if we can fix it using CSS only.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=748462016-12-03T09:54:23ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>I've committed the patch but it comes with an undesirable change: when displaying issue descriptions on the issue list, we used to get the issue row and its description with the same background color. Now, the issue and the description have their own background with different colors. It kind of breaks the readability of the list. Not sure if we can fix it using CSS only.</p>
</blockquote>
<p>I'll come up with a solution to fix this issue.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=748472016-12-03T10:01:21ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Themes that colorize issues based on odd/even classes will have to get fixed (including the "alternate" theme provided with the core). Is the removal of 2 javascript lines worth this pain? I mean, what is the real benefit of using the CSS pseudo classes?</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=748482016-12-03T10:02:32ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>FTR, I've reverted the changes until we find a solution for note-7 and take the decision to integrate the change.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=748642016-12-05T23:09:13ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/17218">issues_list.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/17218/issues_list.png">issues_list.png</a> added</li><li><strong>File</strong> <a href="/attachments/17219">3.4.0_use_pseudo_classes_v3.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/17219/3.4.0_use_pseudo_classes_v3.patch">3.4.0_use_pseudo_classes_v3.patch</a> added</li></ul><p>I've attached a new patch that fixes the issue from note-7. The patch includes both revisions (<a class="changeset" title="Use css pseudo-classes instead "odd", "even" classes (#15361). Patch by Marius BALTEANU." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/16050">r16050</a> and <a class="changeset" title="Removes calls to #reset_cycle (#15361)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/16051">r16051</a>).</p>
<p><img src="https://www.redmine.org/attachments/download/17218/issues_list.png" alt="" /></p>
<p>The simplest solution found was to keep the odd/even classes in the "issues/_list.html.erb" and "timelogs/_list.html.erb" views. The fix required also to have a new class named "odd-even" for the tables that still use the odd/even classes.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=748652016-12-05T23:22:31ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Themes that colorize issues based on odd/even classes will have to get fixed (including the "alternate" theme provided with the core). Is the removal of 2 javascript lines worth this pain? I mean, what is the real benefit of using the CSS pseudo classes?</p>
</blockquote>
<p>The new patch solves also the "alternate" theme. For other themes, the required fix is very small.</p>
<p>Regarding the real benefits, from my point of view:<br />- cleaner view files<br />- using a native and client-side only solution instead one that requires server-side processing and client-side<br />- simple way to style the tables (if you have a simple table, you only need the "list" class on the table; if you have a more complex table and you want to control the odd and even rows, you need the "list odd-even" classes and the "cycle" implementation).</p>
<p>For us, this feature is not a big improvement because in our custom theme we use the same color for rows and a bottom border as delimiter.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=762692017-01-25T11:47:05ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Patch is committed, thanks Marius. I still had to fix the backgrounds for the alternate theme.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=762712017-01-25T12:05:26ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Patch is committed, thanks Marius. I still had to fix the backgrounds for the alternate theme.</p>
</blockquote>
<p>I'm sure that I looked into the problem. I'll apply again the patch without your fix to understand what was the problem. Thanks.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=762772017-01-25T19:53:50ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/17589">add_odd-even_class_to_time_entries_block_from_my_page.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/17589/add_odd-even_class_to_time_entries_block_from_my_page.patch">add_odd-even_class_to_time_entries_block_from_my_page.patch</a> added</li></ul><p>I still can't figure it out which was the problem with the alternate theme, I miss something, for sure. But is not so important.</p>
<p><a class="changeset" title="Use css pseudo-classes instead of cycle("odd", "even") (#15361). Patch by Marius BALTEANU." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/16249">r16249</a> adds the :not(.odd-even) to the respective selectors and make them more powerfull than the rule "div.mypage-box table.time-entries tr.time-entry". The attached patch fixes the issue generated by that change and keeps the current style of the block "Spent Time" from My Page.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=762832017-01-26T01:00:40ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>Reopening to handle <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Use css pseudo-classes instead of cycle("odd", "even") (Closed)" href="https://www.redmine.org/issues/15361#note-15">#15361#note-15</a>.</p> Redmine - Feature #15361: Use css pseudo-classes instead of cycle("odd", "even")https://www.redmine.org/issues/15361?journal_id=763202017-01-26T18:07:49ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Patch applied, thanks.</p>