Simplify controllers and layout handling
Created by: jouve
Controllers related to projects (Projects, Commits, Hooks, ...) share common code (layout :project, before_filters :project and :add_project_abilites), so I created a ProjectController < ApplicationController
to put this common code and made all ProjectsController, CommitsController, HooksController, ... inherit this ProjectController.
Second commit removes most of layout
calls to use default rails layout logic (layout with same name as controller).
Merge request reports
Activity
Created by: dzaporozhets
@jouve can you make it mergeable please :)
By Administrator on 2012-09-27T08:31:50 (imported from GitLab project)
By Administrator on 2012-09-27T08:31:50 (imported from GitLab)
Created by: rspeicher
Is
authorize_read_project!
another filter that can be moved to the parent class? I'm not sure it's in every controller, but it might be.By Administrator on 2012-09-27T14:51:14 (imported from GitLab project)
By Administrator on 2012-09-27T14:51:14 (imported from GitLab)
Created by: dzaporozhets
@tsigo is right. we can move it to project controller too. Also i am confused with
ProjectController
name. Especially whenProjectsController < ProjectController
Maybe something likeProjectBaseController
? What do you think?By Administrator on 2012-09-27T16:43:55 (imported from GitLab project)
By Administrator on 2012-09-27T16:43:55 (imported from GitLab)
Created by: rspeicher
@randx Yeah, I was going to include something like this in my routing changes, but couldn't come up with a good name.
ProjectResourceController
was the best I came up with.Also I don't think ProjectsController should inherit from this new controller, just for the sake of clarity. If we duplicate a few lines in one controller, so be it.
By Administrator on 2012-09-27T16:46:30 (imported from GitLab project)
By Administrator on 2012-09-27T16:46:30 (imported from GitLab)