[Title] [Dibs web] code refactoring and DB query tunning
authordibs <dibs@samsung.com>
Mon, 25 Feb 2013 13:28:46 +0000 (22:28 +0900)
committerdibs <dibs@samsung.com>
Mon, 25 Feb 2013 13:28:46 +0000 (22:28 +0900)
36 files changed:
dibs-web/app/controllers/admin_controller.rb
dibs-web/app/controllers/admin_distribution_controller.rb
dibs-web/app/controllers/admin_group_controller.rb
dibs-web/app/controllers/admin_project_controller.rb
dibs-web/app/controllers/admin_server_controller.rb
dibs-web/app/controllers/admin_user_controller.rb
dibs-web/app/controllers/projects_controller.rb
dibs-web/app/controllers/utils.rb
dibs-web/config/application.rb
dibs-web/config/database.yml [deleted file]
dibs-web/config/routes.rb
dibs-web/public/index.html
dibs-web/public/javascripts/admin-distribution-add.js
dibs-web/public/javascripts/admin-distribution-modify.js
dibs-web/public/javascripts/admin-distribution.js
dibs-web/public/javascripts/admin-group-add.js
dibs-web/public/javascripts/admin-group-modify.js
dibs-web/public/javascripts/admin-group.js
dibs-web/public/javascripts/admin-project-add.js
dibs-web/public/javascripts/admin-project-modify.js
dibs-web/public/javascripts/admin-project.js
dibs-web/public/javascripts/admin-server-add.js
dibs-web/public/javascripts/admin-server-modify.js
dibs-web/public/javascripts/admin-server-remove.js
dibs-web/public/javascripts/admin-user-modify.js
dibs-web/public/javascripts/admin-user.js
dibs-web/public/javascripts/build.js
dibs-web/public/javascripts/dibs-api.js
dibs-web/public/javascripts/jobs.js
dibs-web/public/javascripts/log.js
dibs-web/public/javascripts/main.js
dibs-web/public/javascripts/projects.js
dibs-web/public/javascripts/session.js
dibs-web/public/javascripts/user.js
dibs-web/public/log.html
dibs-web/public/stylesheets/style.css

index b2803d50188daf91d08dbc3f89092222613b585c..c6ea47326a88f9c5a2b9924db1f6f6f7193bf18a 100644 (file)
@@ -31,23 +31,23 @@ class AdminController < ApplicationController
        before_filter :check_login_status, :check_admin_group
 
        def queryAllOS
-               os_list = SupportedOs.all(:order => "name")
+               os_list = SupportedOs.find_by_sql("SELECT supported_os.name AS os_name
+                                                                                               , os_category.name AS category_name
+                                                                                        FROM supported_os
+                                                                                               , os_category
+                                                                                       WHERE supported_os.os_category_id = os_category.id
+                                                                                       ORDER BY supported_os.name")
 
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
                        generate_xml_header(doc)
 
                        doc.Data {
-                               if not os_list.nil? 
-                                       os_list.each do |os|
-                                               doc.OS {
-                                                       doc.OsName(os.name)
-                                                       category = OsCategory.find(:first, :conditions => ["id = ?", os.os_category_id]) 
-                                                       if not category.nil?
-                                                               doc.OsCategory(category.name)
-                                                       end
-                                               }
-                                       end
+                               os_list.each do |os|
+                                       doc.OS {
+                                               doc.OsName(os.os_name)
+                                               doc.OsCategory(os.category_name)
+                                       }
                                end
                        }
                }
@@ -57,17 +57,15 @@ class AdminController < ApplicationController
        end
 
        def queryAllOSCategory
-               os_category_list = OsCategory.all(:order => "name")
+               os_category_list = OsCategory.find(:all, :order => "name")
 
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
                        generate_xml_header(doc)
 
                        doc.Data {
-                               if not os_category_list.nil? 
-                                       os_category_list.each do |category|
-                                               doc.OsCategoryName(category.name)
-                                       end
+                               os_category_list.each do |category|
+                                       doc.OsCategoryName(category.name)
                                end
                        }
                }
index 6d838c6018625f503f99c717523ba0ea609ce109..aa91a87de5f589fd85bfa43b48c6a1bab48d5e09 100644 (file)
@@ -30,28 +30,6 @@ class AdminDistributionController < ApplicationController
 
        before_filter :check_login_status, :check_admin_group
 
-       def queryAllDistribution
-               # get full distribution list
-               distributions = Distribution.all
-
-               doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
-               doc.Response {
-                       generate_xml_header(doc)
-
-                       #generate to XML
-                       doc.Data {
-                               if not distributions.nil? 
-                                       distributions.each do |distribution|
-                                               doc.DistributionName(distribution.name)
-                                       end
-                               end
-                       }
-               }
-               
-               #send_data
-               render :text => out_string, :content_type => "text/xml"
-       end
-
        def queryDistributionInfo
                dist_name = params[:distribution]
 
index 5818e1b61524d8e77cefe46f1afa5bcab530546e..6820593f9333375eac93c2b936ee739dac0982ea 100644 (file)
@@ -32,37 +32,36 @@ class AdminGroupController < ApplicationController
        skip_before_filter :check_admin_group, :only => [:queryAllGroup]
 
        def queryAllGroup
-               project_list = Project.all(:order => "name")
-               group_list = Group.all
+               group_list = Group.find(:all)
             
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
                        generate_xml_header(doc)
 
                        doc.Data {
-                               if not group_list.nil? 
-                                       group_list.each do |group|
-                                               group_access_list = GroupProjectAccess.find(:all, :conditions => ["group_id = ?", group.id])
-                    
-                                               doc.Group {
-                                                       doc.GroupName(group.name)
-                                                       doc.AdminFlag(group.admin)
-                                                       doc.Description(group.description)
-
-                                                       if not group_access_list.nil? 
-                                                               group_access_list.each do |group_right|
-                                                                       project = Project.find(:first, :conditions => ["id = ?", group_right.project_id]);
-                                                                       distribution = Distribution.find(:first, :conditions => ["id = ?", project.distribution_id]);
-                                                                       if not project.nil?
-                                                                               doc.AccessableProject {
-                                                                                       doc.ProjectName(project.name)
-                                                                                       doc.ProjectDistribution(distribution.name)
-                                                                               }
-                                                                       end
-                                                               end
-                                                       end
-                                               }
-                                       end
+                               group_list.each do |group|
+                                       doc.Group {
+                                               doc.GroupName(group.name)
+                                               doc.AdminFlag(group.admin)
+                                               doc.Description(group.description)
+
+                                               project_list = GroupProjectAccess.find_by_sql("SELECT projects.name AS project_name
+                                                                                                                                                       , distributions.name AS distribution_name
+                                                                                                                                                FROM group_project_accesses
+                                                                                                                                                       , projects
+                                                                                                                                                       , distributions
+                                                                                                                                               WHERE group_project_accesses.group_id = #{group.id}
+                                                                                                                                                 AND projects.id = group_project_accesses.project_id
+                                                                                                                                                 AND distributions.id = projects.distribution_id
+                                                                                                                                               ORDER BY projects.name")
+
+                                               project_list.each do |project|
+                                                       doc.AccessableProject {
+                                                               doc.ProjectName(project.project_name)
+                                                               doc.ProjectDistribution(project.distribution_name)
+                                                       }
+                                               end
+                                       }
                                end
                        }
                }
@@ -84,37 +83,36 @@ class AdminGroupController < ApplicationController
                        return
                end
 
-               project_list = Project.all(:order => "name")
-
                #generate to XML
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
                        generate_xml_header(doc)
                        doc.Data {
-                               if not project_list.nil?
-                                       project_list.each do |project|
-                                               distribution = Distribution.find(:first, :conditions => ["id = ?", project.distribution_id]);
-                                               doc.Project{
-                                                       doc.Name(project.name)
-                                                       doc.Id(project.id)
-                                                       doc.DistName(distribution.name)
-                                               }
-                                       end
+                               project_list = Project.find_by_sql("SELECT projects.name AS project_name
+                                                                                                                , projects.id AS project_id
+                                                                                                                , distributions.name AS distribution_name
+                                                                                                         FROM projects
+                                                                                                                , distributions
+                                                                                                        WHERE distributions.id = projects.distribution_id
+                                                                                                        ORDER BY projects.name")
+                                                                                                                                 
+                               project_list.each do |project|
+                                       doc.Project{
+                                               doc.Name(project.project_name)
+                                               doc.Id(project.project_id)
+                                               doc.DistName(project.distribution_name)
+                                       }
                                end
             
                                doc.Group {
-                                       doc.Name(group.name)
-                                       
                                        group_access_list = GroupProjectAccess.find(:all, :conditions => ["group_id = ?", group.id])
                     
-                                       if not group_access_list.nil? and not group_access_list.empty? 
-                                               project_id_list = []
-                                               group_access_list.each do |group_right|
-                                                       project_id_list.push group_right.project_id
-                                               end
-            
-                                               doc.ProjectList(project_id_list.join(","))
+                                       project_id_list = []
+                                       group_access_list.each do |group_right|
+                                               project_id_list.push group_right.project_id
                                        end
+            
+                                       doc.ProjectIdList(project_id_list.join(","))
                                }
                        }
                }
index a0f7b72adb04c7f4f7c63743354d6fdddd2ab9d0..e125bc606dd9fd9bced13e554e85e5bab8dc4b91 100644 (file)
@@ -28,22 +28,25 @@ Contributors:
 
 class AdminProjectController < ApplicationController
        def queryAllProject
-               project_list = Project.all(:order => "name")
+               project_list = Project.find_by_sql("SELECT projects.name AS project_name
+                                                                                                , projects.id AS project_id
+                                                                                                , distributions.name AS distribution_name
+                                                                                         FROM projects
+                                                                                                , distributions
+                                                                                        WHERE distributions.id = projects.distribution_id
+                                                                                        ORDER BY projects.name")
 
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
                        generate_xml_header(doc)
 
                        doc.Data {
-                               if not project_list.nil? 
-                                       project_list.each do |project|
-                                       distribution = Distribution.find(:first, :conditions => ["id = ?", project.distribution_id]);
-                                               doc.Project{
-                                                       doc.Name(project.name)
-                                                       doc.Id(project.id)
-                                                       doc.DistName(distribution.name)
-                                               }
-                                       end
+                               project_list.each do |project|
+                                       doc.Project{
+                                               doc.Name(project.project_name)
+                                               doc.Id(project.project_id)
+                                               doc.DistName(project.distribution_name)
+                                       }
                                end
                        }
                }
@@ -81,37 +84,39 @@ class AdminProjectController < ApplicationController
                                                                                                         WHERE distributions.name = \"#{dist_name}\"
                                                                                                           AND distributions.id = projects.distribution_id 
                                                                                                         ORDER BY projects.name")
-                               if not project_list.nil?
-                                       project_list.each do |project|
-                                               doc.Project {
-                                                       doc.ProjectName(project.name)
-                                                       doc.Type(project.ptype)
+
+                               project_list.each do |project|
+                                       doc.Project {
+                                               doc.ProjectName(project.name)
+                                               doc.Type(project.ptype)
             
-                                                       os_list = ProjectOs.find(:all, :conditions => ["project_id = ?", project.id])
-                                                       if not os_list.nil? then
-                                                               os_list.each do |os|
-                                                                       supported_os = SupportedOs.find(:first, :conditions => ["id = ?", os.supported_os_id])
-                                                                       doc.OS(supported_os.name)
-                                                               end
+                                               os_list = ProjectOs.find_by_sql("SELECT supported_os.name AS name
+                                                                                                                  FROM project_os
+                                                                                                                     , supported_os
+                                                                                                                 WHERE project_os.project_id = #{project.id}
+                                                                                                                   AND project_os.supported_os_id = supported_os.id
+                                                                                                                 ORDER BY supported_os.name")
+                                               os_list.each do |os|
+                                                       doc.OS(os.name)
+                                               end
+
+                                               case project.ptype.upcase
+                                               when "GIT"
+                                                       git = ProjectGit.find(:first, :conditions => ["project_id = ?", project.id])
+                                                       if not git.nil? then
+                                                               doc.GitRepos(git.git_repos)
+                                                               doc.GitBranch(git.git_branch)
                                                        end
-
-                                                       case project.ptype.upcase
-                                                       when "GIT"
-                                                               git = ProjectGit.find(:first, :conditions => ["project_id = ?", project.id])
-                                                               if not git.nil? then
-                                                                       doc.GitRepos(git.git_repos)
-                                                                       doc.GitBranch(git.git_branch)
-                                                               end
-                    
-                                                       when "BINARY"
-                                                               bin = ProjectBin.find(:first, :conditions => ["project_id = ?", project.id])
-                                                               if not bin.nil? then
-                                                                       doc.PackageName(bin.pkg_name)
-                                                               end
+                
+                                               when "BINARY"
+                                                       bin = ProjectBin.find(:first, :conditions => ["project_id = ?", project.id])
+                                                       if not bin.nil? then
+                                                               doc.PackageName(bin.pkg_name)
                                                        end
-                                               }
-                                       end
+                                               end
+                                       }
                                end
+                               
                        }
                }
                
index 8efb20d201e5104a2932c991d02193bd4111a93c..35f0d5aa8d3916eb4a48a8ce2c4e03b0e18cb263 100644 (file)
@@ -29,8 +29,8 @@ Contributors:
 class AdminServerController < ApplicationController
        def queryAllServer
                # get full distribution list
-               server_config = Server_config.all
-               remote_build_servers = RemoteBuildServer.all
+               server_config = Server_config.find(:all)
+               remote_build_servers = RemoteBuildServer.find(:all)
 
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
@@ -38,32 +38,28 @@ class AdminServerController < ApplicationController
         
                        #generate to XML
                        doc.Data {
-                               if not server_config.nil? 
-                                       server_config.each do |info|
-                                               doc.ServerConfig {
-                                                       doc.Property( info.property )
-                                                       doc.Value( info.value )
-                                               }
-                                       end
+                               server_config.each do |info|
+                                       doc.ServerConfig {
+                                               doc.Property( info.property )
+                                               doc.Value( info.value )
+                                       }
                                end
 
-                               if not remote_build_servers.nil? 
-                                       remote_build_servers.each do |server|
-                                               doc.RemoteBuildServer {
-                                                       doc.Address(server.svr_addr)
-                                                       supported_os = SupportedOs.find(:first, :conditions => ["id = ?", server.supported_os_id])
-                                                       if supported_os.nil?
-                                                               doc.SupportedOS("")
-                                                       else
-                                                               doc.SupportedOS(supported_os.name)
-                                                       end
-                                                       doc.Status(server.status)
-                                                       doc.MaxJobCount(server.max_job_count)
-                                                       doc.WorkingJobCount(server.working_job_count)
-                                                       doc.WaitingJobCount(server.waiting_job_count)
-                                                       doc.Description(server.description)
-                                               }
-                                       end
+                               remote_build_servers.each do |server|
+                                       doc.RemoteBuildServer {
+                                               doc.Address(server.svr_addr)
+                                               supported_os = SupportedOs.find(:first, :conditions => ["id = ?", server.supported_os_id])
+                                               if supported_os.nil?
+                                                       doc.SupportedOS("")
+                                               else
+                                                       doc.SupportedOS(supported_os.name)
+                                               end
+                                               doc.Status(server.status)
+                                               doc.MaxJobCount(server.max_job_count)
+                                               doc.WorkingJobCount(server.working_job_count)
+                                               doc.WaitingJobCount(server.waiting_job_count)
+                                               doc.Description(server.description)
+                                       }
                                end
                        }
                }
index 7f4af7e6251b03acdbc0591c441d7b9a4561570e..17791c3980a644975cbc792e5e8ec759927b6f78 100644 (file)
@@ -31,34 +31,34 @@ class AdminUserController < ApplicationController
        before_filter :check_login_status, :check_admin_group
 
        def queryAllUser
