diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-27 18:42:37 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-27 18:42:37 -0400 |
commit | 80d02d941fa5dcfee655e7b7cc576c21b6366894 (patch) | |
tree | 176186e048180b857ef44df5e1bd117ced22aba0 | |
parent | 70fe33a03789a0abbd386fd3007d18f5e66ab8eb (diff) | |
download | cobbler-80d02d941fa5dcfee655e7b7cc576c21b6366894.tar.gz cobbler-80d02d941fa5dcfee655e7b7cc576c21b6366894.tar.xz cobbler-80d02d941fa5dcfee655e7b7cc576c21b6366894.zip |
AT's patch to add multi-select capability when picking what profiles get what repos.
-rw-r--r-- | cobbler/webui/CobblerWeb.py | 11 | ||||
-rw-r--r-- | webui_content/cobblerweb.css | 5 | ||||
-rw-r--r-- | webui_templates/profile_edit.tmpl | 19 |
3 files changed, 27 insertions, 8 deletions
diff --git a/cobbler/webui/CobblerWeb.py b/cobbler/webui/CobblerWeb.py index bfa257b5..3d05520e 100644 --- a/cobbler/webui/CobblerWeb.py +++ b/cobbler/webui/CobblerWeb.py @@ -510,6 +510,7 @@ class CobblerWeb(object): 'edit' : True, 'profile': input_profile, 'distros': self.remote.get_distros(), + 'repos': self.remote.get_repos(), 'ksfiles': self.remote.get_kickstart_templates(self.token) } ) @@ -565,8 +566,16 @@ class CobblerWeb(object): self.remote.modify_profile(profile, 'virt-type', virttype, self.token) if virtpath: self.remote.modify_profile(profile, 'virt-path', virtpath, self.token) - if repos: + + if repos is None: + repos = [] + if type(repos) == type(str()): + repos = [ repos ] + if type(repos) == type([]): + if '--none--' in repos: + repos.remove( '--none--' ) self.remote.modify_profile(profile, 'repos', repos, self.token) + if dhcptag: self.remote.modify_profile(profile, 'dhcp-tag', dhcptag, self.token) self.remote.save_profile(profile,self.token) diff --git a/webui_content/cobblerweb.css b/webui_content/cobblerweb.css index c19ffc20..75367cd3 100644 --- a/webui_content/cobblerweb.css +++ b/webui_content/cobblerweb.css @@ -15,6 +15,11 @@ textarea#ksdata { height: 100%; } +select#repos { + width: 256px; + height: 8em; +} + pre.config_data { font-family: monospace; background: white; diff --git a/webui_templates/profile_edit.tmpl b/webui_templates/profile_edit.tmpl index 1727b4ea..28af17e3 100644 --- a/webui_templates/profile_edit.tmpl +++ b/webui_templates/profile_edit.tmpl @@ -199,18 +199,23 @@ function disablename(value) </td> </tr> - ## FIXME: this should be a multi-select <tr> <td> <label for="repos">Repo Names</label> </td> <td> - <input type="text" style="width: 150px;" name="repos" id="repos" - #if $profile - value="$profile.repos" - #end if - /> - <p class="context-tip">Example: "el5i386updates el5epeltesting el5mycontent"</p> + + <select name="repos" id="repos" multiple="1"> + <option value="--none--"> -- none -- </option> + #for $repo in $repos: + <option value="$repo.name" + #if $profile and $repo.name in $profile.repos + selected="1" + #end if + >$repo.name</option> + #end for + </select> + <p class="context-tip">Select one or many additional repos to automatically assign to the target system. (this is a good place to include an updates repo)</p> </td> </tr> |