Merge pull request #299 from warpc/279-new_design_for_platforms

[Refs #279] new design for platforms
This commit is contained in:
Vladimir Sharshov 2012-03-14 13:22:10 -07:00
commit 8acb512a2e
56 changed files with 746 additions and 290 deletions

View File

@ -3,6 +3,7 @@
//= require jquery-ui //= require jquery-ui
//= require autocomplete-rails //= require autocomplete-rails
//= require vendor //= require vendor
//= require jquery.dataTables_ext
//= require_tree ./design //= require_tree ./design
//= require_tree ./extra //= require_tree ./extra
//= require_self //= require_self

View File

@ -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(
'<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPagePrevious+'">'+oLang.sPrevious+'</a>'+
'<span></span>'+
'<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageNext+'">'+oLang.sNext+'</a>'
);
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) ?
'<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+'">'+oSettings.fnFormatNumber(i)+'</a>' :
'<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButtonActive+'">'+oSettings.fnFormatNumber(i)+'</a>';
}
/* Loop over each instance of the pager */
for ( i=0, iLen=an.length ; i<iLen ; i++ )
{
if ( an[i].childNodes.length === 0 )
{
continue;
}
/* Build up the dynamic list forst - html and listeners */
$('span:eq(0)', an[i])
.html( sList )
.children('a').each( fnBind );
/* Update the premanent botton's classes */
anButtons = an[i].getElementsByTagName('a');
anStatic = [
anButtons[0], anButtons[anButtons.length-1]
];
$(anStatic).removeClass( oClasses.sPageButton+" "+oClasses.sPageButtonActive+" "+oClasses.sPageButtonStaticDisabled );
$([anStatic[0]]).addClass(
(iCurrentPage==1) ?
oClasses.sPageButtonStaticDisabled :
oClasses.sPageButton
);
$([anStatic[1]]).addClass(
(iPages===0 || iCurrentPage===iPages || oSettings._iDisplayLength===-1) ?
oClasses.sPageButtonStaticDisabled :
oClasses.sPageButton
);
}
}
}
} );
}(jQuery, window, document, undefined));

View File