-               user_list = User.all(:order => "name")
+               user_list = User.find(:all, :order => "name")
 
                doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
                doc.Response {
                        generate_xml_header(doc)
                
                        doc.Data {
-                               if not user_list.nil? 
-                                       user_list.each do |user|
-                                               doc.User {
-                                                       doc.Name(user.name)
-                                                       doc.Email(user.email)
-                                                       doc.GroupList {
-                                                               group_list = Group.find_by_sql("SELECT groups.name
-                                                                                                                                       , groups.admin
-                                                                                                                                       , groups.description
-                                                                                                                               FROM users
-                                                                                                                               , user_groups
-                                                                                                                               , groups
-                                                                                                                               WHERE users.id = user_groups.user_id
-                                                                                                                       AND user_groups.group_id = groups.id
-                                                                                                                               AND users.email = \"#{user.email}\"")
-                                                               group_list.each { |group|
-                                                                               doc.GroupName(group.name)
-                                                               }
-                                                       }
+                               user_list.each do |user|
+                                       doc.User {
+                                               doc.Name(user.name)
+                                               doc.Email(user.email)
+                                               doc.Id(user.id)
+                                               doc.GroupList {
+                                                       group_list = Group.find_by_sql("SELECT groups.name
+                                                                                                                                , groups.admin
+                                                                                                                                , groups.description
+                                                                                                                         FROM users
+                                                                                                                        , user_groups
+                                                                                                                        , groups
+                                                                                                                        WHERE users.email = \"#{user.email}\"
+                                                                                                                          AND users.id = user_groups.user_id
+                                                                                                                  AND user_groups.group_id = groups.id
+                                                                                                                        ORDER BY users.name")
+                                                       group_list.each do |group|
+                                                               doc.GroupName(group.name)
+                                                       end
                                                }
-                                       end
+                                       }
                                end
                        }
                }
@@ -67,13 +67,55 @@ class AdminUserController < ApplicationController
                render :text => out_string, :content_type => "text/xml"
        end
 
+       def queryUserInfo
+               user_id = params[:user_id]
+
+               user = User.find(:first, :conditions => ["id = ?", user_id])
+
+               doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
+               doc.Response {
+                       generate_xml_header(doc)
+               
+                       doc.Data {
+                               doc.User {
+                                       doc.Name(user.name)
+                                       doc.Email(user.email)
+                                       doc.Id(user.id)
+                                       doc.GroupInfo{
+                                               full_group_list = Group.find(:all)
+                                               full_group_list.each do |group|
+                                                       doc.Group {
+                                                               doc.Name(group.name)
+                                                               doc.Id(group.id)
+                                                       }
+                                               end
+
+                                               group_list = Group.find_by_sql("SELECT user_groups.group_id
+                                                                                                                 FROM users
+                                                                                                                , user_groups
+                                                                                                                WHERE users.id = #{user.id}
+                                                                                                                  AND users.id = user_groups.user_id")
+                                               group_id_list = []
+                                               group_list.each do |group|
+                                                       group_id_list.push group.group_id
+                                               end
+                                               doc.GroupIdList(group_id_list.join(","))
+                                       }
+                               }
+                       }
+               }
+
+               #send_data
+               render :text => out_string, :content_type => "text/xml"
+       end
+
        def modifyUser
                change_user_list = params[:ChangeInfoList]
                change_item = change_user_list[0]
                errmsg = ""
 
                email = change_item[:Email]
-               group_name = change_item[:GroupName]
+               group_id_list = change_item[:GroupIdList].split(",")
                user_name = change_item[:UserName]
 
                if email.nil? or email.empty?
@@ -89,29 +131,21 @@ class AdminUserController < ApplicationController
                        end
                end
 
-               if group_name.nil? or group_name.empty?
-                       render :text => "Group name is invalid", :status => 406
-                       return
-               else
-                       group = Group.find(:first, :conditions => ["name = ?", group_name])
-                       if group.nil? 
-                               errmsg = "Can't find group information"
-                               render :text => errmsg, :status => 406
-                               return
-                       end
-               end
-
-               user.name  = user_name
+               user.name = user_name
                user.save
 
                UserGroup.delete_all(["user_id = ?", user.id])
 
-               user_groups = UserGroup.new
-
-               user_groups.user_id = user.id
-               user_groups.group_id = group.id
-               user_groups.status = "ACTIVE"
-               user_groups.save
+               if not group_id_list.nil? 
+                       group_id_list.each do |group_id|
+                               user_groups = UserGroup.new
+                
+                               user_groups.user_id = user.id
+                               user_groups.group_id = group_id
+                               user_groups.status = "ACTIVE"
+                               user_groups.save
+                       end
+               end
 
                render :json => { :success => "OK!" }
        end
index 2bb8c944d714d82ab90764ce0a1c3e01f571ecee..64796f3c355e4a0f39c9536d5f4e8d354a5a7388 100644 (file)
@@ -132,8 +132,16 @@ class ProjectsController < ApplicationController
        dist_name = params[:distribution]
 
        user_id = get_user_id
-       distribution = Distribution.find(:first, :conditions => ["name = ?", dist_name])
-       projects = Project.find(:all, :conditions => ["distribution_id = ?", distribution.id], :order => "name")
+       projects = Project.find_by_sql("SELECT projects.name AS project_name
+                                                                                , projects.ptype AS project_type
+                                                                                , projects.id AS project_id
+                                                                                , users.email AS maintainer
+                                                                         FROM projects
+                                                                                , distributions
+                                                                                , users
+                                                                        WHERE distributions.name = \"#{dist_name}\"
+                                                                          AND projects.distribution_id = distributions.id
+                                                                          AND users.id = projects.user_id")
 
        #generate to XML
        doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
@@ -143,28 +151,23 @@ class ProjectsController < ApplicationController
                        doc.ProjectList {
                                projects.each { |project|
                                        doc.Project {
-                                               doc.Name(project.name)
-                                               doc.Type(project.ptype)
-                                               maintainer = User.find(:first, :conditions => ["id = ?", project.user_id])
-                                               if not maintainer.nil? 
-                                                       doc.Maintainer(maintainer.email)
-                                               else
-                                                       doc.Maintainer("")
-                                               end
+                                               doc.Name(project.project_name)
+                                               doc.Type(project.project_type)
+                                               doc.Maintainer(project.maintainer)
 
-                                               if checkUserAccessProject(user_id, project.id)
+                                               if checkUserAccessProject(user_id, project.project_id)
                                                        doc.GroupAccess("TRUE")
                                                else
                                                        doc.GroupAccess("FALSE")
                                                end
 
-                                               os_list = ProjectOs.find(:all, :conditions => ["project_id = ?", project.id], :order => "supported_os_id")
+                                               os_list = ProjectOs.find(:all, :conditions => ["project_id = ?", project.project_id], :order => "supported_os_id")
                                                os_list.each { |os|
                                                        doc.ProjectOs {
                                                                os_info = SupportedOs.find(:first, :conditions => ["id = ?", os.supported_os_id])
                                                                doc.OsName(os_info.name)
 
-                                                               source = queryPackageInfo(project.id, os.supported_os_id) 
+                                                               source = queryPackageInfo(project.project_id, os.supported_os_id) 
                                                                if source.nil?
                                                                        doc.Package {
                                                                                doc.PackageName()
@@ -205,20 +208,20 @@ class ProjectsController < ApplicationController
        dist_name = params[:distribution]
 
        running_project_list = Project.find_by_sql("SELECT projects.name
-                , projects.ptype
-                , jobs.status
-                , supported_os.name AS os_name
-                       FROM jobs 
-                                , projects
-                                , supported_os
-                                , distributions
-                       WHERE jobs.project_id = projects.id
-                               AND distributions.name = \"#{dist_name}\"
-                               AND projects.distribution_id = distributions.id
-                               AND NOT jobs.status in ('FINISHED', 'ERROR', 'CANCELED')
-                               AND supported_os.id = jobs.supported_os_id
-                       ORDER BY jobs.id")
-
+                                                                                                    , projects.ptype
+                                                                                                    , jobs.status
+                                                                                                    , supported_os.name AS os_name
+                                                                                                 FROM jobs 
+                                                                                                    , projects
+                                                                                                    , supported_os
+                                                                                                    , distributions
+                                                                                                WHERE jobs.project_id = projects.id
+                                                                                                  AND distributions.name = \"#{dist_name}\"
+                                                                                                  AND projects.distribution_id = distributions.id
+                                                                                                  AND NOT jobs.status in ('FINISHED', 'ERROR', 'CANCELED')
+                                                                                                  AND supported_os.id = jobs.supported_os_id
+                                                                                                ORDER BY jobs.id")
+                    
        #generate to XML
        doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
        doc.Response {
@@ -258,24 +261,7 @@ class ProjectsController < ApplicationController
        projects = Project.find(:all, :conditions => ["distribution_id = ?", distribution.id], :order => "name")
        osList = SupportedOs.find(:all)
 
-       # check can build
-       project_access_list = []
-
-       # get all my project
-       group_list = get_group_list(get_user_email)
-
-       group_id_list = []
-       group_list.each { |group|
-               group_id_list.push group.id
-       }
-
-       group_name_list_string = 
-       group_access_project_list = GroupProjectAccess.find(:all, :conditions => ["group_id in (?)", group_id_list.join(",") ])
-       if not group_access_project_list.nil?
-               group_access_project_list.each do |access_project| 
-                       project_access_list.push access_project.project_id
-               end
-       end
+       user_id = get_user_id
 
        #generate to XML
        doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
@@ -293,7 +279,7 @@ class ProjectsController < ApplicationController
                        projects.each do |project|
                                if project.ptype.eql? "BINARY" 
                                        bin = ProjectBin.find(:first, :conditions => ["project_id = ?", project.id])
-                                       if project_access_list.include? project.id 
+                                       if checkUserAccessProject(user_id, project.id)
                                                doc.BinaryProject {
                                                        doc.ProjectName(project.name)
                                                        if not bin.nil? then
@@ -317,7 +303,7 @@ class ProjectsController < ApplicationController
                                                buildOsNameList.push(supported_os.name)
                                        end
     
-                                       if project_access_list.include? project.id 
+                                       if checkUserAccessProject(user_id, project.id)
                                                doc.Project {
                                                        doc.ProjectName(project.name)
                                                        doc.OsList(buildOsNameList.join(","))
@@ -340,13 +326,8 @@ class ProjectsController < ApplicationController
   end
 
   def queryDistribution
-       distribution_list = []
-
        # get full distribution list
-       distributions = Distribution.all
-       distributions.each {|distribution| 
-               distribution_list.push distribution.name
-       }
+       distribution_list = Distribution.find(:all)
 
        #generate to XML
        doc = Builder::XmlMarkup.new( :target => out_string = "", :indent => 2 )
@@ -354,10 +335,8 @@ class ProjectsController < ApplicationController
                generate_xml_header(doc)
 
                doc.Data {
-                       if not distribution_list.nil?
-                               distribution_list.each do |distribution|
-                                       doc.DistributionName(distribution)
-                               end
+                       distribution_list.each do |distribution|
+                               doc.DistributionName(distribution.name)
                        end
                }
        }
index b0e5f4b31193e1182bc940041b266382a4337fdd..32f332e4398a03bcdcaf79a21bad5492d14dfb66 100644 (file)
@@ -111,6 +111,7 @@ puts "[[[#{cmd}]]]"
 
        options = "-n #{server_name} --dist #{dist_name} "
        cmd = "#{dibs_path}/build-svr fullbuild #{options}"
+       cmd = "which ruby"
 puts "Fullbuild command"
 puts "[[[#{cmd}]]]"
        return execute_shell_return(cmd)
@@ -121,8 +122,8 @@ puts "[[[#{cmd}]]]"
     ret = false
   
     # get result
-    IO.popen("#{cmd}")
-    #system "#{cmd}"
+    #IO.popen("#{cmd}")
+    system "#{cmd}"
 
        return true
   end
index 1e8680c27314313b78ad4d15f41e7d18a6095923..fd10b4fea1235a758cfa71cee94817ed1cf408e2 100644 (file)
@@ -58,5 +58,6 @@ module Dibs
 
     # Version of your assets, change this if you want to expire all your assets
     config.assets.version = '1.0'
+
   end
 end
diff --git a/dibs-web/config/database.yml b/dibs-web/config/database.yml
deleted file mode 100644 (file)
index 319f61e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# SQLite version 3.x
-#   gem install sqlite3
-#
-#   Ensure the SQLite 3 gem is defined in your Gemfile
-#   gem 'sqlite3'
-# development:
-#   adapter: sqlite3
-#   database: db/development.sqlite3
-#   pool: 5
-#   timeout: 5000
-# 
-# # Warning: The database defined as "test" will be erased and
-# # re-generated from your development database when you run "rake".
-# # Do not set this db to the same as development or production.
- test:
-   adapter: 
-   encoding:
-   host:
-   port:
-   database:
-   username:
-   password:
-   pool:
-   timeout: 
- production:
-   adapter: 
-   encoding:
-   host:
-   port:
-   database:
-   username:
-   password:
-   pool:
-   timeout: 
-
- development:
-   adapter: 
-   encoding: 
-   host: 
-   port: 
-   database: 
-   username: 
-   password: 
-   pool: 
-   timeout: 
index 5d0385e1e19fc48156e42d8af69a7ac13f320770..b9b9e8dcd23c918e2ca7db0400d3f391b8a146f8 100644 (file)
@@ -27,7 +27,6 @@ Contributors:
 =end
 
 Dibs::Application.routes.draw do
-    root :to => "sessions#new"
 
        get "sessions/new" => "sessions#new"
 
@@ -83,6 +82,7 @@ Dibs::Application.routes.draw do
 
        # admin user
        get "admin_user/queryAllUser" 
+       get "admin_user/queryUserInfo/:user_id" => "admin_user#queryUserInfo" 
        post "admin_user/removeUser" 
        post "admin_user/modifyUser" 
 
@@ -109,7 +109,6 @@ Dibs::Application.routes.draw do
        post "admin_project/modifyProject" 
 
        # admin distribution
-       get "admin_distribution/queryAllDistribution" 
        match "admin_distribution/queryDistributionInfo/:distribution" => "admin_distribution#queryDistributionInfo", :constraints => { :distribution => /[0-9A-Za-z\-\.\_]+/ } 
        post "admin_distribution/addDistribution" 
        post "admin_distribution/removeDistribution" 
index e13208797da8daefbe8fcfe4c5f1f4ef2fb3e834..76ba4e122f961543b7eda0ba505054ec747ca1a6 100644 (file)
@@ -98,11 +98,11 @@ Contributors:
                        <h1>Log in</h1>
                </div>
                <div data-role="content">
-                       <form id="loginForm">
-                               <label for="login-email" style="text-align: left; font-size: 12px">Email</label>
-                               <input id="login-email" name="email" type="text" style="font-size: 12px"/>
-                               <label for="login-password" style="text-align: left; font-size: 12px">Password</label>
-                               <input id="login-password" name="password" type="password" style="font-size: 12px"/>
+                       <form id="login-form">
+                               <label for="login-form-email" >Email</label>
+                               <input id="login-form-email" type="email" name="email"/>
+                               <label for="login-form-password">Password</label>
+                               <input id="login-form-password" type="password" name="password"/>
                                <br/>
                                <div data-role="controlgroup" data-type="horizontal">   
                                        <a href="#" data-rel="back" data-role="button" data-mini="true" >Cancel</a>
@@ -112,40 +112,28 @@ Contributors:
                </div> 
        </div><!-- /page -->
 
-       <div data-role="page" id="signup" >
+       <div data-role="page" id="signup">
                <div data-role="header"  data-theme="e" >
                        <h1>Sign up</h1>
                </div>
                <div data-role="content">
-                       <form id="signupForm">
-                               <label for="user-email" style="text-align: left; font-size: 12px">Email</label>
-                               <input id="user-email" name="user[email]" type="text" style="font-size: 12px"/>
-                               <label for="user-name" style="text-align: left; font-size: 12px">Name</label>
-                               <input id="user-name" name="user[name]" type="text" style="font-size: 12px"/>
-                               <label for="user-password" style="text-align: left; font-size: 12px">Password</label>
-                               <input id="user-password" name="user[password]" type="password" style="font-size: 12px"/>
-                               <label for="user-password-confirmation" style="text-align: left; font-size: 12px">Password Comfirmation</label>
-                               <input id="user-password-confirmation" name="user[password_confirmation]" type="password" style="font-size: 12px"/>
-                               <div data-role="controlgroup" id="applyGroupRadio">
-                               </div>
+                       <form id="signup-form">
+                               <label for="signup-form-email">Email</label>
+                               <input id="signup-form-email" type="email" name="email" autocomplete="off"/>
+                               <label for="signup-form-name">Name</label>
+                               <input id="signup-form-name" type="text" name="name" autocomplete="off" />
+                               <label for="signup-form-password">Password</label>
+                               <input id="signup-form-password" type="password" name="password" />
+                               <label for="signup-form-password-confirmation">Password Comfirmation</label>
+                               <input id="signup-form-password-confirmation" type="password" name="password-confirmation" />
                                <div data-role="controlgroup" data-type="horizontal">
                                        <a href="#" data-rel="back" data-role="button" data-mini="true" >Cancel</a>
                                        <a href="#" onClick="userSignUp()" data-role="button" data-mini="true" data-inline="true">Sign up</a>
                                </div>
                        </form> 
-                       <p id="signupErrorMessage" style="text-align: left; font-size: 12px font-color: red">
-                       </p>
                </div> 
        </div><!-- /page -->
 
-       <div data-role="page" id="notification" >
-               <div data-role="header"  data-theme="e" >
-                       <h1></h1>
-               </div>
-               <div data-role="content">
-               </div> 
-       </div><!-- /page -->
-       
        <div data-role="page" id="projects" class="type-interior">
         <div data-role="header" data-theme="a">                                                        
             <a href=#index data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
@@ -157,21 +145,22 @@ Contributors:
                <div data-role="content" >
                        <div class="content-primary">
                                <div data-role="fieldcontain" style="text-align: center; font-size: 14px;">
-                                       <select id="projects-select-distribution"  data-native-menu="false" onchange='projectsQueryProjectListType("MY")'>
+                                       <select id="projects-distribution-select"  data-native-menu="false" onchange='projectsQueryProjectListType("MY")'>
                                        </select>
                                </div>
                                <br>
-                               <div id="projectsSearchSelect">
-                                       <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true" id="projectSearchSelectControlGroup">
-                                               <input type="radio" name="radio-choice" id="projects-project-select-1" value="MY PROJECT" checked="checked" onClick='projectsQueryProjectListType("MY")' />
-                                               <label for="projects-project-select-1">MY PROJECT</label>
-                                               <input type="radio" name="radio-choice" id="projects-project-select-2" value="ALL PROJECT" onClick='projectsQueryProjectListType("ALL")'/>
-                                               <label for="projects-project-select-2">ALL PROJECT</label>
-                                               
-                                               <input type="radio" name="radio-choice" id="projects-project-select-3" value="GIT PROJECT" onClick='projectsQueryProjectListType("GIT")' />
-                                               <label for="projects-project-select-3">GIT PROJECT</label>
-                                               <input type="radio" name="radio-choice" id="projects-project-select-4" value="BINARY PROJECT" onClick='projectsQueryProjectListType("BINARY")' />
-                                               <label for="projects-project-select-4">BINARY PROJECT</label>
+                               <div id="projects-type-select">
+                                       <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
+                                               <form>
+                                                       <input type="radio" name="radio-choice" id="projects-type-select-1" checked="checked" onClick='projectsQueryProjectListType("MY")' />
+                                                       <label for="projects-type-select-1">MY PROJECT</label>
+                                                       <input type="radio" name="radio-choice" id="projects-type-select-2" onClick='projectsQueryProjectListType("ALL")'/>
+                                                       <label for="projects-type-select-2">ALL PROJECT</label>
+                                                       <input type="radio" name="radio-choice" id="projects-type-select-3" onClick='projectsQueryProjectListType("GIT")' />
+                                                       <label for="projects-type-select-3">GIT PROJECT</label>
+                                                       <input type="radio" name="radio-choice" id="projects-type-select-4" onClick='projectsQueryProjectListType("BINARY")' />
+                                                       <label for="projects-type-select-4">BINARY PROJECT</label>
+                                               </form>
                                        </fieldset>
                                </div>
                                <br>
@@ -198,38 +187,28 @@ Contributors:
                        <div class="content-primary">
                                <div>
                                        <div data-role="fieldcontain" style="text-align: center; font-size: 14px;">
-                                               <select id="select-distribution"  data-native-menu="false" onchange="buildQueryProjectList()">
+                                               <select id="build-distribution-select"  data-native-menu="false" onchange="buildQueryProjectList()">
                                                </select>
                                        </div>
                                </div>
-                               <div data-role="collapsible" data-collapsed="false"  style="width: auto;" >
+                               <div data-role="collapsible" data-collapsed="false" style="width: auto;" >
                                        <h3>Git project</h3>
                                        <div align="right" style="font-size: 10px">
                                                <a href="#" data-role="button" data-inline="true" data-mini="true" onClick='buildBuildProject("build")'>Build</a>
                                                <a href="#" data-role="button" data-inline="true" data-mini="true" onClick='buildBuildProject("resolve")'>Resolve</a>
                                        </div>
                                        <div data-role="content">
-                                               <table class="projectTableStyle" style="font-size: 14px" id="projectTable">
+                                               <table class="build-project-table" style="font-size: 14px" id="build-git-table">
                                                </table>
                                        </div>
                                </div>
-                               <div data-role="collapsible" data-collapsed="false">
+                               <div data-role="collapsible" data-collapsed="false" style="width: auto;" >
                                        <h3>Binary project</h3>
                                        <div data-role="content">
-                                               <table class="projectTableStyle" style="font-size: 14px" id="binaryProjectTable">
+                                               <table class="build-project-table" style="font-size: 14px" id="build-binary-table">
                                                </table>
                                        </div>
                                </div>
-                               <!--
-                               <div data-role="collapsible" data-collapsed="false">
-                                       <h3>Binary project batch upload</h3>
-                                       <div data-role="content">
-                                               <input id="buildBatchFileUploadPath" align="right" type="file" webkitdirectory multiple data-inline="true" />
-                                               <input id="buildBatchFileRegister" align="right" type="button" value="Register" data-mini="true" data-inline="true" />
-                                               <ul id="buildBatchFileList"</ul>
-                                       </div>
-                               </div>
-                               -->
                        </div><!--/content-primary -->
 
                        <div class="content-secondary">
@@ -249,73 +228,72 @@ Contributors:
 
                <div data-role="content" >
                        <div class="content-primary">
-                               <div id="jobDivDistribution" data-role="fieldcontain" style="text-align: center; font-size: 14px;">
-                                       <select id="jobSelectDistribution" date-mini="true" data-native-menu="false" onchange="jobsSearchSelected()">
+                               <div data-role="fieldcontain" style="text-align: center; font-size: 14px;">
+                                       <select id="jobs-distribution-select" date-mini="true" data-native-menu="false" onchange="jobsSearchSelected()">
                                        </select>
                                </div>
                                <br/>
                                <div class="ui-grid-a">
-                                       <div id="jobSearchSelect" class="ui-block-a">
+                                       <div id="jobs-type-select" class="ui-block-a">
                                                <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                                                        <form>
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-1" class="jobSearch" value="ALL" checked="checked" />
-                                                               <label for="search-radio-choice-1">ALL</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-1" class="jobSearch" value="ALL" checked="checked" />
+                                                               <label for="jobs-type-1">ALL</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-2" class="jobSearch" value="JOBID"  />
-                                                               <label for="search-radio-choice-2">JOB ID</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-2" class="jobSearch" value="JOBID" />
+                                                               <label for="jobs-type-2">JOB ID</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-3" class="jobSearch" value="USER"  />
-                                                               <label for="search-radio-choice-3">USER</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-3" class="jobSearch" value="USER" />
+                                                               <label for="jobs-type-3">USER</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-4" class="jobSearch" value="GROUP"  />
-                                                               <label for="search-radio-choice-4">GROUP</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-4" class="jobSearch" value="GROUP" />
+                                                               <label for="jobs-type-4">GROUP</label>
                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-5" class="jobSearch" value="PROJECT"  />
-                                                               <label for="search-radio-choice-5">PROJECT</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-5" class="jobSearch" value="PROJECT" />
+                                                               <label for="jobs-type-5">PROJECT</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="radio-choice-6" class="jobSearch" value="DATE"  />
-                                                               <label for="radio-choice-6">DATE</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-6" class="jobSearch" value="DATE" />
+                                                               <label for="jobs-type-6">DATE</label>
                                                        </form>
                                                </fieldset>
                                        </div>
-                                       <div id="jobStatusSelect" class="ui-block-b" style="text-align:right">
+                                       <div id="jobs-status-select" class="ui-block-b" style="text-align:right">
                                                <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                                                        <form>
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-1" class="jobSearch" value="ALL" checked="checked" />
-                                                               <label for="search-radio-choice-1">ALL</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-7" class="jobSearch" value="ALL" checked="checked" />
+                                                               <label for="jobs-type-7">ALL</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-2" class="jobSearch" value="SUCCESS"  />
-                                                               <label for="search-radio-choice-2">SUCCESS</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-8" class="jobSearch" value="SUCCESS" />
+                                                               <label for="jobs-type-8">SUCCESS</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-3" class="jobSearch" value="WORKING"  />
-                                                               <label for="search-radio-choice-3">WORKING</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-9" class="jobSearch" value="WORKING" />
+                                                               <label for="jobs-type-9">WORKING</label>
                                                                
-                                                               <input type="radio" name="radio-choice" id="search-radio-choice-4" class="jobSearch" value="ERROR"  />
-                                                               <label for="search-radio-choice-4">ERROR</label>
+                                                               <input type="radio" name="radio-choice" id="jobs-type-10" class="jobSearch" value="ERROR" />
+                                                               <label for="jobs-type-10">ERROR</label>
                                                        </form>
-       
                                                </fieldset>
                                        </div>
                                </div>
 
-                               <div id="jobDivSearchInput" >
-                                       <input type="search" name="search-mini" id="jobSearchInputText" autocomplete="off" value="" data-mini="true" />
+                               <div id="jobs-search-input" >
+                                       <input type="search" name="search-mini" id="jobs-search-input-text" autocomplete="off" value="" data-mini="true" />
                                        <a href="#" onClick="searchJobInput()" data-role="button" data-mini="true"  data-inline="true">Search</a>
                                                
-                                       <ul data-role="listview" id="jobSearchList" data-inset="true">
+                                       <ul data-role="listview" id="jobs-search-list" data-inset="true">
                                        </ul>
                                </div>
-                               <div id="jobDivSearchDate" >
-                                       <input type="date" name="date" id="jobSearchDate" autocomplete="off" data-mini="true" data-inline="true" data-options='{"mode": "flipbox","noButtonFocusMode": true}' />
+                               <div id="jobs-search-date" >
+                                       <input type="date" name="date" id="jobs-search-date-value" autocomplete="off" data-mini="true" data-inline="true" data-options='{"mode": "flipbox","noButtonFocusMode": true}' />
                                        <a href="#" onClick="searchJobDate()" data-role="button" data-mini="true"  data-inline="true">Search</a>
                                </div>
                                <br>
 
-                               <ul id="jobList" data-role="listview">
+                               <ul id="jobs-job-list" data-role="listview">
                                </ul>
                                <br>
 
-                               <button id="moreJobList" onClick="queryJobList()" data-mini="true">MORE</button>
+                               <button id="jobs-job-more" onClick="queryJobList()" data-mini="true">MORE</button>
                        </div><!--/content-primary -->
 
                        <div class="content-secondary">
@@ -325,15 +303,6 @@ Contributors:
                </div><!-- /content -->
        </div><!-- /page -->
 
-    <div data-role="page" id="log">
-       <table id="logTable" style="border: #000000 1px solid; font-size:9pt">
-       </table> 
-       <div data-role="controlgroup" data-type="horizontal">
-               <input type="button" value="More" onClick=moreLog() / > 
-               <input type="button" value="Stop" onClick=stopLog() / > 
-       </div>
-       </div><!-- /page -->
-       
        <div data-role="page" id="adminUser" class="type-interior">
         <div data-role="header" data-theme="a">                                                        
             <a href=#index data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
@@ -346,7 +315,7 @@ Contributors:
                        <div class="content-primary">
                                <h2>User information</h2>
                                <div>
-                               <table class="imagetable" style="font-size: 14px" id="adminUserTable">
+                               <table class="imagetable" style="font-size: 14px" id="adminUser-contents">
                                </table>
                                </div>
                        </div><!--/content-primary -->
@@ -358,29 +327,28 @@ Contributors:
                </div><!-- /content -->
        </div><!-- /page -->
        
-       <div data-role="page" id="adminUserModifyPopup" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminUserModify" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Modify User</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <label for="popup:modifyUserName"> User name </label>
-                               <input type="text" id="popup:modifyUserName"/> 
+                               <label for="adminUserModify-name"> User name </label>
+                               <input type="text" id="adminUserModify-name" name="adminUserModify-contents" /> 
                                <br>
-                               <label for="popup:modifyUserEmail"> Email </label>
-                               <input type="text" id="popup:modifyUserEmail"/> 
+                               <label for="adminUserModify-email"> Email </label>
+                               <input type="text" id="adminUserModify-email" name="adminUserModify-contents" disabled="disabled"/>
                                <br>
-                               <div data-role="fieldcontain">
-                                       <label for="popup:modifyUserGroup"> Group </label>
+                               <div>
+                                       <fieldset data-role="controlgroup" data-mini="true" data-role="fieldcontain" id="adminUserModify-group">
+                                       </fieldset>
                                        <br>
-                                       <select id="popup:modifyUserGroup">
-                                       </select>
                                </div>
                                <br>
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
-                       <a href=#adminUser onClick="adminUserModifyPopupModify()" data-role="button" data-inline="true" data-icon="gear">Save</a>
+                       <a href=#adminUser onClick="adminUserModify()" data-role="button" data-inline="true" data-icon="gear">Save</a>
                </div>
        </div><!-- /page -->
 
@@ -396,10 +364,10 @@ Contributors:
                        <div class="content-primary">
                                <h2>Group information</h2>
                                <div align="right" style="font-size: 10px">
-                                       <a href="#adminGroupAddPopup" data-role="button" data-rel="dialog"  data-inline="true" data-icon="plus"> Add group </a>
+                                       <a href="#adminGroupAdd" data-role="button" data-rel="dialog"  data-inline="true" data-icon="plus"> Add group </a>
                                </div>
                                <div data-role="content" class="container">
-                                       <table class="imagetable" style="font-size: 14px" id="groupTable">
+                                       <table class="imagetable" style="font-size: 14px" id="adminGroup-contents">
                                        </table>
                                </div>
                        </div><!--/content-primary -->
@@ -469,7 +437,7 @@ Contributors:
                                <h2>Project information</h2>
                                <div>
                                        <div data-role="fieldcontain" style="text-align: center; font-size: 14px;">
-                                               <select id="adminProjectDistributionSelect" data-native-menu="false" onchange="adminProjectSetProjectInfo()">
+                                               <select id="adminProject-distribution-select" data-native-menu="false" onchange="adminProjectSetProjectInfo()">
                                                </select>
                                        </div>
                                </div>
@@ -478,19 +446,19 @@ Contributors:
                                                <div data-role="collapsible" data-theme="b" data-content-theme="c" data-collapsed="false" > 
                                                        <h2> Git project </h2>
                                                        <div align="right" style="font-size: 10px">
-                                                               <a href="#addGitProject"  data-role="button" data-rel="dialog"  data-inline="true" data-icon="plus"> Add git project</a>
+                                                               <a href="#adminProjectAddGit"  data-role="button" data-rel="dialog"  data-inline="true" data-icon="plus"> Add git project</a>
                                                        </div>
                                                        <br> 
-                                                       <table class="imagetable" id="adminProjectTable" style="font-size: 14px">
+                                                       <table class="imagetable" id="adminProject-git" style="font-size: 14px">
                                                        </table>
                                                </div>
                                                <br>
                                                <div data-role="collapsible" data-theme="b" data-content-theme="c" data-collapsed="false" > 
                                                        <h2> Binary project </h2>
                                                        <div align="right" style="font-size: 10px">
-                                                               <a href="#addBinaryProject"  data-role="button"data-rel="dialog"  data-inline="true" data-icon="plus"> Add binary project</a>
+                                                               <a href="#adminProjectAddBinary"  data-role="button"data-rel="dialog"  data-inline="true" data-icon="plus"> Add binary project</a>
                                                        </div>
-                                                       <table class="imagetable" id="adminBinaryProjectTable" style="font-size: 14px">
+                                                       <table class="imagetable" id="adminProject-binary" style="font-size: 14px">
                                                        </table>
                                                </div>
                                        </div>
@@ -517,7 +485,7 @@ Contributors:
                                <h2>Distribution information</h2>
                                <div>
                                        <div data-role="fieldcontain" style="text-align: center; font-size: 14px;">
-                                               <select id="adminDistributionSelect" data-native-menu="false" onchange="adminDistributionSetInfo()">
+                                               <select id="adminDistribution-distribution-select" data-native-menu="false" onchange="adminDistributionSetInfo()">
                                                </select>
                                        </div>
                                        <div align="right" style="font-size: 10px">
@@ -525,29 +493,29 @@ Contributors:
                                        </div>
                                        <div data-role="collapsible" data-theme="c" data-content-theme="d" data-collapsed="false" > 
                                                <h2> Package server url </h2>
-                                               <p id="adminDistribution:packageServerUrl" style="font-size: 14px"> </p>
+                                               <p id="adminDistribution-url" style="font-size: 14px"> </p>
                                        </div>
                                        <div data-role="collapsible" data-theme="c" data-content-theme="d" data-collapsed="false" > 
                                                <h2> Package server address </h2>
-                                               <p id="adminDistribution:packageServerAddress" style="font-size: 14px"> </p>
+                                               <p id="adminDistribution-address" style="font-size: 14px"> </p>
                                        </div>
                                        <div data-role="collapsible" data-theme="c" data-content-theme="d" data-collapsed="false" > 
                                                <h2> Status </h2>
-                                               <p id="adminDistribution:distributionStatus" style="font-size: 14px"> </p>
+                                               <p id="adminDistribution-status" style="font-size: 14px"> </p>
                                        </div>
                                        <div data-role="collapsible" data-theme="c" data-content-theme="d" data-collapsed="false" > 
                                                <h2> Description </h2>
-                                               <p id="adminDistribution:distributionDescription" style="font-size: 14px"> </p>
+                                               <p id="adminDistribution-description" style="font-size: 14px"> </p>
                                        </div>
                                        <div data-role="collapsible" data-theme="c" data-content-theme="d" data-collapsed="false" >
                                                <h2> Sync package server </h2>
-                                               <div id="adminDistribution-SyncPackageServer">
+                                               <div id="adminDistribution-syncPackageServer">
                                                </div>
                                        </div>  
                                        <br> 
                                        <div align="right" style="font-size: 10px">
-                                               <a href="#addDistribution" data-role="button" data-rel="dialog" data-inline="true" data-icon="plus"> Add distribution</a>
-                                               <a href="#modifyDistribution" data-role="button" data-rel="dialog" data-inline="true" data-icon="gear"> Modify distribution</a>
+                                               <a href="#adminDistributionAdd" data-role="button" data-rel="dialog" data-inline="true" data-icon="plus"> Add distribution</a>
+                                               <a href="#adminDistributionModify" data-role="button" data-rel="dialog" data-inline="true" data-icon="gear"> Modify distribution</a>
                                                <a href="javascript:adminDistributionRemove()" data-role="button" data-rel="dialog" data-inline="true" data-icon="minus"> Remove distribution</a>
                                        </div>
                                </div>
@@ -560,38 +528,38 @@ Contributors:
                </div><!-- /content -->
        </div><!-- /page -->            
 
-       <div data-role="page" id="addDistribution" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminDistributionAdd" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Add Distribution</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <label for="adminDistributionAddPopup-DistirubtionName"> Distirbution name </label>
-                               <input type="text" id="adminDistributionAddPopup-DistirubtionName"/>
+                               <label for="adminDistributionAdd-name"> Distirbution name </label>
+                               <input type="text" id="adminDistributionAdd-name" name="name" />
                                <br>
-                               <label for="adminDistributionAddPopup-PackageServerUrl"> Package server url </label>
-                               <input type="text" id="adminDistributionAddPopup-PackageServerUrl"/>
+                               <label for="adminDistributionAdd-url"> Package server url </label>
+                               <input type="text" id="adminDistributionAdd-url" name="url" />
                                <br>
-                               <label for="adminDistributionAddPopup-PackageServerAddress"> Package server address </label>
-                               <input type="text" id="adminDistributionAddPopup-PackageServerAddress"/>
+                               <label for="adminDistributionAdd-address"> Package server address </label>
+                               <input type="text" id="adminDistributionAdd-address" name="address" />
                                <br>
-                               <label for="adminDistributionAddPopup-DistributionStatus"> Distribution status </label>
-                               <select id="adminDistributionAddPopup-DistributionStatus">
+                               <label for="adminDistributionAdd-status"> Distribution status </label>
+                               <select id="adminDistributionAdd-status" name="status" >
                                        <option value="OPEN" selected="selected">OPEN</option>
                                        <option value="CLOSE">CLOSE</option>
                                </select>
                                <br>
-                               <label for="adminDistributionAddPopup-DistributionDescription"> Description </label>
-                               <input type="text" id="adminDistributionAddPopup-DistributionDescription"/>
+                               <label for="adminDistributionAdd-description"> Description </label>
+                               <input type="text" id="adminDistributionAdd-description" name="description" />
                                <br>
                                <div>
                                        <h3> Sync package server </h3>
-                                       <label for="adminDistributionAddPopup-SyncPackageServer-Url"> Url </label>
-                                       <input type="text" id="adminDistributionAddPopup-SyncPackageServer-Url"/>
-                                       <label for="adminDistributionAddPopup-SyncPackageServer-period"> Period </label>
-                                       <input type="text" id="adminDistributionAddPopup-SyncPackageServer-period"/>
-                                       <label for="adminDistributionAddPopup-SyncPackageServer-Description"> Description </label>
-                                       <input type="text" id="adminDistributionAddPopup-SyncPackageServer-Description"/>
+                                       <label for="adminDistributionAdd-syncPackageServer-url"> Url </label>
+                                       <input type="text" id="adminDistributionAdd-syncPackageServer-url" name="url" />
+                                       <label for="adminDistributionAdd-syncPackageServer-period"> Period </label>
+                                       <input type="text" id="adminDistributionAdd-syncPackageServer-period" name="period" />
+                                       <label for="adminDistributionAdd-syncPackageServer-description"> Description </label>
+                                       <input type="text" id="adminDistributionAdd-syncPackageServer-description" name="description" />
                                </div>
                        </form>
                </div>
@@ -600,33 +568,33 @@ Contributors:
                </div>
        </div><!-- /page -->
        
-       <div data-role="page" id="modifyDistribution" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminDistributionModify" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Modofy Distribution</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <label for="adminDistributionModifyPopup-PackageServerUrl"> Package server url </label>
-                               <input type="text" id="adminDistributionModifyPopup-PackageServerUrl"/>
+                               <label for="adminDistributionModify-url"> Package server url </label>
+                               <input type="text" id="adminDistributionModify-url" name="description" />
                                <br>
-                               <label for="adminDistributionModifyPopup-PackageServerAddress"> Package server address </label>
-                               <input type="text" id="adminDistributionModifyPopup-PackageServerAddress"/>
+                               <label for="adminDistributionModify-address"> Package server address </label>
+                               <input type="text" id="adminDistributionModify-address" name="address" />
                                <br>
-                               <label for="adminDistributionModifyPopup-Status"> Distribution status </label>
-                               <select id="adminDistributionModifyPopup-Status">
+                               <label for="adminDistributionModify-status"> Distribution status </label>
+                               <select id="adminDistributionModify-status" name="status" >
                                </select>
                                <br>
-                               <label for="adminDistributionModifyPopup-Description"> Description </label>
-                               <input type="text" id="adminDistributionModifyPopup-Description"/>
+                               <label for="adminDistributionModify-description"> Description </label>
+                               <input type="text" id="adminDistributionModify-description" name="description" />
                                <br>
                                <div>
                                        <h3> Sync package server </h3>
-                                       <label for="adminDistributionModifyPopup-SyncPackageServer-Url"> Url </label>
-                                       <input type="text" id="adminDistributionModifyPopup-SyncPackageServer-Url"/>
-                                       <label for="adminDistributionModifyPopup-SyncPackageServer-Period"> Period </label>
-                                       <input type="text" id="adminDistributionModifyPopup-SyncPackageServer-Period"/>
-                                       <label for="adminDistributionModifyPopup-SyncPackageServer-Description"> Description </label>
-                                       <input type="text" id="adminDistributionModifyPopup-SyncPackageServer-Description"/>
+                                       <label for="adminDistributionModify-syncPackageServer-url"> Url </label>
+                                       <input type="text" id="adminDistributionModify-syncPackageServer-url" name="url" />
+                                       <label for="adminDistributionModify-syncPackageServer-period"> Period </label>
+                                       <input type="text" id="adminDistributionModify-syncPackageServer-period" name="period" />
+                                       <label for="adminDistributionModify-syncPackageServer-description"> Description </label>
+                                       <input type="text" id="adminDistributionModify-syncPackageServer-description" name="description" />
                                </div>
                        </form>
                </div>
@@ -635,26 +603,26 @@ Contributors:
                </div>
        </div>
        
-       <div data-role="page" id="addGitProject" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminProjectAddGit" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Add Git Project</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <label for="popup:addGitProjectName"> Project name </label>
-                               <input type="text" id="popup:addGitProjectName"/>
+                               <label for="adminProjectAddGit-name"> Project name </label>
+                               <input type="text" id="adminProjectAddGit-name" name="name" />
                                <br>
-                               <label for="popup:addGitProjectPassword"> Project password </label>
-                               <input type="text" id="popup:addGitProjectPassword"/>
+                               <label for="adminProjectAddGit-password"> Project password </label>
+                               <input type="text" id="adminProjectAddGit-password" name="password" />
                                <br>
-                               <label for="popup:addGitAddress"> Git address </label>
-                               <input type="text" id="popup:addGitAddress"/>
+                               <label for="adminProjectAddGit-address"> Git address </label>
+                               <input type="text" id="adminProjectAddGit-address" name="address" />
                                <br>
-                               <label for="popup:addGitBranch"> Git Branch </label>
-                               <input type="text" id="popup:addGitBranch"/>
+                               <label for="adminProjectAddGit-branch"> Git Branch </label>
+                               <input type="text" id="adminProjectAddGit-branch" name="branch" />
                                <br>
                                <div data-role="fieldcontain">
-                                       <fieldset data-role="controlgroup" data-mini="true" id="popup:addGitProjectOs">
+                                       <fieldset data-role="controlgroup" data-mini="true" id="adminProjectAddGit-os" name="os" >
                                        </fieldset>
                                        <br>
                                </div>
@@ -665,22 +633,22 @@ Contributors:
                </div>
        </div><!-- /page -->
        
-       <div data-role="page" id="addBinaryProject" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminProjectAddBinary" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Add Binary Project</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <label for="popup:addBinaryProjectName"> Project name </label>
-                               <input type="text" id="popup:addBinaryProjectName"/>
+                               <label for="adminProjectAddBinary-name"> Project name </label>
+                               <input type="text" id="adminProjectAddBinary-name" name="name" />
                                <br>
-                               <label for="popup:addBinaryProjectPassword"> Project password</label>
-                               <input type="text" id="popup:addBinaryProjectPassword"/>
+                               <label for="adminProjectAddBinary-password"> Project password</label>
+                               <input type="text" id="adminProjectAddBinary-password" name="password" />
                                <br>
-                               <label for="popup:addBinaryPackageName"> Pakcage name</label>
-                               <input type="text" id="popup:addBinaryPackageName"/>
+                               <label for=adminProjectAddBinary-packagename""> Pakcage name</label>
+                               <input type="text" id="adminProjectAddBinary-packagename" name="name" />
                                <div data-role="fieldcontain">
-                                       <fieldset data-role="controlgroup" data-mini="true" id="popup:addBinaryProjectOs">
+                                       <fieldset data-role="controlgroup" data-mini="true" id="adminProjectAddBinary-os" name="os" >
                                        </fieldset>
                                        <br>
                                </div>
@@ -691,33 +659,24 @@ Contributors:
                </div>
        </div><!-- /page -->
        
-       <div data-role="page" id="modifyBinaryProject" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminProjectModifyBinary" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Modify Project</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <input type="hidden" id="popup:modifyBinaryOldProjectName" disabled="disabled"/> 
+                               <input type="hidden" id="adminProjectModifyBinary-oldName" disabled="disabled" name="name" /> 
                                <br>
-                               <label for="popup:modifyBinaryNewProjectName"> New Project name </label>
-                               <input type="text" id="popup:modifyBinaryNewProjectName"/> 
+                               <label for="adminProjectModifyBinary-newName"> New Project name </label>
+                               <input type="text" id="adminProjectModifyBinary-newName" name="name" /> 
                                <br>
-                               <div data-role="fieldcontain">
-                                       <label for="popup:modifyBinaryProjectType"> Project type </label>
-                                       <br>
-                                       <select id="popup:modifyBinaryProjectType" disabled="disabled">
-                                               <option value="git">Git</option>
-                                               <option value="binary" selected="selected">Binary</option>
-                                       </select>
-                               </div>
+                               <label for="adminProjectModifyBinary-password"> Project password</label>
+                               <input type="text" id="adminProjectModifyBinary-password" name="name" />
                                <br>
-                               <label for="popup:modifyBinaryProjectPassword"> Project password</label>
-                               <input type="text" id="popup:modifyBinaryProjectPassword"/>
-                               <br>
-                               <label for="popup:modifyBinaryPackageName"> Pakcage name</label>
-                               <input type="text" id="popup:modifyBinaryPackageName"/>
+                               <label for="adminProjectModifyBinary-packageName"> Pakcage name</label>
+                               <input type="text" id="adminProjectModifyBinary-packageName" name="name" />
                                <div data-role="fieldcontain">
-                                       <fieldset data-role="controlgroup" data-mini="true" id="popup:modifyBinaryProjectOs">
+                                       <fieldset data-role="controlgroup" data-mini="true" id="adminProjectModifyBinary-os" name="os" >
                                        </fieldset>
                                        <br>
                                </div>
@@ -728,37 +687,28 @@ Contributors:
                </div>
        </div><!-- /page -->
 
-       <div data-role="page" id="modifyGitProject" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminProjectModifyGit" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Modify Project</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <input type="hidden" id="popup:modifyGitOldProjectName" disabled="disabled"/> 
+                               <input type="hidden" id="adminProjectModifyGit-oldName" disabled="disabled" name="name" /> 
                                <br>
-                               <label for="popup:modifyGitNewProjectName"> New Project name </label>
-                               <input type="text" id="popup:modifyGitNewProjectName"/> 
+                               <label for="adminProjectModifyGit-newName"> New Project name </label>
+                               <input type="text" id="adminProjectModifyGit-newName" name="name" /> 
                                <br>
-                               <div data-role="fieldcontain">
-                                       <label for="popup:modifyGitProjectType"> Project type </label>
-                                       <br>
-                                       <select id="popup:modifyGitProjectType" disabled="disabled">
-                                               <option value="git" selected="selected">Git</option>
-                                               <option value="binary">Binary</option>
-                                       </select>
-                               </div>
-                               <br>
-                               <label for="popup:modifyGitProjectPassword"> Project password</label>
-                               <input type="text" id="popup:modifyGitProjectPassword"/>
+                               <label for="adminProjectModifyGit-password"> Project password</label>
+                               <input type="text" id="adminProjectModifyGit-password" name="password" />
                                <br>
-                               <label for="popup:modifyGitProjectAddress"> Git address </label>
-                               <input type="text" id="popup:modifyGitProjectAddress"/>
+                               <label for="adminProjectModifyGit-address"> Git address </label>
+                               <input type="text" id="adminProjectModifyGit-address" name="address" />
                                <br>
-                               <label for="popup:modifyGitProjectBranch"> Git branch</label>
-                               <input type="text" id="popup:modifyGitProjectBranch"/>
+                               <label for="adminProjectModifyGit-branch"> Git branch</label>
+                               <input type="text" id="adminProjectModifyGit-branch" name="branch" />
                                <br>
                                <div data-role="fieldcontain">
-                                       <fieldset data-role="controlgroup" data-mini="true" id="popup:modifyGitProjectOs">
+                                       <fieldset data-role="controlgroup" data-mini="true" id="adminProjectModifyGit-os" name="os" >
                                        </fieldset>
                                        <br>
                                </div>
@@ -769,29 +719,29 @@ Contributors:
                </div>
        </div><!-- /page -->
 
-       <div data-role="page" id="adminGroupAddPopup" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminGroupAdd" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>Add Group</h1>
                </div>
                <div data-role="content">
                        <form method="post" style="font-size: 12px">
-                               <label for="adminGroupAddPopup-Name"> Group name </label>
-                               <input type="text" id="adminGroupAddPopup-Name"/>
+                               <label for="adminGroupAdd-name"> Group name </label>
+                               <input type="text" id="adminGroupAdd-name" name="name" />
                                <br>
                                <div data-role="fieldcontain">
-                                       <label for="adminGroupAddPopup-Admin"> Admin Flag </label>
+                                       <label for="adminGroupAdd-admin"> Admin Flag </label>
                                        <br>
-                                       <select id="adminGroupAddPopup-Admin">
+                                       <select id="adminGroupAdd-admin" name="admin" >
                                                <option value="TRUE">True</option>
                                                <option value="FALSE" selected="selected">False</option>
                                        </select>
                                </div>
                                <br>
-                               <label for="adminGroupAddPopup-Description"> Description </label>
-                               <input type="text" id="adminGroupAddPopup-Description"/>
+                               <label for="adminGroupAdd-description"> Description </label>
+                               <input type="text" id="adminGroupAdd-description" name="description" />
                                <br>
                                <div data-role="fieldcontain">
-                                       <fieldset data-role="controlgroup" data-mini="true" id="popup:addProjectCheckbox">
+                                       <fieldset data-role="controlgroup" data-mini="true" id="adminGroupAdd-project" name="project" >
                                        </fieldset>
                                        <br>
                                </div>
@@ -802,28 +752,29 @@ Contributors:
                </div>
        </div><!-- /page -->
        
-       <div data-role="page" id="adminGroupModifyPopup" style="height: 800px; width: 800px">
+       <div data-role="page" id="adminGroupModify" style="height: 800px; width: 800px">
                <div data-role="header" >
                        <h1>modify Group</h1>
                </div>
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
-                               <input type="hidden" id="adminGroupModifyPopup-Name"/>
-                               <label for="adminGroupModifyPopup-NewName"> New group name </label>
-                               <input type="text" id="adminGroupModifyPopup-NewName"/>
+                               <input type="hidden" id="adminGroupModify-oldName" name="name" />
+                               <br>
+                               <label for="adminGroupModify-newName"> New group name </label>
+                               <input type="text" id="adminGroupModify-newName" name="name" />
                                <br>
                                <div data-role="fieldcontain">
-                                       <label for="adminGroupModifyPopup-Admin"> Admin Flag </label>
+                                       <label for="adminGroupModify-admin"> Admin Flag </label>
                                        <br>
-                                       <select id="adminGroupModifyPopup-Admin">
+                                       <select id="adminGroupModify-admin" name="admin" >
                                        </select>
                                </div>
                                <br>
-                               <label for="adminGroupModifyPopup-Description"> Description </label>
-                               <input type="text" id="adminGroupModifyPopup-Description"/>
+                               <label for="adminGroupModify-description"> Description </label>
+                               <input type="text" id="adminGroupModify-description" name="description" />
                                <br>
                                <div>
-                                       <fieldset data-role="controlgroup" data-mini="true" data-role="fieldcontain" id="popup:modifyProjectSelect">
+                                       <fieldset data-role="controlgroup" data-mini="true" data-role="fieldcontain" id="adminGroupModify-project" name="project" >
                                        </fieldset>
                                        <br>
                                </div>
@@ -841,10 +792,10 @@ Contributors:
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
                                <label for="adminServer-AddRemoteBuildServer-Address"> Server address </label>
-                               <input type="text" id="adminServer-AddRemoteBuildServer-Address"/>
+                               <input type="text" id="adminServer-AddRemoteBuildServer-Address" name="address" />
                                <br>
                                <label for="adminServer-AddRemoteBuildServer-Description"> Server description</label>
-                               <input type="text" id="adminServer-AddRemoteBuildServer-Description"/>
+                               <input type="text" id="adminServer-AddRemoteBuildServer-Description" name="description" />
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
@@ -857,13 +808,13 @@ Contributors:
                </div>
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
-                               <input type="hidden" id="adminServer-modifyRemoteBuildServer-OldAddress"/>
+                               <input type="hidden" id="adminServer-modifyRemoteBuildServer-OldAddress" name="address" />
                                <br>
                                <label for="adminServer-modifyRemoteBuildServer-newAddress"> New server address </label>
-                               <input type="text" id="adminServer-modifyRemoteBuildServer-newAddress"/>
+                               <input type="text" id="adminServer-modifyRemoteBuildServer-newAddress" name="address" />
                                <br>
                                <label for="adminServer-modifyRemoteBuildServer-description"> Description </label>
-                               <input type="text" id="adminServer-modifyRemoteBuildServer-description"/>
+                               <input type="text" id="adminServer-modifyRemoteBuildServer-description" name="description" />
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
@@ -872,23 +823,23 @@ Contributors:
                </div>
        </div><!-- /page -->
 
-       <div data-role="page" id="userModifyPopup" style="height: 800px; width: 800px"> 
+       <div data-role="page" id="userModify" style="height: 800px; width: 800px"> 
                <div data-role="header" >
                        <h1>User information</h1>
                </div>
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
-                               <label for="popup-user-info-email">Email</label>
-                               <input type="text" id="popup-user-info-email" disabled="disabled"/>
+                               <label for="userModify-email">Email</label>
+                               <input type="text" id="userModify-email" disabled="disabled" name="email" />
                                <br>
-                               <label for="popup-user-info-name">Name</label>
-                               <input type="text" id="popup-user-info-name"/>
+                               <label for="userModify-name">Name</label>
+                               <input type="text" id="userModify-name" name="email" />
                                <br>
-                               <label for="popup-user-info-password">Password</label>
-                               <input type="password" id="popup-user-info-password"/>
+                               <label for="userModify-password">Password</label>
+                               <input type="password" id="userModify-password" name="password" />
                                <br>
-                               <label for="popup-user-info-password-confirm">Password confirmation</label>
-                               <input type="password" id="popup-user-info-password-confirm"/>
+                               <label for="userModify-password-confirm">Password confirmation</label>
+                               <input type="password" id="userModify-password-confirm" name="password" />
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
@@ -903,12 +854,12 @@ Contributors:
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
                                <label for="adminServer-AddSupportedOs-OsName">Supported os name</label>
-                               <input type="text" id="adminServer-AddSupportedOs-OsName"/>
+                               <input type="text" id="adminServer-AddSupportedOs-OsName" name="os" />
                                <br>
                                <div data-role="fieldcontain">
                                        <label for="adminServer-AddSupportedOs-OsCategory"> Os category </label>
                                        <br>
-                                       <select id="adminServer-AddSupportedOs-OsCategory">
+                                       <select id="adminServer-AddSupportedOs-OsCategory" name="os-category" >
                                        </select>
                                </div>
                        </form>
@@ -924,14 +875,14 @@ Contributors:
                </div>
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
-                               <input type="hidden" id="adminServer-ModifySupportedOs-OldOsName" disabled="disabled"/>
+                               <input type="hidden" id="adminServer-ModifySupportedOs-OldOsName" disabled="disabled" name="name" />
                                <label for="adminServer-ModifySupportedOs-OsName">Supported os name</label>
-                               <input type="text" id="adminServer-MoidfySupportedOs-OsName"/>
+                               <input type="text" id="adminServer-MoidfySupportedOs-OsName" name="name" />
                                <br>
                                <div data-role="fieldcontain">
                                        <label for="adminServer-ModifySupportedOs-OsCategory"> Os category </label>
                                        <br>
-                                       <select id="adminServer-ModifySupportedOs-OsCategory">
+                                       <select id="adminServer-ModifySupportedOs-OsCategory" name="os-category" >
                                        </select>
                                </div>
                        </form>
@@ -949,7 +900,7 @@ Contributors:
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
                                <label for="adminServer-AddOsCategory-Name">OS category name</label>
-                               <input type="text" id="adminServer-AddOsCategory-Name"/>
+                               <input type="text" id="adminServer-AddOsCategory-Name" name="name" />
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
@@ -966,7 +917,7 @@ Contributors:
                                <div data-role="fieldcontain">
                                        <label for="adminServer-RemoveOSCategory-CategorySelect"> Os category </label>
                                        <br>
-                                       <select id="adminServer-RemoveOSCategory-CategorySelect">
+                                       <select id="adminServer-RemoveOSCategory-CategorySelect" name="osCategory" >
                                        </select>
                                </div>
                        </form>
@@ -982,10 +933,10 @@ Contributors:
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
                                <label for="adminServer-addServerInfo-property"> Property</label>
-                               <input type="text" id="adminServer-addServerInfo-property"/>
+                               <input type="text" id="adminServer-addServerInfo-property" name="property" />
                                <br>
                                <label for="adminServer-addServerInfo-value"> Value </label>
-                               <input type="text" id="adminServer-addServerInfo-value"/>
+                               <input type="text" id="adminServer-addServerInfo-value" name="value" />
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
@@ -999,10 +950,10 @@ Contributors:
                <div data-role="content" data-role="fieldcontain">
                        <form method="post" style="font-size: 12px">
                                <label for="adminServer-modifyServerInfo-property"> Property</label>
-                               <input type="text" id="adminServer-modifyServerInfo-property" disabled="disabled"/>
+                               <input type="text" id="adminServer-modifyServerInfo-property" disabled="disabled" name="property" />
                                <br>
                                <label for="adminServer-modifyServerInfo-value"> Value </label>
-                               <input type="text" id="adminServer-modifyServerInfo-value"/>
+                               <input type="text" id="adminServer-modifyServerInfo-value" name="value" />
                        </form>
                </div>
                <div align="right" style="font-size: 10px">
index f6486381c50faec3c95505e510c747a6f611a191..9ea84ca5f28361ad8212755c80d9d45978bbca10 100644 (file)
@@ -29,15 +29,15 @@ Contributors:
 function adminDistributionAdd() {
        var changeInfoList = [];
        var changeInfoItem;
-       var name = document.getElementById("adminDistributionAddPopup-DistirubtionName").value;
-       var url = document.getElementById("adminDistributionAddPopup-PackageServerUrl").value;
-       var address = document.getElementById("adminDistributionAddPopup-PackageServerAddress").value;
-       var description = document.getElementById("adminDistributionAddPopup-DistributionDescription").value;
-       var distStatus = $("#adminDistributionAddPopup-DistributionStatus option:selected").val();
+       var name = $("#adminDistributionAdd-name").val();
+       var url = $("#adminDistributionAdd-url").val();
+       var address = $("#adminDistributionAdd-address").val();
+       var description = $("#adminDistributionAdd-description").val();
+       var distStatus = $("#adminDistributionAdd-status option:selected").val();
 
-       var sync_pkg_svr_url = document.getElementById("adminDistributionAddPopup-SyncPackageServer-Url").value;
-       var sync_pkg_svr_period = document.getElementById("adminDistributionAddPopup-SyncPackageServer-period").value;
-       var sync_pkg_svr_description = document.getElementById("adminDistributionAddPopup-SyncPackageServer-Description").value;
+       var sync_pkg_svr_url = $("#adminDistributionAdd-syncPackageServer-url").val();
+       var sync_pkg_svr_period = $("#adminDistributionAdd-syncPackageServer-period").val();
+       var sync_pkg_svr_description = $("#adminDistributionAdd-syncPackageServer-description").val();
 
        if(name == "" || url == "" || address == ""){
                alert("You must input full data");
@@ -48,13 +48,13 @@ function adminDistributionAdd() {
        changeInfoList.push(changeInfoItem);
        
        addDistribution(changeInfoList, function () {
-               document.getElementById("adminDistributionAddPopup-DistirubtionName").value = "";
-               document.getElementById("adminDistributionAddPopup-PackageServerUrl").value = "";
-               document.getElementById("adminDistributionAddPopup-PackageServerAddress").value = "";
-               document.getElementById("adminDistributionAddPopup-DistributionDescription").value = "";
-               document.getElementById("adminDistributionAddPopup-SyncPackageServer-Url").value = "";
-               document.getElementById("adminDistributionAddPopup-SyncPackageServer-period").value = "";
-               document.getElementById("adminDistributionAddPopup-SyncPackageServer-Description").value = "";
+               $("#adminDistributionAdd-name").val("");
+               $("#adminDistributionAdd-url").val("");
+               $("#adminDistributionAdd-address").val("");
+               $("#adminDistributionAdd-description").val("");
+               $("#adminDistributionAdd-syncPackageServer-url").val("");
+               $("#adminDistributionAdd-syncPackageServer-period").val("");
+               $("#adminDistributionAdd-syncPackageServer-description").val("");
 
                $.mobile.changePage("#adminDistribution"); 
        });
index 5c5c2933cdab6519eb4568e33c518d1036cc076d..679e46ae22d0b5fd7f65ae73efc928a2cf6f5a92 100644 (file)
@@ -27,15 +27,15 @@ Contributors:
 */
 
 function adminDistributionModifyPopupInit() {
-       var distName = $("#adminDistributionSelect option:selected").val();
-       var packageServerUrl = document.getElementById("adminDistribution:packageServerUrl").innerHTML;
-       var packageServeraddress = document.getElementById("adminDistribution:packageServerAddress").innerHTML;
-       var serverStatusText = document.getElementById("adminDistribution:distributionStatus").innerHTML;
-       var serverDescription = document.getElementById("adminDistribution:distributionDescription").innerHTML;
+       var distName = $("#adminDistribution-distribution-select option:selected").val();
+       var packageServerUrl = $("#adminDistribution-url").html();
+       var packageServeraddress = $("#adminDistribution-address").html();
+       var serverStatusText = $("#adminDistribution-status").html();
+       var serverDescription = $("#adminDistribution-description").html();
 
-       var syncPkgSvrUrl = document.getElementById("adminDistribution-SyncPackageServer-Url").innerHTML;
-       var syncPkgSvrPeriod = document.getElementById("adminDistribution-SyncPackageServer-period").innerHTML;
-       var syncPkgSvrDescription = document.getElementById("adminDistribution-SyncPackageServer-Description").innerHTML;
+       var syncPkgSvrUrl = $("#adminDistribution-syncPackageServer-url").html();
+       var syncPkgSvrPeriod = $("#adminDistribution-syncPackageServer-period").html();
+       var syncPkgSvrDescription = $("#adminDistribution-syncPackageServer-description").html();
 
        if (syncPkgSvrUrl) {
                syncPkgSvrUrl = syncPkgSvrUrl.replace("Package server url : ", "");
@@ -54,42 +54,42 @@ function adminDistributionModifyPopupInit() {
                syncPkgSvrDescription = ""
        }
 
-       document.getElementById('adminDistributionModifyPopup-PackageServerUrl').value = packageServerUrl;
-       document.getElementById('adminDistributionModifyPopup-PackageServerAddress').value = packageServeraddress;
-       document.getElementById('adminDistributionModifyPopup-Description').value = serverDescription;
-       document.getElementById('adminDistributionModifyPopup-SyncPackageServer-Url').value = syncPkgSvrUrl;
-       document.getElementById('adminDistributionModifyPopup-SyncPackageServer-Period').value = syncPkgSvrPeriod;
-       document.getElementById('adminDistributionModifyPopup-SyncPackageServer-Description').value = syncPkgSvrDescription;
+       $("#adminDistributionModify-url").val(packageServerUrl);
+       $("#adminDistributionModify-address").val(packageServeraddress);
+       $("#adminDistributionModify-description").val(serverDescription);
+       $("#adminDistributionModify-syncPackageServer-url").val(syncPkgSvrUrl);
+       $("#adminDistributionModify-syncPackageServer-period").val(syncPkgSvrPeriod);
+       $("#adminDistributionModify-syncPackageServer-description").val(syncPkgSvrDescription);
 
-       $("#adminDistributionModifyPopup-Status").empty();
+       $("#adminDistributionModify-status").empty();
        var option; 
        if(serverStatusText.toUpperCase() == "OPEN") {
                option = '<option value="OPEN" selected="selected">OPEN</option>';
        } else {
                option = '<option value="OPEN">OPEN</option>';
        }
-       $("#adminDistributionModifyPopup-Status").append(option);
+       $("#adminDistributionModify-status").append(option);
        
        if(serverStatusText.toUpperCase() == "CLOSE") {
                option = '<option value="CLOSE" selected="selected">CLOSE</option>';
        } else {
                option = '<option value="CLOSE">FALSE</option>';
        }
-       $("#adminDistributionModifyPopup-Status").append(option);
-       $("#adminDistributionModifyPopup-Status").selectmenu("refresh");
+       $("#adminDistributionModify-status").append(option);
+       $("#adminDistributionModify-status").selectmenu("refresh");
 }
 
 function adminDistributionModify() {
        var changeInfoList = [];
        var changeInfoItem;
-       var distName = $("#adminDistributionSelect option:selected").val();
-       var url = document.getElementById("adminDistributionModifyPopup-PackageServerUrl").value;
-       var address = document.getElementById("adminDistributionModifyPopup-PackageServerAddress").value;
-       var description = document.getElementById("adminDistributionModifyPopup-Description").value;
-       var distStatus = $("#adminDistributionModifyPopup-Status option:selected").val();
-       var syncPkgSvrUrl = document.getElementById("adminDistributionModifyPopup-SyncPackageServer-Url").value;
-       var syncPkgSvrPeriod = document.getElementById("adminDistributionModifyPopup-SyncPackageServer-Period").value;
-       var syncPkgSvrDescription = document.getElementById("adminDistributionModifyPopup-SyncPackageServer-Description").value;
+       var distName = $("#adminDistribution-distribution-select option:selected").val();
+       var url = $("#adminDistributionModify-url").val();
+       var address = $("#adminDistributionModify-address").val();
+       var description = $("#adminDistributionModify-description").val();
+       var distStatus = $("#adminDistributionModify-status option:selected").val();
+       var syncPkgSvrUrl = $("#adminDistributionModify-syncPackageServer-url").val();
+       var syncPkgSvrPeriod = $("#adminDistributionModify-syncPackageServer-period").val();
+       var syncPkgSvrDescription = $("#adminDistributionModify-syncPackageServer-description").val();
 
        if(distName == "" || url == "" || address == ""){
                alert("You must input full data");
index 12e112b28919b7ff039c84fad70ed8fd87464feb..7fd24de5d3b8b425c05337f6bc60d3ca03aa3ef4 100644 (file)
@@ -27,32 +27,32 @@ Contributors:
 */
 
 function adminDistributionInit() {
-       queryAllDistribution( function (xml) {
-               var oldDistName = $("#adminDistributionSelect option:selected").val();
+       queryDistribution( function (xml) {
+               var oldDistName = $("#adminDistribution-distribution-select option:selected").val();
                var find = false;
                var distributionList = $(xml).find("Data").find("DistributionName");
 
                // remove old select options
-               $("#adminDistributionSelect").empty();
+               $("#adminDistribution-distribution-select").empty();
 
                distributionList.each(function(){
                        var name = $(this).text();
        
                        if( oldDistName == name ) {
-                               $("#adminDistributionSelect").append("<option value=\'"+name+"\' selected=\"selected\">"+name+"</option>");
+                               $("#adminDistribution-distribution-select").append("<option value=\'"+name+"\' selected=\"selected\">"+name+"</option>");
                                find = true;
                                
                        } else {
-                               $("#adminDistributionSelect").append("<option value=\'"+name+"\'>"+name+"</option>");
+                               $("#adminDistribution-distribution-select").append("<option value=\'"+name+"\'>"+name+"</option>");
                        }
                });
        
                /* default distribution selection */
                if(!find) {
-                       $("#adminDistributionSelect option:eq(0)").attr("selected", "selected");
+                       $("#adminDistribution-distribution-select option:eq(0)").attr("selected", "selected");
                }
 
-               $("#adminDistributionSelect").selectmenu('refresh');
+               $("#adminDistribution-distribution-select").selectmenu('refresh');
 
                // set distribution info
                adminDistributionSetInfo();
@@ -60,7 +60,7 @@ function adminDistributionInit() {
 }
 
 function adminDistributionSetInfo() {
-       var distName = $("#adminDistributionSelect option:selected").val();
+       var distName = $("#adminDistribution-distribution-select option:selected").val();
 
        queryDistributionInfo( distName, function (xml) {
                var data = $(xml).find("Data").find("DistributionInfo");
@@ -71,10 +71,10 @@ function adminDistributionSetInfo() {
                var distStatus = data.find("Status").text();
                var distDescription = data.find("Description").text();
 
-               $("#adminDistribution\\:packageServerUrl").text(url);
-               $("#adminDistribution\\:packageServerAddress").text(address);
-               $("#adminDistribution\\:distributionStatus").text(distStatus);
-               $("#adminDistribution\\:distributionDescription").text(distDescription);
+               $("#adminDistribution-url").text(url);
+               $("#adminDistribution-address").text(address);
+               $("#adminDistribution-status").text(distStatus);
+               $("#adminDistribution-description").text(distDescription);
 
                adminDistributionInitSyncPackageServer(syncPackageServer);
        });
@@ -83,7 +83,7 @@ function adminDistributionSetInfo() {
 function adminDistributionRemove() {
        var changeInfoList = [];
        var changeInfoItem;
-       var distName = $("#adminDistributionSelect option:selected").val();
+       var distName = $("#adminDistribution-distribution-select option:selected").val();
 
        changeInfoItem = {"DistributionName":distName};
        changeInfoList.push(changeInfoItem);
@@ -100,19 +100,19 @@ function adminDistributionRemove() {
 }
 
 function adminDistributionInitSyncPackageServer(serverInfo){
-       $("#adminDistribution-SyncPackageServer").empty();
+       $("#adminDistribution-syncPackageServer").empty();
 
-       var info = '<h3 style="font-size: 16px" id="adminDistribution-SyncPackageServer-Url">Package server url : '+serverInfo.find("Url").text()+'</h3>';
-       info += '<p style="font-size: 14px" id="adminDistribution-SyncPackageServer-period">Period : '+serverInfo.find("Period").text()+'</p>';
-       info += '<p style="font-size: 14px" id="adminDistribution-SyncPackageServer-Description">Description : '+serverInfo.find("Description").text()+'</p>';
+       var info = '<h3 style="font-size: 16px" id="adminDistribution-syncPackageServer-url">Package server url : '+serverInfo.find("Url").text()+'</h3>';
+       info += '<p style="font-size: 14px" id="adminDistribution-syncPackageServer-period">Period : '+serverInfo.find("Period").text()+'</p>';
+       info += '<p style="font-size: 14px" id="adminDistribution-syncPackageServer-description">Description : '+serverInfo.find("Description").text()+'</p>';
                
-       $("#adminDistribution-SyncPackageServer").append(info);
+       $("#adminDistribution-syncPackageServer").append(info);
 }
 
 function adminDistributionFullBuild() {
        var changeInfoList = [];
        var changeInfoItem;
-       var distName = $("#adminDistributionSelect option:selected").val();
+       var distName = $("#adminDistribution-distribution-select option:selected").val();
 
        changeInfoItem = {"DistributionName":distName};
        changeInfoList.push(changeInfoItem);
index 60c7a1660da56c2516710c79cc594040c1a8d01a..9811bd6c3bf17a1d3273bd6148cffbab9f311a66 100644 (file)
@@ -27,8 +27,8 @@ Contributors:
 */
 
 function adminGroupAddInit() {
-       document.getElementById('adminGroupAddPopup-Name').value = "";
-       document.getElementById('adminGroupAddPopup-Description').value = "";
+       $("#adminGroupAdd-name").val("");
+       $("#adminGroupAdd-description").val("");
 
        queryAllProject( function(xml) {
                var fullProjectList = $(xml).find("Data").find("Project");
@@ -38,60 +38,37 @@ function adminGroupAddInit() {
 }
 
 function adminGroupAddGenerateProjectSelect(projectList) {
-       fieldset = document.getElementById('popup:addProjectCheckbox');
-
-       /* remove all table rows */
-       while(fieldset.hasChildNodes())
-       {
-               fieldset.removeChild(fieldset.firstChild);
-       }
-
-       legend = document.createElement('legend');
-       legend.innerHTML = "Project list";
-       fieldset.appendChild(legend);
+       $("#adminGroupAdd-project").empty();
 
        projectList.each(function(){
                var projectName = $(this).find("Name").text();
                var projectId = $(this).find("Id").text();
                var projectDistName = $(this).find("DistName").text();
 
-               var input = document.createElement('input');
-               input.type = 'checkbox';
-               input.id = 'popup:addGroupProjectCheckbox:'+projectId;
-               input.name = 'popup:addGroupProjectCheckbox';
-               input.value = projectName;
-
-               var label = document.createElement('label');
-               label.setAttribute('for', 'popup:addGroupProjectCheckbox:'+projectId);
-               label.innerHTML = projectName + "[" + projectDistName + "]";
-               
-               fieldset.appendChild(input);
-               fieldset.appendChild(label);
+               var input = '<input type=checkbox id=adminGroupAdd-project-checkbox-'+projectId+' name=adminGroupAdd-project-checkbox value='+projectId+' />';
+               var label = '<label for=adminGroupAdd-project-checkbox-'+projectId+'> '+projectName+'['+projectDistName+'] <label>';
+               $("#adminGroupAdd-project").append(input);
+               $("#adminGroupAdd-project").append(label);
        });
 
-       $("[name='popup\\:addGroupProjectCheckbox']").checkboxradio();
+       $("input[name='adminGroupAdd-project-checkbox']").checkboxradio();
 }
 
 function adminGroupAddGroup() {
-       var selectArray = document.getElementsByName('popup:addGroupProjectCheckbox');
-       var groupName = document.getElementById('adminGroupAddPopup-Name').value;
-       var adminFlag = $("#adminGroupAddPopup-Admin option:selected").val();
-       var description = document.getElementById('adminGroupAddPopup-Description').value;
-       var selectProjectIdList = "";
+       var groupName = $("#adminGroupAdd-name").val();
+       var adminFlag = $("#adminGroupAdd-admin option:selected").val();
+       var description = $("#adminGroupAdd-description").val();
+       var selectProjectIdList = [];
        var changeInfoList = [];
        
+       var selectArray = $("input[name='adminGroupAdd-project-checkbox']");
        for(var i = 0; i < selectArray.length; i++) {
                if (selectArray[i].checked == true) {
-                       var projectId = selectArray[i].id.split(":")[2];
-                       selectProjectIdList = selectProjectIdList + "," + projectId;
+                       selectProjectIdList.push(selectArray[i].value);
                }
        }
-
-       if(selectProjectIdList.length > 0) {
-               selectProjectIdList = selectProjectIdList.substring(1,selectProjectIdList.length);
-       }
                
-       changeItem = {"GroupName" : groupName, "AdminFlag":adminFlag, "Description":description, "ProjectList" : selectProjectIdList};
+       changeItem = {"GroupName" : groupName, "AdminFlag":adminFlag, "Description":description, "ProjectList" : selectProjectIdList.toString()};
        changeInfoList.push(changeItem);
 
        addGroup(changeInfoList, function() {
index 17ed56edb37b4793f4c7784b5d816be55231e4a6..51b4e658c6dff74d29d70b11d01971cbd558c72b 100644 (file)
@@ -28,98 +28,76 @@ Contributors:
 
 function adminGroupModifyInit() {
        var index = localStorage.groupTableIndex;
-       var groupName = document.getElementById("groupTableName:"+index).innerHTML;
-       var description = document.getElementById("groupTableDescription:"+index).innerHTML;
-       var adminFlagText = document.getElementById("groupTableAdminFlag:"+index).innerHTML;
-
-       document.getElementById('adminGroupModifyPopup-Name').value = groupName;
-       document.getElementById('adminGroupModifyPopup-NewName').value = groupName;
-       document.getElementById('adminGroupModifyPopup-Description').value = description;
-       $("#adminGroupModifyPopup-Admin").empty();
-       var option; 
+       var groupName = $("#adminGroup-contents-"+index+"-name").html();
+       var adminFlagText = $("#adminGroup-contents-"+index+"-flag").html();
+       var description = $("#adminGroup-contents-"+index+"-description").html();
+
+       $("#adminGroupModify-oldName").val(groupName);
+       $("#adminGroupModify-newName").val(groupName);
+       $("#adminGroupModify-description").val(description);
+
+       $("#adminGroupModify-admin").empty();
        if(adminFlagText.toUpperCase() == "TRUE") {
-               option = '<option value="TRUE" selected="selected">TRUE</option>';
+               $("#adminGroupModify-admin").append('<option value="TRUE" selected="selected">TRUE</option>');
        } else {
-               option = '<option value="TRUE">TRUE</option>';
+               $("#adminGroupModify-admin").append('<option value="TRUE">TRUE</option>');
        }
-       $("#adminGroupModifyPopup-Admin").append(option);
        
        if(adminFlagText.toUpperCase() == "FALSE") {
-               option = '<option value="FALSE" selected="selected">FALSE</option>';
+               $("#adminGroupModify-admin").append('<option value="FALSE" selected="selected">FALSE</option>');
        } else {
-               option = '<option value="FALSE">FALSE</option>';
+               $("#adminGroupModify-admin").append('<option value="FALSE">FALSE</option>');
        }
-       $("#adminGroupModifyPopup-Admin").append(option);
-       $("#adminGroupModifyPopup-Admin").selectmenu("refresh");
+       $("#adminGroupModify-admin").selectmenu("refresh");
 
        queryGroupInfo(groupName, function(xml) {
                var fullProjectList = $(xml).find("Data").find("Project");
-               var projectIdList = $(xml).find("Data").find("Group").find("ProjectList").text().split(",");
+               var projectIdList = $(xml).find("Data").find("Group").find("ProjectIdList").text().split(",");
 
                adminGroupModifyGenerateProjectSelect(fullProjectList, projectIdList);
        });
 }
 
 function adminGroupModifyGenerateProjectSelect(fullProjectList, projectIdList) {
-       fieldset = document.getElementById('popup:modifyProjectSelect');
-       /* remove all table rows */
-       while(fieldset.hasChildNodes())
-       {
-               fieldset.removeChild(fieldset.firstChild);
-       }
-
-       legend = document.createElement('legend');
-       legend.innerHTML = "Project list";
-       fieldset.appendChild(legend);
-
+       $("#adminGroupModify-project").empty();
        fullProjectList.each(function(){
                var projectName = $(this).find("Name").text();
                var projectId = $(this).find("Id").text();
                var projectDistName = $(this).find("DistName").text();
 
-               var input = document.createElement('input');
-               input.type = 'checkbox';
-               input.id = 'popup:modifyProjectCheckbox:'+projectId;
-               input.name = 'popup:modifyProjectCheckbox';
-               input.value = projectName;
-
+               var input; 
                if(contains(projectIdList, projectId))
                {
-                       input.setAttribute('checked', 'checked');
-               }
+                       input = '<input type=checkbox id=adminGroupModify-project-checkbox-'+projectId+' name=adminGroupModify-project-checkbox value='+projectId+' checked=checked />';
+               } else {
+                       input = '<input type=checkbox id=adminGroupModify-project-checkbox-'+projectId+' name=adminGroupModify-project-checkbox value='+projectId+' />';
 
-               var label = document.createElement('label');
-               label.setAttribute('for', 'popup:modifyProjectCheckbox:'+projectId);
-               label.innerHTML = projectName + "[" + projectDistName + "]";
+               }
+               var label = '<label for=adminGroupModify-project-checkbox-'+projectId+'> '+projectName+'['+projectDistName+'] <label>';
                
-               fieldset.appendChild(input);
-               fieldset.appendChild(label);
+               $("#adminGroupModify-project").append(input);
+               $("#adminGroupModify-project").append(label);
        });
 
-       $("[name='popup\\:modifyProjectCheckbox']").checkboxradio();
+       $("input[name='adminGroupModify-project-checkbox']").checkboxradio();
 }
 
 function adminGroupModifyGroup() {
-       var selectArray = document.getElementsByName('popup:modifyProjectCheckbox');
-       var oldGroupName = document.getElementById('adminGroupModifyPopup-Name').value;
-       var groupName = document.getElementById('adminGroupModifyPopup-NewName').value;
-       var description = document.getElementById('adminGroupModifyPopup-Description').value;
-       var adminFlag = $("#adminGroupModifyPopup-Admin option:selected").val();
-       var selectProjectIdList = "";
+       var oldGroupName = $("#adminGroupModify-oldName").val();
+       var groupName = $("#adminGroupModify-newName").val();
+       var description = $("#adminGroupModify-description").val();
+       var adminFlag = $("#adminGroupModify-admin option:selected").val();
+       var selectProjectList = [];
        var changeInfoList = [];
        
+       var selectArray = $("input[name='adminGroupModify-project-checkbox']");
        for(var i = 0; i < selectArray.length; i++) {
                if (selectArray[i].checked == true) {
-                       var projectId = selectArray[i].id.split(":")[2];
-                       selectProjectIdList = selectProjectIdList + "," + projectId;
+                       selectProjectList.push(selectArray[i].value);
                }
        }
-
-       if(selectProjectIdList.length > 0) {
-               selectProjectIdList = selectProjectIdList.substring(1,selectProjectIdList.length);
-       }
                
-       changeItem = {"GroupName" : oldGroupName, "NewGroupName":groupName, "AdminFlag":adminFlag, "Description":description, "ProjectList" : selectProjectIdList};
+       changeItem = {"GroupName" : oldGroupName, "NewGroupName":groupName, "AdminFlag":adminFlag, "Description":description, "ProjectList":selectProjectList.toString()};
        changeInfoList.push(changeItem);
 
        changeGroup(changeInfoList, function() {
index 6f2104b7012621e3404c4946d5f643da2038520c..f897766fc56c9c181ff70eb53a237c25fe53a50d 100644 (file)
@@ -27,7 +27,7 @@ Contributors:
 */
 
 function adminGroupInit() {
-       adminGroupInitTable();
+       $("#adminGroup-contents").empty();
 
        queryAllGroup( function(xml) {
                var header = $(xml).find("Header");
@@ -37,30 +37,14 @@ function adminGroupInit() {
        });
 }
 
-function adminGroupInitTable() {
-       var groupTable = document.getElementById("groupTable");
-
-       /* remove all table rows */
-       while(groupTable.hasChildNodes())
-       {
-               groupTable.removeChild(groupTable.firstChild);
-       }
-}
-
 function adminGroupFillTableInfo(groupList) {
-       var groupTable = document.getElementById("groupTable");
-
-       /* remove all table rows */
-       while(groupTable.hasChildNodes())
-       {
-               groupTable.removeChild(groupTable.firstChild);
-       }
+       var groupTable = document.getElementById("adminGroup-contents");
 
        /* create table header */
        var row = groupTable.insertRow(-1);
        var tableHeader = "<tr><th> Group name </th><th> Project list </th><th> Admin </th><th> Description </th><th> Modify </th><th> Delete </th></tr>";
        
-       $("#groupTable").append(tableHeader);
+       $("#adminGroup-contents").append(tableHeader);
 
        var index = 2;
 
@@ -75,7 +59,7 @@ function adminGroupFillTableInfo(groupList) {
                row.setAttribute('id', 'table:'+index);
 
                cell = row.insertCell(-1);
-               cell.setAttribute('id', 'groupTableName:'+index);
+               cell.setAttribute('id', 'adminGroup-contents-'+index+'-name');
                cell.innerHTML = groupName
 
                cell = row.insertCell(-1);
@@ -83,20 +67,20 @@ function adminGroupFillTableInfo(groupList) {
                cell.appendChild(div);
 
                cell = row.insertCell(-1);
-               cell.setAttribute('id', 'groupTableAdminFlag:'+index);
+               cell.setAttribute('id', 'adminGroup-contents-'+index+'-flag');
                cell.innerHTML = adminFlag;
 
                cell = row.insertCell(-1);
-               cell.setAttribute('id', 'groupTableDescription:'+index);
+               cell.setAttribute('id', 'adminGroup-contents-'+index+'-description');
                cell.innerHTML = description;
 
                cell = row.insertCell(-1);
                var button = document.createElement('a');
-               button.setAttribute('href','#adminGroupModifyPopup');
+               button.setAttribute('href','#adminGroupModify');
                button.setAttribute('data-role','button');
                button.setAttribute('data-rel','dialog');
-               button.setAttribute('onClick','adminGroupModifyPopupSetup(\"'+index+'\")');
-               button.setAttribute('class','groupTableCellButton');
+               button.setAttribute('onClick','adminGroupModifySetup(\"'+index+'\")');
+               button.setAttribute('class','adminGroup-contents-button');
                button.innerHTML = " "
                cell.appendChild(button);
 
@@ -104,17 +88,17 @@ function adminGroupFillTableInfo(groupList) {
                var button = document.createElement('input');
                button.setAttribute('type','button');
                button.setAttribute('onClick','adminGroupRemoveGroup('+index+')');
-               button.setAttribute('class','groupTableCellButton');
+               button.setAttribute('class','adminGroup-contents-button');
                cell.appendChild(button);
 
                index = index + 1;
        });
 
-       $(".groupProjectList").collapsible();
-       $(".groupTableCellButton").button();
+       $(".adminGroup-projectList").collapsible();
+       $(".adminGroup-contents-button").button();
 }
 
-function adminGroupModifyPopupSetup(index) {
+function adminGroupModifySetup(index) {
        localStorage.groupTableIndex = index;
 }
 
@@ -122,7 +106,7 @@ function adminGroupGenerateProjectListCell(projectList) {
        var div = document.createElement('div');
        div.setAttribute('data-role', 'collapsible');
        div.setAttribute('data-content-theme', 'b');
-       div.setAttribute('class', 'groupProjectList');
+       div.setAttribute('class', 'adminGroup-projectList');
        div.setAttribute('style', 'text-align: left');
 
        var header = document.createElement('h3');
@@ -145,7 +129,7 @@ function adminGroupGenerateProjectListCell(projectList) {
 }
 
 function adminGroupRemoveGroup(index) {
-       var groupName = document.getElementById("groupTableName:"+index).innerHTML;
+       var groupName = $("#adminGroup-contents-"+index+"-name").html();
 
        var r=confirm("User ["+groupName+"] will be removed!!!");
        if (r==false)
index 7251408f2a67f68168f91dd0aea8717043ab32f8..8aa5ddbc5c69c077c8838027c6c4505db0c46892 100644 (file)
@@ -27,110 +27,72 @@ Contributors:
 */
 
 function adminProjectAddGitInit() {
-       document.getElementById("popup:addGitProjectName").value = "";
-       document.getElementById("popup:addGitProjectPassword").value = "";
-       document.getElementById("popup:addGitAddress").value = "";
-       document.getElementById("popup:addGitBranch").value = "";
+       $("#adminProjectAddGit-name").val("");
+       $("#adminProjectAddGit-password").val("");
+       $("#adminProjectAddGit-address").val("");
+       $("#adminProjectAddGit-branch").val("");
 
        queryAllOS( function (xml) {
                var osList = $(xml).find("Data").find("OsName");
 
-               fieldset = document.getElementById('popup:addGitProjectOs');
-               /* remove all table rows */
-               while(fieldset.hasChildNodes())
-               {
-                       fieldset.removeChild(fieldset.firstChild);
-               }
-        
-               legend = document.createElement('legend');
-               legend.innerHTML = "Project os list";
-               fieldset.appendChild(legend);
+               $("#adminProjectAddGit-os").empty();
+               $("#adminProjectAddGit-os").append("<legend>os list</legend>");
         
                osList.each(function(){
                        var osName = $(this).text();
         
-                       var input = document.createElement('input');
-                       input.type = 'checkbox';
-                       input.id = 'popup:addGitProjectOsCheckbox:'+osName;
-                       input.name = 'popup:addGitProjectOsCheckbox';
-                       input.value = osName;
-                       input.setAttribute('class', 'popup:addGitProjectOsCheckbox');
-                       input.setAttribute('checked', 'checked');
-        
-                       var label = document.createElement('label');
-                       label.setAttribute('for', 'popup:addGitProjectOsCheckbox:'+osName);
-                       label.innerHTML = osName;
-                       
-                       fieldset.appendChild(input);
-                       fieldset.appendChild(label);
+                       var input = '<input type=checkbox id=adminProjectAddGit-os-checkbox-'+osName+' name=adminProjectAddGit-os-checkbox value='+osName+' checked=checked />'
+                       var label = '<label for=adminProjectAddGit-os-checkbox-'+osName+'> '+osName+'<label>';
+                       $("#adminProjectAddGit-os").append(input);
+                       $("#adminProjectAddGit-os").append(label);
                });
         
-               $('.popup\\:addGitProjectOsCheckbox').checkboxradio();
+               $('input[name="adminProjectAddGit-os-checkbox"]').checkboxradio();
        });
 }
 
 function adminProjectAddBinaryInit() {
-       document.getElementById("popup:addBinaryProjectName").value = "";
-       document.getElementById("popup:addBinaryProjectPassword").value = "";
-       document.getElementById("popup:addBinaryPackageName").value = "";
+       $("#adminProjectAddBinary-name").val("");
+       $("#adminProjectAddBinary-password").val("");
+       $("#adminProjectAddBinary-packagename").val("");
 
        queryAllOS( function (xml) {
                var osList = $(xml).find("Data").find("OsName");
 
-               fieldset = document.getElementById('popup:addBinaryProjectOs');
-               /* remove all table rows */
-               while(fieldset.hasChildNodes())
-               {
-                       fieldset.removeChild(fieldset.firstChild);
-               }
-        
-               legend = document.createElement('legend');
-               legend.innerHTML = "Project os list";
-               fieldset.appendChild(legend);
+               $("#adminProjectAddBinary-os").empty();
+               $("#adminProjectAddBinary-os").append("<legend>os list</legend>");
         
                osList.each(function(){
                        var osName = $(this).text();
         
-                       var input = document.createElement('input');
-                       input.type = 'checkbox';
-                       input.id = 'popup:addBinaryProjectOsCheckbox:'+osName;
-                       input.name = 'popup:addBinaryProjectOsCheckbox';
-                       input.value = osName;
-                       input.setAttribute('class', 'popup:addBinaryProjectOsCheckbox');
-                       input.setAttribute('checked', 'checked');
-        
-                       var label = document.createElement('label');
-                       label.setAttribute('for', 'popup:addBinaryProjectOsCheckbox:'+osName);
-                       label.innerHTML = osName;
-                       
-                       fieldset.appendChild(input);
-                       fieldset.appendChild(label);
+                       var input = '<input type=checkbox id=adminProjectAddBinary-os-checkbox-'+osName+' name=adminProjectAddBinary-os-checkbox value='+osName+' checked=checked />'
+                       var label = '<label for=adminProjectAddBinary-os-checkbox-'+osName+'> '+osName+'<label>';
+                       $("#adminProjectAddBinary-os").append(input);
+                       $("#adminProjectAddBinary-os").append(label);
                });
         
-               $('.popup\\:addBinaryProjectOsCheckbox').checkboxradio();
+               $('input[name="adminProjectAddBinary-os-checkbox"]').checkboxradio();
        });
 }
 
 function adminProjectAddGitProject() {
-       var distName = $("#adminProjectDistributionSelect option:selected").val();
        var changeInfoList = [];
        var changeInfoItem;
+       var distName = $("#adminProject-distribution-select option:selected").val();
        var type = "GIT";
-       var name = document.getElementById("popup:addGitProjectName").value;
-       var password = document.getElementById("popup:addGitProjectPassword").value;
-       var address = document.getElementById("popup:addGitAddress").value;
-       var branch = document.getElementById("popup:addGitBranch").value;
-       var selectArray = document.getElementsByName('popup:addGitProjectOsCheckbox');
+       var name = $("#adminProjectAddGit-name").val();
+       var password = $("#adminProjectAddGit-password").val();
+       var address = $("#adminProjectAddGit-address").val();
+       var branch = $("#adminProjectAddGit-branch").val();
        var selectOsList = [];
 
+       var selectArray = $("input[name='adminProjectAddGit-os-checkbox']");
        for(var i = 0; i < selectArray.length; i++) {
                if (selectArray[i].checked == true) {
-                       var osName = selectArray[i].id.split(":")[2];
-                       selectOsList.push(osName);
+                       selectOsList.push(selectArray[i].value);
                }
        }
 
-
        if(name == "" || password == "" || address == "" || branch == ""){
                alert("You must input full data(Project name, Git password, Git address, Branch)");
                return;
@@ -145,20 +107,19 @@ function adminProjectAddGitProject() {
 }
 
 function adminProjectAddBinaryProject() {
-       var distName = $("#adminProjectDistributionSelect option:selected").val();
        var changeInfoList = [];
        var changeInfoItem;
+       var distName = $("#adminProject-distribution-select option:selected").val();
        var type = "BINARY";
-       var name = document.getElementById("popup:addBinaryProjectName").value;
-       var password = document.getElementById("popup:addBinaryProjectPassword").value;
-       var pkgName = document.getElementById("popup:addBinaryPackageName").value;
-       var selectArray = document.getElementsByName('popup:addBinaryProjectOsCheckbox');
+       var name = $("#adminProjectAddBinary-name").val();
+       var password = $("#adminProjectAddBinary-password").val();
+       var pkgName = $("#adminProjectAddBinary-packagename").val();
        var selectOsList = [];
 
+       var selectArray = $("input[name='adminProjectAddBinary-os-checkbox']");
        for(var i = 0; i < selectArray.length; i++) {
                if (selectArray[i].checked == true) {
-                       var osName = selectArray[i].id.split(":")[2];
-                       selectOsList.push(osName);
+                       selectOsList.push(selectArray[i].value);
                }
        }
 
index 420d093852001164c6db6a74a89faef9cbbc2502..16930e2ce16a83cb8a0209ee342b0db2ee5ec844 100644 (file)
@@ -28,145 +28,113 @@ Contributors:
 
 function adminProjectModifyBinaryProjectInit() {
        var projectName = localStorage.projectName;
-       var packageName = document.getElementById('modifyBinaryPackageName:'+projectName).innerHTML;
+       var packageName = $("#adminProject-binary-packageName-"+projectName).html();
 
-       document.getElementById('popup:modifyBinaryOldProjectName').value = projectName;
-       document.getElementById('popup:modifyBinaryNewProjectName').value = projectName;
-       document.getElementById('popup:modifyBinaryProjectPassword').value = "";
-       document.getElementById('popup:modifyBinaryPackageName').value = packageName;
+       $("#adminProjectModifyBinary-oldName").val(projectName);
+       $("#adminProjectModifyBinary-newName").val(projectName);
+       $("#adminProjectModifyBinary-password").val("");
+       $("#adminProjectModifyBinary-packageName").val(packageName);
+       $("#adminProjectModifyBinary-os").empty();
+       $("#adminProjectModifyBinary-os").append("<legend> os list </legend>");
 
        queryAllOS( function (xml) {
                var osList = $(xml).find("Data").find("OsName");
                var selectedOsList = [];
                var projectName = localStorage.projectName;
        
-               var osListElement = document.getElementById('adminBINARYProjectTableOsList:'+projectName);
+               var osListElement = document.getElementById("adminProject-binary-"+projectName+"-osList");
                for(var i = 0; i < osListElement.childNodes.length; i++)
                {
                        selectedOsList.push(osListElement.childNodes[i].innerHTML);
                }
 
-               fieldset = document.getElementById('popup:modifyBinaryProjectOs');
-               /* remove all table rows */
-               while(fieldset.hasChildNodes())
-               {
-                       fieldset.removeChild(fieldset.firstChild);
-               }
-        
-               legend = document.createElement('legend');
-               legend.innerHTML = "Project os list";
-               fieldset.appendChild(legend);
-        
                osList.each(function(){
                        var osName = $(this).text();
-        
-                       var input = document.createElement('input');
-                       input.type = 'checkbox';
-                       input.id = 'popup:modifyBinaryProjectOs:'+osName;
-                       input.name = 'popup:modifyBinaryProjectOs'
-                       input.value = osName;
-                       input.setAttribute('class', 'popup:modifyBinaryProjectOs');
+                       var input;
                        if(contains(selectedOsList, osName))
                        {
-                               input.setAttribute('checked', 'checked');
+                               input = '<input type=checkbox id=adminProjectModifyBinary-os-checkbox-'+osName+' name=adminProjectModifyBinary-os-checkbox value='+osName+' checked=checked />';
+                       } else {
+                               input = '<input type=checkbox id=adminProjectModifyBinary-os-checkbox-'+osName+' name=adminProjectModifyBinary-os-checkbox value='+osName+' />';
+            
                        }
-        
-                       var label = document.createElement('label');
-                       label.setAttribute('for', 'popup:modifyBinaryProjectOs:'+osName);
-                       label.innerHTML = osName;
+                       var label = '<label for=adminProjectModifyBinary-os-checkbox-'+osName+'> '+osName+' <label>';
                        
-                       fieldset.appendChild(input);
-                       fieldset.appendChild(label);
+                       $("#adminProjectModifyBinary-os").append(input);
+                       $("#adminProjectModifyBinary-os").append(label);
                });
         
-               $('.popup\\:modifyBinaryProjectOs').checkboxradio();
+               $("input[name='adminProjectModifyBinary-os-checkbox']").checkboxradio();
        });
 }
 
 function adminProjectModifyGitProjectInit() {
        var projectName = localStorage.projectName;
-       var projectAddress = document.getElementById('modifyGitProjectAddress:'+projectName).innerHTML;
-       var projectBranch = document.getElementById('modifyGitProjectBranch:'+projectName).innerHTML;
+       var projectAddress = $("#adminProject-git-"+projectName+"-address").html();
+       var projectBranch = $("#adminProject-git-"+projectName+"-branch").html();
 
-       document.getElementById('popup:modifyGitOldProjectName').value = projectName;
-       document.getElementById('popup:modifyGitNewProjectName').value = projectName;
-       document.getElementById('popup:modifyGitProjectPassword').value = "";
-       document.getElementById('popup:modifyGitProjectAddress').value = projectAddress;
-       document.getElementById('popup:modifyGitProjectBranch').value = projectBranch;
+       $("#adminProjectModifyGit-oldName").val(projectName);
+       $("#adminProjectModifyGit-newName").val(projectName);
+       $("#adminProjectModifyGit-password").val("");
+       $("#adminProjectModifyGit-address").val(projectAddress);
+       $("#adminProjectModifyGit-branch").val(projectBranch);
+       $("#adminProjectModifyGit-os").empty();
+       $("#adminProjectModifyGit-os").append("<legend> os list </legend>");
 
        queryAllOS( function (xml) {
                var osList = $(xml).find("Data").find("OsName");
                var selectedOsList = [];
                var projectName = localStorage.projectName;
        
-               var osListElement = document.getElementById('adminGITProjectTableOsList:'+projectName);
+               var osListElement = document.getElementById("adminProject-git-"+projectName+"-osList");
                for(var i = 0; i < osListElement.childNodes.length; i++)
                {
                        selectedOsList.push(osListElement.childNodes[i].innerHTML);
                }
 
-               fieldset = document.getElementById('popup:modifyGitProjectOs');
-               /* remove all table rows */
-               while(fieldset.hasChildNodes())
-               {
-                       fieldset.removeChild(fieldset.firstChild);
-               }
-        
-               legend = document.createElement('legend');
-               legend.innerHTML = "Project os list";
-               fieldset.appendChild(legend);
-        
                osList.each(function(){
                        var osName = $(this).text();
-        
-                       var input = document.createElement('input');
-                       input.type = 'checkbox';
-                       input.id = 'popup:modifyGitProjectOs:'+osName;
-                       input.name = 'popup:modifyGitProjectOs'
-                       input.value = osName;
-                       input.setAttribute('class', 'popup:modifyGitProjectOs');
+                       var input;
                        if(contains(selectedOsList, osName))
                        {
-                               input.setAttribute('checked', 'checked');
+                               input = '<input type=checkbox id=adminProjectModifyGit-os-checkbox-'+osName+' name=adminProjectModifyGit-os-checkbox value='+osName+' checked=checked />';
+                       } else {
+                               input = '<input type=checkbox id=adminProjectModifyGit-os-checkbox-'+osName+' name=adminProjectModifyGit-os-checkbox value='+osName+' />';
+            
                        }
-        
-                       var label = document.createElement('label');
-                       label.setAttribute('for', 'popup:modifyGitProjectOs:'+osName);
-                       label.innerHTML = osName;
+                       var label = '<label for=adminProjectModifyGit-os-checkbox-'+osName+'> '+osName+' <label>';
                        
-                       fieldset.appendChild(input);
-                       fieldset.appendChild(label);
+                       $("#adminProjectModifyGit-os").append(input);
+                       $("#adminProjectModifyGit-os").append(label);
                });
         
-               $('.popup\\:modifyGitProjectOs').checkboxradio();
+               $("input[name='adminProjectModifyGit-os-checkbox']").checkboxradio();
        });
 }
 
 function adminProjectModfyBinaryProject() {
-       var distName = $("#adminProjectDistributionSelect option:selected").val();
+       var distName = $("#adminProject-distribution-select option:selected").val();
        var changeInfoList = [];
        var changeInfoItem;
-       var oldProjectName = document.getElementById('popup:modifyBinaryOldProjectName').value;
-       var newProjectName = document.getElementById('popup:modifyBinaryNewProjectName').value;
-       var projectType = document.getElementById('popup:modifyBinaryProjectType').value;
-       var projectPassword = document.getElementById('popup:modifyBinaryProjectPassword').value;
-       var packageName = document.getElementById('popup:modifyBinaryPackageName').value;
-       var selectArray = document.getElementsByName('popup:modifyBinaryProjectOs');
+       var oldProjectName = $("#adminProjectModifyBinary-oldName").val();
+       var newProjectName = $("#adminProjectModifyBinary-newName").val();
+       var projectPassword = $("#adminProjectModifyBinary-password").val();
+       var packageName = $("#adminProjectModifyBinary-packageName").val();
        var selectOsList = [];
 
+       var selectArray = $("input[name='adminProjectModifyBinary-os-checkbox']");
        for(var i = 0; i < selectArray.length; i++) {
                if (selectArray[i].checked == true) {
-                       var osName = selectArray[i].id.split(":")[2];
-                       selectOsList.push(osName);
+                       selectOsList.push(selectArray[i].value);
                }
        }
 
-       if(oldProjectName == "" || newProjectName == "" || projectPassword == "" || projectType == "" || packageName == ""){
+       if(oldProjectName == "" || newProjectName == "" || projectPassword == "" || packageName == ""){
                alert("You must input full data");
                return;
        }
                
-       changeInfoItem = {"Distribution":distName, "Name":oldProjectName, "NewProjectName":newProjectName, "ProjectType":projectType, "ProjectPass":projectPassword, "PackageName":packageName, "OSNameList":selectOsList.toString()};
+       changeInfoItem = {"Distribution":distName, "Name":oldProjectName, "NewProjectName":newProjectName, "ProjectType":"BINARY", "ProjectPass":projectPassword, "PackageName":packageName, "OSNameList":selectOsList.toString()};
        changeInfoList.push(changeInfoItem);
 
        modifyProject(changeInfoList, function () {
@@ -175,31 +143,29 @@ function adminProjectModfyBinaryProject() {
 }
 
 function adminProjectModfyGitProject() {
-       var distName = $("#adminProjectDistributionSelect option:selected").val();
+       var distName = $("#adminProject-distribution-select option:selected").val();
        var changeInfoList = [];
        var changeInfoItem;
-       var oldProjectName = document.getElementById('popup:modifyGitOldProjectName').value;
-       var newProjectName = document.getElementById('popup:modifyGitNewProjectName').value;
-       var projectType = document.getElementById('popup:modifyGitProjectType').value;
-       var projectPassword = document.getElementById('popup:modifyGitProjectPassword').value;
-       var projectAddress = document.getElementById('popup:modifyGitProjectAddress').value;
-       var projectBranch = document.getElementById('popup:modifyGitProjectBranch').value;
-       var selectArray = document.getElementsByName('popup:modifyGitProjectOs');
+       var oldProjectName = $("#adminProjectModifyGit-oldName").val();
+       var newProjectName = $("#adminProjectModifyGit-newName").val();
+       var projectPassword = $("#adminProjectModifyGit-password").val();
+       var projectAddress = $("#adminProjectModifyGit-address").val();
+       var projectBranch = $("#adminProjectModifyGit-branch").val();
        var selectOsList = [];
 
+       var selectArray = $("input[name='adminProjectModifyGit-os-checkbox']");
        for(var i = 0; i < selectArray.length; i++) {
                if (selectArray[i].checked == true) {
-                       var osName = selectArray[i].id.split(":")[2];
-                       selectOsList.push(osName);
+                       selectOsList.push(selectArray[i].value);
                }
        }
 
-       if(oldProjectName == "" || newProjectName == "" || projectPassword == "" || projectType == "" || projectAddress == "" || projectBranch == ""){
+       if(oldProjectName == "" || newProjectName == "" || projectPassword == "" || projectAddress == "" || projectBranch == ""){
                alert("You must input full data");
                return;
        }
                
-       changeInfoItem = {"Distribution":distName, "Name":oldProjectName, "NewProjectName":newProjectName, "ProjectType":projectType, "ProjectPass":projectPassword, "ProjectAddress":projectAddress, "ProjectBranch":projectBranch, "OSNameList":selectOsList.toString()};
+       changeInfoItem = {"Distribution":distName, "Name":oldProjectName, "NewProjectName":newProjectName, "ProjectType":"GIT", "ProjectPass":projectPassword, "ProjectAddress":projectAddress, "ProjectBranch":projectBranch, "OSNameList":selectOsList.toString()};
        changeInfoList.push(changeInfoItem);
 
        modifyProject(changeInfoList, function () {
index 03e06b782da86c506b5d7a653e586cd97bb71ef8..f28ef05145cc49d30c43c209ce181c304591c198 100644 (file)
@@ -27,40 +27,29 @@ Contributors:
 */
 
 function adminProjectInit() {
-       queryAllDistribution( function (xml) {
-               var oldDistName = $("#adminProjectDistributionSelect option:selected").val();
-               var find = false;
-               var distributionList = $(xml).find("Data").find("DistributionName");
-
-               // remove old select options
-               $("#adminProjectDistributionSelect").empty();
-
-               distributionList.each(function(){
-                       var name = $(this).text();
-       
-                       if( oldDistName == name ) {
-                               $("#adminProjectDistributionSelect").append("<option value=\'"+name+"\' selected=\"selected\">"+name+"</option>");
-                               find = true;
-                               
-                       } else {
-                               $("#adminProjectDistributionSelect").append("<option value=\'"+name+"\'>"+name+"</option>");
-                       }
+       if( $("#adminProject-distribution-select").children().length == 0 ) {
+               queryDistribution( function(xml) {
+                       $(xml).find("Data").find("DistributionName").each(function(){
+                               var name = $(this).text();
+               
+                               $("#adminProject-distribution-select").append("<option value=\'"+name+"\'>"+name+"</option>");
+                       });
+               
+                       /* default distribution selection */
+                       $("#adminProject-distribution-select option:eq(0)").attr("selected", "selected");
+                       $("#adminProject-distribution-select").selectmenu('refresh');
+               
+                       // set project info
+                       adminProjectSetProjectInfo();
                });
-       
-               /* default distribution selection */
-               if(!find) {
-                       $("#adminProjectDistributionSelect option:eq(0)").attr("selected", "selected");
-               }
-
-               $("#adminProjectDistributionSelect").selectmenu('refresh');
-
+       } else {
                // set project info
                adminProjectSetProjectInfo();
-       });
+       }
 }
 
 function adminProjectSetProjectInfo() {
-       var distName = $("#adminProjectDistributionSelect option:selected").val();
+       var distName = $("#adminProject-distribution-select option:selected").val();
 
        queryProjectsInDistributionForAdmin( distName, function (xml) {
                var projectList = $(xml).find("Data").find("Project");
@@ -75,7 +64,7 @@ function popupModifyProject(projectName) {
 }
 
 function adminProjectRemoveProject(projectType, projectName ) {
-       var distName = $("#adminProjectDistributionSelect option:selected").val();
+       var distName = $("#adminProject-distribution-select option:selected").val();
 
        var r=confirm("Project ["+projectName+"] is removed!!!");
        if (r==false)
@@ -95,28 +84,22 @@ function adminProjectRemoveProject(projectType, projectName ) {
 
 function adminProjectUpdateTable(projectList) {
        /* project table */
-       var projectTable = document.getElementById("adminProjectTable");
+       var projectTable = document.getElementById("adminProject-git");
 
        /* binary project table */
-       var binaryProjectTable = document.getElementById("adminBinaryProjectTable");
+       var binaryProjectTable = document.getElementById("adminProject-binary");
 
        /* remove all table rows */
-       while(projectTable.hasChildNodes())
-       {
-               projectTable.removeChild(projectTable.firstChild);
-       }
-       while(binaryProjectTable.hasChildNodes())
-       {
-               binaryProjectTable.removeChild(binaryProjectTable.firstChild);
-       }
+       $("#adminProject-git").empty();
+       $("#adminProject-binary").empty();
 
        // Project table header
        var tableHeader = "<tr><th>Project</th><th>Git repos</th><th>Branch</th><th>OS list</th><th>Modify</th><th>Delete</th>";
-       $("#adminProjectTable").append(tableHeader);
+       $("#adminProject-git").append(tableHeader);
 
        // Binary project table header
        var tableHeader = "<tr><th>Project</th><th>Package name</th><th>OS list</th><th>Modify</th><th>Delete</th>";
-       $("#adminBinaryProjectTable").append(tableHeader);
+       $("#adminProject-binary").append(tableHeader);
 
        var projectIdx = 1;
        var binaryProjectIdx = 1;
@@ -133,17 +116,16 @@ function adminProjectUpdateTable(projectList) {
 
                        cell = row.insertCell(-1);
                        cell.setAttribute('style', 'text-align: left');
-                       cell.setAttribute('id',"modifyGitProjectName:"+name);
                        cell.innerHTML = name;
 
                        cell = row.insertCell(-1);
                        cell.setAttribute('style', 'text-align: left');
-                       cell.setAttribute('id',"modifyGitProjectAddress:"+name);
+                       cell.setAttribute('id',"adminProject-git-"+name+"-address");
                        cell.innerHTML = $(this).find("GitRepos").text();
 
                        cell = row.insertCell(-1);
                        cell.setAttribute('style', 'text-align: left');
-                       cell.setAttribute('id',"modifyGitProjectBranch:"+name);
+                       cell.setAttribute('id',"adminProject-git-"+name+"-branch");
                        cell.innerHTML = $(this).find("GitBranch").text();
 
                        cell = row.insertCell(-1);
@@ -152,7 +134,7 @@ function adminProjectUpdateTable(projectList) {
 
                        cell = row.insertCell(-1);
                        var button = document.createElement('a');
-                       button.setAttribute('href','#modifyGitProject');
+                       button.setAttribute('href','#adminProjectModifyGit');
                        button.setAttribute('data-role','button');
                        button.setAttribute('data-rel','dialog');
                        button.setAttribute('data-mini','true');
@@ -180,12 +162,11 @@ function adminProjectUpdateTable(projectList) {
 
                        cell = row.insertCell(-1);
                        cell.setAttribute('style', 'text-align: left');
-                       cell.setAttribute('id',"modifyBinaryProjectName:"+name);
                        cell.innerHTML = name;
 
                        cell = row.insertCell(-1);
                        cell.setAttribute('style', 'text-align: left');
-                       cell.setAttribute('id',"modifyBinaryPackageName:"+name);
+                       cell.setAttribute('id',"adminProject-binary-packageName-"+name);
                        cell.innerHTML = $(this).find("PackageName").text();
 
                        cell = row.insertCell(-1);
@@ -194,7 +175,7 @@ function adminProjectUpdateTable(projectList) {
 
                        cell = row.insertCell(-1);
                        var button = document.createElement('a');
-                       button.setAttribute('href','#modifyBinaryProject');
+                       button.setAttribute('href','#adminProjectModifyBinary');
                        button.setAttribute('data-role','button');
                        button.setAttribute('data-inline','true');
                        button.setAttribute('data-mini','true');
@@ -220,7 +201,7 @@ function adminProjectUpdateTable(projectList) {
        });
 
        $(".binaryProjectTableButton").button();
-       $(".groupProjectList").collapsible();
+       $(".adminProject-OsList").collapsible();
 }
 
 function adminProjectApendOsCell(osList, projectName, projectType) {
@@ -230,14 +211,14 @@ function adminProjectApendOsCell(osList, projectName, projectType) {
        div.setAttribute('data-role', 'collapsible');
        div.setAttribute('data-mini', 'true');
        div.setAttribute('data-content-theme', 'b');
-       div.setAttribute('class', 'groupProjectList');
+       div.setAttribute('class', 'adminProject-OsList');
 
        var header = document.createElement('h3');
        header.innerHTML = "OS list";
        div.appendChild(header);
 
        var ul = document.createElement('ul');
-       ul.setAttribute('id', 'admin'+projectType+'ProjectTableOsList:'+projectName);
+       ul.setAttribute('id', 'adminProject-'+projectType.toLowerCase()+'-'+projectName+'-osList');
 
        // if osList does not exist then just return 
        if (osList != undefined) {
index 18a47d2298874362f05c97bb80730586af6d808b..3d46b09d3adf20a84828293eaa9938508ce70b5f 100644 (file)
@@ -28,7 +28,7 @@ Contributors:
 
 function adminServerAddSupportedOsInit() {
        // Remove select option
-       $('#adminServer-AddSupportedOs-OsCategory').empty();
+       $("#adminServer-AddSupportedOs-OsCategory").empty();
 
        queryAllOSCategory(function(xml){
                $(xml).find("Data").find("OsCategoryName").each(function(){
@@ -45,8 +45,8 @@ function adminServerAddRemoteBuildServer() {
        var changeInfoList = [];
        var changeInfoItem;
 
-       var address = document.getElementById("adminServer-AddRemoteBuildServer-Address").value;
-       var description = document.getElementById("adminServer-AddRemoteBuildServer-Description").value;
+       var address = $("#adminServer-AddRemoteBuildServer-Address").val();
+       var description = $("#adminServer-AddRemoteBuildServer-Description").val();
 
        if(address == ""){
                alert("You must input server address");
@@ -57,8 +57,8 @@ function adminServerAddRemoteBuildServer() {
        changeInfoList.push(changeInfoItem);
        
        addRemoteBuildServer(changeInfoList, function () {
-               document.getElementById('adminServer-AddRemoteBuildServer-Address').value = "";
-               document.getElementById('adminServer-AddRemoteBuildServer-Description').value = "";
+               $("#adminServer-AddRemoteBuildServer-Address").val("");
+               $("#adminServer-AddRemoteBuildServer-Description").val("");
 
                $.mobile.changePage("#adminServer"); 
        });
@@ -68,7 +68,7 @@ function adminServerAddSupportedOs() {
        var changeInfoList = [];
        var changeInfoItem;
 
-       var osName = document.getElementById("adminServer-AddSupportedOs-OsName").value;
+       var osName = $("#adminServer-AddSupportedOs-OsName").val();
        var osCategory = $("#adminServer-AddSupportedOs-OsCategory option:selected").val();
 
        if(osName == ""){
@@ -80,7 +80,7 @@ function adminServerAddSupportedOs() {
        changeInfoList.push(changeInfoItem);
        
        addSupportedOS(changeInfoList, function () {
-               document.getElementById('adminServer-AddSupportedOs-OsName').value = "";
+               $("#adminServer-AddSupportedOs-OsName").val("");
 
                $.mobile.changePage("#adminServer"); 
        });
@@ -90,7 +90,7 @@ function adminServerAddOSCategory() {
        var changeInfoList = [];
        var changeInfoItem;
 
-       var categoryName = document.getElementById("adminServer-AddOsCategory-Name").value;
+       var categoryName = $("#adminServer-AddOsCategory-Name").val();
 
        if(categoryName == ""){
                alert("You must input category name");
@@ -101,15 +101,15 @@ function adminServerAddOSCategory() {
        changeInfoList.push(changeInfoItem);
        
        addOSCategory(changeInfoList, function () {
-               document.getElementById('adminServer-AddOsCategory-Name').value = "";
+               $("#adminServer-AddOsCategory-Name").val("");
 
                $.mobile.changePage("#adminServer"); 
        }); 
 } 
 
 function adminServerAddServerInfo() {
-       var property = document.getElementById('adminServer-addServerInfo-property').value;
-       var value = document.getElementById('adminServer-addServerInfo-value').value;
+       var property = $("#adminServer-addServerInfo-property").val();
+       var value = $("#adminServer-addServerInfo-value").val();
        var changeInfoList = [];
        var changeInfoItem;
 
index 28e9c9786452035dd0e9f38aa7f5f7922dce4801..26dae6d5e168c9a7cfe1737104e85416675419ab 100644 (file)
@@ -30,22 +30,22 @@ function adminServerModifyRemoteBuildServerInit() {
        var serverAddress = localStorage.remoteBuildServerAddress;
        var serverDescription = localStorage.remoteBuildServerDescription;
 
-       document.getElementById('adminServer-modifyRemoteBuildServer-OldAddress').value = serverAddress;
-       document.getElementById('adminServer-modifyRemoteBuildServer-newAddress').value = serverAddress;
-       document.getElementById('adminServer-modifyRemoteBuildServer-description').value = serverDescription 
+       $("#adminServer-modifyRemoteBuildServer-OldAddress").val(serverAddress);
+       $("#adminServer-modifyRemoteBuildServer-newAddress").val(serverAddress);
+       $("#adminServer-modifyRemoteBuildServer-description").val(serverDescription);
 }
 
 function adminServerModifyServerInfoInit(property, value) {
-       document.getElementById('adminServer-modifyServerInfo-property').value = property;
-       document.getElementById('adminServer-modifyServerInfo-value').value = value;
+       $("#adminServer-modifyServerInfo-property").val(property);
+       $("#adminServer-modifyServerInfo-value").val(value);
 }
 
 function adminServerModifySupportedOSInit(osName, osCategory) {
        // Remove select option
        $('#adminServer-ModifySupportedOs-OsCategory').empty();
 
-       document.getElementById('adminServer-ModifySupportedOs-OldOsName').value = osName;
-       document.getElementById('adminServer-MoidfySupportedOs-OsName').value = osName;
+       $("#adminServer-ModifySupportedOs-OldOsName").val(osName);
+       $("#adminServer-MoidfySupportedOs-OsName").val(osName);
 
        queryAllOSCategory( function(xml){
                $(xml).find("Data").find("OsCategoryName").each(function(){
@@ -67,9 +67,9 @@ function adminServerModifySupportedOSInit(osName, osCategory) {
 function adminServerModifyRemoteBuildServer() {
        var changeInfoList = [];
        var changeInfoItem;
-       var serverAddress = document.getElementById('adminServer-modifyRemoteBuildServer-OldAddress').value;
-       var newServerAddress = document.getElementById('adminServer-modifyRemoteBuildServer-newAddress').value;
-       var description = document.getElementById('adminServer-modifyRemoteBuildServer-description').value;
+       var serverAddress = $("#adminServer-modifyRemoteBuildServer-OldAddress").val();
+       var newServerAddress = $("#adminServer-modifyRemoteBuildServer-newAddress").val();
+       var description = $("#adminServer-modifyRemoteBuildServer-description").val();
 
        if(serverAddress == ""){
                alert("server address is invalid");
@@ -87,8 +87,8 @@ function adminServerModifyRemoteBuildServer() {
 function adminServerModifySupportedOS() {
        var changeInfoList = [];
        var changeInfoItem;
-       var oldOsName = document.getElementById('adminServer-ModifySupportedOs-OldOsName').value;
-       var osName = document.getElementById('adminServer-MoidfySupportedOs-OsName').value;
+       var oldOsName = $("#adminServer-ModifySupportedOs-OldOsName").val();
+       var osName = $("#adminServer-MoidfySupportedOs-OsName").val();
        var osCategory = $("#adminServer-ModifySupportedOs-OsCategory option:selected").val();
 
        changeInfoItem = {"Name":oldOsName, "NewName":osName, "OsCategory":osCategory};
@@ -100,8 +100,8 @@ function adminServerModifySupportedOS() {
 }
 
 function adminServerModifyServerInfo() {
-       var property = document.getElementById('adminServer-modifyServerInfo-property').value;
-       var value = document.getElementById('adminServer-modifyServerInfo-value').value;
+       var property = $("#adminServer-modifyServerInfo-property").val();
+       var value = $("#adminServer-modifyServerInfo-value").val();
        var changeInfoList = [];
        var changeInfoItem;
 
index db74a01a0a57b07542984baa8687867c21e84a1b..676ac99bb802cf1ec0ab3c79784ab1b1cf11f3e3 100644 (file)
@@ -62,8 +62,8 @@ function adminServerRemoveOSCategory() {
 function adminServerRemoveSupportedOS() {
        var changeInfoList = [];
        var changeInfoItem;
-       var oldOsName = document.getElementById('adminServer-ModifySupportedOs-OldOsName').value;
-       var osName = document.getElementById('adminServer-MoidfySupportedOs-OsName').value;
+       var oldOsName = $('#adminServer-ModifySupportedOs-OldOsName').val();
+       var osName = $('#adminServer-MoidfySupportedOs-OsName').val();
 
        if(oldOsName != osName ){
                alert("Remove command must be same to original os name");
@@ -79,7 +79,7 @@ function adminServerRemoveSupportedOS() {
 }
 
 function adminServerRemoveServerInfo() {
-       var property = document.getElementById('adminServer-modifyServerInfo-property').value;
+       var property = $('#adminServer-modifyServerInfo-property').val();
        var changeInfoList = [];
        var changeInfoItem;
 
@@ -99,7 +99,7 @@ function adminServerRemoveServerInfo() {
 function adminServerRemoveRemoteBuildServer() {
        var changeInfoList = [];
        var changeInfoItem;
-       var serverAddress = document.getElementById('adminServer-modifyRemoteBuildServer-OldAddress').value;
+       var serverAddress = $('#adminServer-modifyRemoteBuildServer-OldAddress').val();
 
        if(serverAddress == ""){
                alert("server address is invalid");
index fd00e4108d35d246dc2f75f7474eee31d5f5c286..4add0839ef19be5ead115c37509276e9ebb62fe3 100644 (file)
@@ -26,43 +26,61 @@ Contributors:
 - S-Core Co., Ltd
 */
 
-function adminUserModifyPopupInit() {
-       var index = localStorage.userTableIndex;
-       var userName = document.getElementById("userTableName:"+index).innerHTML;
-       var email = document.getElementById("userTableEmail:"+index).innerHTML;
-       var group = document.getElementById("userTableGroup:"+index).innerHTML;
-
-       document.getElementById('popup:modifyUserName').value = userName;
-       mailElement = document.getElementById('popup:modifyUserEmail');
-       mailElement.value = email;
-       mailElement.setAttribute('disabled', 'disabled');
-
-       queryAllGroup( function(xml) {
-               var groupList = $(xml).find("Data").find("GroupName");
+function adminUserModifyInit() {
+       var userId = localStorage.userId;
+       var userName = $("#adminUser-contents-"+userId+"-name").html();
+       var email = $("#adminUser-contents-"+userId+"-email").html();
+
+       $("#adminUserModify-name").val(userName);
+       $("#adminUserModify-email").val(email);
+
+       queryUserInfoForAdmin(userId, function(xml) {
+               var fullGroupList = $(xml).find("Data").find("GroupInfo").find("Group");
+               var userGroupIdList = $(xml).find("Data").find("GroupInfo").find("GroupIdList").text().split(",");
                
-               $("#popup\\:modifyUserGroup").empty();
-
-               groupList.each( function(){
-                       var groupName = $(this).text();
-                       if( groupName == group ) {
-                               $("#popup\\:modifyUserGroup").append("<option value=\'"+groupName+"\' selected=\"selected\">"+groupName+"</option>");
-                       } else {
-                               $("#popup\\:modifyUserGroup").append("<option value=\'"+groupName+"\'>"+groupName+"</option>");
-                       }
-
-                       $("#popup\\:modifyUserGroup").selectmenu('refresh');
-               });
+               adminUserModifyGenerateGroupSelect(fullGroupList, userGroupIdList); 
        });
 }
 
-function adminUserModifyPopupModify() {
-       var userName = document.getElementById("popup:modifyUserName").value;
-       var email = document.getElementById("popup:modifyUserEmail").value;
-       var groupName = $("#popup\\:modifyUserGroup option:selected").val();
+function adminUserModifyGenerateGroupSelect(fullGroupList, userGroupIdList) {
+       $("#adminUserModify-group").empty();
+       fullGroupList.each(function(){
+               var groupName = $(this).find("Name").text();
+               var groupId = $(this).find("Id").text();
+
+               var input; 
+               if(contains(userGroupIdList, groupId))
+               {
+                       input = '<input type=checkbox id=adminUserModify-group-checkbox-'+groupId+' name=adminUserModify-group-checkbox value='+groupId+' checked=checked />';
+               } else {
+                       input = '<input type=checkbox id=adminUserModify-group-checkbox-'+groupId+' name=adminUserModify-group-checkbox value='+groupId+' />';
+
+               }
+               var label = '<label for=adminUserModify-group-checkbox-'+groupId+'> '+groupName+'<label>';
+               
+               $("#adminUserModify-group").append(input);
+               $("#adminUserModify-group").append(label);
+       });
 
+       $("input[name='adminUserModify-group-checkbox']").checkboxradio();
+}
+
+
+function adminUserModify() {
        var changeInfoList = [];
        var changeInfoItem;
-       changeInfoItem = {"Type":"ModifyUser", "Email":email, "UserName":userName, "GroupName":groupName};
+       var userName = $("#adminUserModify-name").val();
+       var email = $("#adminUserModify-email").val();
+       var selectGroupList = [];
+
+       var selectArray = $("input[name='adminUserModify-group-checkbox']");
+       for(var i = 0; i < selectArray.length; i++) {
+               if (selectArray[i].checked == true) {
+                       selectGroupList.push(selectArray[i].value);
+               }
+       }
+               
+       changeInfoItem = {"Type":"ModifyUser", "Email":email, "UserName":userName, "GroupIdList":selectGroupList.toString()};
        changeInfoList.push(changeInfoItem);
 
        changeUser(changeInfoList, function () {
index 73acf008ec766459cecbbe0e1085f0c288cda87a..c41f888e52b8b0b31411242e16aa5c6ba5728530 100644 (file)
@@ -27,17 +27,11 @@ Contributors:
 */
 
 function adminUserInit() {
-       var userTable = document.getElementById("adminUserTable");
-
-       /* remove all table rows */
-       while(userTable.hasChildNodes())
-       {
-               userTable.removeChild(userTable.firstChild);
-       }
+       $("#adminUser-contents").empty();
 
        /* create table header */
        var tableHeader = "<tr><th>User name</th><th>Email</th><th>Group</th><th>Modify</th><th>Delete</th></tr>";
-       $("#adminUserTable").append(tableHeader);
+       $("#adminUser-contents").append(tableHeader);
 
        queryAllUser( function(xml) {
                var userList = $(xml).find("Data").find("User");
@@ -47,36 +41,35 @@ function adminUserInit() {
 }
 
 function adminUserFillTable(userList) {
-       var userTable = document.getElementById("adminUserTable");
-       var index = 2;
+       var userTable = document.getElementById("adminUser-contents");
 
-       userList.each(function(idx){
+       userList.each(function(){
                var row = userTable.insertRow(-1);
                var cell;
                var userName = $(this).find("Name").text();
-               var groupName = $(this).find("GroupName").text();
+               var groupList = $(this).find("GroupName");
                var email = $(this).find("Email").text();
+               var userId = $(this).find("Id").text();
 
-               row.setAttribute('id', 'userTable:'+index);
                cell = row.insertCell(-1);
-               cell.setAttribute('id',"userTableName:"+index);
+               cell.setAttribute('id',"adminUser-contents-"+userId+"-name");
                cell.innerHTML = userName;
 
                cell = row.insertCell(-1);
-               cell.setAttribute('id',"userTableEmail:"+index);
+               cell.setAttribute('id',"adminUser-contents-"+userId+"-email");
                cell.innerHTML = email;
 
                cell = row.insertCell(-1);
-               cell.setAttribute('id',"userTableGroup:"+index);
-               cell.innerHTML = groupName;
+               div = adminUserGenerateGroupListCell(groupList);
+               cell.appendChild(div);
 
                cell = row.insertCell(-1);
                var button = document.createElement('a');
-               button.setAttribute('href','#adminUserModifyPopup');
+               button.setAttribute('href','#adminUserModify');
                button.setAttribute('data-role','button');
                button.setAttribute('data-rel','dialog');
-               button.setAttribute('class','adminUserTableButton');
-               button.setAttribute('onClick','adminUserModifyPopupSetup(\"'+index+'\")');
+               button.setAttribute('class','adminUser-contentsButton');
+               button.setAttribute('onClick','adminUserModifySetup('+userId+')');
                button.innerHTML = " "
                cell.appendChild(button);
 
@@ -84,22 +77,32 @@ function adminUserFillTable(userList) {
                var button = document.createElement('input');
                button.setAttribute('type','button');
                button.setAttribute('name',email);
-               button.setAttribute('class','adminUserTableButton');
-               button.setAttribute('onClick','adminUserRemoveUser('+index+')');
+               button.setAttribute('class','adminUser-contentsButton');
+               button.setAttribute('onClick','adminUserRemoveUser('+userId+')');
                cell.appendChild(button);
-
-               index = index + 1;
        });
 
-       $(".adminUserTableButton").button();
+       $(".adminUser-groupList").collapsible();
+       $(".adminUser-contentsButton").button();
+}
+
+function adminUserGenerateGroupListCell(groupList) {
+       var div = document.createElement('div');
+
+       groupList.each(function(){
+               var item = document.createElement('li');
+               item.innerHTML = $(this).text();
+               div.appendChild(item);
+       });
+       return div;
 }
 
-function adminUserModifyPopupSetup(index) {
-       localStorage.userTableIndex = index;
+function adminUserModifySetup(id) {
+       localStorage.userId = id;
 }
 
-function adminUserRemoveUser(index) {
-       var email = document.getElementById("userTableEmail:"+index).innerHTML;
+function adminUserRemoveUser(userId) {
+       var email = $("#adminUser-contents-"+userId+"-email").val();
 
        var r=confirm("User ["+email+"] is removed!!!");
        if (r==false)
index c2efd259bc1408ce3559df16bdfc1f31136da582..bb213a89e3597904b69253a6a8d2436a62fc71db 100644 (file)
@@ -27,17 +27,17 @@ Contributors:
 */
 
 function buildInit() {
-       if( $("#select-distribution").children().length == 0 ) {
+       if( $("#build-distribution-select").children().length == 0 ) {
                queryDistribution( function(xml) {
                        $(xml).find("Data").find("DistributionName").each(function(){
                                var name = $(this).text();
                
-                               $("#select-distribution").append("<option value=\'"+name+"\'>"+name+"</option>");
+                               $("#build-distribution-select").append("<option value=\'"+name+"\'>"+name+"</option>");
                        });
                
                        /* default distribution selection */
-                       $("#select-distribution option:eq(0)").attr("selected", "selected");
-                       $("#select-distribution").selectmenu('refresh');
+                       $("#build-distribution-select option:eq(0)").attr("selected", "selected");
+                       $("#build-distribution-select").selectmenu('refresh');
                
                        // query Project list
                        buildQueryProjectList();
@@ -61,10 +61,12 @@ function buildInit() {
 }
 
 function buildQueryProjectList() {
-       var distName = $("#select-distribution option:selected").val();
+       var distName = $("#build-distribution-select option:selected").val();
 
        queryProjectsInDistribution( distName, function(xml) {
-               buildInitTable();
+               $("#build-git-table").empty();
+               $("#build-binary-table").empty();
+               
                var xmlBody = $(xml).find("Data");
                buildAddTableRow( xmlBody.find("BuildServerInfo").find("supportedOs"),
                                         xmlBody.find("Project"),
@@ -75,7 +77,7 @@ function buildQueryProjectList() {
 }
 
 function buildQueryRunningProjectList() {
-       var distName = $("#select-distribution option:selected").val();
+       var distName = $("#build-distribution-select option:selected").val();
 
        queryRunningProjectsInfoInDistribution( distName, function(xml) {
                var running_project = $(xml).find("RunProjectInfo");
@@ -115,30 +117,12 @@ function contains(a, obj) {
        return false; 
 }
 
-function buildInitTable() {
-       /* project table */
-       var projectTable = document.getElementById("projectTable");
-       
-       /* binary project table */
-       var binaryProjectTable = document.getElementById("binaryProjectTable");
-       
-       /* remove all table rows */
-       while(projectTable.hasChildNodes())
-       {
-               projectTable.removeChild(projectTable.firstChild);
-       }
-       while(binaryProjectTable.hasChildNodes())
-       {
-               binaryProjectTable.removeChild(binaryProjectTable.firstChild);
-       }
-}
-
 function buildAddTableRow(supportedOs, projectList, otherProjectList) {
        // Table header
        var idx = 0;
        var tableHeader = "";
        var osArray = new Array();
-       var projectTable = document.getElementById("projectTable");
+       var projectTable = document.getElementById("build-git-table");
 
        // Project table header
        tableHeader = "<tr><th>Project</th>";
@@ -151,7 +135,7 @@ function buildAddTableRow(supportedOs, projectList, otherProjectList) {
        });
 
        tableHeader = tableHeader + "<th>ALL</th></tr>";
-       $("#projectTable").append(tableHeader);
+       $("#build-git-table").append(tableHeader);
 
        // table row - projectList
        var index = 2;
@@ -232,7 +216,7 @@ function buildAddTableRow(supportedOs, projectList, otherProjectList) {
 }
 
 function buildAddBinaryTableRow(binaryProjectList, otherProjectList) {
-       var binaryProjectTable = document.getElementById("binaryProjectTable");
+       var binaryProjectTable = document.getElementById("build-binary-table");
        var row = binaryProjectTable.insertRow(-1);
        var thCell = document.createElement('th');
        thCell.innerHTML = "Project";
@@ -253,7 +237,7 @@ function buildAddBinaryTableRow(binaryProjectList, otherProjectList) {
                row += '<td bgcolor="#dcddc0" style="text-align:left"><a href="upload.html" onClick="buildUploadBinaryName(\'' +name+'\')" class="binary_project_button" data-role="button" data-ajax="false" data-mini="true">REGISTER</a>';
                row += '</tr>'
                
-               $("#binaryProjectTable tr:last").after(row);
+               $("#build-binary-table tr:last").after(row);
        });
 
        otherProjectList.each(function(){
@@ -290,7 +274,7 @@ function buildAddBinaryTableRow(binaryProjectList, otherProjectList) {
 }
 
 function buildBuildProject(type) {
-       var distName = $("#select-distribution option:selected").val();
+       var distName = $("#build-distribution-select option:selected").val();
        var buildProjectList = [];
 
        //var node_list = document.getElementsByTagName('input');
@@ -316,7 +300,7 @@ function buildBuildProject(type) {
 }
 
 function buildUploadBinaryName(project_name) {
-       localStorage.distibutionName = $("#select-distribution option:selected").val();
+       localStorage.distibutionName = $("#build-distribution-select option:selected").val();
        localStorage.uploadBinaryProjectName = project_name;
 }
 
@@ -338,7 +322,7 @@ function buildBatchFilePathSelector() {
 }
 
 function buildClear() {
-       $("#select-distribution").empty();
-       
-       buildInitTable();
+       $("#build-distribution-select").empty();
+       $("#build-git-table").empty();
+       $("#build-binary-table").empty();
 }
index 9802a7190c2a6d3a3345748c7b25a7a6414b4c93..4cbee8ba3a7150b2f84c555edb6baaeb4df952be 100644 (file)
@@ -133,6 +133,11 @@ function queryAllUser(successFunction) {
        getInfoFromServer(url, successFunction);
 }
 
+function queryUserInfoForAdmin(email, successFunction) {
+       var url = 'admin_user/queryUserInfo/' + email;
+       getInfoFromServer(url, successFunction);
+}
+
 function changeUser(changeInfoList, successFunction) {
        var url = 'admin_user/modifyUser';
        postForServer(url, changeInfoList, successFunction);
@@ -241,11 +246,6 @@ function modifyProject(changeInfoList, successFunction) {
 }
 
 // controller : admin_distribution
-function queryAllDistribution(successFunction) {
-       var url = 'admin_distribution/queryAllDistribution';
-       getInfoFromServer(url, successFunction);
-}
-
 function queryDistributionInfo(distName, successFunction) {
        var url = 'admin_distribution/queryDistributionInfo/' + distName;
        getInfoFromServer(url, successFunction);
index cde6c982ec77216f69620efe4abcb12ecacc1b06..e5e61d310f5d76c51634da7fcc70b154d9289500 100644 (file)
@@ -32,16 +32,16 @@ var request_list = new Array();
 var request_idx = 0;
 
 $(function() {
-       $('#jobSearchSelect input[type="radio"]').checkboxradio().click(function() {
+       $('#jobs-type-select input[type="radio"]').checkboxradio().click(function() {
                jobsSearchSelected();
        });
 
-       $('#jobStatusSelect input[type="radio"]').checkboxradio().click(function() {
+       $('#jobs-status-select input[type="radio"]').checkboxradio().click(function() {
                jobsStatusSelected();
        });
 
-       $("#jobSearchInputText").on("input", function(e) {
-               var selectedValue = $('#jobSearchSelect').find("input[type='radio']:checked").val();
+       $("#jobs-search-input-text").on("input", function(e) {
+               var selectedValue = $('#jobs-type-select').find("input[type='radio']:checked").val();
                switch(selectedValue) {
                        case "GROUP":
                        case "PROJECT":
@@ -52,13 +52,13 @@ $(function() {
                }
        });
 
-       $('#jobSearchInputText').keypress(function() {
+       $('#jobs-search-input-text').keypress(function() {
                if(event.keyCode == '13') {
                        searchJobInput();
                }
        });
 
-       $('#jobSearchDate').keypress(function() {
+       $('#jobs-search-date-value').keypress(function() {
                if(event.keyCode == '13') {
                        searchJobDate();
                }
@@ -72,7 +72,7 @@ function jobsInit() {
 function jobsSearchSelected() {
        clearSuggestJobSearchList();
 
-       var selectedValue = $('#jobSearchSelect').find("input[type='radio']:checked").val();
+       var selectedValue = $('#jobs-type-select').find("input[type='radio']:checked").val();
        switch(selectedValue) {
                case "ALL":
                        selectJobAll();
@@ -99,7 +99,7 @@ function jobsSearchSelected() {
 }
 
 function jobsStatusSelected() {
-       var selectedValue = $('#jobStatusSelect').find("input[type='radio']:checked").val();
+       var selectedValue = $('#jobs-status-select').find("input[type='radio']:checked").val();
        switch(selectedValue) {
                case "ALL":
                        jobsSearchSelected();
@@ -120,22 +120,22 @@ function jobsStatusSelected() {
 }
 
 function searchJobInput() {
-       var searchText = $("#jobSearchInputText").val()
+       var searchText = $("#jobs-search-input-text").val()
        if(searchText.length > 0) {
                searchJob(searchText);
        }
 }
 
 function searchJobDate() {
-       var searchText = $("#jobSearchDate").val()
+       var searchText = $("#jobs-search-date-value").val()
        if(searchText.length > 0) {
                searchJob(searchText);
        }
 }
 
 function searchJob(searchText) {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
-       var selectedValue = $('#jobSearchSelect').find("input[type='radio']:checked").val();
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
+       var selectedValue = $('#jobs-type-select').find("input[type='radio']:checked").val();
        switch(selectedValue) {
                case "ALL":
                        alert("Can't search on ALL!!");
@@ -162,37 +162,37 @@ function searchJob(searchText) {
 }
 
 function selectJobAll() {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
-       $("#jobDivSearchDate").hide();
-       $("#jobDivSearchInput").hide();
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
+       $("#jobs-search-date").hide();
+       $("#jobs-search-input").hide();
        queryJobListAll(distribution);
 }
 
 function selectJobId() {
-       $("#jobDivSearchDate").hide();
-       $("#jobDivSearchInput").show();
-       $("#jobSearchInputText").val("").textinput();
+       $("#jobs-search-date").hide();
+       $("#jobs-search-input").show();
+       $("#jobs-search-input-text").val("").textinput();
        clearJobList();
 }
 
 function selectUser() {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
-       $("#jobDivSearchDate").hide();
-       $("#jobDivSearchInput").show();
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
+       $("#jobs-search-date").hide();
+       $("#jobs-search-input").show();
 
        var name = sessionStorage.sessionInfoName;
-       $("#jobSearchInputText").val(name).textinput();
+       $("#jobs-search-input-text").val(name).textinput();
 
        queryJobListUserName(distribution, name);
 }
 
 function selectGroup() {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
-       $("#jobDivSearchDate").hide();
-       $("#jobDivSearchInput").show();
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
+       $("#jobs-search-date").hide();
+       $("#jobs-search-input").show();
 
        var group = sessionStorage.sessionInfoGroup;
-       $("#jobSearchInputText").val(group).textinput();
+       $("#jobs-search-input-text").val(group).textinput();
 
        jobsQueryGroupList("JOBS");
 
@@ -200,18 +200,18 @@ function selectGroup() {
 }
 
 function selectProject() {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
-       $("#jobDivSearchDate").hide();
-       $("#jobDivSearchInput").show();
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
+       $("#jobs-search-date").hide();
+       $("#jobs-search-input").show();
        clearJobList();
 
-       $("#jobSearchInputText").val("").textinput();
+       $("#jobs-search-input-text").val("").textinput();
 
        jobsQueryProjectsList(distribution);
 }
 
 function selectDate() {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
        var today = new Date();
        var yyyy = today.getFullYear();
        var mm = today.getMonth()+1; //January is 0!
@@ -224,16 +224,16 @@ function selectDate() {
        } 
 
        var date = yyyy+'-'+mm+'-'+dd;
-       $('#jobSearchDate').val(date);
+       $('#jobs-search-date-value').val(date);
 
-       $("#jobDivSearchInput").hide();
-       $("#jobDivSearchDate").show();
+       $("#jobs-search-input").hide();
+       $("#jobs-search-date").show();
        clearJobList();
        queryJobListDate(distribution, date);
 }
 
 function clearJobList() {
-       $("#jobList").empty();
+       $("#jobs-job-list").empty();
 }
 
 function queryJobListAll(distribution) {
@@ -263,7 +263,7 @@ function queryJobListDate(distribution, date) {
 function queryJobListByButton(condition, param, distribution, jobId) {
        clearJobList();
        clearRequestList();
-       var selectedStatus= $('#jobStatusSelect').find("input[type='radio']:checked").val();
+       var selectedStatus= $('#jobs-status-select').find("input[type='radio']:checked").val();
        var request = queryJobList("jobs/list", condition, param, distribution, selectedStatus, jobId);
        if(request != undefined) {
                request.done(function() {
@@ -274,21 +274,20 @@ function queryJobListByButton(condition, param, distribution, jobId) {
 }
 
 function jobQueryDistribution() {
-       if( $("#jobSelectDistribution").children().length == 0 ) {
+       if( $("#jobs-distribution-select").children().length == 0 ) {
                queryDistribution( function(xml) {
-                       // remove old select options
-                       $("#jobSelectDistribution").empty();
-                       $("#jobSelectDistribution").append("<option value='ALL'>ALL</option>");
+                       // append "ALL" distribution
+                       $("#jobs-distribution-select").append("<option value='ALL'>ALL</option>");
                
                        $(xml).find("Data").find("DistributionName").each(function(){
                                var name = $(this).text();
                
-                               $("#jobSelectDistribution").append("<option value=\'"+name+"\'>"+name+"</option>");
+                               $("#jobs-distribution-select").append("<option value=\'"+name+"\'>"+name+"</option>");
                        });
                
                        /* default distribution selection */
-                       $("#jobSelectDistribution option:eq(0)").attr("selected", "selected");
-                       $("#jobSelectDistribution").selectmenu('refresh');
+                       $("#jobs-distribution-select option:eq(0)").attr("selected", "selected");
+                       $("#jobs-distribution-select").selectmenu('refresh');
     
                        selectJobAll();
                });
@@ -313,7 +312,7 @@ function queryJobList(requestUrl, condition, param, queryDistribution, selectedS
                        var li = generateHtmlJobList($(this));
 
                        lastJobId = id;
-                       $("#jobList").append(li).listview('refresh');
+                       $("#jobs-job-list").append(li).listview('refresh');
 
                        $("#jobs-li-link-"+id).popupWindow({ 
                                height:900, 
@@ -328,20 +327,20 @@ function queryJobList(requestUrl, condition, param, queryDistribution, selectedS
                {
                        var moreJobListUrl = 'queryJobList("'+requestUrl+'", "'+condition+'", "'+param+'", "'+queryDistribution+'", "'+selectedStatus+'", "'+lastJobId+'")';
                        console.log(moreJobListUrl);
-                       $('#moreJobList').attr("onClick", moreJobListUrl);
-                       $('#moreJobList').removeClass('ui-disabled');
+                       $('#jobs-job-more').attr("onClick", moreJobListUrl);
+                       $('#jobs-job-more').removeClass('ui-disabled');
                }
                else
                {
-                       $('#moreJobList').addClass('ui-disabled');
+                       $('#jobs-job-more').addClass('ui-disabled');
                }
-               $('#moreJobList').button('refresh');
+               $('#jobs-job-more').button('refresh');
 
        }, errorProcess); 
 }
 
 function jobUpdateList(condition, param, distribution, selectedStatus) {
-       var latest_job_id= $("#jobList li").first().attr("title");
+       var latest_job_id= $("#jobs-job-list li").first().attr("title");
        if(latest_job_id == undefined) {
                latest_job_id = 0;
        }
@@ -349,7 +348,7 @@ function jobUpdateList(condition, param, distribution, selectedStatus) {
        item = {"Condition":condition, "Param":param, "Distribution":distribution, "Status":selectedStatus, "LatestId":latest_job_id, "WorkingJobId":working_job_list};
 
        var update_ajax = updateList(item, function(xml) {
-               var firstLi= $("#jobList li").first();
+               var firstLi= $("#jobs-job-list li").first();
 
                // Add new job list
                $(xml).find("JobList").find("Job").each(function(){
@@ -357,7 +356,7 @@ function jobUpdateList(condition, param, distribution, selectedStatus) {
                        var li = generateHtmlJobList($(this));
 
                        $(li).insertBefore(firstLi);
-                       $("#jobList").listview('refresh');
+                       $("#jobs-job-list").listview('refresh');
                        $("#jobs-li-link-"+id).popupWindow({ 
                                height:900, 
                                width:800, 
@@ -419,7 +418,7 @@ function jobUpdateList(condition, param, distribution, selectedStatus) {
                                var li = generateHtmlJobList($(this));
 
                                $(li).insertBefore(next_parent_job_li);
-                               $("#jobList").listview('refresh');
+                               $("#jobs-job-list").listview('refresh');
                                $("#jobs-li-link-"+job_id).popupWindow({ 
                                        height:900, 
                                        width:800, 
@@ -448,7 +447,7 @@ function jobUpdateList(condition, param, distribution, selectedStatus) {
 }
 
 function clearSuggestJobSearchList() {
-       $("#jobSearchList").empty();
+       $("#jobs-search-list").empty();
 }
 
 function jobsQueryGroupList() {
@@ -465,7 +464,7 @@ function jobsQueryGroupList() {
 }
 
 function suggestJobSearchList(inputText) {
-       var sugList = $("#jobSearchList");
+       var sugList = $("#jobs-search-list");
 
        if(inputText.length < 1) {
                sugList.html("");
@@ -487,8 +486,8 @@ function suggestJobSearchList(inputText) {
 }
 
 function jobSuggestListClick(suggestText) {
-       $("#jobSearchInputText").val(suggestText);
-       $("#jobSearchList").empty();
+       $("#jobs-search-input-text").val(suggestText);
+       $("#jobs-search-list").empty();
 
        var startIndex = suggestText.search(/\[/);
        var endIndex = suggestText.search('\]');
@@ -504,7 +503,7 @@ function jobSuggestListClick(suggestText) {
 }
 
 function jobsQueryProjectsList() {
-       var distribution = $("#jobSelectDistribution option:selected").val(); 
+       var distribution = $("#jobs-distribution-select option:selected").val(); 
        suggestion_list = [];
 
        if(distribution == "ALL") {
@@ -532,7 +531,7 @@ function jobsQueryProjectsList() {
 }
 
 function jobsClear() {
-       $("#jobSelectDistribution").empty();
+       $("#jobs-distribution-select").empty();
        clearJobList();
 }
 
@@ -636,7 +635,7 @@ function generateHtmlJobList(xml) {
 
 function searchWorkingList() {
        working_job_array = new Array();
-       $("#jobList .jobs-list-data").each(function(index) {
+       $("#jobs-job-list .jobs-list-data").each(function(index) {
                var job_attr = $(this).find(".jobs-li-hidden-attr").text();
                var job_id = $(this).find(".jobs-li-hidden-id").text();
                var job_status= $(this).find(".jobs-li-status").text();
index 607b68cb608caabc27604fe7232b876ea998f234..9dcbed2038d2d8a965ebf9500c7140c828f9c1b6 100644 (file)
@@ -106,7 +106,7 @@ function queryLog()
 
                /* Insert data */
                $(xml).find("Data").find("LogData").each(function() {
-                       var insertTable = document.getElementById("logTable");
+                       var insertTable = document.getElementById("log-contents");
                        var insertRow = document.createElement("tr");
                        var insertCel1 = document.createElement("td");
                        var insertCel2 = document.createElement("td");
@@ -143,8 +143,7 @@ function autoQueryLog(conti, working_status) {
        if(conti && stop) {
                queryLog();
        }
-
-       if(working_status == 1 && stop) {
+       else if(working_status == 1 && stop) {
                console.log("status is working. try request");
                setTimeout(function(){queryLog()}, 3000);
        }
index bb60f7fe3d7a476ad8183c17b9fee44accbc5d14..245617cea0eb37c8317b6057d338e35d89424e1e 100644 (file)
@@ -66,10 +66,10 @@ $( document ).bind( "pagechange", function( event, data ){
                        generateNavigationBar(id);
                        break;
                case "signup":
-                       clearFormData('signupForm');
+                       clearFormData('signup-form');
                        break;
                case "login":
-                       clearFormData('loginForm');
+                       clearFormData('login-form');
                        break;
                case "projects":
                        generateNavigationBar(id);
@@ -106,31 +106,31 @@ $( document ).bind( "pagechange", function( event, data ){
                        generateNavigationBar(id);
                        adminDistributionInit();
                        break;
-               case "modifyDistribution":
+               case "adminDistributionModify":
                        adminDistributionModifyPopupInit();
                        break;
-               case "adminUserModifyPopup":
-                       adminUserModifyPopupInit();
+               case "adminUserModify":
+                       adminUserModifyInit();
                        break;
-               case "modifyBinaryProject":
+               case "adminProjectModifyBinary":
                        adminProjectModifyBinaryProjectInit();
                        break;
-               case "modifyGitProject":
+               case "adminProjectModifyGit":
                        adminProjectModifyGitProjectInit();
                        break;
-               case "adminGroupAddPopup":
+               case "adminGroupAdd":
                        adminGroupAddInit();
                        break;
-               case "adminGroupModifyPopup":
+               case "adminGroupModify":
                        adminGroupModifyInit();
                        break;
                case "adminServerModifyRemoteBuildServer":
                        adminServerModifyRemoteBuildServerInit();
                        break;
-               case "addGitProject":
+               case "adminProjectAddGit":
                        adminProjectAddGitInit();
                        break;
-               case "addBinaryProject":
+               case "adminProjectAddBinary":
                        adminProjectAddBinaryInit();
                        break;
                case "adminServerAddSupportedOs":
index 22886655f90678832b0de5e4e0f7dff0f05ad1be..e982f67efd6af783b464336ac4f07fba4f878c3e 100644 (file)
@@ -27,43 +27,36 @@ Contributors:
 */
 
 function projectsInit() {
-       if( $("#projects-select-distribution").children().length == 0 ) {
+       if( $("#projects-distribution-select").children().length == 0 ) {
                queryDistribution( function(xml) {
-                       // remove old select options
-                       $("#projects-select-distribution").empty();
-               
                        $(xml).find("Data").find("DistributionName").each(function(){
                                var name = $(this).text();
                
-                               $("#projects-select-distribution").append("<option value=\'"+name+"\'>"+name+"</option>");
+                               $("#projects-distribution-select").append("<option value=\'"+name+"\'>"+name+"</option>");
                        });
                
                        /* default distribution selection */
-                       $("#projects-select-distribution option:eq(0)").attr("selected", "selected");
-                       $("#projects-select-distribution").selectmenu('refresh');
+                       $("#projects-distribution-select option:eq(0)").attr("selected", "selected");
+                       $("#projects-distribution-select").selectmenu('refresh');
                
                        projectsQueryProjectListType("MY"); 
-                       $('#projectsSearchSelect input[type="radio"]').attr("checked",false).checkboxradio("refresh");
-                       $('#projectsSearchSelect input[type="radio"]:first').attr("checked",true).checkboxradio("refresh");
+                       $('#projects-type-select input[type="radio"]').attr("checked",false).checkboxradio("refresh");
+                       $('#projects-type-select input[type="radio"]:first').attr("checked",true).checkboxradio("refresh");
                });
        } else {
                projectsQueryProjectListType("MY"); 
-               $('#projectsSearchSelect input[type="radio"]').attr("checked",false).checkboxradio("refresh");
-               $('#projectsSearchSelect input[type="radio"]:first').attr("checked",true).checkboxradio("refresh");
+               $('#projects-type-select input[type="radio"]').attr("checked",false).checkboxradio("refresh");
+               $('#projects-type-select input[type="radio"]:first').attr("checked",true).checkboxradio("refresh");
        }
 }
 
 function projectsQueryProjectListType(queryType) {
-       var distName = $("#projects-select-distribution option:selected").val();
+       var distName = $("#projects-distribution-select option:selected").val();
 
        queryProjectsInfoInDistribution( distName, function(xml) {
-               var projectList = document.getElementById("projects-project-list");
+               $("#projects-project-list").empty();
 
-               /* remove all list */
-               while(projectList.hasChildNodes())
-               {
-                       projectList.removeChild(projectList.firstChild);
-               }
+               var projectList = document.getElementById("projects-project-list");
 
                $(xml).find("Data").find("ProjectList").find("Project").each(function(){
                        switch(queryType) {
@@ -166,13 +159,7 @@ function projectsAppendProjectList( project, projectList ) {
 }
 
 function projectsClear() {
-       $("#projects-select-distribution").empty();
-
-       var projectList = document.getElementById("projects-project-list");
-       /* remove all list */
-       while(projectList.hasChildNodes())
-       {
-               projectList.removeChild(projectList.firstChild);
-       }
+       $("#projects-distribution-select").empty();
+       $("#projects-project-list").empty();
 }
 
index 12582dc43b1613c519b0b11171fefbda1e0e1459..60969b97d612b90de23d0879058eecf37738a04e 100644 (file)
@@ -27,7 +27,7 @@ Contributors:
 */
 
 $(function() {
-       $('#login-password').keypress(function() {
+       $('#login-form-password').keypress(function() {
                if(event.keyCode == '13') {
                        sessionLogin();
                }
@@ -61,7 +61,7 @@ function checkSessionInfo(){
        if(email)
        {
                sessionHtml = '<div data-role="controlgroup" style="text-align: left; font-size: 12px" data-type="horizontal" class="ui-btn-right ui-btn-corner-all">';
-               sessionHtml += '<p data-direction="reverse" ><a href="#userModifyPopup" onClick="userQueryUserInfo()" data-rel="dialog">'+name+'</a> | ';
+               sessionHtml += '<p data-direction="reverse" ><a href="#userModify" onClick="userQueryUserInfo()" data-rel="dialog">'+name+'</a> | ';
                sessionHtml += '<a href=# onClick="logout()" data-direction="reverse">Log out</a></p></div>';
        }
        else
@@ -89,8 +89,8 @@ function expireSession(){
 function sessionLogin() {
        var infoList = [];
        var infoItem;
-       var email = $('#login-email').val();
-       var password = $('#login-password').val();
+       var email = $('#login-form-email').val();
+       var password = $('#login-form-password').val();
 
        if(email == ""){
                alert("Email is invalid");
@@ -127,20 +127,3 @@ function sessionLogin() {
                        }
        });
 } 
-
-function signupQueryGroupList() {
-       queryAllGroup( function(xml) {
-               $("#applyGroupRadio").children().remove();
-
-               var newHtml ='<fieldset data-role="controlgroup" data-mini="true"><legend>Apply for group :</legend>';
-               $(xml).find("Data").find("GroupName").each(function(){
-                       var name = $(this).text();
-                       newHtml += '<input type="radio" name="group" id="group-'+name+'" value="'+name+'" />';
-                       newHtml += '<label for="group-'+name+'">'+name+'</label>';
-               });
-               console.log(newHtml);
-               $("#applyGroupRadio").append(newHtml).trigger('create');
-               $("#applyGroupRadio div[role='heading']").attr("style","text-align: left; font-size: 12px");
-       }, errorProcess);
-}
-
index 70d8689216594c96f11808ed161883a0affbdc26..1e5efb8d0c085d3110be67ee9f401c433d8a2eb0 100644 (file)
@@ -37,10 +37,10 @@ $(function() {
 function userSignUp() {
        var infoList = [];
        var infoItem;
-       var email = $('#user-email').val();
-       var name = $('#user-name').val();
-       var password = $('#user-password').val();
-       var password_confirm = $('#user-password-confirmation').val();
+       var email = $('#signup-form-email').val();
+       var name = $('#signup-form-name').val();
+       var password = $('#signup-form-password').val();
+       var password_confirm = $('#signup-form-password-confirmation').val();
        var emailCheckReg = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/
 
        if(email == "" || !emailCheckReg.test(email)){
@@ -95,18 +95,18 @@ function userQueryUserInfo() {
                var email = $(xml).find("Data").find("User").find("Email").text();
                var name = $(xml).find("Data").find("User").find("Name").text();
 
-               $("#popup-user-info-email").val(email).textinput();
-               $("#popup-user-info-name").val(name).textinput();
+               $("#userModify-email").val(email).textinput();
+               $("#userModify-name").val(name).textinput();
        });
 }
 
 function userModifyUserInfo() {
        var changeInfoList = [];
        var changeInfoItem;
-       var email = $('#popup-user-info-email').val();
-       var name = $('#popup-user-info-name').val();
-       var password = $('#popup-user-info-password').val();
-       var password_confirm = $('#popup-user-info-password-confirm').val();
+       var email = $('#userModify-email').val();
+       var name = $('#userModify-name').val();
+       var password = $('#userModify-password').val();
+       var password_confirm = $('#userModify-password-confirm').val();
 
        if(email == ""){
                alert("Email is invalid");
index ec4c4c4eac202d0caa13c5dcf9b6b237a4a8acd9..9157238fba50bca2a677781d1d68b8dc5c161acf 100644 (file)
@@ -103,7 +103,7 @@ Contributors:
                </div>
        </div>
        <div id="body">
-               <table id="logTable" style="width: 100%; border: #000000 1px solid; font-size:9pt">
+               <table id="log-contents" style="width: 100%; border: #000000 1px solid; font-size:9pt">
                </table> 
        <div id="footer" data-role="controlgroup" data-mini="true" data-type="horizontal">
                <input type="button" value="More" onClick=moreLog() / > 
index 1200aa7702e99f9209d31a1d3e4118a39d1fc547..35d14f540f2b8878ff4bbff398ee2473351e7add 100644 (file)
@@ -38,12 +38,12 @@ div.content-secondary {
        width: 25%;
 }
 
-#jobDivSearchInput .ui-input-search {
+#jobs-search-input .ui-input-search {
     width: 80%;
     display: inline-block;
 }
 
-#jobDivSearchDate .ui-input-text {
+#jobs-search-date .ui-input-text {
     width: 80%;
     display: inline-block;
 }
@@ -74,14 +74,14 @@ table.imagetable td {
     max-width: 500px;                                                                      
 }     
 
-table.projectTableStyle {
+table.build-project-table {
     font-family: verdana,arial,sans-serif;
     font-size:11px;
     border-width: 1px;
     border-color: #999999;
     border-collapse: collapse;
 }
-table.projectTableStyle th {
+table.build-project-table th {
     background:#b5cfd2;
     border-width: 1px;
     padding: 8px;
@@ -89,7 +89,7 @@ table.projectTableStyle th {
     border-color: #999999;
     text-align: center;
 }
-table.projectTableStyle td {
+table.build-project-table td {
     border-width: 1px;
     padding: 8px;
     border-style: solid;
@@ -99,6 +99,18 @@ table.projectTableStyle td {
 .alignleft {
        float: left;
 }
+
 .alignright {
        float: right;
 }
+
+#signup-form * {
+       text-align: left; 
+       font-size: 12px;
+}
+
+#login-form * {
+       text-align: left; 
+       font-size: 12px;
+}
+