Gossamer Forum
Home : Products : Gossamer Links : Discussions :

User interface in Admin -> Browse == massive headache

Quote Reply
User interface in Admin -> Browse == massive headache
Hello ...

Right now I'm finding the user interface to Browse very difficult for sustained and productive editing of an imported list.

One problem in particular has caused helper editors to give up completely. I will outline it here, as I think it may be quite easy to hack a solution without a plugin.

When you are looking at the records for individual links in the right-hand frame, there is nothing to tell you which other categories it appears in.

It's a vital item of information -- I know it has to be pulled from another table, but editing is virtually impossible without it. In our project every link has at least two locations, and some may have four. Preparation for launching the project consists mainly of trawling through the list, and ensuring that every link is properly described and categorized. But we can't actually do it in Links SQL.

The reason we think there may be a simple solution is that in Database > Links > Modify Record, this information is displayed and can be edited (though not easily).

GT staff: can you help us out here please? All we need is to be able to see the list of categories somewhere on the 'Modify Link in ...' page.


Last edited by:

YoYoYoYo: Oct 10, 2001, 10:24 PM
Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == massive headache In reply to
Hi,

Would you want to be able to edit it? The difficulty here is that the editor may not have permission to modify the other category.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] User interface in Admin -> Browse == massive headache In reply to
My biggest problem is that admin (ie: me) can't even see the alternative categories.

It would be good to edit the categories directly in the Modify Link form when in Browse mode, but the Links SQL copy method works well enough.

So non-admin editor permissions are not an issue. They don't need to copy or remove links from their categories -- but they do need to know what other categories the links are in.
Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == massive headache In reply to
Hi,

Sure, I can add this into the next release. For now, if you edit browser_link_modify_form.html and add:

Code:
<br>
<%if alt_cat%>
<table border=1 cellpadding=0 cellspacing=0><tr><td align=center>
<table border=0 width=500><tr><td align=left><font
face="Tahoma,Arial,Helvetica" size="2">
This link is also in the following categories:
<blockquote>
<%alt_cat%>
</blockquote>
</font></td></tr></table>
</td></tr></table>
<br>
<%endif%>

after <%form%>. And then edit admin/Links/Browser.pm and add:

Code:
my $catlink = $DB->table ('Category', 'CatLinks');
my $alt_cat;
my $sth = $catlink->select ( { LinkID => $link_id }, ['ID', 'Full_Name', 'Name']);
while (my ($id, $fname, $name) = $sth->fetchrow_array) {
next if ($id == $category_id);
$alt_cat .= $fname . "<BR>";
}

around line 940 in sub link_modify_form and lastly put:

alt_cat => $alt_cat,

in the call to print_template in the same subroutine.

Let me know if that makes sense.

Cheers,

Alex
--
Gossamer Threads Inc.

Last edited by:

Alex: Oct 11, 2001, 3:05 PM
Quote Reply
Re: [Alex] User interface in Admin -> Browse == massive headache In reply to
Oh, Alex...

Is it possible to do something similiar for copied links? As I think I will be using copied rather then Alts.
Quote Reply
Re: [rayhne] User interface in Admin -> Browse == massive headache In reply to
Alt == copy, no?

Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == massive headache In reply to
Appearently not...see this thread:

http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=160682;sb=post_latest_reply;so=DESC;forum_view=forum_view_collapsed;
Quote Reply
Re: [Alex] User interface in Admin -> Browse == massive headache In reply to
Tried that ... it generates this error message:
Code:
A fatal error has occured:

Links::Browser: Unable to compile: link_modify_form (Global symbol "$sth" requires explicit package name at (eval 1) line 21.
) at /<PATH_TO>/cgi-bin/dir/Links/Browser.pm line 71.

Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == massive headache In reply to
That means you need to use

my $sth ..bla..

instead of just

$sth ...bla...
Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == massive headache In reply to
Ooops, bad cut and paste. I've edited it again, try now.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] User interface in Admin -> Browse == massive headache In reply to
Thanks Alex ... that works for us.
We have put it in the browser_link_modify_form.html for both admin and editors, before <form ..., etc, to emphasize its importance.

How can we modify the Browser.pm code to convert the alt category list to a list of links to the static category pages?

Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == massive headache In reply to
Hi,

Around line 830, you could change:

$output .= qq~
<input type="checkbox" name="delete" value="$id"> $name_r->{Full_Name} $rel_name<br>
~;

to:

my $url = $category->as_url ( $name_r->{Full_Name} );
$output .= qq~
<input type="checkbox" name="delete" value="$id"> <a href="$CFG->{build_root_url}/$url/$CFG->{build_index}" target="_blank">$name_r->{Full_Name}</a> $rel_name<br>
~;

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] User interface in Admin -> Browse != headache In reply to
Thanks Alex ... it's getting better day by day.

Links from the editing interface to relevant sections of the public database are always helpful.

Would it be easy to get the links into $alt_cat ?

Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse != headache In reply to
Hello,

I have done ths:

$alt_cat .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=$id">$fname</a>~;

and it works

I think you can do something like

$alt_cat .= qq~<option value="$id">$fname~;

and add in your browser_link_modify_form.html
something like this

<%if alt_cat%>
<select name="CatLinks.CategoryID">
<%alt_cat%>
<%endif%>

I didn't test it but you can try.

Quote Reply
Re: [ridesworld] User interface in Admin -> Browse == Massive Improvement In reply to
Hi ridesworld ... thanks for the instant (perfect) solution.

If you are doing intensive editing, of course you need a dynamic link so as to keep us with everything you have done.

I'm using multiple categories, so I modified Browser.pm like this ...
Code:
$alt_cat .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=$id" target="_blank">$fname</a><BR> ~;

Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == Massive Improvement In reply to
Finally, I have this

In Browser.pm
Code:
my $alt_cat;
my $this_cat;
my $sth = $catlink->select ( { LinkID => $link_id }, ['ID', 'Full_Name', 'Name']);
while (my ($id, $fname, $name) = $sth->fetchrow_array) {
if ($id == $category_id) {
$this_cat = qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=$id" target="_blank">$fname</a><BR> ~;
}
else {
$alt_cat .= qq~<I>and</I>&nbsp; <a href="$CFG->{db_cgi_url}/page.cgi?g=$id" target="_blank">$fname</a><BR> ~;
}
}


In browser_link_modify_form.html
Code:
<table border=0 cellpadding=0 cellspacing=0 width=500>
<tr><td><font face="Tahoma,Arial,Helvetica" size="2">
<B>Categories:</B><BR>
<%if this_cat%> <%this_cat%> <%endif%>
<%if alt_cat%> <%alt_cat%> <%endif%>
</font>
</td></tr>
</table>

Quote Reply
Re: [YoYoYoYo] User interface in Admin -> Browse == Massive Improvement In reply to
Ok, here's what will be in the next version:

Browser.pm:

Quote:
my @cats;
while (my $cat = $sth->fetchrow_hashref) {
$cat->{as_url} = $category->as_url ($cat->{Full_Name});
push @cats, $cat;
}

and browser_link_modify.html:

Quote:
<%if category_loop%>
<%Links::config_vars%>
<table border=1 cellpadding=0 cellspacing=0><tr><td align=center>
<table border=0 width=500><tr><td align=left><font face="Tahoma,Arial,Helvetica" size="2">
This link is in the following categories:
<blockquote>
<%loop category_loop%>
<li><a href="<%cfg_db_cgi_url%>/page.cgi?g=<%as_url%>" target="_blank"><%Full_Name%></a>
<%endloop%>
</blockquote>
</font></td></tr></table>
</td></tr></table>
<br>
<%endif%>

Let me know what you think.. Using a loop means you can switch from <li> separated to AND separated or whatever else you need.

Cheers,

Alex
--
Gossamer Threads Inc.