@ -443,4 +443,118 @@ table.wiki .history .td2 .name span.username {
width: 164px; width: 164px;
} }
table.tablesorter.platforms .th1 {
width: 290px;
}
table.tablesorter.platforms .th2 {
width: 280px;
}
table.tablesorter tr td.buttons {
text-align: center;
}
table.tablesorter tr td.buttons a span.delete {
background: image-url('x.png') no-repeat 0 0 transparent;
width: 12px;
display: inline-block;
}
#fork-and-edit {display:block;} #fork-and-edit {display:block;}
a.button.left_floated {
display: inline-block;
float: left;
margin-right: 5px;
}
div.buttons_block {
margin-top: 20px;
}
table.tablesorter.unbordered {
border: none;
}
table.tablesorter.unbordered tr td {
border: none;
padding: 3px;
}
table.tablesorter.repo-projects th.th1 {
width: 250px;
}
table.tablesorter.repo-projects th.th3 {
width: 60px;
}
table.tablesorter.repo-projects td.td2,
.table-sort-right {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
div.dataTables_filter {
margin-bottom: 15px;
}
div.dataTables_paginate {
float: left;
}
div.dataTables_info {
float: right;
}
div.dataTables_info,
div.dataTables_paginate.paging_will_paginate_like {
margin-top: 15px;
}
div.dataTables_paginate.paging_will_paginate_like a.paginate_button,
div.dataTables_paginate.paging_will_paginate_like a.paginate_active {
background: none repeat scroll 0 0 #EDEDED;
color: #4C90D0 !important;
border: 1px solid #DDDDDD;
border-radius: 1px 1px 1px 1px;
padding: 3px 7px;
margin-right: 3px;
cursor: pointer;
}
div.dataTables_paginate.paging_will_paginate_like a.paginate_button_disabled,
div.dataTables_paginate.paging_will_paginate_like a.paginate_active {
color: #565657 !important;
cursor: default;
}
div.dataTables_paginate.paging_will_paginate_like a.paginate_button_disabled:hover,
div.dataTables_paginate.paging_will_paginate_like a.paginate_active:hover {
text-decoration: none;
}
div.dataTables_paginate.paging_will_paginate_like a.previous {
margin-left: 0px;
margin-right: 4px;
}
div.dataTables_paginate.paging_will_paginate_like a.next {
margin-left: 1px;
margin-right: 0px;
}
div.dataTables_paginate.paging_will_paginate_like a.paginate_active {
background: none repeat scroll 0 0 #D5E7F9;
border: 1px solid #C1DAED;
}
div.dataTables_processing {
z-index: 999;
}
div.rightlist textarea {
resize: none;
}

View File

@ -14,7 +14,7 @@ class PlatformsController < ApplicationController
end end
def index def index
@platforms = Platform.accessible_by(current_ability).paginate(:page => params[:platform_page]) @platforms = @platforms.paginate(:page => params[:page], :per_page => 20)
end end
def easy_urpmi def easy_urpmi
@ -35,8 +35,8 @@ class PlatformsController < ApplicationController
def show def show
@platform = Platform.find params[:id], :include => :repositories @platform = Platform.find params[:id], :include => :repositories
@repositories = @platform.repositories #@repositories = @platform.repositories
@members = @platform.members.uniq #@members = @platform.members.uniq
end end
def new def new
@ -44,7 +44,7 @@ class PlatformsController < ApplicationController
@admin_uname = current_user.uname @admin_uname = current_user.uname
@admin_id = current_user.id @admin_id = current_user.id
end end
def edit def edit
@admin_id = @platform.owner.id @admin_id = @platform.owner.id
@admin_uname = @platform.owner.uname @admin_uname = @platform.owner.uname

View File

@ -8,6 +8,10 @@ class ProductsController < ApplicationController
load_and_authorize_resource :platform load_and_authorize_resource :platform
load_and_authorize_resource :product, :through => :platform load_and_authorize_resource :product, :through => :platform
def index
@products = @products.paginate(:page => params[:page])
end
def new def new
@product = @platform.products.new @product = @platform.products.new
@product.ks = DEFAULT_KS @product.ks = DEFAULT_KS

View File

@ -12,9 +12,9 @@ class RepositoriesController < ApplicationController
def index def index
if params[:platform_id] 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 else
@repositories = Repository.paginate(:page => params[:repository_page]) @repositories = Repository.paginate(:page => params[:page])
end end
end end
@ -60,7 +60,7 @@ class RepositoriesController < ApplicationController
else else
flash[:error] = t('flash.repository.project_not_added') flash[:error] = t('flash.repository.project_not_added')
end end
redirect_to repository_path(@repository) redirect_to platform_repository_path(@platform, @repository)
else else
render :projects_list render :projects_list
end end
@ -96,7 +96,7 @@ class RepositoriesController < ApplicationController
def remove_project def remove_project
@project = Project.find(params[:project_id]) @project = Project.find(params[:project_id])
ProjectToRepository.where(:project_id => @project.id, :repository_id => @repository.id).destroy_all 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 end
protected protected

View File

@ -18,6 +18,10 @@ module ApplicationHelper
'right slim' 'right slim'
when params[:controller] == 'build_lists' && ['new', 'create'].include?(params[:action]) when params[:controller] == 'build_lists' && ['new', 'create'].include?(params[:action])
nil nil
when params[:controller] == 'platforms' && params[:action] == 'show'
'right bigpadding'
when params[:controller] == 'platforms' && params[:action] == 'clone'
'right middlepadding'
else else
content_for?(:sidebar) ? 'right' : 'all' content_for?(:sidebar) ? 'right' : 'all'
end end

View File

@ -112,6 +112,14 @@ class User < ActiveRecord::Base
email.downcase == commit.committer.email.downcase email.downcase == commit.committer.email.downcase
end 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 private
def create_settings_notifier def create_settings_notifier

View File

@ -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

View File

@ -1,33 +1,29 @@
- unless ['edit', 'update'].include? controller.action_name - unless ['edit', 'update'].include? controller.action_name
.group .leftlist= f.label :name, :class => :label
= f.label :name, :class => :label .rightlist= f.text_field :name, :class => 'text_field'
= f.text_field :name, :class => 'text_field'
.group .leftlist= f.label :description, :class => :label
= f.label :description, :class => :label .rightlist= f.text_field :description, :class => 'text_field'
= f.text_field :description, :class => 'text_field'
- unless ['edit', 'update'].include? controller.action_name - unless ['edit', 'update'].include? controller.action_name
.group .leftlist= f.label :distrib_type, :class => :label
= f.label :distrib_type, :class => :label .rightlist= f.select :distrib_type, options_for_select(APP_CONFIG['distr_types'])
= f.select :distrib_type, options_for_select(APP_CONFIG['distr_types'])
.group .leftlist= f.label :parent, :class => :label
= f.label :parent, :class => :label .rightlist= f.collection_select :parent_platform_id, Platform.all, :id, :description, :include_blank => true
= f.collection_select :parent_platform_id, Platform.all, :id, :description, :include_blank => true
.group .leftlist= f.label :released, :class => :label
= f.label :released, :class => :label .rightlist= f.check_box :released, :class => 'check_box'
= f.check_box :released, :class => 'check_box'
.group .leftlist= label_tag "", t("layout.platforms.admin_id"), :class => :label
= 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'
= 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'
= hidden_field_tag 'admin_id', @admin_id, :id => 'admin_id_field' .both
.group.navform.wat-cf .button_block
%button.button{:type => "submit"} = submit_tag t("layout.clone")
= image_tag("choose.png", :alt => t("layout.save")) -#%input.button{:type => "submit", :class => "button"}
= t("layout.save") -#= image_tag("choose.png", :alt => t("layout.save"))
-#= t("layout.clone")
%span.text_button_padding= t("layout.or") %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"

View File

@ -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 &nbsp;
-#%table.table
%tr %tr
%th.first= t("activerecord.attributes.platform.name") %th.first= t("activerecord.attributes.platform.name")
%th.first= t("activerecord.attributes.platform.distrib_type") %th.first= t("activerecord.attributes.platform.distrib_type")

View File

@ -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") %h3= t("layout.groups.members")
.content .content
- @platform.members.uniq.each do |member| - @platform.members.uniq.each do |member|

View File

@ -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

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to "#{t("layout.platforms.list")}", @platforms_path %li.first= link_to "#{t("layout.platforms.list")}", @platforms_path

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to t("layout.platforms.list"), platforms_path %li.first= link_to t("layout.platforms.list"), platforms_path
@ -10,4 +15,4 @@
.inner .inner
= form_for @platform, :url => platform_path(@platform), :html => { :class => :form } do |f| = form_for @platform, :url => platform_path(@platform), :html => { :class => :form } do |f|
= render :partial => "form", :locals => {:f => f} = render :partial => "form", :locals => {:f => f}
- content_for :sidebar, render(:partial => 'sidebar') -# content_for :sidebar, render(:partial => 'sidebar')

View File

@ -1,35 +1,3 @@
.block = link_to t("layout.platforms.new"), new_platform_path, :class => 'button' if can? :create, Platform
.secondary-navigation = render :partial => 'platforms/list', :object => @platforms
%ul.wat-cf = will_paginate @platforms
%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 &nbsp;
/ - @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

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to t("layout.platforms.list"), platforms_path %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.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 = link_to t("layout.platforms.edit"), edit_platform_path(@platform), :class => "button" if can? :edit, @platform
%a{ :name => "repositories" } -#%a{ :name => "repositories" }
.block -#.block
.secondary-navigation .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first.active= link_to t("layout.repositories.list"), platform_path(@platform) + "#repositories" %li.first.active= link_to t("layout.repositories.list"), platform_path(@platform) + "#repositories"
@ -91,8 +130,8 @@
.actions-bar.wat-cf .actions-bar.wat-cf
.actions .actions
%a{ :name => "producs" } -#%a{ :name => "producs" }
.block -#.block
.secondary-navigation .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first.active= link_to t("layout.products.list"), platform_path(@platform) + "#products" %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 =# (product.can_clone? ? "| #{link_to t("layout.products.clone"), clone_platform_product_path(@platform, product)}" : "").html_safe
.actions-bar.wat-cf .actions-bar.wat-cf
.actions .actions
- content_for :sidebar, render(:partial => 'sidebar') -# content_for :sidebar, render(:partial => 'sidebar')

View File

@ -63,9 +63,9 @@
} }
.group .leftlist= form.label :use_cron
= form.check_box :use_cron .rightlist= form.check_box :use_cron
= form.label :use_cron .both
#genereator_btn #genereator_btn
%a{ :href => "#" }= t("layout.products.cron_tab_generator.show") %a{ :href => "#" }= t("layout.products.cron_tab_generator.show")
@ -144,7 +144,7 @@
- Date::DAYNAMES.each_with_index do |day, index| - Date::DAYNAMES.each_with_index do |day, index|
%option{ :value => index, :selected => @product.cron_tab_weekdays.include?(index) }= t("layout.weekdays.#{day}") %option{ :value => index, :selected => @product.cron_tab_weekdays.include?(index) }= t("layout.weekdays.#{day}")
.group .leftlist= form.label :cron_tab, :class => :label
= 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
= form.text_field :cron_tab, :id => "cron", :class => "text_field", :style => "width: 40%", :disabled => !@product.use_cron, :value => @product.cron_tab = @product.cron_command
= @product.cron_command .both

