Skip to content

A projects extension to manage your portfolio or case studies within SpinaCMS

License

Notifications You must be signed in to change notification settings

wearefuze/spina-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependabot Status

Getting Started

This is a Portfolio plugin for Spina CMS based on projects.

gem 'spina-projects'

Run the migration installer to get started.

rails g spina_projects:install

This should copy the migration file required to create the Spina::Project model.

Restart your server and head over to '/admin', you should see your plugin located below the Media Library.

Consumer views

Note: This plugin does not include the controller or view for the customer facing website, just the admin only.

To get you going you'll need to add the routes:

Spina::Engine.routes.draw do
  resources :projects, only: [:show, :index]
end

Then create the the controller controllers/spina/projects_controller.rb and include your index and show actions:

module Spina
  class ProjectsController < ApplicationController
    before_action :set_page
    layout 'layouts/default/application'

    def index
      @projects = Spina::Project.is_live.by_position
    end

    def show
      @project = Spina::Project.find(params[:id])
    end

    def set_page
      @page = Spina::Page.find_or_create_by(name: 'projects') do |page|
        page.title = 'Projects'
        page.link_url = '/projects'
        page.deletable = false
      end
    end
  end
end
TODO: Create admin UI to manage ProjectCategory, in the short term, fire up the $ rails console and run:

Spina::ProjectCategory.create(name: 'Commercial')

This project rocks and uses MIT-LICENSE.

About

A projects extension to manage your portfolio or case studies within SpinaCMS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •