Hello all,

Attached is a patch that fills out the previous effort.  Diffs to
deployed files now work properly.  I added a symlink icon (I used your
existing file icon and basically pasted an icon from gnome on top - I
don't know if that's okay with you all.  The specific file is
/usr/share/icons/gnome/8x8/emblems/emblem-symbolic-link.png.)  Symlinks
are now created in file_utils.py/process, and deployed in the
transactions.py/deploy method, just like files are.

I also changed setfilecon to lsetfilecon, but left the chown/chmod as
they were and didn't change them over to their lch??? equivalents -
lchmod is only in python 2.6.  Links are usually root:root/0777 anyways.
   The only thing I might still do is add some javascript to grey out the
user/mode fields in the webui.

Thanks,

Joshua Roys

Hello again,

Attached is a diff for git commit --amend. It fixes 3 typos and adds the javascript to disable unneeded input fields when the 'symlink' type is selected in the 'Create File' part of config management.

Thanks,

Joshua Roys
diff --git 
a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml 
b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index daef1dd..c8ca1d5 100644
--- 
a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ 
b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -7220,7 +7220,7 @@ Follow this url to see the full list of inactive systems:
                        <source>{0} file and {2} symlinks</source>
             </trans-unit>
             <trans-unit id="config.files_1_dirs_1_symlinks_0">
-                       <source>{0} file and {2} directory</source>
+                       <source>{0} file and {1} directory</source>
             </trans-unit>
             <trans-unit id="config.files_1_dirs_1_symlinks_1">
                        <source>{0} file and {1} directory and {2} 
symlink</source>
@@ -7229,7 +7229,7 @@ Follow this url to see the full list of inactive systems:
                        <source>{0} file and {1} directory and {2} 
symlinks</source>
             </trans-unit>
             <trans-unit id="config.files_1_dirs_2_symlinks_0">
-                       <source>{0} file and {2} directories</source>
+                       <source>{0} file and {1} directories</source>
             </trans-unit>
             <trans-unit id="config.files_1_dirs_2_symlinks_1">
                        <source>{0} file and {1} directories and {2} 
symlink</source>
@@ -7248,7 +7248,7 @@ Follow this url to see the full list of inactive systems:
                        <source>{0} files and {2} symlinks</source>
             </trans-unit>
             <trans-unit id="config.files_2_dirs_1_symlinks_0">
-                       <source>{0} files and {2} directory</source>
+                       <source>{0} files and {1} directory</source>
             </trans-unit>
             <trans-unit id="config.files_2_dirs_1_symlinks_1">
                        <source>{0} files and {1} directory and {2} 
symlink</source>
diff --git 
a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/create.jspf
 
b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/create.jspf
index 66a6fd4..f8cf93a 100644
--- 
a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/create.jspf
+++ 
b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/create.jspf
@@ -6,14 +6,33 @@
                <tr>
                        <th><bean:message key="addfiles.jsp.type-name" /></th>
                        <td>
-                       <html:radio property="filetype" value="file" 
/><bean:message
+                       <html:radio property="filetype" value="file" 
styleId="file_radio" /><bean:message
                                key="addfiles.jsp.type.text" /> <br />
                        <html:radio
-                               property="filetype" value="directory" 
/><bean:message
+                               property="filetype" value="directory" 
styleId="dir_radio" /><bean:message
                                key="addfiles.jsp.type.directory" /><br />
-                       <html:radio property="filetype" value="symlink" 
/><bean:message
+                       <html:radio property="filetype" value="symlink" 
styleId="symlink_radio" /><bean:message
                                key="addfiles.jsp.type.symlink" /><br />
-                       <bean:message key="filedetails.jsp.tip.symlink" />
+                       <script type="text/javascript">
+                               function enableAllInputs(event) {
+                                       $('cffUid').disabled = "";
+                                       $('cffGid').disabled = "";
+                                       $('cffPermissions').disabled = "";
+                                       $('cffMacroStart').disabled = "";
+                                       $('cffMacroEnd').disabled = "";
+                               }
+
+                               Event.observe('file_radio', 'focus', 
enableAllInputs);
+                               Event.observe('dir_radio', 'focus', 
enableAllInputs);
+                               Event.observe('symlink_radio', 'focus', 
function(event) {
+                                       $('cffUid').disabled = "disabled";
+                                       $('cffGid').disabled = "disabled";
+                                       $('cffPermissions').disabled = 
"disabled";
+                                       $('cffMacroStart').disabled = 
"disabled";
+                                       $('cffMacroEnd').disabled = "disabled";
+                               });
+                       </script>
+                       <span class="small-text"><bean:message 
key="filedetails.jsp.tip.symlink" /></span>
                        </td>
                </tr>
                <tr>
@@ -26,11 +45,11 @@
                        <table>
                                <tr>
                                        <td><bean:message 
key="filedetails.properties.jspf.uid" /></td>
-                                       <td><html:text property="cffUid" 
size="6" /></td>
+                                       <td><html:text property="cffUid" 
size="6" styleId="cffUid" /></td>
                                </tr>
                                <tr>
                                        <td><bean:message 
key="filedetails.properties.jspf.gid" /></td>
-                                       <td><html:text property="cffGid" 
size="6" /></td>
+                                       <td><html:text property="cffGid" 
size="6" styleId="cffGid" /></td>
                                </tr>
                                <tr>
                                        <td colspan="2"><span 
class="small-text"><bean:message
@@ -41,7 +60,7 @@
                </tr>
                <tr>
                        <th><bean:message 
key="filedetails.properties.jspf.permissions" /></th>
-                       <td><html:text property="cffPermissions" maxlength="4" 
size="4" /><br />
+                       <td><html:text property="cffPermissions" maxlength="4" 
size="4" styleId="cffPermissions" /><br />
                        <span class="small-text"><bean:message
                                key="filedetails.jsp.tip.permissions" 
/></span></td>
                </tr>
@@ -54,9 +73,9 @@
                        <th><bean:message 
key="filedetails.add_details.jspf.macro" /></th>
                        <td nowrap="nowrap">
                          <bean:message 
key="filedetails.add_details.jspf.macro.start" />
-                         <html:text property="cffMacroStart" size="3" />
+                         <html:text property="cffMacroStart" size="3" 
styleId="cffMacroStart" />
               <bean:message key="filedetails.add_details.jspf.macro.end" />
-              <html:text property="cffMacroEnd" size="3" /><br />
+              <html:text property="cffMacroEnd" size="3" styleId="cffMacroEnd" 
/><br />
               <span class="small-text">
                 <bean:message key="filedetails.jsp.tip.macros" 
arg0="/rhn/help/reference/index.jsp" />
               </span>
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to