View File

@ -1,44 +1,55 @@
.group .leftlist= f.label :name, t("activerecord.attributes.product.name"), :class => :label
= f.label :name, t("activerecord.attributes.product.name"), :class => :label .rightlist= f.text_field :name, :class => 'text_field'
= f.text_field :name, :class => 'text_field' .both
.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')
.group .leftlist= f.label :description, t("activerecord.attributes.product.description"), :class => :label
= render :partial => "products/crontab", :locals => { :form => f } .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 .leftlist= f.label :is_template, :class => :label
= f.label :is_template, :class => :label .rightlist= f.check_box :is_template, :class => 'check_box'
= f.check_box :is_template, :class => 'check_box'
- content_for :commented do - content_for :commented do
.group .leftlist= f.label :system_wide, :class => :label
= f.label :system_wide, :class => :label .rightlist= f.check_box :system_wide, :class => 'check_box'
= f.check_box :system_wide, :class => 'check_box'
.group.navform.wat-cf .both
%button.button{:type => "submit"} .button_block
= image_tag("choose.png", :alt => t("layout.save")) = submit_tag t("layout.save")
= 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") %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"

View File

@ -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 &nbsp;

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to @platform.name, platform_path(@platform) + "#products" %li.first= link_to @platform.name, platform_path(@platform) + "#products"

