webbuild-cgi: keep spec create fields to editr on failure

This commit is contained in:
Silvan Calarco 2024-09-14 14:53:23 +02:00
parent b8e6a0a960
commit 36b00b7e43

View File

@ -972,23 +972,29 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
# SPECFILE creation # SPECFILE creation
if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -a "$MAINTAINERMODE" != "true" ]; then if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -a "$MAINTAINERMODE" != "true" ]; then
SPECCREATENAME=""
[ "$SPECCREATEURL" != "" ] && SPECCREATENAME=$PACKAGE
DISABLED="disabled"
[ "$SPECCREATEURL" != "" ] && DISABLED=""
DISABLED_GIT="disabled"
[ "$SPECCREATEGITBRANCH" != "" ] && DISABLED_GIT=""
echo -n "<speccreate><![CDATA[<div class=\"speccreate\">" echo -n "<speccreate><![CDATA[<div class=\"speccreate\">"
echo -n " Start from URL:<input onChange=\"suggestSpecName()\" type=text id=speccreateurl value=\"\" style=\"width:32%\">" echo -n " Start from URL:<input onChange=\"suggestSpecName()\" type=text id=speccreateurl value=\"$SPECCREATEURL\" style=\"width:32%\">"
echo -n " name:<input type=text id=speccreatename disabled value=\"\" style=\"width:10%\">" echo -n " name:<input type=text id=speccreatename $DISABLED value=\"$SPECCREATENAME\" style=\"width:10%\">"
echo -n " type:<select id=speccreatetype disabled>" echo -n " type:<select id=speccreatetype $DISABLED>"
for t in `ls /usr/share/autospec/templates`; do for t in `ls /usr/share/autospec/templates`; do
[ "$t" = "library" ] && SELECTED="selected=selected" || SELECTED= [ "$t" = "$SPECCREATETYPE" ] && SELECTED="selected=selected" || SELECTED=
echo -n "<option id=speccreatetype value=\"$t\" $SELECTED>$t</option>" echo -n "<option id=speccreatetype value=\"$t\" $SELECTED>$t</option>"
done done
echo -n "</select>" echo -n "</select>"
echo -n " version:<input type=text disabled id=speccreateversion value=\"\" style=\"width:5%\">" echo -n " version:<input type=text $DISABLED id=speccreateversion value=\"$SPECCREATEVERSION\" style=\"width:5%\">"
echo -n " branch/tag:<input type=text disabled id=speccreategitbranch value=\"\" style=\"width:5%\">" echo -n " branch/tag:<input type=text $DISABLED_GIT id=speccreategitbranch value=\"$SPECCREATEGITBRANCH\" style=\"width:5%\">"
echo -n "<input type=button disabled id=speccreatebutton value=\"Create .spec\" onclick=ajax_getvalues(\"" echo -n "<input type=button $DISABLED id=speccreatebutton value=\"Create .spec\" onclick=ajax_getvalues(\""
echo -n "REQUEST=speccreate&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&" echo -n "REQUEST=speccreate&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
echo -n "PACKAGE=\"+encodeURIComponent(getElementById('speccreatename').value)+\"&" echo -n "PACKAGE=\"+encodeURIComponent(getElementById('speccreatename').value)+\"&"
echo -n "SPECCREATETYPE=\"+getElementById('speccreatetype').value+\"&" echo -n "SPECCREATETYPE=\"+getElementById('speccreatetype').value+\"&"
echo -n "SPECCREATEVERSION=\"+getElementById('speccreateversion').value+\"&" echo -n "SPECCREATEVERSION=\"+encodeURIComponent(getElementById('speccreateversion').value)+\"&"
echo -n "SPECCREATEGITBRANCH=\"+getElementById('speccreategitbranch').value+\"&" echo -n "SPECCREATEGITBRANCH=\"+encodeURIComponent(getElementById('speccreategitbranch').value)+\"&"
echo -n "SPECCREATEURL=\"+encodeURIComponent(getElementById('speccreateurl').value));>" echo -n "SPECCREATEURL=\"+encodeURIComponent(getElementById('speccreateurl').value));>"
echo "</div>]]></speccreate>" echo "</div>]]></speccreate>"
elif [ "$MAINTAINERMODE" = "true" ]; then elif [ "$MAINTAINERMODE" = "true" ]; then