[refs #195] Add design to form and edit page
This commit is contained in:
parent
328cd17f46
commit
ba1798fd71
|
@ -42,7 +42,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
|
||||||
|
|
||||||
def committer_link
|
def committer_link
|
||||||
@committer_link ||= if committer.is_a? User
|
@committer_link ||= if committer.is_a? User
|
||||||
link_to committer.uname, user_path(committer)
|
link_to committer.uname, '#'#user_path(committer)
|
||||||
else
|
else
|
||||||
mail_to committer.email.encode_to_default, committer.name.encode_to_default
|
mail_to committer.email.encode_to_default, committer.name.encode_to_default
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,28 +1,104 @@
|
||||||
.group
|
= act = controller.action_name.to_sym
|
||||||
= f.label :category_id, t("activerecord.attributes.project.category_id"), :class => :label
|
- if [:new, :create].include? act
|
||||||
= f.grouped_collection_select :category_id, Category.roots, :children, :name, :id, :name, :include_blank => true
|
.leftlist
|
||||||
.group
|
= f.label :name, t("activerecord.attributes.project.name"), :class => :label
|
||||||
= f.label :name, t("activerecord.attributes.project.name"), :class => :label
|
.rightlist
|
||||||
= f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
|
= f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
|
||||||
.group
|
.both
|
||||||
= f.label :visibility, t("activerecord.attributes.project.visibility"), :class => :label
|
.leftlist
|
||||||
= f.select :visibility, Project::VISIBILITIES
|
|
||||||
.group
|
|
||||||
= f.label :description, t("activerecord.attributes.project.description"), :class => :label
|
= f.label :description, t("activerecord.attributes.project.description"), :class => :label
|
||||||
|
.rightlist
|
||||||
= f.text_area :description, :class => 'text_field', :cols => 80
|
= f.text_area :description, :class => 'text_field', :cols => 80
|
||||||
.group
|
.both
|
||||||
= f.label :has_issues, t("activerecord.attributes.project.has_issues"), :class => :label
|
- if [:new, :create].include? act
|
||||||
= f.check_box :has_issues
|
.leftlist
|
||||||
.group
|
= f.label :category_id, t("activerecord.attributes.project.category_id"), :class => :label
|
||||||
= f.label :has_wiki, t("activerecord.attributes.project.has_wiki"), :class => :label
|
.rightlist
|
||||||
= f.check_box :has_wiki
|
= f.grouped_collection_select :category_id, Category.roots, :children, :name, :id, :name, :include_blank => true
|
||||||
.group
|
.both
|
||||||
= f.label :srpm, t("activerecord.attributes.project.srpm"), :class => :label
|
.leftlist
|
||||||
= f.file_field :srpm, :class => 'file_field'
|
= f.label :visibility, t("activerecord.attributes.project.visibility"), :class => :label
|
||||||
|
.rightlist
|
||||||
|
=# f.select :visibility, Project::VISIBILITIES
|
||||||
|
- Project::VISIBILITIES.each do |visibility|
|
||||||
|
%span.niceRadio.radioChecked
|
||||||
|
= f.radio_button :visibility, visibility, :class => 'niceRadio'
|
||||||
|
- if visibility == 'open'
|
||||||
|
= image_tag("unlock.png")
|
||||||
|
- else
|
||||||
|
= image_tag("lock.png")
|
||||||
|
= t("activerecord.attributes.project.visibilities.#{visibility}")
|
||||||
|
.both
|
||||||
|
.leftlist
|
||||||
|
Ветка по умолчанию:
|
||||||
|
.rightlist
|
||||||
|
= f.select :default_branch, options_from_collection_for_select(@project.branches, :name, :name, @project.default_branch), :class => 'sel80', :id => 'branch_selector'
|
||||||
|
-#.lineForm
|
||||||
|
-# #cuselFrame-ext.cusel.sel80{:style => "width:200px", :tabindex => "2"}
|
||||||
|
-# .cuselFrameRight
|
||||||
|
-# .cuselText Master
|
||||||
|
-# .cusel-scroll-wrap{:style => "display: none; visibility: visible; "}
|
||||||
|
-# #cusel-scroll-ext.cusel-scroll-pane
|
||||||
|
-# %span.cuselActive{:selected => "selected", :val => "1000"} Master
|
||||||
|
-# %span{:val => "1"} Extend
|
||||||
|
-# %span{:val => "2"} Fork4Driver
|
||||||
|
-# %input#ext{:name => "ext", :type => "hidden", :value => "1000"}/
|
||||||
|
.both
|
||||||
|
.leftlist
|
||||||
|
\
|
||||||
|
.rightlist
|
||||||
|
.check
|
||||||
|
%span#niceCheckbox1.niceCheck-main{:onclick => "changeCheck(this)"}
|
||||||
|
%input{:name => "ch1", :type => "checkbox"}/
|
||||||
|
.forcheck
|
||||||
|
Проект является пакетом
|
||||||
|
.both
|
||||||
|
.both
|
||||||
|
- if [:new, :create].include? act
|
||||||
|
.leftlist
|
||||||
|
= f.label :srpm, t("activerecord.attributes.project.srpm"), :class => :label
|
||||||
|
.rightlist
|
||||||
|
= f.file_field :srpm, :class => 'file_field'
|
||||||
|
.both
|
||||||
|
.leftlist
|
||||||
|
\
|
||||||
|
.rightlist
|
||||||
|
-#%a.button{:href => "#"} Сохранить
|
||||||
|
= submit_tag t("layout.save"), :class => 'button'
|
||||||
|
.both
|
||||||
|
.hr
|
||||||
|
.leftside
|
||||||
|
= t("layout.projects.delete_warning")
|
||||||
|
.rightside
|
||||||
|
= link_to t("layout.delete"), project_path(@project), :method => :delete, :confirm => t("layout.projects.confirm_delete"), :class => 'button' if can? :destroy, @project
|
||||||
|
.both
|
||||||
|
|
||||||
.group.navform.wat-cf
|
|
||||||
%button.button{:type => "submit"}
|
-#.group
|
||||||
= image_tag("web-app-theme/icons/tick.png", :alt => t("layout.save"))
|
-# = f.label :category_id, t("activerecord.attributes.project.category_id"), :class => :label
|
||||||
= t("layout.save")
|
-# = f.grouped_collection_select :category_id, Category.roots, :children, :name, :id, :name, :include_blank => true
|
||||||
%span.text_button_padding= t("layout.or")
|
-#.group
|
||||||
= link_to t("layout.cancel"), @projects_path, :class => "text_button_padding link_button"
|
-# = f.label :name, t("activerecord.attributes.project.name"), :class => :label
|
||||||
|
-# = f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
|
||||||
|
-#.group
|
||||||
|
-# = f.label :visibility, t("activerecord.attributes.project.visibility"), :class => :label
|
||||||
|
-# = f.select :visibility, Project::VISIBILITIES
|
||||||
|
-#.group
|
||||||
|
-# = f.label :description, t("activerecord.attributes.project.description"), :class => :label
|
||||||
|
-# = f.text_area :description, :class => 'text_field', :cols => 80
|
||||||
|
-#.group
|
||||||
|
-# = f.label :has_issues, t("activerecord.attributes.project.has_issues"), :class => :label
|
||||||
|
-# = f.check_box :has_issues
|
||||||
|
-#.group
|
||||||
|
-# = f.label :has_wiki, t("activerecord.attributes.project.has_wiki"), :class => :label
|
||||||
|
-# = f.check_box :has_wiki
|
||||||
|
-#.group
|
||||||
|
-# = f.label :srpm, t("activerecord.attributes.project.srpm"), :class => :label
|
||||||
|
-# = f.file_field :srpm, :class => 'file_field'
|
||||||
|
-#
|
||||||
|
-#.group.navform.wat-cf
|
||||||
|
-# %button.button{:type => "submit"}
|
||||||
|
-# = image_tag("web-app-theme/icons/tick.png", :alt => t("layout.save"))
|
||||||
|
-# = t("layout.save")
|
||||||
|
-# %span.text_button_padding= t("layout.or")
|
||||||
|
-# = link_to t("layout.cancel"), @projects_path, :class => "text_button_padding link_button"
|
||||||
|
|
|
@ -1,50 +1,66 @@
|
||||||
.block.notice
|
- act = action_name.to_sym
|
||||||
%h3= t("layout.projects.members")
|
- contr = controller_name.to_sym
|
||||||
.content
|
|
||||||
%p
|
|
||||||
%b
|
|
||||||
= "#{t("layout.projects.collaborators")}:"
|
|
||||||
%ul
|
|
||||||
- @project.collaborators.each do |user|
|
|
||||||
%li
|
|
||||||
- if can? :read, user
|
|
||||||
= link_to user.name, user_path(user)
|
|
||||||
- else
|
|
||||||
= user.name
|
|
||||||
- if (@project.owner == user)
|
|
||||||
= '(' + t("layout.owner") + ')'
|
|
||||||
/%br
|
|
||||||
-# if can? :update, @project
|
|
||||||
%p
|
|
||||||
%b
|
|
||||||
= "#{t("layout.projects.groups")}:"
|
|
||||||
%ul
|
|
||||||
- @project.groups.each do |group|
|
|
||||||
%li
|
|
||||||
= link_to group.name, group_path(group)
|
|
||||||
- if (@project.owner == group)
|
|
||||||
= '(' + t("layout.owner") + ')'
|
|
||||||
%br
|
|
||||||
= link_to t("layout.projects.edit_collaborators"), edit_project_collaborators_path(@project) if can? :manage_collaborators, @project
|
|
||||||
|
|
||||||
/ %p
|
%aside
|
||||||
/ %b
|
.admin-preferences
|
||||||
/ = "#{t("layout.projects.groups")}:"
|
%ul
|
||||||
/ %ul
|
- if can? :edit, @project
|
||||||
/ - @project.groups.each do |group|
|
%li{:class => (act == :edit && contr == :projects) ? 'active' : ''}
|
||||||
/ %li
|
= link_to t("layout.projects.edit"), edit_project_path(@project)
|
||||||
/ = link_to group.name, group_path(group)
|
%li
|
||||||
/ - if (@project.owner == group)
|
%a{:href => '#'} Разделы
|
||||||
/ = '(' + t("layout.owner") + ')'
|
- if can? :manage_collaborators, @project
|
||||||
/ %br
|
%li{:class => (act == :edit && contr == :collaborators) ? 'active' : ''}
|
||||||
/ = link_to t("layout.projects.add_groups"), '#' #add_collaborators_project_path(@project)
|
= link_to t("layout.projects.edit_collaborators"), edit_project_collaborators_path(@project)
|
||||||
|
|
||||||
/ .block.notice
|
|
||||||
/ %h3= t("layout.platforms.current_platform_header")
|
-#.block.notice
|
||||||
/ .content
|
-# %h3= t("layout.projects.members")
|
||||||
/ %p= link_to @platform.name, platform_path(@platform)
|
-# .content
|
||||||
/
|
-# %p
|
||||||
/ .block.notice
|
-# %b
|
||||||
/ %h3= t("layout.repositories.current_repository_header")
|
-# = "#{t("layout.projects.collaborators")}:"
|
||||||
/ .content
|
-# %ul
|
||||||
/ %p= link_to @repository.name + repository_name_postfix(@platform), platform_repository_path(@platform, @repository)
|
-# - @project.collaborators.each do |user|
|
||||||
|
-# %li
|
||||||
|
-# - if can? :read, user
|
||||||
|
-# = link_to user.name, user_path(user)
|
||||||
|
-# - else
|
||||||
|
-# = user.name
|
||||||
|
-# - if (@project.owner == user)
|
||||||
|
-# = '(' + t("layout.owner") + ')'
|
||||||
|
-# /%br
|
||||||
|
-# -# if can? :update, @project
|
||||||
|
-# %p
|
||||||
|
-# %b
|
||||||
|
-# = "#{t("layout.projects.groups")}:"
|
||||||
|
-# %ul
|
||||||
|
-# - @project.groups.each do |group|
|
||||||
|
-# %li
|
||||||
|
-# = link_to group.name, group_path(group)
|
||||||
|
-# - if (@project.owner == group)
|
||||||
|
-# = '(' + t("layout.owner") + ')'
|
||||||
|
-# %br
|
||||||
|
-# = link_to t("layout.projects.edit_collaborators"), edit_project_collaborators_path(@project) if can? :manage_collaborators, @project
|
||||||
|
-#
|
||||||
|
-# / %p
|
||||||
|
-# / %b
|
||||||
|
-# / = "#{t("layout.projects.groups")}:"
|
||||||
|
-# / %ul
|
||||||
|
-# / - @project.groups.each do |group|
|
||||||
|
-# / %li
|
||||||
|
-# / = link_to group.name, group_path(group)
|
||||||
|
-# / - if (@project.owner == group)
|
||||||
|
-# / = '(' + t("layout.owner") + ')'
|
||||||
|
-# / %br
|
||||||
|
-# / = link_to t("layout.projects.add_groups"), '#' #add_collaborators_project_path(@project)
|
||||||
|
-#
|
||||||
|
-#/ .block.notice
|
||||||
|
-#/ %h3= t("layout.platforms.current_platform_header")
|
||||||
|
-#/ .content
|
||||||
|
-#/ %p= link_to @platform.name, platform_path(@platform)
|
||||||
|
-#/
|
||||||
|
-#/ .block.notice
|
||||||
|
-#/ %h3= t("layout.repositories.current_repository_header")
|
||||||
|
-#/ .content
|
||||||
|
-#/ %p= link_to @repository.name + repository_name_postfix(@platform), platform_repository_path(@platform, @repository)
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
.block
|
= render :partial => 'projects/submenu'
|
||||||
.secondary-navigation
|
|
||||||
%ul.wat-cf
|
|
||||||
%li.first= link_to t("layout.projects.list"), @projects_path # url_for(get_owner) + "#projects"
|
|
||||||
%li= link_to t("layout.projects.new"), @new_project_path # new_platform_repository_project_path(@platform, @repository)
|
|
||||||
%li.active= link_to t("layout.projects.edit"), @edit_project_path
|
|
||||||
|
|
||||||
.content
|
= form_for @project, :html => { :class => :form, :multipart => true } do |f|
|
||||||
%h2.title= t("layout.projects.edit_header")
|
= render :partial => "form", :locals => {:f => f}
|
||||||
.inner
|
|
||||||
= form_for @project, :html => { :class => :form, :multipart => true } do |f|
|
|
||||||
= render :partial => "form", :locals => {:f => f}
|
|
||||||
|
|
||||||
- content_for :sidebar, render('sidebar')
|
- content_for :sidebar, render('sidebar')
|
||||||
|
|
|
@ -297,6 +297,7 @@ en:
|
||||||
edit_collaborators: Edit collaborators
|
edit_collaborators: Edit collaborators
|
||||||
issues: Issues
|
issues: Issues
|
||||||
wiki: Wiki
|
wiki: Wiki
|
||||||
|
delete_warning: Attention! Deleted project can not be restored!
|
||||||
|
|
||||||
collaborators:
|
collaborators:
|
||||||
back_to_proj: Back to project
|
back_to_proj: Back to project
|
||||||
|
@ -823,6 +824,9 @@ en:
|
||||||
description: Descripton
|
description: Descripton
|
||||||
owner: Owner
|
owner: Owner
|
||||||
visibility: Visibility
|
visibility: Visibility
|
||||||
|
visibility_types:
|
||||||
|
open: Open
|
||||||
|
hidden: Hidden
|
||||||
repository_id: Repository
|
repository_id: Repository
|
||||||
repository: Repository
|
repository: Repository
|
||||||
created_at: Created
|
created_at: Created
|
||||||
|
|
|
@ -297,6 +297,7 @@ ru:
|
||||||
edit_collaborators: Изменить список участников
|
edit_collaborators: Изменить список участников
|
||||||
issues: Задачи
|
issues: Задачи
|
||||||
wiki: Wiki
|
wiki: Wiki
|
||||||
|
delete_warning: Внимание! Удаленный проект восстановлению не подлежит.
|
||||||
|
|
||||||
collaborators:
|
collaborators:
|
||||||
back_to_proj: Вернуться к проекту
|
back_to_proj: Вернуться к проекту
|
||||||
|
@ -685,6 +686,9 @@ ru:
|
||||||
description: Описание
|
description: Описание
|
||||||
owner: Владелец
|
owner: Владелец
|
||||||
visibility: Видимость
|
visibility: Видимость
|
||||||
|
visibilities:
|
||||||
|
open: Публичная
|
||||||
|
hidden: Приватная
|
||||||
repository_id: Репозиторий
|
repository_id: Репозиторий
|
||||||
repository: Репозиторий
|
repository: Репозиторий
|
||||||
created_at: Создан
|
created_at: Создан
|
||||||
|
|
|
@ -142,6 +142,7 @@ Rosa::Application.routes.draw do
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
get :auto_build
|
get :auto_build
|
||||||
|
get :settings
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
23
db/schema.rb
23
db/schema.rb
|
@ -13,6 +13,14 @@
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20120220131333) do
|
ActiveRecord::Schema.define(:version => 20120220131333) do
|
||||||
|
|
||||||
|
create_table "activity_feeds", :force => true do |t|
|
||||||
|
t.integer "user_id", :null => false
|
||||||
|
t.string "kind"
|
||||||
|
t.text "data"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
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"
|
t.datetime "created_at"
|
||||||
|
@ -262,22 +270,20 @@ ActiveRecord::Schema.define(:version => 20120220131333) do
|
||||||
t.string "default_branch", :default => "master"
|
t.string "default_branch", :default => "master"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "projects", ["category_id"], :name => "index_projects_on_category_id"
|
|
||||||
add_index "projects", ["owner_id"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false
|
|
||||||
|
|
||||||
create_table "register_requests", :force => true do |t|
|
create_table "register_requests", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "email"
|
t.string "email"
|
||||||
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"
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at", :null => false
|
||||||
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"
|
||||||
|
@ -338,8 +344,8 @@ ActiveRecord::Schema.define(:version => 20120220131333) do
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "email", :default => "", :null => false
|
t.string "email", :default => "", :null => false
|
||||||
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
||||||
|
t.string "password_salt", :default => "", :null => false
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
t.datetime "reset_password_sent_at"
|
|
||||||
t.datetime "remember_created_at"
|
t.datetime "remember_created_at"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
@ -347,9 +353,14 @@ ActiveRecord::Schema.define(:version => 20120220131333) do
|
||||||
t.string "uname"
|
t.string "uname"
|
||||||
t.string "role"
|
t.string "role"
|
||||||
t.string "language", :default => "en"
|
t.string "language", :default => "en"
|
||||||
|
t.string "confirmation_token"
|
||||||
|
t.datetime "confirmed_at"
|
||||||
|
t.datetime "confirmation_sent_at"
|
||||||
t.integer "own_projects_count", :default => 0, :null => false
|
t.integer "own_projects_count", :default => 0, :null => false
|
||||||
|
t.datetime "reset_password_sent_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
|
||||||
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
||||||
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
||||||
add_index "users", ["uname"], :name => "index_users_on_uname", :unique => true
|
add_index "users", ["uname"], :name => "index_users_on_uname", :unique => true
|
||||||
|
|
Loading…
Reference in New Issue