View File

@ -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

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to @platform.name, platform_path(@platform) + "#products" %li.first= link_to @platform.name, platform_path(@platform) + "#products"

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to @platform.name, platform_path(@platform) + "#products" %li.first= link_to @platform.name, platform_path(@platform) + "#products"
@ -35,7 +63,7 @@
- if can?(:create, @product => ProductBuildList) - 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") = 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 .content
.inner .inner
%table.table %table.table

View File

@ -1,14 +1,15 @@
.group .leftlist= f.label :name, t("activerecord.attributes.repository.name"), :class => :label
= f.label :name, t("activerecord.attributes.repository.name"), :class => :label .rightlist= f.text_field :name, :class => 'text_field'
= 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'
.group.navform.wat-cf .leftlist= f.label :description, t("activerecord.attributes.repository.description"), :class => :label
%button.button{:type => "submit"} .rightlist= f.text_field :description, :class => 'text_field'
= 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") %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"

View File

@ -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 &nbsp;
-#%table.table
%tr %tr
%th.first= t("activerecord.attributes.repository.name") %th.first= t("activerecord.attributes.repository.name")
%th.last &nbsp; %th.last &nbsp;

View File

@ -1,18 +1,19 @@
- columns = [{:type => 'html', :searchable => false}, {:type => 'html'}, {:type => nil, :sortable => false, :searchable => false}] - 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"), = 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"), :pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")},
:next => t("datatables.next_label"), :last => t("datatables.last_label")},
:empty_label => t("datatables.empty_label"), :empty_label => t("datatables.empty_label"),
:info_label => t("datatables.info_label"), :info_label => t("datatables.info_label"),
:info_empty_label => t("datatables.info_empty_label"), :info_empty_label => t("datatables.info_empty_label"),
:filtered_label => t("datatables.filtered_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}" }) :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 %thead
%tr %tr
%th.first{:style => 'width: 80px'}= t("activerecord.attributes.user.uname") %th.th1= t("activerecord.attributes.user.uname")
%th= t("activerecord.attributes.project.name") %th.th2= t("activerecord.attributes.project.name")
%th.last &nbsp; %th.buttons &nbsp;
%tbody %tbody
%br %br

