Comments

berdir’s picture

Title: Add color legends to the node source view » Add color legends to the entity source view
miro_dietiker’s picture

Assigned: Unassigned » cgalli

I guess christophe is/was working on this.

cgalli’s picture

Assigned: cgalli » Unassigned
Status: Active » Needs review
StatusFileSize
new14.62 KB

Added color legends to the help area, implemented for 'node sources' and 'entity sources'

The patch has not touched a windows editor so the endings should be ok...

berdir’s picture

Status: Needs review » Needs work

Thanks!

There are quite a lot of views bulk operation changes in the export view. I assume that's because the version changed or something and not because you made any changes?

+++ b/ui/tmgmt_ui.moduleundefined
@@ -820,3 +820,43 @@ function tmgmt_ui_redirect_queue_dequeue() {
+ * Implements hook_help.
+ * @param $path
+ * @param $arg
+ * @return string

The @param and @return should be removed.

+++ b/ui/tmgmt_ui.moduleundefined
@@ -820,3 +820,43 @@ function tmgmt_ui_redirect_queue_dequeue() {
+
+function tmgmt_ui_help($path, $arg){

Unecessary empty line.

+++ b/ui/tmgmt_ui.moduleundefined
@@ -820,3 +820,43 @@ function tmgmt_ui_redirect_queue_dequeue() {
+  case 'admin/config/regional/tmgmt/entity':
+  case 'admin/config/regional/tmgmt/node':

As discussed, the problem with this is that the documentation for the entity and node modules is in the base module.

So if i18n finally adds a UI too, we will have to add it here as well.

Let's do this instead:
Move the code below into a helper function, something like tmgmt_ui_color_legend(), implement this hook for tmgmt_entity_ui and tmgmt_node_ui and call that function.

+++ b/ui/tmgmt_ui.moduleundefined
@@ -820,3 +820,43 @@ function tmgmt_ui_redirect_queue_dequeue() {
+        <div class="tmgmt-legend-title">Color Legend:</div>';

This part is not translatable.

+++ b/ui/tmgmt_ui.moduleundefined
@@ -820,3 +820,43 @@ function tmgmt_ui_redirect_queue_dequeue() {
+          $legend['color'] . '" title="Source language"><span></span></div>

The title here doesn't seem to make sense? And it isn't translatable, but I think we can just remove it.

cgalli’s picture

Here we go again.

- Only removed the footer from the view
- split the hook_help into three parts as suggested
- corrected errors

berdir’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Fixed

Thanks, commited.

miro_dietiker’s picture

Status: Fixed » Needs review

Looks great! Some extra notes:

+++ b/sources/entity/ui/tmgmt_entity_ui.moduleundefined
@@ -39,3 +39,18 @@ function tmgmt_entity_ui_tmgmt_source_plugin_info_alter(&$info) {
+function tmgmt_entity_ui_help($path, $arg){

+++ b/sources/node/ui/tmgmt_node_ui.moduleundefined
@@ -89,3 +89,18 @@ function tmgmt_node_ui_checkout_multiple_action($nodes, $info) {
+function tmgmt_node_ui_help($path, $arg){

Now we're floating contents of the hook_help... Finally we expect all the elements to be default-wrapped in the admin theme. Note we cannot really guarantee the sequence and thus floating is quite risky when considering other admin themes.

+++ b/ui/tmgmt_ui.moduleundefined
@@ -820,3 +820,31 @@ function tmgmt_ui_redirect_queue_dequeue() {
+    $output .= '<div class="tmgmt-one-legend">
...
+        <div class="tmgmt-legend-status">' .$legend['legend'] . '</div>

All legend labels have the exact same class. I guess somehow the color should also go into the outer class definition to allow better custom theming.

berdir’s picture

Status: Needs review » Needs work

That was too fast then.

Yes. Suggestion: Make the css selector so specific that it only matches if it's placed in the region where we want it to be floated. Make sure that things don't break when help is moved into a sidebar or below the main content. Maybe even put the css into a .seven.css and only apply it when the active theme is seven.

miro_dietiker’s picture

Assigned: Unassigned » cgalli

Can you please provide an update?

cgalli’s picture

Assigned: cgalli » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.07 KB

The right floating happens only in theme seven and only in the content region

removed the title to save space

cgalli’s picture

Added formatting for entity sources as well.

Load css files in color legend function

Replaces the path in #11

berdir’s picture

Status: Needs review » Needs work
+++ b/ui/tmgmt_ui.moduleundefined
@@ -825,6 +825,13 @@ function tmgmt_ui_redirect_queue_dequeue() {
+  global $theme;
+  if($theme == 'seven')
+    drupal_add_css(drupal_get_path('module', 'tmgmt_ui') . '/css/tmgmt_ui.admin.seven.css');

globals are usually defined at the top of a function.

Missing a space after if and { }

cgalli’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB

fixed

Status: Needs review » Needs work

The last submitted patch, Add-color-legends-to-the-entity-source-view-1900916-14.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Fixed

Thanks, committed with a few coding style fixes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.