[#369] project sections page
This commit is contained in:
parent
bc0b196319
commit
f4eb6de8b0
|
@ -1,7 +1,7 @@
|
|||
class Projects::ProjectsController < Projects::BaseController
|
||||
include DatatableHelper
|
||||
include ProjectsHelper
|
||||
layout 'bootstrap', only: [:index, :new, :create, :edit, :update]
|
||||
layout 'bootstrap', only: [:index, :new, :create, :edit, :update, :sections]
|
||||
before_filter :authenticate_user!
|
||||
load_and_authorize_resource id_param: :name_with_owner # to force member actions load
|
||||
before_filter :who_owns, only: [:new, :create, :mass_import, :run_mass_import]
|
||||
|
@ -130,7 +130,7 @@ class Projects::ProjectsController < Projects::BaseController
|
|||
end
|
||||
|
||||
def sections
|
||||
if request.post?
|
||||
if request.patch?
|
||||
if @project.update_attributes(params[:project])
|
||||
flash[:notice] = t('flash.project.saved')
|
||||
redirect_to sections_project_path(@project)
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
= link_to t('project_menu.wiki'), project_wiki_index_path(@project)
|
||||
%li=# link_to t('project_menu.readme'), '#' #pending
|
||||
- if can? :update, @project
|
||||
%li{ class: ('active' if act == :edit && contr == :projects) }
|
||||
%li{ class: ('active' if act.in?(%i[edit update sections]) && contr == :projects) }
|
||||
= link_to t('project_menu.settings'), edit_project_path(@project)
|
||||
/ /.navbar-collapse
|
||||
/ /.container-fluid
|
||||
|
|
|
@ -46,7 +46,7 @@ div ng-controller = 'ProjectFromController' ng-cloak = 'true'
|
|||
= f.input :srpm, as: :file
|
||||
|
||||
.col-sm-offset-3.col-sm-9
|
||||
= f.button :submit, t('layout.save')
|
||||
= f.button :submit, t('layout.save'), data: {'disable-with' => t('layout.saving')}
|
||||
|
||||
- content_for :additional_scripts do
|
||||
javascript:
|
||||
|
|
|
@ -1,25 +1,20 @@
|
|||
-set_meta_tags title: [title_object(@project), t('layout.projects.sections')]
|
||||
= render 'submenu'
|
||||
= render 'sidebar'
|
||||
|
||||
= form_for @project, url: sections_project_path(@project), method: :post, html: { class: :form, multipart: true } do |f|
|
||||
.leftside.w25
|
||||
%span.niceCheck-main{onclick: "changeCheck(this)"}= f.check_box :has_issues
|
||||
.leftside.w420
|
||||
= t("activerecord.attributes.project.has_issues")
|
||||
%br
|
||||
%span{style: "font-size: 11px;"}= t("layout.projects.has_issue_description")
|
||||
.both
|
||||
.leftside.w25
|
||||
%span.niceCheck-main{onclick: "changeCheck(this)"}= f.check_box :has_wiki, class: 'niceCheck-main'
|
||||
.leftside.w420
|
||||
= t("activerecord.attributes.project.has_wiki")
|
||||
%br
|
||||
%span{style: "font-size: 11px;"}= t("layout.projects.has_wiki_description")
|
||||
.both
|
||||
.padd25= submit_tag t('layout.save'), class: 'button', data: {'disable-with' => t('layout.saving')}
|
||||
.both
|
||||
.container.col-md-offset-2.col-md-8
|
||||
.row
|
||||
= render 'settings_menu'
|
||||
|
||||
:javascript
|
||||
// TODO: Replace this temporary hack by something more true
|
||||
$('.right').addClass('bigpadding');
|
||||
= simple_form_for @project, url: sections_project_path(@project),
|
||||
html: { class: 'form-horizontal' },
|
||||
wrapper: :horizontal_form,
|
||||
wrapper_mappings: { boolean: :horizontal_boolean } do |f|
|
||||
|
||||
= f.input :has_issues, as: :boolean,
|
||||
hint: t('layout.projects.has_issue_description')
|
||||
|
||||
= f.input :has_wiki, as: :boolean,
|
||||
hint: t('layout.projects.has_wiki_description')
|
||||
|
||||
.col-sm-offset-3.col-sm-9
|
||||
= f.button :submit, t('layout.save'), data: {'disable-with' => t('layout.saving')}
|
||||
|
|
|
@ -356,7 +356,7 @@ Rosa::Application.routes.draw do
|
|||
post '/fork' => 'projects#fork', as: :fork_project
|
||||
get '/possible_forks' => 'projects#possible_forks', as: :possible_forks_project
|
||||
get '/sections' => 'projects#sections', as: :sections_project
|
||||
post '/sections' => 'projects#sections'
|
||||
patch '/sections' => 'projects#sections'
|
||||
delete '/remove_user' => 'projects#remove_user', as: :remove_user_project
|
||||
# constraints treeish: /[\w\-\.]+(\/[\w\-\.]+)?/ do
|
||||
constraints treeish: /.+/ do
|
||||
|
|
Loading…
Reference in New Issue