View File

@ -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 %tr
%th.first= t("activerecord.attributes.project.name") %th.first= t("activerecord.attributes.project.name")
%th.
%th.last &nbsp; %th.last &nbsp;
- @projects.each do |project| - @projects.each do |project|
%tr{:class => cycle("odd", "even")} %tr{:class => cycle("odd", "even")}

View File

@ -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 &nbsp;

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first.active= link_to t("layout.repositories.list"), repositories_path %li.first.active= link_to t("layout.repositories.list"), repositories_path

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to t("layout.repositories.list"), @repositories_path + "#platforms" %li.first= link_to t("layout.repositories.list"), @repositories_path + "#platforms"

View File

@ -1,45 +1,6 @@
.block = render :partial => 'platforms/submenu'
.secondary-navigation = render :partial => 'platforms/sidebar'
%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")
%a{ :name => "projects" } %h3= "#{t("layout.repositories.add_project_to")}: #{@repository.name}"
.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')
= render :partial => 'proj_list', :object => @projects

View File

@ -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 .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first= link_to t("layout.repositories.list"), @repositories_path + "#repositories" %li.first= link_to t("layout.repositories.list"), @repositories_path + "#repositories"
@ -24,8 +37,8 @@
.wat-cf .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 = 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" } -#%a{ :name => "projects" }
.block -#.block
.secondary-navigation .secondary-navigation
%ul.wat-cf %ul.wat-cf
%li.first.active= link_to t("layout.projects.list"), repository_path(@repository) + "#projects" %li.first.active= link_to t("layout.projects.list"), repository_path(@repository) + "#projects"

View File

