{"id":13819074,"url":"https://github.com/drgcms/drg-cms","last_synced_at":"2025-05-16T04:32:20.037Z","repository":{"id":31815870,"uuid":"35382536","full_name":"drgcms/drg-cms","owner":"drgcms","description":"DRG CMS: Content management system for Ruby, Rails and MongoDB","archived":false,"fork":false,"pushed_at":"2024-03-24T10:59:22.000Z","size":2724,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T18:45:59.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drgcms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-10T18:21:31.000Z","updated_at":"2024-02-01T11:35:26.000Z","dependencies_parsed_at":"2023-01-14T19:50:08.120Z","dependency_job_id":"9be5863d-6df2-4571-b410-24bdb83060c4","html_url":"https://github.com/drgcms/drg-cms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drgcms%2Fdrg-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drgcms%2Fdrg-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drgcms%2Fdrg-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drgcms%2Fdrg-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drgcms","download_url":"https://codeload.github.com/drgcms/drg-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254469351,"owners_count":22076489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T08:00:39.271Z","updated_at":"2025-05-16T04:32:18.541Z","avatar_url":"https://github.com/drgcms.png","language":"Ruby","funding_links":[],"categories":["Happy Exploring 🤘"],"sub_categories":[],"readme":"# drg-cms\r\n\r\n[![Gem Version](http://img.shields.io/gem/v/drg_cms.svg)](https://rubygems.org/gems/drg_cms)\r\n[![Gem Downloads](https://img.shields.io/gem/dt/drg_cms.svg)](https://rubygems.org/gems/drg_cms)\r\n\r\n\r\nDRG CMS simplifies the programming of business applications. \r\nMinimal database experience and only basic programming skills are needed \r\nto create a data entry program. You can do it in 6 simple steps.\r\n\r\nStep 1: Create Model\u003cbr\u003e\r\nStep 2: Generate DRG Form\u003cbr\u003e\r\nStep 3: Edit Form\u003cbr\u003e\r\nStep 4: Define Labels and Help Text\u003cbr\u003e\r\nStep 5: Create Controls File (if required)\u003cbr\u003e\r\nStep 6: Include in application menu\u003cbr\u003e\r\n\r\nMost of the time, you will end up with two source files.\r\n\r\n\u003cb\u003eModel:\u003c/b\u003e Model file is a database document definition file written in Ruby\r\nlanguage. Model file holds fields definitions, \r\nindex definitions, dependencies, validations, callbacks and transformations \r\nfor a database document (record). \r\n\r\nAn example of a typical model file app/models/note.rb\r\n\r\n```ruby\r\nclass Note\r\ninclude Mongoid::Document\r\ninclude Mongoid::Timestamps\r\n\r\nfield   :title,       type: String\r\nfield   :body,        type: String\r\nfield   :time_begin,  type: DateTime\r\nfield   :duration,    type: Integer\r\nfield   :search,      type: String\r\n\r\nfield   :user_id,     type: BSON::ObjectId\r\n\r\nindex   user_id: 1\r\n\r\nvalidates :title,      presence: true\r\nvalidates :time_begin, presence: true\r\nvalidates :duration,   presence: true\r\n\r\nend\r\n```\r\n\r\n\u003cb\u003eForm:\u003c/b\u003e DRG Form file is a text file, written in the YAML markup language. It consists\r\nof three main parts.\u003cbr\u003e\r\n\r\n\u003cb\u003eindex:\u003c/b\u003e Which defines actions performed on database documents or \r\nset of document.\u003cbr\u003e\r\n\u003cb\u003eresult_set:\u003c/b\u003e Defines set of documents, document fields and actions \r\nwhich can be performed on a document.\u003cbr\u003e\r\n\u003cb\u003eform:\u003c/b\u003e Defines data entry fields for editing and viewing a single document.\u003cbr\u003e\r\n\r\nExample of form file for Note model app/forms/note.yaml\r\n\r\n```yaml\r\ntable: note\r\n\r\nindex:\r\n  filter: search as text_field\r\n  actions: standard\r\n\r\nresult_set:\r\n  filter: current_users_documents\r\n  actions:\r\n    1: edit\r\n\r\n  columns:\r\n    10:\r\n     name: title\r\n     width: 25%\r\n    20:\r\n      name: time_started\r\n      width: 10%\r\n      format: '%d.%m.%Y'\r\n    30:\r\n      name: duration\r\n\r\nform:\r\n  fields:\r\n  10:\r\n    name: user_id\r\n    type: readonly\r\n    eval: dc_name4_id,dc_user,name\r\n    default:\r\n      eval: 'session[:user_id]'    \r\n  20:\r\n    name: title\r\n    type: text_field\r\n    size: 50\r\n  30:\r\n    name: time_started\r\n    type: datetime_picker\r\n    options:\r\n      step: 15\r\n  40:\r\n    name: duration\r\n    type: select\r\n  50:\r\n    name: body\r\n    type: html_field\r\n    options: \"height: 500\"\r\n```\r\n\r\nAdd labels and help text to your project locales files.\r\n```yaml\r\nen:\r\n  helpers:\r\n    label:\r\n      diary:\r\n        tabletitle: Diary\r\n        choices4_duration: \"10 min:10,15 min:15,20 min:20,30 min:30,45 min:45,1 hour:60,1 hour 30 min:90,2 hours:120,2 hours 30 min:150,3 hours:180,4 hours:240,5 hours:300,6 hours:360,7 hours:420,8 hours:480\"\r\n\r\n        title: Title\r\n        body: Description\r\n        time_started: Start time\r\n        duration: Duration \r\n        search: Search\r\n        user_id: Owner\r\n\r\n    help:\r\n      diary:\r\n        title: Short title\r\n        body: Description of event or note\r\n        time_started: Time or date when note is created or event started\r\n        duration: Duration of event\r\n        search: Data used for searching data\r\n        user_id: Owner of the note\r\n  ```\r\nCombination of two source files and localisation data makes application\r\ndata entry program. Application data entry program implements all data\r\nentry operations on a database:\u003cbr\u003e\r\n\u003cli\u003eadd new document\u003cbr\u003e\r\n\u003cli\u003eedit document\u003cbr\u003e\r\n\u003cli\u003edelete document\u003cbr\u003e\r\n\u003cli\u003eview document\r\n\u003cbr\u003e\u003cbr\u003eAdd it into your application menu with this code:\r\n\r\n```ruby\r\ndc_link_to('Notes', 'book', { table: 'note' }, target: 'iframe_edit')\r\n```\r\n\r\nAnd when you need advanced program logic, you will implement it in \r\nthe control file. Control files code is injected into cmsedit\r\ncontroller during form load, and provides additional program logic required\r\nby data entry program.\r\n```ruby\r\n######################################################################\r\n# Drgcms controls for Notes application\r\n######################################################################\r\nmodule NoteControl\r\n\r\n######################################################################\r\n# Fill in currently logged user on new record action.\r\n######################################################################\r\ndef dc_new_record\r\n  @record.user_id = session[:user_id]\r\n  @record.time_started = Time.now.localtime\r\nend\r\n\r\n###########################################################################\r\n# Allow only current user documents to be displayed\r\n###########################################################################\r\ndef current_user_documents\r\n  user_filter_options(Note).and(user_id: session[:user_id]).order_by(id: -1)\r\nend\r\n\r\nend\r\n```\r\n\u003cbr\u003e\r\n\r\nVisit [gallery](https://www.drgcms.org/gallery) of DRG Forms\r\nusage in production.\r\n\r\n## Features\r\nDRG CMS uses Ruby on Rails, one of the most popular frameworks for \r\nbuilding web sites. Ruby on Rails guarantees highest level of application security and huge base of extensions which will help you when your application grows.\r\n\u003cbr\u003e\u003cbr\u003e\r\nDRG CMS uses MongoDB, leading NO-SQL document database, as database \r\nback-end with a help of mongoid gem. Mongoid's flexible document model \r\ndefines all document fields, indexes, dependencies, validations in a \r\nsingle model file with no database migrations required.\r\n\u003cbr\u003e\u003cbr\u003e\r\nDRG CMS has built-in user friendly role based database access system. Administrator\r\ndefines roles and roles rights (no access, can read, can edit) as web site policies.\r\nRoles are then assigned to users and policies can be assigned to documents (web pages)\r\nor even parts of a documents.\r\n\u003cbr\u003e\u003cbr\u003e\r\nDRG CMS can coexist with other frameworks which use MongoDB as database\r\nback-end. Use your favorite framework for data presentation and \r\nuse DRG Forms for rapid development of data entry forms.\r\n\u003cbr\u003e\u003cbr\u003e\r\nDRG CMS can coexist with other databases and Rails controllers. I can \r\nhighly recommend using DRG CMS in heterogeneous database Intranet \r\nprojects. For the last few years, DRG has been used for development of \r\nan in-house Intranet portal which uses MongoDB as primary database and\r\nconnects frequently to Oracle and MS-SQL databases.\r\n\r\n## Installation\r\n\r\nGo and [jumpstart](https://github.com/drgcms/drg-portal-jumpstart)\r\ninternal portal application with DRG CMS in just few minutes.\r\n\r\nProject Tracking\r\n----------------\r\n\r\n* [Visit DRG CMS web site](http://www.drgcms.org)\r\n\r\nCompatibility\r\n-------------\r\n\r\nDRG CMS is being actively developed since 2012 and has been live tested in production \r\nsince beginning. It runs against latest technology Ruby (3.1), Rails (7.0) \r\nand MongoDB (5.0) and had so far little or no problems advancing to latest versions \r\nof required programs.\r\n\r\nDocumentation\r\n-------------\r\n\r\nPlease see the DRG CMS website for up-to-date documentation:\r\n[www.drgcms.org](http://www.drgcms.org)\r\n\r\nLicense (MIT LICENCE)\r\n---------------------\r\n\r\nCopyright (c) 2012-2022 Damjan Rems\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\nCredits\r\n-------\r\n\r\nDamjan Rems: damjan dot rems at gmail dot com\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrgcms%2Fdrg-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrgcms%2Fdrg-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrgcms%2Fdrg-cms/lists"}