diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 7913509af..6a5cf1762 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -3,6 +3,7 @@ //= require jquery-ui //= require autocomplete-rails //= require vendor +//= require jquery.dataTables_ext //= require_tree ./design //= require_tree ./extra //= require_self diff --git a/app/assets/javascripts/jquery.dataTables_ext.js b/app/assets/javascripts/jquery.dataTables_ext.js new file mode 100644 index 000000000..627b64774 --- /dev/null +++ b/app/assets/javascripts/jquery.dataTables_ext.js @@ -0,0 +1,139 @@ +(function($, window, document, undefined) { + $.extend( $.fn.DataTable.ext.oPagination, { + "will_paginate_like": { + /* + * Function: oPagination.full_numbers.fnInit + * Purpose: Initialise dom elements required for pagination with a list of the pages + * Returns: - + * Inputs: object:oSettings - dataTables settings object + * node:nPaging - the DIV which contains this pagination control + * function:fnCallbackDraw - draw function which must be called on update + */ + "fnInit": function ( oSettings, nPaging, fnCallbackDraw ) { + var oLang = oSettings.oLanguage.oPaginate; + var oClasses = oSettings.oClasses; + var fnClickHandler = function ( e ) { + if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) ) + { + fnCallbackDraw( oSettings ); + } + }; + + $(nPaging).append( + ''+oLang.sPrevious+''+ + ''+ + ''+oLang.sNext+'' + ); + var els = $('a', nPaging); + var nPrev = els[0], + nNext = els[1] + + oSettings.oApi._fnBindAction( nPrev, {action: "previous"}, fnClickHandler ); + oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler ); + + /* ID the first elements only */ + if ( !oSettings.aanFeatures.p ) + { + nPaging.id = oSettings.sTableId+'_paginate'; + nPrev.id =oSettings.sTableId+'_previous'; + nNext.id =oSettings.sTableId+'_next'; + } + }, + + /* + * Function: oPagination.full_numbers.fnUpdate + * Purpose: Update the list of page buttons shows + * Returns: - + * Inputs: object:oSettings - dataTables settings object + * function:fnCallbackDraw - draw function to call on page change + */ + "fnUpdate": function ( oSettings, fnCallbackDraw ) { + if ( !oSettings.aanFeatures.p ) + { + return; + } + + var iPageCount = $.fn.DataTable.ext.oPagination.iFullNumbersShowPages; + var iPageCountHalf = Math.floor(iPageCount / 2); + var iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength); + var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1; + var sList = ""; + var iStartButton, iEndButton, i, iLen; + var oClasses = oSettings.oClasses; + var anButtons, anStatic, nPaginateList; + var an = oSettings.aanFeatures.p; + var fnBind = function (j) { + oSettings.oApi._fnBindAction( this, {"page": j+iStartButton-1}, function(e) { + /* Use the information in the element to jump to the required page */ + oSettings.oApi._fnPageChange( oSettings, e.data.page ); + fnCallbackDraw( oSettings ); + e.preventDefault(); + } ); + }; + + /* Pages calculation */ + if (iPages < iPageCount) + { + iStartButton = 1; + iEndButton = iPages; + } + else if (iCurrentPage <= iPageCountHalf) + { + iStartButton = 1; + iEndButton = iPageCount; + } + else if (iCurrentPage >= (iPages - iPageCountHalf)) + { + iStartButton = iPages - iPageCount + 1; + iEndButton = iPages; + } + else + { + iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1; + iEndButton = iStartButton + iPageCount - 1; + } + + /* Build the dynamic list */ + for ( i=iStartButton ; i<=iEndButton ; i++ ) + { + sList += (iCurrentPage !== i) ? + ''+oSettings.fnFormatNumber(i)+'' : + ''+oSettings.fnFormatNumber(i)+''; + } + + /* Loop over each instance of the pager */ + for ( i=0, iLen=an.length ; i params[:platform_page]) + @platforms = @platforms.paginate(:page => params[:page], :per_page => 20) end def easy_urpmi @@ -35,8 +35,8 @@ class PlatformsController < ApplicationController def show @platform = Platform.find params[:id], :include => :repositories - @repositories = @platform.repositories - @members = @platform.members.uniq + #@repositories = @platform.repositories + #@members = @platform.members.uniq end def new @@ -44,7 +44,7 @@ class PlatformsController < ApplicationController @admin_uname = current_user.uname @admin_id = current_user.id end - + def edit @admin_id = @platform.owner.id @admin_uname = @platform.owner.uname diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 66beed7b7..dbac9d9bf 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -8,6 +8,10 @@ class ProductsController < ApplicationController load_and_authorize_resource :platform load_and_authorize_resource :product, :through => :platform + def index + @products = @products.paginate(:page => params[:page]) + end + def new @product = @platform.products.new @product.ks = DEFAULT_KS diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index f02f49c1b..dafddb715 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -12,9 +12,9 @@ class RepositoriesController < ApplicationController def index if params[:platform_id] - @repositories = Platform.find(params[:platform_id]).repositories.paginate(:page => params[:repository_page]) + @repositories = Platform.find(params[:platform_id]).repositories.paginate(:page => params[:page]) else - @repositories = Repository.paginate(:page => params[:repository_page]) + @repositories = Repository.paginate(:page => params[:page]) end end @@ -60,7 +60,7 @@ class RepositoriesController < ApplicationController else flash[:error] = t('flash.repository.project_not_added') end - redirect_to repository_path(@repository) + redirect_to platform_repository_path(@platform, @repository) else render :projects_list end @@ -96,7 +96,7 @@ class RepositoriesController < ApplicationController def remove_project @project = Project.find(params[:project_id]) ProjectToRepository.where(:project_id => @project.id, :repository_id => @repository.id).destroy_all - redirect_to repository_path(@repository), :notice => t('flash.repository.project_removed') + redirect_to platform_repository_path(@platform, @repository), :notice => t('flash.repository.project_removed') end protected diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b3a9ca42a..1052213cc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -18,6 +18,10 @@ module ApplicationHelper 'right slim' when params[:controller] == 'build_lists' && ['new', 'create'].include?(params[:action]) nil + when params[:controller] == 'platforms' && params[:action] == 'show' + 'right bigpadding' + when params[:controller] == 'platforms' && params[:action] == 'clone' + 'right middlepadding' else content_for?(:sidebar) ? 'right' : 'all' end diff --git a/app/models/user.rb b/app/models/user.rb index 5b269ba30..53dbf1a0f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -112,6 +112,14 @@ class User < ActiveRecord::Base email.downcase == commit.committer.email.downcase end + def owner_of? object + if object.respond_to? :owner + object.owner_id == self.id or self.group_ids.include? object.owner_id + else + false + end + end + private def create_settings_notifier diff --git a/app/views/build_lists/_platform_build_list.html.haml b/app/views/build_lists/_platform_build_list.html.haml new file mode 100644 index 000000000..9a0e1edf5 --- /dev/null +++ b/app/views/build_lists/_platform_build_list.html.haml @@ -0,0 +1,5 @@ +%tr{:id => "row#{build_list_counter}"} + %td= link_to (build_list.bs_id.present? ? build_list.bs_id : t("layout.build_lists.bs_id_not_set")), build_list + %td= build_list.human_status + %td= link_to build_list.project.name, build_list.project + %td= build_list.notified_at diff --git a/app/views/platforms/_form.html.haml b/app/views/platforms/_form.html.haml index 94d9d7770..f3a5082e3 100644 --- a/app/views/platforms/_form.html.haml +++ b/app/views/platforms/_form.html.haml @@ -1,33 +1,29 @@ - unless ['edit', 'update'].include? controller.action_name - .group - = f.label :name, :class => :label - = f.text_field :name, :class => 'text_field' + .leftlist= f.label :name, :class => :label + .rightlist= f.text_field :name, :class => 'text_field' -.group - = f.label :description, :class => :label - = f.text_field :description, :class => 'text_field' +.leftlist= f.label :description, :class => :label +.rightlist= f.text_field :description, :class => 'text_field' - unless ['edit', 'update'].include? controller.action_name - .group - = f.label :distrib_type, :class => :label - = f.select :distrib_type, options_for_select(APP_CONFIG['distr_types']) + .leftlist= f.label :distrib_type, :class => :label + .rightlist= f.select :distrib_type, options_for_select(APP_CONFIG['distr_types']) - .group - = f.label :parent, :class => :label - = f.collection_select :parent_platform_id, Platform.all, :id, :description, :include_blank => true + .leftlist= f.label :parent, :class => :label + .rightlist= f.collection_select :parent_platform_id, Platform.all, :id, :description, :include_blank => true -.group - = f.label :released, :class => :label - = f.check_box :released, :class => 'check_box' +.leftlist= f.label :released, :class => :label +.rightlist= f.check_box :released, :class => 'check_box' -.group - = label_tag "", t("layout.platforms.admin_id"), :class => :label - = autocomplete_field_tag 'admin_id', @admin_uname, autocomplete_user_uname_platforms_path, :id_element => '#admin_id_field' - = hidden_field_tag 'admin_id', @admin_id, :id => 'admin_id_field' - -.group.navform.wat-cf - %button.button{:type => "submit"} - = image_tag("choose.png", :alt => t("layout.save")) - = t("layout.save") +.leftlist= label_tag "", t("layout.platforms.admin_id"), :class => :label +.rightlist= autocomplete_field_tag 'admin_id', @admin_uname, autocomplete_user_uname_platforms_path, :id_element => '#admin_id_field' += hidden_field_tag 'admin_id', @admin_id, :id => 'admin_id_field' +.both + +.button_block + = submit_tag t("layout.clone") + -#%input.button{:type => "submit", :class => "button"} + -#= image_tag("choose.png", :alt => t("layout.save")) + -#= t("layout.clone") %span.text_button_padding= t("layout.or") - = link_to t("layout.cancel"), @platforms_path, :class => "text_button_padding link_button" + = link_to t("layout.cancel"), @platforms_path, :class => "button" diff --git a/app/views/platforms/_list.html.haml b/app/views/platforms/_list.html.haml index 233487bad..4d469ac40 100644 --- a/app/views/platforms/_list.html.haml +++ b/app/views/platforms/_list.html.haml @@ -1,4 +1,22 @@ -%table.table +%table#myTable.tablesorter.platforms{:cellspacing => "0", :cellpadding => "0"} + %thead + %tr + %th.th1= t("activerecord.attributes.platform.name") + %th.th2= t("activerecord.attributes.platform.distrib_type") + %th.th3= t("layout.delete") + %tbody + - @platforms.each do |platform| + %tr{:class => cycle("odd", "even")} + %td + = link_to platform.name, platform_path(platform) + %td + = platform.distrib_type + %td.buttons + - if can? :destroy, platform + = link_to platform_path(platform), :method => :delete, :confirm => t("layout.platforms.confirm_delete") do + %span.delete   + +-#%table.table %tr %th.first= t("activerecord.attributes.platform.name") %th.first= t("activerecord.attributes.platform.distrib_type") diff --git a/app/views/platforms/_sidebar.html.haml b/app/views/platforms/_sidebar.html.haml index ff8060a01..2ef8ac458 100644 --- a/app/views/platforms/_sidebar.html.haml +++ b/app/views/platforms/_sidebar.html.haml @@ -1,4 +1,20 @@ -.block.notice +- act = action_name.to_sym +- contr = controller_name.to_sym + +- content_for :sidebar do + %aside + .admin-preferences + %ul + %li{:class => (act == :show && contr == :platforms) ? 'active' : ''} + = link_to t("layout.platforms.about"), platform_path(@platform) + %li{:class => (contr == :repositories) ? 'active' : ''} + = link_to t("layout.repositories.list_header"), platform_repositories_path(@platform) + %li{:class => (contr == :products) ? 'active' : ''} + = link_to t("layout.products.list_header"), platform_products_path(@platform) + -#- if current_user.owner_of? @platform or current_user.admin? + %li{:class => (act == :index && contr == :private_users) ? 'active' : ''} + = link_to t("layout.platforms.private_users"), platform_private_users_path(@platform) +-#.block.notice %h3= t("layout.groups.members") .content - @platform.members.uniq.each do |member| diff --git a/app/views/platforms/_submenu.html.haml b/app/views/platforms/_submenu.html.haml new file mode 100644 index 000000000..622e52b45 --- /dev/null +++ b/app/views/platforms/_submenu.html.haml @@ -0,0 +1,7 @@ +- content_for :submenu do + - act = action_name.to_sym; contr = controller_name.to_sym + .left= @platform.name + %nav + %ul + - if can? :update, @platform + %li= link_to t("platform_menu.settings"), edit_platform_path(@platform), :class => (act == :edit && contr == :platforms) ? 'active' : nil diff --git a/app/views/platforms/clone.html.haml b/app/views/platforms/clone.html.haml index 9129e8b70..a096fbf08 100644 --- a/app/views/platforms/clone.html.haml +++ b/app/views/platforms/clone.html.haml @@ -1,4 +1,23 @@ -.block += render :partial => 'submenu' += render :partial => 'sidebar' + += form_for @cloned, :url => make_clone_platform_path(@platform), :html => { :class => :form } do |f| + .leftlist= f.label :name, :class => :label + .rightlist= f.text_field :name, :class => 'text_field' + + .leftlist= f.label :description, :class => :label + .rightlist= f.text_field :description, :class => 'text_field' + + .both + + .button_block + = submit_tag t("layout.clone") + -#%input.button{:type => "submit", :class => "button"} + -#= image_tag("choose.png", :alt => t("layout.save")) + -#= t("layout.clone") + %span.text_button_padding= t("layout.or") + = link_to t("layout.cancel"), @platforms_path, :class => "button" +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to "#{t("layout.platforms.list")}", @platforms_path diff --git a/app/views/platforms/edit.html.haml b/app/views/platforms/edit.html.haml index efbea247f..bfabaafbb 100644 --- a/app/views/platforms/edit.html.haml +++ b/app/views/platforms/edit.html.haml @@ -1,4 +1,9 @@ -.block += render :partial => 'submenu' += render :partial => 'sidebar' + += form_for @platform, :url => platform_path(@platform), :html => { :class => :form } do |f| + = render :partial => "form", :locals => {:f => f} +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to t("layout.platforms.list"), platforms_path @@ -10,4 +15,4 @@ .inner = form_for @platform, :url => platform_path(@platform), :html => { :class => :form } do |f| = render :partial => "form", :locals => {:f => f} -- content_for :sidebar, render(:partial => 'sidebar') +-# content_for :sidebar, render(:partial => 'sidebar') diff --git a/app/views/platforms/index.html.haml b/app/views/platforms/index.html.haml index 1bcaa46ca..efc39b219 100644 --- a/app/views/platforms/index.html.haml +++ b/app/views/platforms/index.html.haml @@ -1,35 +1,3 @@ -.block - .secondary-navigation - %ul.wat-cf - %li.first.active= link_to t("layout.platforms.list"), platforms_path - %li= link_to t("layout.platforms.new"), new_platform_path if can? :create, Platform - .content - %h2.title - = t("layout.platforms.list_header") - .inner - = render :partial => 'shared/search_form' - = render :partial => 'platforms/list', :object => @platforms - .actions-bar.wat-cf - .actions - = will_paginate @platforms, :param_name => :platform_page -/.block -/ .secondary-navigation -/ %ul.wat-cf -/ %li.first.active= link_to t("layout.platforms.list"), platforms_path -/ %li= link_to t("layout.platforms.new"), new_platform_path -/ .content -/ %h2.title -/ = t("layout.platforms.list_header") -/ .inner -/ %table.table -/ %tr -/ %th.first= t("activerecord.attributes.platform.name") -/ %th.last   -/ - @platforms.each do |platform| -/ %tr{:class => cycle("odd", "even")} -/ %td -/ = link_to platform.name, platform_path(platform) -/ %td.last -/ #{link_to t("layout.show"), platform_path(platform)} | #{link_to t("layout.delete"), platform_path(platform), :method => :delete, :confirm => t("layout.platforms.confirm_delete")} -/ .actions-bar.wat-cf -/ .actions += link_to t("layout.platforms.new"), new_platform_path, :class => 'button' if can? :create, Platform += render :partial => 'platforms/list', :object => @platforms += will_paginate @platforms diff --git a/app/views/platforms/show.html.haml b/app/views/platforms/show.html.haml index 3622927a5..d5076c630 100644 --- a/app/views/platforms/show.html.haml +++ b/app/views/platforms/show.html.haml @@ -1,4 +1,43 @@ -.block += render :partial => 'submenu' += render :partial => 'sidebar' + +%h3.fix= t("layout.platforms.about") + +%p= @platform.description + +%table.tablesorter.unbordered + - if @platform.parent + %tr + %td + %b= "#{t("activerecord.attributes.platform.parent")}:" + %td= link_to @platform.parent.description, platform_path(@platform.parent) + %tr + %td + %b= "#{t('layout.platforms.owner')}:" + %td= link_to @platform.owner.try(:name), url_for(@platform.owner) + %tr + %td + %b= "#{t('layout.platforms.visibility')}:" + %td= t("layout.visibilities.#{@platform.visibility}") + %tr + %td + %b= "#{t('layout.platforms.platform_type')}:" + %td= @platform.platform_type + %tr + %td + %b= "#{t('layout.platforms.distrib_type')}:" + %td= @platform.distrib_type + +.buttons_block + = link_to t("layout.platforms.build_all"), build_all_platform_path(@platform), :confirm => I18n.t("layout.confirm"), :method => :post, :class => "button left_floated" if can? :build_all, @platform + - if @platform.released? + = link_to t("layout.platforms.unfreeze"), unfreeze_platform_path(@platform), :confirm => I18n.t("layout.platforms.confirm_unfreeze"), :method => :post, :class => "button left_floated" if can? :unfreeze, @platform + - else + = link_to t("layout.platforms.freeze"), freeze_platform_path(@platform), :confirm => I18n.t("layout.platforms.confirm_freeze"), :method => :post, :class => "button left_floated" if can? :freeze, @platform + = link_to "Клонировать", clone_platform_path(@platform), :class => "button left_floated" if can? :clone, @platform + .both + +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to t("layout.platforms.list"), platforms_path @@ -66,8 +105,8 @@ = link_to t("layout.platforms.build_all"), build_all_platform_path(@platform), :confirm => I18n.t("layout.confirm"), :method => :post, :class => "button" if can? :build_all, @platform = link_to t("layout.platforms.edit"), edit_platform_path(@platform), :class => "button" if can? :edit, @platform -%a{ :name => "repositories" } -.block +-#%a{ :name => "repositories" } +-#.block .secondary-navigation %ul.wat-cf %li.first.active= link_to t("layout.repositories.list"), platform_path(@platform) + "#repositories" @@ -91,8 +130,8 @@ .actions-bar.wat-cf .actions -%a{ :name => "producs" } -.block +-#%a{ :name => "producs" } +-#.block .secondary-navigation %ul.wat-cf %li.first.active= link_to t("layout.products.list"), platform_path(@platform) + "#products" @@ -116,4 +155,4 @@ =# (product.can_clone? ? "| #{link_to t("layout.products.clone"), clone_platform_product_path(@platform, product)}" : "").html_safe .actions-bar.wat-cf .actions -- content_for :sidebar, render(:partial => 'sidebar') +-# content_for :sidebar, render(:partial => 'sidebar') diff --git a/app/views/products/_crontab.html.haml b/app/views/products/_crontab.html.haml index 6e3074904..d489ad3ca 100644 --- a/app/views/products/_crontab.html.haml +++ b/app/views/products/_crontab.html.haml @@ -63,9 +63,9 @@ } -.group - = form.check_box :use_cron - = form.label :use_cron +.leftlist= form.label :use_cron +.rightlist= form.check_box :use_cron +.both #genereator_btn %a{ :href => "#" }= t("layout.products.cron_tab_generator.show") @@ -144,7 +144,7 @@ - Date::DAYNAMES.each_with_index do |day, index| %option{ :value => index, :selected => @product.cron_tab_weekdays.include?(index) }= t("layout.weekdays.#{day}") -.group - = form.label :cron_tab, :class => :label - = form.text_field :cron_tab, :id => "cron", :class => "text_field", :style => "width: 40%", :disabled => !@product.use_cron, :value => @product.cron_tab - = @product.cron_command \ No newline at end of file +.leftlist= form.label :cron_tab, :class => :label +.rightlist= form.text_field :cron_tab, :id => "cron", :class => "text_field", :style => "width: 40%", :disabled => !@product.use_cron, :value => @product.cron_tab += @product.cron_command +.both diff --git a/app/views/products/_form.html.haml b/app/views/products/_form.html.haml index 7ab628a35..3fe806e34 100644 --- a/app/views/products/_form.html.haml +++ b/app/views/products/_form.html.haml @@ -1,44 +1,55 @@ -.group - = f.label :name, t("activerecord.attributes.product.name"), :class => :label - = f.text_field :name, :class => 'text_field' -.group - = f.label :build_script, t("activerecord.attributes.product.build_script"), :class => :label - = f.text_area :build_script, :class => 'text_field', :cols => 80 -.group - = f.label :counter, t("activerecord.attributes.product.counter"), :class => :label - = f.text_area :counter, :class => 'text_field', :cols => 80 -.group - = f.label :ks, t("activerecord.attributes.product.ks"), :class => :label - = f.text_area :ks, :class => 'text_field', :cols => 80 -.group - = f.label :menu, t("activerecord.attributes.product.menu"), :class => :label - = f.text_area :menu, :class => 'text_field', :cols => 80 -.group - %p - = f.label :tar, t("activerecord.attributes.product.tar"), :class => :label - = f.file_field :tar, :class => 'file_field' - %p - - if @product.tar? - = link_to @product.tar_file_name, @product.tar.url - = f.check_box :delete_tar - = f.label :delete_tar, t('layout.delete') +.leftlist= f.label :name, t("activerecord.attributes.product.name"), :class => :label +.rightlist= f.text_field :name, :class => 'text_field' +.both -.group - = render :partial => "products/crontab", :locals => { :form => f } +.leftlist= f.label :description, t("activerecord.attributes.product.description"), :class => :label +.rightlist= f.text_area :description, :class => 'text_field', :cols => 80 +.both + +.leftlist= f.label :build_script, t("activerecord.attributes.product.build_script"), :class => :label +.rightlist= f.text_area :build_script, :class => 'text_field', :cols => 80 +.both + +.leftlist= f.label :counter, t("activerecord.attributes.product.counter"), :class => :label +.rightlist= f.text_area :counter, :class => 'text_field', :cols => 80 +.both + +.leftlist= f.label :ks, t("activerecord.attributes.product.ks"), :class => :label +.rightlist= f.text_area :ks, :class => 'text_field', :cols => 80 +.both + +.leftlist= f.label :menu, t("activerecord.attributes.product.menu"), :class => :label +.rightlist= f.text_area :menu, :class => 'text_field', :cols => 80 +.both + +%p + .leftlist= f.label :tar, t("activerecord.attributes.product.tar"), :class => :label + .rightlist= f.file_field :tar, :class => 'file_field' + .both +%p +- if @product.tar? + .leftlist= link_to @product.tar_file_name, @product.tar.url + .both + %br + .leftlist= f.label :delete_tar, t('layout.delete') + .rightlist= f.check_box :delete_tar + .both + += render :partial => "products/crontab", :locals => { :form => f } -.group - = f.label :is_template, :class => :label - = f.check_box :is_template, :class => 'check_box' +.leftlist= f.label :is_template, :class => :label +.rightlist= f.check_box :is_template, :class => 'check_box' - content_for :commented do - .group - = f.label :system_wide, :class => :label - = f.check_box :system_wide, :class => 'check_box' + .leftlist= f.label :system_wide, :class => :label + .rightlist= f.check_box :system_wide, :class => 'check_box' -.group.navform.wat-cf - %button.button{:type => "submit"} - = image_tag("choose.png", :alt => t("layout.save")) - = t("layout.save") +.both +.button_block + = submit_tag t("layout.save") + -#%input.button{:type => "submit", :class => "button"} + -#= image_tag("choose.png", :alt => t("layout.save")) + -#= t("layout.clone") %span.text_button_padding= t("layout.or") - = link_to t("layout.cancel"), platform_path(@platform), :class => "text_button_padding link_button" + = link_to t("layout.cancel"), platform_path(@platform), :class => "button" diff --git a/app/views/products/_list.html.haml b/app/views/products/_list.html.haml new file mode 100644 index 000000000..0ee555749 --- /dev/null +++ b/app/views/products/_list.html.haml @@ -0,0 +1,14 @@ +%table#myTable.tablesorter.platform-products{:cellspacing => "0", :cellpadding => "0"} + %thead + %tr + %th.th1= t("activerecord.attributes.product.name") + %th= t("layout.delete") + %tbody + - @products.each do |product| + %tr{:class => cycle("odd", "even")} + %td + = link_to product.name, platform_product_path(@platform, product) + %td.buttons + - if can? :destroy, product + = link_to platform_product_path(@platform, product), :method => :delete, :confirm => t("layout.products.confirm_delete") do + %span.delete   diff --git a/app/views/products/edit.html.haml b/app/views/products/edit.html.haml index 0f5e6bc01..894e6f87f 100644 --- a/app/views/products/edit.html.haml +++ b/app/views/products/edit.html.haml @@ -1,4 +1,15 @@ -.block += render :partial => 'platforms/submenu' += render :partial => 'platforms/sidebar' + +%h3 + = t("layout.products.edit_header") + = link_to @product.name, platform_product_path(@platform, @product) +%br + += form_for [@platform, @product], :html => { :class => :form, :multipart => true } do |f| + = render :partial => "form", :locals => {:f => f} + +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to @platform.name, platform_path(@platform) + "#products" diff --git a/app/views/products/index.html.haml b/app/views/products/index.html.haml new file mode 100644 index 000000000..012bb8d39 --- /dev/null +++ b/app/views/products/index.html.haml @@ -0,0 +1,6 @@ += render :partial => 'platforms/submenu' if params[:platform_id] += render :partial => 'platforms/sidebar' if params[:platform_id] += link_to t("layout.products.new"), new_platform_product_path(@platform), :class => 'button' if can? :create, @platform.products.build += render :partial => 'list', :object => @products += will_paginate @products + diff --git a/app/views/products/new.html.haml b/app/views/products/new.html.haml index 6e226404e..b805fead7 100644 --- a/app/views/products/new.html.haml +++ b/app/views/products/new.html.haml @@ -1,4 +1,10 @@ -.block += render :partial => 'platforms/submenu' += render :partial => 'platforms/sidebar' + += form_for [@platform, @product], :html => { :class => :form, :multipart => true } do |f| + = render :partial => "form", :locals => {:f => f} + +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to @platform.name, platform_path(@platform) + "#products" diff --git a/app/views/products/show.html.haml b/app/views/products/show.html.haml index f61124ea8..7543a439e 100644 --- a/app/views/products/show.html.haml +++ b/app/views/products/show.html.haml @@ -1,4 +1,32 @@ -.block += render :partial => 'platforms/submenu' += render :partial => 'platforms/sidebar' + +%h3= "#{t("layout.products.about")} #{@product.name}" + +%p= @product.description + +.buttons_block + - if can? :update, @product + = link_to image_tag("code.png", :alt => t("layout.edit")) + " " + t("layout.edit"), edit_platform_product_path(@platform, @product), :class => "button" + - if can? :destroy, @product + = link_to image_tag("x.png", :alt => t("layout.delete")) + " " + t("layout.delete"), platform_product_path(@platform, @product), :method => "delete", :class => "button", :confirm => t("layout.products.confirm_delete") + -# if @product.can_clone? + =# link_to t("layout.products.clone"), clone_platform_product_path(@platform, @product), :class => "button" + - if can?(:create, @product => ProductBuildList) + = link_to t("layout.products.build"), platform_product_product_build_lists_path(@platform, @product), :class => "button", :method => 'post', :confirm => t("layout.confirm") + +%h3= t("layout.products.build_lists_monitoring") + +%table#myTable.tablesorter.platform-product-main{:cellspacing => "0", :cellpadding => "0"} + %thead + %tr + %th.th1= t("activerecord.attributes.product_build_list.id") + %th.th2= t("activerecord.attributes.product_build_list.status") + %th.th3= t("layout.product_build_lists.action") + %th.th4= t("activerecord.attributes.product_build_list.notified_at") + %tbody + = render @product.product_build_lists.default_order +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to @platform.name, platform_path(@platform) + "#products" @@ -35,7 +63,7 @@ - if can?(:create, @product => ProductBuildList) = link_to t("layout.products.build"), platform_product_product_build_lists_path(@platform, @product), :class => "button", :method => 'post', :confirm => t("layout.confirm") -.block +-#.block .content .inner %table.table diff --git a/app/views/repositories/_form.html.haml b/app/views/repositories/_form.html.haml index 8296174a9..95ee827e1 100644 --- a/app/views/repositories/_form.html.haml +++ b/app/views/repositories/_form.html.haml @@ -1,14 +1,15 @@ -.group - = f.label :name, t("activerecord.attributes.repository.name"), :class => :label - = f.text_field :name, :class => 'text_field' -.group - = f.label :description, t("activerecord.attributes.repository.description"), :class => :label - = f.text_field :description, :class => 'text_field' +.leftlist= f.label :name, t("activerecord.attributes.repository.name"), :class => :label +.rightlist= f.text_field :name, :class => 'text_field' -.group.navform.wat-cf - %button.button{:type => "submit"} - = image_tag("choose.png", :alt => t("layout.save")) - = t("layout.save") +.leftlist= f.label :description, t("activerecord.attributes.repository.description"), :class => :label +.rightlist= f.text_field :description, :class => 'text_field' + +.both + +.button_block + = submit_tag t("layout.save") + -#%input.button{:type => "submit", :class => "button"} + -#= image_tag("choose.png", :alt => t("layout.save")) + -#= t("layout.clone") %span.text_button_padding= t("layout.or") - = link_to t("layout.cancel"), @repositories_path + "#repositories", :class => "text_button_padding link_button" - + = link_to t("layout.cancel"), @repositories_path, :class => "button" diff --git a/app/views/repositories/_list.html.haml b/app/views/repositories/_list.html.haml index 581f705d3..f1df53f26 100644 --- a/app/views/repositories/_list.html.haml +++ b/app/views/repositories/_list.html.haml @@ -1,4 +1,21 @@ -%table.table +%table#myTable.tablesorter.platform-repos{:cellspacing => "0", :cellpadding => "0"} + %thead + %tr + %th.th1= t("activerecord.attributes.repository.name") + %th.th2= t("layout.repositories.projects") + %th= t("layout.delete") + %tbody + - @repositories.each do |repository| + %tr{:class => cycle("odd", "even")} + %td + = link_to repository.name, platform_repository_path(@platform, repository) + %td + = repository.projects.count + %td.buttons + - if can? :destroy, repository + = link_to platform_repository_path(@platform, repository), :method => :delete, :confirm => t("layout.repositories.confirm_delete") do + %span.delete   +-#%table.table %tr %th.first= t("activerecord.attributes.repository.name") %th.last   diff --git a/app/views/repositories/_proj_list.html.haml b/app/views/repositories/_proj_list.html.haml index 1635b5a0c..e4aeda913 100644 --- a/app/views/repositories/_proj_list.html.haml +++ b/app/views/repositories/_proj_list.html.haml @@ -1,18 +1,19 @@ - columns = [{:type => 'html', :searchable => false}, {:type => 'html'}, {:type => nil, :sortable => false, :searchable => false}] = raw datatable(columns, {:sort_by => "[1, 'asc']", :search_label => t("layout.search_by_name"), :processing => t("layout.processing"), - :pagination_labels => {:first => t("datatables.first_label"), :previous => t("datatables.previous_label"), - :next => t("datatables.next_label"), :last => t("datatables.last_label")}, + :pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")}, :empty_label => t("datatables.empty_label"), :info_label => t("datatables.info_label"), :info_empty_label => t("datatables.info_empty_label"), :filtered_label => t("datatables.filtered_label"), + :table_dom_id => 'datatable', + :auto_width => 'false', :ajax_source => "#{url_for :controller => :repositories, :action => :projects_list, :id => @repository.id}" }) -%table.table.datatable +%table#datatable.tablesorter.repo-projects{:cellspacing => 0, :cellpadding => 0} %thead %tr - %th.first{:style => 'width: 80px'}= t("activerecord.attributes.user.uname") - %th= t("activerecord.attributes.project.name") - %th.last   + %th.th1= t("activerecord.attributes.user.uname") + %th.th2= t("activerecord.attributes.project.name") + %th.buttons   %tbody %br diff --git a/app/views/repositories/_proj_list1.html.haml b/app/views/repositories/_proj_list1.html.haml index c548783b5..0033945f2 100644 --- a/app/views/repositories/_proj_list1.html.haml +++ b/app/views/repositories/_proj_list1.html.haml @@ -1,6 +1,15 @@ -%table.table +%table#myTable.tablesorter.repo-projects{:cellpadding => "0", :cellspacing => "0"} + %thead + %tr + %th.th1= t("activerecord.attributes.project.name") + %th.th2= t("activerecord.attributes.project.description") + %th.th3= t("layout.remove") + %tbody= render :partial => 'repositories/project', :collection => @projects + +-#%table.tablesorter %tr %th.first= t("activerecord.attributes.project.name") + %th. %th.last   - @projects.each do |project| %tr{:class => cycle("odd", "even")} diff --git a/app/views/repositories/_project.html.haml b/app/views/repositories/_project.html.haml new file mode 100644 index 000000000..c7fc27f63 --- /dev/null +++ b/app/views/repositories/_project.html.haml @@ -0,0 +1,10 @@ +%tr{:id => "Row#{project_counter}", :class => cycle('odd', 'even')} + %td + = link_to project do + .table-sort-left= image_tag visibility_icon(project.visibility) + .table-sort-right #{project.owner.uname} / #{project.name} + %td.td2 + %span= project.description + %td.buttons + = link_to remove_project_repository_path(@repository, :project_id => project.id), :method => :delete, :confirm => t("layout.confirm") do + %span.delete   diff --git a/app/views/repositories/index.html.haml b/app/views/repositories/index.html.haml index 8a56a4eb9..af5862e23 100644 --- a/app/views/repositories/index.html.haml +++ b/app/views/repositories/index.html.haml @@ -1,4 +1,9 @@ -.block += render :partial => 'platforms/submenu' if params[:platform_id] += render :partial => 'platforms/sidebar' if params[:platform_id] += link_to t("layout.repositories.new"), new_platform_repository_path(@platform), :class => 'button' if can? :create, @platform.repositories.build += render :partial => 'list', :object => @repositories += will_paginate @repositories +-#.block .secondary-navigation %ul.wat-cf %li.first.active= link_to t("layout.repositories.list"), repositories_path diff --git a/app/views/repositories/new.html.haml b/app/views/repositories/new.html.haml index 36708efde..c2839a5d0 100644 --- a/app/views/repositories/new.html.haml +++ b/app/views/repositories/new.html.haml @@ -1,4 +1,12 @@ -.block += render :partial => 'platforms/submenu' += render :partial => 'platforms/sidebar' + +%h3= t("layout.repositories.new_header") + += form_for :repository, :url => @repositories_path, :html => { :class => :form } do |f| + = render :partial => "form", :locals => {:f => f} + +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to t("layout.repositories.list"), @repositories_path + "#platforms" diff --git a/app/views/repositories/projects_list.html.haml b/app/views/repositories/projects_list.html.haml index cf23f82ca..65417f86c 100644 --- a/app/views/repositories/projects_list.html.haml +++ b/app/views/repositories/projects_list.html.haml @@ -1,45 +1,6 @@ -.block - .secondary-navigation - %ul.wat-cf - %li.first= link_to t("layout.repositories.list"), @repositories_path + "#repositories" - %li= link_to t("layout.repositories.new"), @new_repository_path - %li.active= link_to t("layout.repositories.show"), repository_path(@repository) - .content - .inner - %p - %b - = t("activerecord.attributes.repository.name") - \: - = @repository.name - %p - %b - = t("activerecord.attributes.repository.description") - \: - = @repository.description - %p - %b - = t("activerecord.attributes.repository.platform") - \: - = link_to @repository.platform.description, url_for(@repository.platform) - .wat-cf - = link_to image_tag("x.png", :alt => t("layout.delete")) + " " + t("layout.delete"), @repository_path, :method => "delete", :class => "button", :confirm => t("layout.repositories.confirm_delete") += render :partial => 'platforms/submenu' += render :partial => 'platforms/sidebar' -%a{ :name => "projects" } -.block - .secondary-navigation - %ul.wat-cf - %li.first= link_to t("layout.projects.list"), repository_path(@repository) + "#projects" - %li.active= link_to t("layout.projects.add"), url_for(:controller => :repositories, :action => :add_project) - .content - %h2.title - = t("layout.projects.list_header") - .inner - -#= render :partial => 'shared/search_form' - = render :partial => 'proj_list', :object => @projects - -#.actions-bar.wat-cf - .actions - = will_paginate @projects, :param_name => :project_page - - --# content_for :sidebar, render(:partial => 'sidebar') +%h3= "#{t("layout.repositories.add_project_to")}: #{@repository.name}" += render :partial => 'proj_list', :object => @projects diff --git a/app/views/repositories/show.html.haml b/app/views/repositories/show.html.haml index c74d00bd1..8e8bc60f0 100644 --- a/app/views/repositories/show.html.haml +++ b/app/views/repositories/show.html.haml @@ -1,4 +1,17 @@ -.block += render :partial => 'platforms/submenu' += render :partial => 'platforms/sidebar' + +%h3.fix= "#{t("layout.repositories.about")}: #{@repository.name}" + +%p= @platform.description + +%br +%br +%h3.fix= t("layout.projects.list_header") += link_to t("layout.projects.add"), add_project_repository_path(@repository), :class => 'button' + += render :partial => 'proj_list1', :object => @projects +-#.block .secondary-navigation %ul.wat-cf %li.first= link_to t("layout.repositories.list"), @repositories_path + "#repositories" @@ -24,8 +37,8 @@ .wat-cf = link_to image_tag("x.png", :alt => t("layout.delete")) + " " + t("layout.delete"), @repository_path, :method => "delete", :class => "button", :confirm => t("layout.repositories.confirm_delete") if can? :destroy, @repository -%a{ :name => "projects" } -.block +-#%a{ :name => "projects" } +-#.block .secondary-navigation %ul.wat-cf %li.first.active= link_to t("layout.projects.list"), repository_path(@repository) + "#projects" diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb index 11203b486..a5fa28d3b 100644 --- a/config/initializers/load_config.rb +++ b/config/initializers/load_config.rb @@ -24,3 +24,6 @@ types = [ types.each do |type| MIME::Types.add MIME::Type.from_array(type) end + +# load datatables plugin +require Rails.root.join("lib/rails_datatables") diff --git a/config/locales/layout.en.yml b/config/locales/layout.en.yml index b8779b053..b114e1f26 100644 --- a/config/locales/layout.en.yml +++ b/config/locales/layout.en.yml @@ -11,3 +11,7 @@ en: read_write_access: read & write by: by + + visibilities: + open: open + hidden: hidden diff --git a/config/locales/layout.ru.yml b/config/locales/layout.ru.yml index 52e4c78eb..dc7b04ccd 100644 --- a/config/locales/layout.ru.yml +++ b/config/locales/layout.ru.yml @@ -11,3 +11,7 @@ ru: read_write_access: чтение и запись by: '' + + visibilities: + open: открытая + hidden: скрытая diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 3736e6cb6..3d425bd3c 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -26,4 +26,6 @@ en: tracker: Tracker wiki: Wiki readme: Readme - settings: Settings \ No newline at end of file + settings: Settings + platform_menu: + settings: Settings diff --git a/config/locales/menu.ru.yml b/config/locales/menu.ru.yml index 2a56ac703..48f1f9be7 100644 --- a/config/locales/menu.ru.yml +++ b/config/locales/menu.ru.yml @@ -26,4 +26,6 @@ ru: tracker: Трекер wiki: Wiki readme: Readme - settings: Настройки \ No newline at end of file + settings: Настройки + platform_menu: + settings: Настройки diff --git a/config/locales/models/platform.en.yml b/config/locales/models/platform.en.yml index 4025ff4b8..e833f1ceb 100644 --- a/config/locales/models/platform.en.yml +++ b/config/locales/models/platform.en.yml @@ -6,6 +6,7 @@ en: list: List new: Create edit: Edit + about: About platform new_header: New platform edit_header: Edit list_header: Platforms @@ -22,7 +23,7 @@ en: freeze: Freeze unfreeze: Unfeeze confirm_freeze: Are you sure to freeze this platform? - confirm_freeze: Are you sure to clone this platform? + confirm_clone: Are you sure to clone this platform? confirm_unfreeze: Are you sure to defrost this platform? released_suffix: (released) confirm_delete: Are you sure to delete this platform? diff --git a/config/locales/models/platform.ru.yml b/config/locales/models/platform.ru.yml index 3aecfc0a9..26cf1ab0d 100644 --- a/config/locales/models/platform.ru.yml +++ b/config/locales/models/platform.ru.yml @@ -6,6 +6,7 @@ ru: list: Список new: Создать edit: Редактировать + about: О платформе new_header: Новая платформа edit_header: Редактировать list_header: Платформы @@ -22,7 +23,7 @@ ru: freeze: Заморозить unfreeze: Разморозить confirm_freeze: Вы уверены, что хотите заморозить эту платформу? - confirm_freeze: Вы уверены, что хотите клонировать эту платформу? + confirm_clone: Вы уверены, что хотите клонировать эту платформу? confirm_unfreeze: Вы уверены, что хотите разморозить эту платформу? released_suffix: (выпущена) confirm_delete: Вы уверены, что хотите удалить эту платформу? diff --git a/config/locales/models/product.en.yml b/config/locales/models/product.en.yml index 5670d6618..4a64ab00c 100644 --- a/config/locales/models/product.en.yml +++ b/config/locales/models/product.en.yml @@ -2,6 +2,8 @@ en: layout: products: list: List + about: About product + build_lists_monitoring: Build lists monitoring new: New product list_header: Products clone: Clone diff --git a/config/locales/models/product.ru.yml b/config/locales/models/product.ru.yml index d53a389d9..a845b4990 100644 --- a/config/locales/models/product.ru.yml +++ b/config/locales/models/product.ru.yml @@ -2,6 +2,8 @@ ru: layout: products: list: Список + about: О продукте + build_lists_monitoring: Мониторинг сборочных заданий new: Новый продукт list_header: Продукты clone: Клонировать diff --git a/config/locales/models/repository.en.yml b/config/locales/models/repository.en.yml index ccfa02b8d..a61759cbe 100644 --- a/config/locales/models/repository.en.yml +++ b/config/locales/models/repository.en.yml @@ -1,7 +1,9 @@ en: layout: repositories: + add_project_to: Add project to repository list: List + about: About repository list_header: Repositories new: New repository new_header: New repository diff --git a/config/locales/models/repository.ru.yml b/config/locales/models/repository.ru.yml index 87bca736f..b666334db 100644 --- a/config/locales/models/repository.ru.yml +++ b/config/locales/models/repository.ru.yml @@ -1,7 +1,9 @@ ru: layout: repositories: + add_project_to: Добавить проект к репозиторию list: Список + about: О репозитории list_header: Репозитории new: Новый репозиторий new_header: Новый репозиторий diff --git a/config/locales/ru.yml b/config/locales/ru.yml index ac0c8e33c..f516a5995 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -5,8 +5,8 @@ ru: page_gap: ... datatables: - previous_label: ‹ Пред. - next_label: След. › + previous_label: ‹ Предыдущая + next_label: Следующая › first_label: « Первая last_label: Последняя » empty_label: Нет доступных данных diff --git a/config/routes.rb b/config/routes.rb index e8382f7fe..5c9fd705f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -164,7 +164,7 @@ Rosa::Application.routes.draw do resources :repositories do member do get :add_project - get :remove_project + delete :remove_project get :projects_list end end diff --git a/db/migrate/20120314162313_add_description_to_products.rb b/db/migrate/20120314162313_add_description_to_products.rb new file mode 100644 index 000000000..3a54c661a --- /dev/null +++ b/db/migrate/20120314162313_add_description_to_products.rb @@ -0,0 +1,10 @@ +class AddDescriptionToProducts < ActiveRecord::Migration + def self.up + add_column :products, :description, :text + execute "UPDATE products SET description = name" + end + + def self.down + remove_column :products, :description + end +end diff --git a/db/schema.rb b/db/schema.rb index f33c79ae4..2b8fc29b9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120306212914) do +ActiveRecord::Schema.define(:version => 20120314162313) do create_table "activity_feeds", :force => true do |t| t.integer "user_id", :null => false @@ -23,8 +23,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do create_table "arches", :force => true do |t| t.string "name", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end add_index "arches", ["name"], :name => "index_arches_on_name", :unique => true @@ -33,8 +33,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "user_id" t.string "provider" t.string "uid" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end add_index "authentications", ["provider", "uid"], :name => "index_authentications_on_provider_and_uid", :unique => true @@ -45,8 +45,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "arch_id" t.integer "pl_id" t.integer "bpl_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "build_list_items", :force => true do |t| @@ -54,8 +54,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "level" t.integer "status" t.integer "build_list_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.string "version" end @@ -69,8 +69,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "project_id" t.integer "arch_id" t.datetime "notified_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.boolean "is_circle", :default => false t.text "additional_repos" t.string "name" @@ -93,16 +93,16 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "name" t.string "ancestry" t.integer "projects_count", :default => 0, :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "comments", :force => true do |t| t.string "commentable_type" t.integer "user_id" t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.decimal "commentable_id", :precision => 50, :scale => 0 t.integer "project_id" end @@ -111,8 +111,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "name", :null => false t.integer "project_id", :null => false t.integer "owner_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "delayed_jobs", :force => true do |t| @@ -124,8 +124,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.datetime "locked_at" t.datetime "failed_at" t.string "locked_by" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.string "queue" end @@ -137,8 +137,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "distro" t.string "platform" t.integer "counter", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "event_logs", :force => true do |t| @@ -153,14 +153,14 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "controller" t.string "action" t.text "message" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "groups", :force => true do |t| t.integer "owner_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.string "uname" t.integer "own_projects_count", :default => 0, :null => false t.text "description" @@ -173,8 +173,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "title" t.text "body" t.string "status", :default => "open" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.integer "creator_id" t.datetime "closed_at" t.integer "closed_by" @@ -205,8 +205,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "description" t.string "name" t.integer "parent_platform_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.boolean "released", :default => false t.integer "owner_id" t.string "owner_type" @@ -219,8 +219,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "platform_id" t.string "login" t.string "password" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.integer "user_id" end @@ -228,8 +228,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "product_id" t.integer "status", :default => 2, :null => false t.datetime "notified_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end add_index "product_build_lists", ["product_id"], :name => "index_product_build_lists_on_product_id" @@ -239,8 +239,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.integer "platform_id", :null => false t.integer "build_status", :default => 2, :null => false t.string "build_path" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.text "build_script" t.text "counter" t.text "ks" @@ -253,6 +253,7 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.boolean "system_wide", :default => false t.text "cron_tab" t.boolean "use_cron", :default => false + t.text "description" end create_table "project_imports", :force => true do |t| @@ -260,8 +261,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "name" t.string "version" t.datetime "file_mtime" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.integer "platform_id" end @@ -270,14 +271,14 @@ ActiveRecord::Schema.define(:version => 20120306212914) do create_table "project_to_repositories", :force => true do |t| t.integer "project_id" t.integer "repository_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end create_table "projects", :force => true do |t| t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.integer "owner_id" t.string "owner_type" t.string "visibility", :default => "open" @@ -303,30 +304,29 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "token" t.boolean "approved", :default => false t.boolean "rejected", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.string "interest" t.text "more" end add_index "register_requests", ["email"], :name => "index_register_requests_on_email", :unique => true, :case_sensitive => false - add_index "register_requests", ["token"], :name => "index_register_requests_on_token", :unique => true, :case_sensitive => false create_table "relations", :force => true do |t| t.integer "object_id" t.string "object_type" t.integer "target_id" t.string "target_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.string "role" end create_table "repositories", :force => true do |t| t.string "description", :null => false t.integer "platform_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.string "name", :null => false end @@ -334,8 +334,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.string "name", :null => false t.integer "arch_id", :null => false t.integer "project_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" end add_index "rpms", ["project_id", "arch_id"], :name => "index_rpms_on_project_id_and_arch_id" @@ -348,8 +348,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do t.boolean "new_comment_reply", :default => true t.boolean "new_issue", :default => true t.boolean "issue_assign", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.boolean "new_comment_commit_owner", :default => true t.boolean "new_comment_commit_repo_owner", :default => true t.boolean "new_comment_commit_commentor", :default => true @@ -358,8 +358,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do create_table "subscribes", :force => true do |t| t.string "subscribeable_type" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.boolean "status", :default => true t.integer "project_id" t.decimal "subscribeable_id", :precision => 50, :scale => 0 @@ -367,18 +367,18 @@ ActiveRecord::Schema.define(:version => 20120306212914) do create_table "users", :force => true do |t| t.string "name" - t.string "email", :default => "", :null => false - t.string "encrypted_password", :default => "", :null => false + t.string "email", :default => "", :null => false + t.string "encrypted_password", :limit => 128, :default => "", :null => false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" t.text "ssh_key" t.string "uname" t.string "role" - t.string "language", :default => "en" - t.integer "own_projects_count", :default => 0, :null => false + t.string "language", :default => "en" + t.integer "own_projects_count", :default => 0, :null => false t.text "professional_experience" t.string "site" t.string "company" diff --git a/vendor/plugins/rails_datatables/init.rb b/lib/rails_datatables.rb similarity index 53% rename from vendor/plugins/rails_datatables/init.rb rename to lib/rails_datatables.rb index 2ab09eb51..ac2cdf3af 100644 --- a/vendor/plugins/rails_datatables/init.rb +++ b/lib/rails_datatables.rb @@ -1,2 +1,3 @@ # -*- encoding : utf-8 -*- +require Rails.root.join('lib/rails_datatables/rails_datatables') ActionView::Base.send :include, RailsDatatables diff --git a/vendor/plugins/rails_datatables/MIT-LICENSE b/lib/rails_datatables/MIT-LICENSE similarity index 100% rename from vendor/plugins/rails_datatables/MIT-LICENSE rename to lib/rails_datatables/MIT-LICENSE diff --git a/vendor/plugins/rails_datatables/README.md b/lib/rails_datatables/README.md similarity index 100% rename from vendor/plugins/rails_datatables/README.md rename to lib/rails_datatables/README.md diff --git a/vendor/plugins/rails_datatables/lib/rails_datatables.rb b/lib/rails_datatables/rails_datatables.rb similarity index 97% rename from vendor/plugins/rails_datatables/lib/rails_datatables.rb rename to lib/rails_datatables/rails_datatables.rb index e562db479..b5007bd7b 100644 --- a/vendor/plugins/rails_datatables/lib/rails_datatables.rb +++ b/lib/rails_datatables/rails_datatables.rb @@ -60,7 +60,7 @@ module RailsDatatables "sProcessing": '#{processing}' }, - "sPaginationType": "full_numbers", + "sPaginationType": "will_paginate_like", "iDisplayLength": #{per_page}, "bProcessing": true, "bServerSide": #{server_side}, @@ -81,6 +81,8 @@ module RailsDatatables } ); } })#{append}; + + $('#datatable_wrapper').append("
"); }); } diff --git a/vendor/assets/javascripts/vendor.js b/vendor/assets/javascripts/vendor.js index 28dc4921a..35d3e2aaf 100644 --- a/vendor/assets/javascripts/vendor.js +++ b/vendor/assets/javascripts/vendor.js @@ -2,6 +2,7 @@ //= require gollum/gollum.dialog //= require gollum/gollum.placeholder //= require gollum/editor/gollum.editor +//= require jquery.dataTables //= require codemirror //= require codemirror/runmode //= require_tree ./codemirror/modes diff --git a/vendor/plugins/rails_datatables/Rakefile b/vendor/plugins/rails_datatables/Rakefile deleted file mode 100644 index 6be4ee971..000000000 --- a/vendor/plugins/rails_datatables/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the rails_datatables plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the rails_datatables plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'RailsDatatables' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/vendor/plugins/rails_datatables/install.rb b/vendor/plugins/rails_datatables/install.rb deleted file mode 100644 index c447292d8..000000000 --- a/vendor/plugins/rails_datatables/install.rb +++ /dev/null @@ -1,2 +0,0 @@ -# -*- encoding : utf-8 -*- -# Install hook code here diff --git a/vendor/plugins/rails_datatables/uninstall.rb b/vendor/plugins/rails_datatables/uninstall.rb deleted file mode 100644 index f6e78fdab..000000000 --- a/vendor/plugins/rails_datatables/uninstall.rb +++ /dev/null @@ -1,2 +0,0 @@ -# -*- encoding : utf-8 -*- -# Uninstall hook code here