@ -24,3 +24,6 @@ types = [
types.each do |type| types.each do |type|
MIME::Types.add MIME::Type.from_array(type) MIME::Types.add MIME::Type.from_array(type)
end end
# load datatables plugin
require Rails.root.join("lib/rails_datatables")

View File

@ -11,3 +11,7 @@ en:
read_write_access: read & write read_write_access: read & write
by: by by: by
visibilities:
open: open
hidden: hidden

View File

@ -11,3 +11,7 @@ ru:
read_write_access: чтение и запись read_write_access: чтение и запись
by: '' by: ''
visibilities:
open: открытая
hidden: скрытая

View File

@ -26,4 +26,6 @@ en:
tracker: Tracker tracker: Tracker
wiki: Wiki wiki: Wiki
readme: Readme readme: Readme
settings: Settings settings: Settings
platform_menu:
settings: Settings

View File

@ -26,4 +26,6 @@ ru:
tracker: Трекер tracker: Трекер
wiki: Wiki wiki: Wiki
readme: Readme readme: Readme
settings: Настройки settings: Настройки
platform_menu:
settings: Настройки

View File

@ -6,6 +6,7 @@ en:
list: List list: List
new: Create new: Create
edit: Edit edit: Edit
about: About platform
new_header: New platform new_header: New platform
edit_header: Edit edit_header: Edit
list_header: Platforms list_header: Platforms
@ -22,7 +23,7 @@ en:
freeze: Freeze freeze: Freeze
unfreeze: Unfeeze unfreeze: Unfeeze
confirm_freeze: Are you sure to freeze this platform? 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? confirm_unfreeze: Are you sure to defrost this platform?
released_suffix: (released) released_suffix: (released)
confirm_delete: Are you sure to delete this platform? confirm_delete: Are you sure to delete this platform?

View File

@ -6,6 +6,7 @@ ru:
list: Список list: Список
new: Создать new: Создать
edit: Редактировать edit: Редактировать
about: О платформе
new_header: Новая платформа new_header: Новая платформа
edit_header: Редактировать edit_header: Редактировать
list_header: Платформы list_header: Платформы
@ -22,7 +23,7 @@ ru:
freeze: Заморозить freeze: Заморозить
unfreeze: Разморозить unfreeze: Разморозить
confirm_freeze: Вы уверены, что хотите заморозить эту платформу? confirm_freeze: Вы уверены, что хотите заморозить эту платформу?
confirm_freeze: Вы уверены, что хотите клонировать эту платформу? confirm_clone: Вы уверены, что хотите клонировать эту платформу?
confirm_unfreeze: Вы уверены, что хотите разморозить эту платформу? confirm_unfreeze: Вы уверены, что хотите разморозить эту платформу?
released_suffix: (выпущена) released_suffix: (выпущена)
confirm_delete: Вы уверены, что хотите удалить эту платформу? confirm_delete: Вы уверены, что хотите удалить эту платформу?

View File

@ -2,6 +2,8 @@ en:
layout: layout:
products: products:
list: List list: List
about: About product
build_lists_monitoring: Build lists monitoring
new: New product new: New product
list_header: Products list_header: Products
clone: Clone clone: Clone

View File

@ -2,6 +2,8 @@ ru:
layout: layout:
products: products:
list: Список list: Список
about: О продукте
build_lists_monitoring: Мониторинг сборочных заданий
new: Новый продукт new: Новый продукт
list_header: Продукты list_header: Продукты
clone: Клонировать clone: Клонировать

View File

@ -1,7 +1,9 @@
en: en:
layout: layout:
repositories: repositories:
add_project_to: Add project to repository
list: List list: List
about: About repository
list_header: Repositories list_header: Repositories
new: New repository new: New repository
new_header: New repository new_header: New repository

View File

@ -1,7 +1,9 @@
ru: ru:
layout: layout:
repositories: repositories:
add_project_to: Добавить проект к репозиторию
list: Список list: Список
about: О репозитории
list_header: Репозитории list_header: Репозитории
new: Новый репозиторий new: Новый репозиторий
new_header: Новый репозиторий new_header: Новый репозиторий

View File

@ -5,8 +5,8 @@ ru:
page_gap: ... page_gap: ...
datatables: datatables:
previous_label: Пред. previous_label: Предыдущая
next_label: След. next_label: Следующая
first_label: « Первая first_label: « Первая
last_label: Последняя » last_label: Последняя »
empty_label: Нет доступных данных empty_label: Нет доступных данных

View File

@ -164,7 +164,7 @@ Rosa::Application.routes.draw do
resources :repositories do resources :repositories do
member do member do
get :add_project get :add_project
get :remove_project delete :remove_project
get :projects_list get :projects_list
end end
end end

View File

@ -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

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # 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| create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false t.integer "user_id", :null => false
@ -23,8 +23,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
create_table "arches", :force => true do |t| create_table "arches", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "arches", ["name"], :name => "index_arches_on_name", :unique => true 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.integer "user_id"
t.string "provider" t.string "provider"
t.string "uid" t.string "uid"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "authentications", ["provider", "uid"], :name => "index_authentications_on_provider_and_uid", :unique => true 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 "arch_id"
t.integer "pl_id" t.integer "pl_id"
t.integer "bpl_id" t.integer "bpl_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "build_list_items", :force => true do |t| create_table "build_list_items", :force => true do |t|
@ -54,8 +54,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.integer "level" t.integer "level"
t.integer "status" t.integer "status"
t.integer "build_list_id" t.integer "build_list_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "version" t.string "version"
end end
@ -69,8 +69,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.integer "project_id" t.integer "project_id"
t.integer "arch_id" t.integer "arch_id"
t.datetime "notified_at" t.datetime "notified_at"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "is_circle", :default => false t.boolean "is_circle", :default => false
t.text "additional_repos" t.text "additional_repos"
t.string "name" t.string "name"
@ -93,16 +93,16 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "name" t.string "name"
t.string "ancestry" t.string "ancestry"
t.integer "projects_count", :default => 0, :null => false t.integer "projects_count", :default => 0, :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "comments", :force => true do |t| create_table "comments", :force => true do |t|
t.string "commentable_type" t.string "commentable_type"
t.integer "user_id" t.integer "user_id"
t.text "body" t.text "body"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.decimal "commentable_id", :precision => 50, :scale => 0 t.decimal "commentable_id", :precision => 50, :scale => 0
t.integer "project_id" t.integer "project_id"
end end
@ -111,8 +111,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "name", :null => false t.string "name", :null => false
t.integer "project_id", :null => false t.integer "project_id", :null => false
t.integer "owner_id", :null => false t.integer "owner_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "delayed_jobs", :force => true do |t| create_table "delayed_jobs", :force => true do |t|
@ -124,8 +124,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.datetime "locked_at" t.datetime "locked_at"
t.datetime "failed_at" t.datetime "failed_at"
t.string "locked_by" t.string "locked_by"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "queue" t.string "queue"
end end
@ -137,8 +137,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "distro" t.string "distro"
t.string "platform" t.string "platform"
t.integer "counter", :default => 0 t.integer "counter", :default => 0
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "event_logs", :force => true do |t| create_table "event_logs", :force => true do |t|
@ -153,14 +153,14 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "controller" t.string "controller"
t.string "action" t.string "action"
t.text "message" t.text "message"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "groups", :force => true do |t| create_table "groups", :force => true do |t|
t.integer "owner_id" t.integer "owner_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "uname" t.string "uname"
t.integer "own_projects_count", :default => 0, :null => false t.integer "own_projects_count", :default => 0, :null => false
t.text "description" t.text "description"
@ -173,8 +173,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "title" t.string "title"
t.text "body" t.text "body"
t.string "status", :default => "open" t.string "status", :default => "open"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "creator_id" t.integer "creator_id"
t.datetime "closed_at" t.datetime "closed_at"
t.integer "closed_by" t.integer "closed_by"
@ -205,8 +205,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "description" t.string "description"
t.string "name" t.string "name"
t.integer "parent_platform_id" t.integer "parent_platform_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "released", :default => false t.boolean "released", :default => false
t.integer "owner_id" t.integer "owner_id"
t.string "owner_type" t.string "owner_type"
@ -219,8 +219,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.integer "platform_id" t.integer "platform_id"
t.string "login" t.string "login"
t.string "password" t.string "password"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "user_id" t.integer "user_id"
end end
@ -228,8 +228,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.integer "product_id" t.integer "product_id"
t.integer "status", :default => 2, :null => false t.integer "status", :default => 2, :null => false
t.datetime "notified_at" t.datetime "notified_at"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "product_build_lists", ["product_id"], :name => "index_product_build_lists_on_product_id" 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 "platform_id", :null => false
t.integer "build_status", :default => 2, :null => false t.integer "build_status", :default => 2, :null => false
t.string "build_path" t.string "build_path"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.text "build_script" t.text "build_script"
t.text "counter" t.text "counter"
t.text "ks" t.text "ks"
@ -253,6 +253,7 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.boolean "system_wide", :default => false t.boolean "system_wide", :default => false
t.text "cron_tab" t.text "cron_tab"
t.boolean "use_cron", :default => false t.boolean "use_cron", :default => false
t.text "description"
end end
create_table "project_imports", :force => true do |t| create_table "project_imports", :force => true do |t|
@ -260,8 +261,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "name" t.string "name"
t.string "version" t.string "version"
t.datetime "file_mtime" t.datetime "file_mtime"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "platform_id" t.integer "platform_id"
end end
@ -270,14 +271,14 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
create_table "project_to_repositories", :force => true do |t| create_table "project_to_repositories", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "repository_id" t.integer "repository_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "projects", :force => true do |t| create_table "projects", :force => true do |t|
t.string "name" t.string "name"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "owner_id" t.integer "owner_id"
t.string "owner_type" t.string "owner_type"
t.string "visibility", :default => "open" t.string "visibility", :default => "open"
@ -303,30 +304,29 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "token" t.string "token"
t.boolean "approved", :default => false t.boolean "approved", :default => false
t.boolean "rejected", :default => false t.boolean "rejected", :default => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "interest" t.string "interest"
t.text "more" t.text "more"
end end
add_index "register_requests", ["email"], :name => "index_register_requests_on_email", :unique => true, :case_sensitive => false 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| create_table "relations", :force => true do |t|
t.integer "object_id" t.integer "object_id"
t.string "object_type" t.string "object_type"
t.integer "target_id" t.integer "target_id"
t.string "target_type" t.string "target_type"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "role" t.string "role"
end end
create_table "repositories", :force => true do |t| create_table "repositories", :force => true do |t|
t.string "description", :null => false t.string "description", :null => false
t.integer "platform_id", :null => false t.integer "platform_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "name", :null => false t.string "name", :null => false
end end
@ -334,8 +334,8 @@ ActiveRecord::Schema.define(:version => 20120306212914) do
t.string "name", :null => false t.string "name", :null => false
t.integer "arch_id", :null => false t.integer "arch_id", :null => false
t.integer "project_id", :null => false t.integer "project_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "rpms", ["project_id", "arch_id"], :name => "index_rpms_on_project_id_and_arch_id" 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_comment_reply", :default => true
t.boolean "new_issue", :default => true t.boolean "new_issue", :default => true
t.boolean "issue_assign", :default => true t.boolean "issue_assign", :default => true
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "new_comment_commit_owner", :default => true t.boolean "new_comment_commit_owner", :default => true
t.boolean "new_comment_commit_repo_owner", :default => true t.boolean "new_comment_commit_repo_owner", :default => true
t.boolean "new_comment_commit_commentor", :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| create_table "subscribes", :force => true do |t|
t.string "subscribeable_type" t.string "subscribeable_type"
t.integer "user_id" t.integer "user_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "status", :default => true t.boolean "status", :default => true
t.integer "project_id" t.integer "project_id"
t.decimal "subscribeable_id", :precision => 50, :scale => 0 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| create_table "users", :force => true do |t|
t.string "name" t.string "name"
t.string "email", :default => "", :null => false t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at"
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.text "ssh_key" t.text "ssh_key"
t.string "uname" t.string "uname"
t.string "role" t.string "role"
t.string "language", :default => "en" t.string "language", :default => "en"
t.integer "own_projects_count", :default => 0, :null => false t.integer "own_projects_count", :default => 0, :null => false
t.text "professional_experience" t.text "professional_experience"
t.string "site" t.string "site"
t.string "company" t.string "company"

View File

@ -1,2 +1,3 @@
# -*- encoding : utf-8 -*- # -*- encoding : utf-8 -*-
require Rails.root.join('lib/rails_datatables/rails_datatables')
ActionView::Base.send :include, RailsDatatables ActionView::Base.send :include, RailsDatatables

View File

@ -60,7 +60,7 @@ module RailsDatatables
"sProcessing": '#{processing}' "sProcessing": '#{processing}'
}, },
"sPaginationType": "full_numbers", "sPaginationType": "will_paginate_like",
"iDisplayLength": #{per_page}, "iDisplayLength": #{per_page},
"bProcessing": true, "bProcessing": true,
"bServerSide": #{server_side}, "bServerSide": #{server_side},
@ -81,6 +81,8 @@ module RailsDatatables
} ); } );
} }
})#{append}; })#{append};
$('#datatable_wrapper').append("<div class='both'></div>");
}); });
</script> </script>
} }

View File

@ -2,6 +2,7 @@
//= require gollum/gollum.dialog //= require gollum/gollum.dialog
//= require gollum/gollum.placeholder //= require gollum/gollum.placeholder
//= require gollum/editor/gollum.editor //= require gollum/editor/gollum.editor
//= require jquery.dataTables
//= require codemirror //= require codemirror
//= require codemirror/runmode //= require codemirror/runmode
//= require_tree ./codemirror/modes //= require_tree ./codemirror/modes

View File

@ -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

View File

@ -1,2 +0,0 @@
# -*- encoding : utf-8 -*-
# Install hook code here

View File

@ -1,2 +0,0 @@
# -*- encoding : utf-8 -*-
# Uninstall hook code here