├── .editorconfig ├── .eslintignore ├── .gitattributes ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ └── help-and-other-questions.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── .yo-rc.json ├── LICENSE ├── README.md ├── __tests__ └── app.js ├── _config.yml ├── generators ├── app │ └── index.js ├── common │ ├── build │ │ └── dnn-package.js │ ├── csproj │ │ ├── App_LocalResources │ │ │ └── _Module.resx │ │ ├── NuGet.config │ │ ├── Providers │ │ │ └── DataProviders │ │ │ │ └── SqlDataProvider │ │ │ │ ├── 01.00.00.SqlDataProvider │ │ │ │ └── Uninstall.SqlDataProvider │ │ └── _Project.csproj │ └── src │ │ ├── License.md │ │ ├── ReleaseNotes.md │ │ ├── Resources │ │ ├── img │ │ │ └── extension.png │ │ └── styles │ │ │ └── module.scss │ │ └── _templates │ │ └── Markdown.html ├── gulp │ ├── build.js │ └── dnn-package.js ├── lib │ └── DnnGeneratorBase.js ├── mvc │ ├── index.js │ └── templates │ │ ├── App_LocalResources │ │ └── Settings.resx │ │ ├── Components │ │ └── FeatureController.cs │ │ ├── Controllers │ │ ├── HomeController.cs │ │ └── SettingsController.cs │ │ ├── Models │ │ └── Settings.cs │ │ ├── Resources │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ └── bootstrap.min.css │ │ │ ├── img │ │ │ │ ├── glyphicons-halflings-white.png │ │ │ │ └── glyphicons-halflings.png │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ └── bootstrap.min.js │ │ ├── img │ │ │ └── extension.png │ │ └── module.css │ │ ├── RouteConfig.cs │ │ ├── Views │ │ ├── Home │ │ │ ├── Edit.cshtml │ │ │ └── Index.cshtml │ │ ├── Settings │ │ │ └── Settings.cshtml │ │ ├── Shared │ │ │ └── _Layout.cshtml │ │ └── _ViewStart.cshtml │ │ ├── _BuildScripts │ │ └── webpack.config.js │ │ ├── manifest.dnn │ │ ├── package.json │ │ └── src │ │ └── index.jsx ├── personabar │ ├── index.js │ └── templates │ │ ├── ReactJS │ │ ├── _BuildScripts │ │ │ └── webpack.config.js │ │ ├── package.json │ │ └── src │ │ │ ├── app.jsx │ │ │ ├── components │ │ │ └── Module.jsx │ │ │ ├── containers │ │ │ ├── DevTools.js │ │ │ ├── Root.dev.js │ │ │ ├── Root.js │ │ │ └── Root.prod.js │ │ │ ├── reducers │ │ │ └── rootReducer.js │ │ │ ├── store │ │ │ └── configureStore.js │ │ │ └── utils │ │ │ └── index.jsx │ │ └── common │ │ ├── .eslintrc.js │ │ ├── MenuControllers │ │ └── AdminMenuController.cs │ │ ├── manifest.dnn │ │ └── src │ │ ├── Resources │ │ ├── css │ │ │ └── _Module.css │ │ └── scripts │ │ │ └── _Module.js │ │ └── View.html └── spa │ ├── index.js │ └── templates │ ├── ReactJS │ ├── jsx │ │ ├── .eslintrc.js │ │ ├── _BuildScripts │ │ │ └── webpack.config.js │ │ └── src │ │ │ ├── app.jsx │ │ │ ├── components │ │ │ └── Hello.jsx │ │ │ ├── edit.jsx │ │ │ └── settings.jsx │ └── tsx │ │ ├── _BuildScripts │ │ └── webpack.config.js │ │ ├── src │ │ ├── app.tsx │ │ ├── components │ │ │ └── Hello.tsx │ │ ├── edit.tsx │ │ └── settings.tsx │ │ └── tslint.json │ └── common │ ├── App_LocalResources │ ├── Edit.resx │ ├── Settings.resx │ └── View.resx │ ├── Components │ └── FeatureController.cs │ ├── Controllers │ └── DataController.cs │ ├── RouteConfig.cs │ ├── _BuildScripts │ ├── bs.js │ └── watch.js │ ├── manifest.dnn │ ├── package.json │ └── src │ ├── Edit.html │ ├── Settings.html │ └── View.html ├── package.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | coverage 2 | **/templates 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mtrutledge@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | *We have tried to make this as simple as possible. The most important part is when you want to test locally you need to create a link using `npm link` in your local generator-dnn directory.* 4 | 5 | ## Project organization 6 | 7 | * Branch `master` is always stable and release-ready. 8 | * Branch `development` contains the next versions features and bugs merged from pull requests. 9 | * Feature branches should be created for adding new features and branched off of `development`. 10 | * Bug fix branches should be created for fixing bugs and branched off of `development`. 11 | 12 | ## Opening a new issue 13 | 14 | **Do not open a duplicate issue!** 15 | 16 | 1. Look through existing issues to see if your issue already exists. 17 | 2. If your issue already exists, comment on its thread with any information you have. Even if this is simply to note that you are having the same problem, it is still helpful! 18 | 3. Always *be as descriptive as you can*. 19 | 4. What is the expected behavior? What is the actual behavior? What are the steps to reproduce? 20 | 5. Attach screenshots, videos, GIFs if possible. 21 | 6. **Include library version or branch experiencing the issue.** 22 | 7. **Include OS version and devices experiencing the issue.** 23 | 24 | ## Submitting a pull request 25 | 26 | 1. Find an issue to work on, or create a new one. *Avoid duplicates, please check existing issues!* 27 | 2. Fork the repo, or make sure you are synced with the latest changes on `development`. 28 | 3. Create a new branch with a sweet name: `git checkout -b issue_<##>_`. 29 | 4. Do some programming. 30 | 5. Write [unit tests](http://nshipster.com/unit-testing) when applicable. 31 | 6. Keep your code nice and clean by adhering to the coding standards & guidelines below. 32 | 7. Don't break unit tests or functionality. 33 | 8. Update the documentation header comments if needed. 34 | 9. **Rebase on `development` branch and resolve any conflicts _before submitting a pull request!_** 35 | 10. Submit a pull request to the `development` branch. 36 | 37 | **You should submit one pull request per feature!** The smaller the PR, the better your chances are of getting merged. Enormous PRs will likely take enormous amounts of time to review, or they will be rejected. 38 | 39 | ## Running the Yeoman Generator Locally 40 | 41 | Once you fork the repo and have it checkout out locally you will need to be able to test the generator locally. In order to do this go to the directory you have generator-dnn checkout to and run the following command 42 | 43 | `npm link` 44 | 45 | That will install your project dependencies and symlink a global module to your local file. After npm is done, you’ll be able to call `yo dnn` and you should be able to see your changes! 46 | 47 | # Style guidelines 48 | 49 | Try to stick to the style that is already in the files. eslint is installed and will let you know if you are making errors that need to be corrected. Please correct all linting errors. 50 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | ## Describe the bug 8 | A clear and concise description of what the bug is. 9 | 10 | ## To Reproduce 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | ## Expected behavior 18 | A clear and concise description of what you expected to happen. 19 | 20 | ## Screenshots 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | ## Errors 24 | Paste the error(s) related to this issue. 25 | 26 | ## Additional context 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | ## Is your feature request related to a problem? 8 | **Please describe.** 9 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 10 | 11 | ## Describe the solution you'd like 12 | A clear and concise description of what you want to happen. 13 | 14 | ## Describe alternatives you've considered 15 | A clear and concise description of any alternative solutions or features you've considered. 16 | 17 | ## Additional context 18 | Add any other context or screenshots about the feature request here. 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/help-and-other-questions.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Help and Other Questions 3 | about: Ask for help or others questions re. using the solution 4 | 5 | --- 6 | 7 | ## Please summarize your question in one sentence 8 | 9 | 10 | ## Give a more extended description 11 | 12 | 13 | ## Steps to reproduce (if needed) 14 | 15 | 16 | ## Other comments or remarks 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | ## Related to Issue 3 | Fixes # 4 | 5 | ## Description 6 | 7 | 8 | ## How Has This Been Tested? 9 | 10 | 11 | 12 | 13 | ## Screenshots (if appropriate): 14 | 15 | ## Types of changes 16 | 17 | - [ ] Bug fix (non-breaking change which fixes an issue) 18 | - [ ] New feature (non-breaking change which adds functionality) 19 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 20 | 21 | ## Checklist: 22 | 23 | 24 | - [ ] My code follows the code style of this project. 25 | - [ ] My change requires a change to the documentation. 26 | - [ ] I have updated the documentation accordingly. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "stable" 4 | -------------------------------------------------------------------------------- /.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-node": { 3 | "promptValues": { 4 | "authorName": "Matt Rutledge", 5 | "authorEmail": "mtrutledge@gmail.com", 6 | "authorUrl": "" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Matt Rutledge 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # generator-dnn [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] 2 | > Scaffolds DNN / DotNetNuke Modules, Persona Bar, Skin projects 3 | 4 | ## Installation 5 | 6 | First, install [Yeoman](http://yeoman.io) and generator-dnn using [yarn](https://yarnpkg.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)). 7 | 8 | ```bash 9 | yarn global add yo 10 | yarn global add generator-dnn 11 | ``` 12 | 13 | Then generate your new project: 14 | 15 | ```bash 16 | mkdir my-project-name 17 | cd my-project-name 18 | yo dnn 19 | ``` 20 | 21 | [More verbose instructions on how to use this.](http://www.dnnsoftware.com/community-blog/cid/155574/create-a-dnn-module-in-less-than-2-minutes) 22 | 23 | ## Getting To Know Yeoman 24 | 25 | * Yeoman has a heart of gold. 26 | * Yeoman is a person with feelings and opinions, but is very easy to work with. 27 | * Yeoman can be too opinionated at times but is easily convinced not to be. 28 | * Feel free to [learn more about Yeoman](http://yeoman.io/). 29 | 30 | ## More Documentation 31 | 32 | Want to learn more or how to build the gnerator code locally? 33 | 34 | [Project Documentation](https://mtrutledge.github.io/generator-dnn/) 35 | 36 | ## License 37 | 38 | MIT © [Matt Rutledge]() 39 | 40 | 41 | [npm-image]: https://badge.fury.io/js/generator-dnn.svg 42 | [npm-url]: https://npmjs.org/package/generator-dnn 43 | [travis-image]: https://travis-ci.org/mtrutledge/generator-dnn.svg?branch=master 44 | [travis-url]: https://travis-ci.org/mtrutledge/generator-dnn 45 | [daviddm-image]: https://david-dm.org/mtrutledge/generator-dnn.svg?theme=shields.io 46 | [daviddm-url]: https://david-dm.org/mtrutledge/generator-dnn 47 | -------------------------------------------------------------------------------- /__tests__/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const path = require('path'); 3 | const assert = require('yeoman-assert'); 4 | const helpers = require('yeoman-test'); 5 | 6 | describe('generator-dnn:mvc', () => { 7 | beforeAll(() => { 8 | return helpers 9 | .run(path.join(__dirname, '../generators/mvc')) 10 | .withArguments(['--noinstall']) 11 | .withPrompts({ 12 | company: 'Believe', 13 | name: 'TestMVC', 14 | description: 'Test Build Module', 15 | companyUrl: 'www.believekids.com', 16 | emailAddy: 'mtrutledge@gmail.com' 17 | }); 18 | }); 19 | 20 | it('created files', () => { 21 | assert(true); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /generators/app/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const Generator = require('yeoman-generator'); 3 | const chalk = require('chalk'); 4 | const yosay = require('yosay'); 5 | const updateNotifier = require('update-notifier'); 6 | const pkg = require('../../package.json'); 7 | 8 | updateNotifier({ 9 | pkg 10 | }).notify({ 11 | message: 'Run yo and select Update Generators to get the latest' 12 | }); 13 | 14 | module.exports = class extends Generator { 15 | prompting() { 16 | // Have Yeoman greet the user. 17 | this.log(yosay('Welcome to the ' + chalk.green('DNN') + ' project generator!')); 18 | this.log(chalk.white('This scaffolds the project in your current directory.')); 19 | 20 | 21 | const prompts = [ 22 | { 23 | when: !this.options.projType, 24 | type: 'list', 25 | name: 'projType', 26 | message: 'What type of project would you like to scaffold?', 27 | choices: [ 28 | { name: 'MVC Module', value: 'mvc' }, 29 | { name: 'SPA Module', value: 'spa' }, 30 | { name: 'Persona Bar', value: 'personabar' } 31 | ] 32 | }, 33 | { 34 | when: !this.options.dnnHost, 35 | type: 'input', 36 | name: 'dnnHost', 37 | message: 'What is the url to your local DNN site?', 38 | default: 'http://dnndev.me', 39 | store: true, 40 | validate: str => { 41 | return str.length > 0; 42 | } 43 | }, 44 | { 45 | when: !this.options.dnnRoot, 46 | type: 'input', 47 | name: 'dnnRoot', 48 | message: 'What is the local path to the root of your DNN site?', 49 | store: true, 50 | validate: str => { 51 | return str.length > 0; 52 | } 53 | } 54 | ]; 55 | 56 | return this.prompt(prompts).then(props => { 57 | // To access props later use this.props.someAnswer; 58 | this.props = props; 59 | }); 60 | } 61 | 62 | composing() { 63 | const options = { 64 | projType: this.props.value, 65 | dnnHost: this.props.dnnHost, 66 | dnnRoot: this.props.dnnRoot 67 | }; 68 | 69 | this.composeWith(require.resolve(`../${this.props.projType}`), options); 70 | } 71 | 72 | writing() {} 73 | 74 | install() {} 75 | }; 76 | -------------------------------------------------------------------------------- /generators/common/build/dnn-package.js: -------------------------------------------------------------------------------- 1 | // require modules 2 | var path = require("path"); 3 | var fs = require('fs'); 4 | var archiver = require('archiver'); 5 | var package = require('../package.json'); 6 | 7 | function createResourcesArchive(){ 8 | var ws = fs.createWriteStream(`dist/Resources.zip`); 9 | var archive = archiver('zip', { 10 | zlib: { level: 9 } // Sets the compression level. 11 | }); 12 | 13 | archive.pipe(ws); 14 | ws.on('end', function() { 15 | console.log('Data has been drained'); 16 | }); 17 | ws.on("close", function() { console.log(archive.pointer() + ' total bytes'); console.log("Created Resources"); createInstaller(); }); 18 | 19 | archive.glob("**/*.{cshtml,ascx,asmx,htm,html,js,css,resx,png,gif,svg,jpg}", { cwd: "dist" }, { prefix: "" }); 20 | 21 | archive.finalize(); 22 | return ws; 23 | } 24 | 25 | function createInstaller() { 26 | 27 | var outputPath = path.resolve(`dist/${package.name}_${package.version}_Install.zip`); 28 | if(fs.existsSync(outputPath)) { 29 | console.log(`Removing existing package ${outputPath}`); 30 | fs.unlinkSync(outputPath); 31 | } 32 | 33 | var output = fs.createWriteStream(outputPath); 34 | var archive = archiver('zip', { 35 | zlib: { level: 9 } // Sets the compression level. 36 | }); 37 | archive.on('warning', function(err) { 38 | if (err.code === 'ENOENT') { 39 | // log warning 40 | } else { 41 | // throw error 42 | throw err; 43 | } 44 | }); 45 | archive.on('error', function(err) { 46 | throw err; 47 | }); 48 | archive.pipe(output); 49 | 50 | output.on('end', function() { 51 | console.log('Data has been drained'); 52 | }); 53 | 54 | // listen for all archive data to be written 55 | // 'close' event is fired only when a file descriptor is involved 56 | output.on('close', function() { 57 | fs.unlinkSync(path.resolve("dist/Resources.zip")); 58 | console.log(archive.pointer() + ' total bytes'); 59 | console.log('DNN Install Package Created.'); 60 | }); 61 | 62 | archive.glob("bin/*.*", { cwd: "dist", ignore: [outputPath] }); 63 | archive.glob("Providers/**/*.*", { cwd: "dist", ignore: [outputPath] }); 64 | archive.glob("*.{txt,dnn}", { cwd: "dist", ignore: [outputPath] }); 65 | archive.file(path.resolve("dist/Resources.zip"), { name: "Resources.zip" }); 66 | 67 | archive.finalize(); 68 | } 69 | 70 | createResourcesArchive(); -------------------------------------------------------------------------------- /generators/common/csproj/App_LocalResources/_Module.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | <%= menuLinkName %> 122 | 123 | -------------------------------------------------------------------------------- /generators/common/csproj/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /generators/common/csproj/Providers/DataProviders/SqlDataProvider/01.00.00.SqlDataProvider: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtrutledge/generator-dnn/8143dec94b2728c5bed1406e0c287c993ff78120/generators/common/csproj/Providers/DataProviders/SqlDataProvider/01.00.00.SqlDataProvider -------------------------------------------------------------------------------- /generators/common/csproj/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtrutledge/generator-dnn/8143dec94b2728c5bed1406e0c287c993ff78120/generators/common/csproj/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider -------------------------------------------------------------------------------- /generators/common/csproj/_Project.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= namespace %>.<%= moduleName %> 5 | net462 6 | bin 7 | false 8 | false 9 | <%= namespace %> 10 | <%= namespace %> 11 | <%= moduleName %> 12 | <%= currentYear%> 13 | <%= moduleName %> 14 | 1.0.0.0 15 | 1.0.0.0 16 | <%= description %> 17 | en-US 18 | 19 | Library 20 | 21 | Portable 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | win-x64 44 | $(NuGetPackageRoot)microsoft.targetingpack.netframework.v4.6.2\1.0.1\lib\net462\ 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /generators/common/src/License.md: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | 4 | Copyright (c) <%= currentYear%> 5 | 6 | All rights reserved. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /generators/common/src/ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | ## v<%= version%> 3 | Intitial Release -------------------------------------------------------------------------------- /generators/common/src/Resources/img/extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtrutledge/generator-dnn/8143dec94b2728c5bed1406e0c287c993ff78120/generators/common/src/Resources/img/extension.png -------------------------------------------------------------------------------- /generators/common/src/Resources/styles/module.scss: -------------------------------------------------------------------------------- 1 | #<%= moduleName%>-container { 2 | 3 | } -------------------------------------------------------------------------------- /generators/common/src/_templates/Markdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%%= htmlWebpackPlugin.options.title %%> 6 | 7 | 8 | <%%= htmlWebpackPlugin.options.bodyHTML %%> 9 | 10 | -------------------------------------------------------------------------------- /generators/gulp/build.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var msbuild = require('gulp-msbuild'); 3 | var nugetRestore = require('gulp-nuget-restore'); 4 | var assemblyInfo = require('gulp-dotnet-assembly-info'); 5 | var config = require('../../package.json'); 6 | 7 | gulp.task('nuget', function() { 8 | return gulp 9 | .src('./packages.config') 10 | .pipe(nugetRestore({ additionalArgs: ['-PackagesDirectory', '../packages'] })); 11 | }); 12 | 13 | gulp.task('assemblyInfo', function() { 14 | return gulp 15 | .src(['**/AssemblyInfo.cs', '!node_modules/**']) 16 | .pipe( 17 | assemblyInfo({ 18 | title: config.dnnModule.friendlyName, 19 | description: config.description, 20 | version: config.version, 21 | fileVersion: config.version, 22 | company: config.dnnModule.owner.organization, 23 | copyright: function() { 24 | return ( 25 | 'Copyright ' + 26 | new Date().getFullYear() + 27 | ' by ' + 28 | config.dnnModule.owner.organization 29 | ); 30 | } 31 | }) 32 | ) 33 | .pipe(gulp.dest('.')); 34 | }); 35 | 36 | gulp.task('build', function() { 37 | return gulp.src('./<%= moduleName %>.csproj').pipe( 38 | msbuild({ 39 | toolsVersion: 'auto', 40 | targets: ['Clean', 'Build'], 41 | errorOnFail: true, 42 | stdout: true, 43 | verbosity: 'minimal', 44 | properties: { 45 | DeployOnBuild: false, 46 | Configuration: 'Release' 47 | } 48 | }) 49 | ); 50 | }); 51 | -------------------------------------------------------------------------------- /generators/gulp/dnn-package.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var config = require('../../package.json'); 3 | var zip = require('gulp-zip'); 4 | var markdown = require('gulp-markdown'); 5 | var rename = require('gulp-rename'); 6 | var es = require('event-stream'); 7 | 8 | gulp.task('packageInstall', function() { 9 | var packageName = config.dnnModule.fullName + '_' + config.version; 10 | 11 | var resourceZip = gulp 12 | .src( 13 | [ 14 | '**/*.cshtml', 15 | '**/*.ascx', 16 | '**/*.asmx', 17 | '**/*.css', 18 | '**/*.html', 19 | '**/*.htm', 20 | '**/*.resx', 21 | '**/*.aspx', 22 | '**/*.js', 23 | '**/*.txt', 24 | '**/*.png', 25 | '**/*.gif', 26 | '**/*.jpg', 27 | '**/*.svg', 28 | '!**/web.config', 29 | '!**/gulpfile.js', 30 | '!**/{_BuildScripts,_BuildScripts/**}', 31 | '!**/{_Packages,_Packages/**}', 32 | '!**/{bin,bin/**}', 33 | '!**/{obj,obj/**}', 34 | '!**/{packages,packages/**}', 35 | '!**/{node_modules,node_modules/**}', 36 | '!**/{_PublishedWebsites,_PublishedWebsites/**}' 37 | ], 38 | { 39 | base: '.' 40 | } 41 | ) 42 | .pipe(zip('Resources.zip')); 43 | 44 | return es 45 | .merge( 46 | gulp.src([ 47 | '**/<%= namespace%>.<%= moduleName %>.dll', 48 | '**/<%= moduleName %>.dnn', 49 | '**/*.SqlDataProvider', 50 | '!**/gulpfile.js', 51 | '!**/{_BuildScripts,_BuildScripts/**}', 52 | '!**/{_Packages,_Packages/**}', 53 | '!**/{obj,obj/**}', 54 | '!**/{packages,packages/**}', 55 | '!**/{node_modules,node_modules/**}', 56 | '!**/{_PublishedWebsites,_PublishedWebsites/**}' 57 | ]), 58 | gulp 59 | .src(config.dnnModule.pathToSupplementaryFiles + 'License.md') 60 | .pipe(markdown()) 61 | .pipe(rename('License.txt')), 62 | gulp 63 | .src(config.dnnModule.pathToSupplementaryFiles + 'ReleaseNotes.md') 64 | .pipe(markdown()) 65 | .pipe(rename('ReleaseNotes.txt')), 66 | resourceZip 67 | ) 68 | .pipe(zip(packageName + '_Install.zip')) 69 | .pipe(gulp.dest(config.dnnModule.packagesPath)); 70 | }); 71 | 72 | gulp.task('packageSource', function() { 73 | var packageName = config.dnnModule.fullName + '_' + config.version; 74 | 75 | var resourceZip = gulp 76 | .src( 77 | [ 78 | '**/*.*', 79 | '!**/{License.txt,ReleaseNotes.txt, *-lock.json}', 80 | '!**/{_Packages,_Packages/**}', 81 | '!**/{bin,bin/**}', 82 | '!**/{obj,obj/**}', 83 | '!**/{packages,packages/**}', 84 | '!**/{node_modules,node_modules/**}', 85 | '!**/{_PublishedWebsites,_PublishedWebsites/**}' 86 | ], 87 | { 88 | base: '.' 89 | } 90 | ) 91 | .pipe(zip('Resources.zip')); 92 | 93 | return es 94 | .merge( 95 | gulp.src([ 96 | '**/<%= namespace %>.<%= moduleName %>.dll', 97 | '**/<%= moduleName %>.dnn', 98 | '**/*.SqlDataProvider', 99 | '!**/{obj,obj/**}', 100 | '!**/{_PublishedWebsites,_PublishedWebsites/**}' 101 | ]), 102 | gulp 103 | .src(config.dnnModule.pathToSupplementaryFiles + 'License.md') 104 | .pipe(markdown()) 105 | .pipe(rename('License.txt')), 106 | gulp 107 | .src(config.dnnModule.pathToSupplementaryFiles + 'ReleaseNotes.md') 108 | .pipe(markdown()) 109 | .pipe(rename('ReleaseNotes.txt')), 110 | resourceZip 111 | ) 112 | .pipe(zip(packageName + '_Source.zip')) 113 | .pipe(gulp.dest(config.dnnModule.packagesPath)); 114 | }); 115 | 116 | gulp.task('package', gulp.parallel(['packageInstall', 'packageSource'])); 117 | -------------------------------------------------------------------------------- /generators/lib/DnnGeneratorBase.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const Generator = require('yeoman-generator'); 3 | const chalk = require('chalk'); 4 | const uuid = require('uuid-v4'); 5 | const pascalCase = require('pascal-case'); 6 | const which = require('which'); 7 | 8 | module.exports = class DnnGeneratorBase extends Generator { 9 | constructor(args, opts) { 10 | super(args, opts); 11 | 12 | // This method adds support for a `--test` flag 13 | this.option('noinstall'); 14 | } 15 | 16 | _hasYarn() { 17 | return which.sync('yarn', { nothrow: true }) !== undefined; 18 | } 19 | 20 | _generateGuid() { 21 | return uuid(); 22 | } 23 | 24 | _pascalCaseName(val) { 25 | return pascalCase(val); 26 | } 27 | 28 | _createSolutionFromTemplate() { 29 | this.log(chalk.white('Creating sln.')); 30 | return this.spawnCommandSync('dotnet', [ 31 | 'new', 32 | 'sln', 33 | '-n', 34 | this.props.company, 35 | '-o', 36 | this.destinationRoot() 37 | ]); 38 | } 39 | 40 | _addProjectToSolution() { 41 | this.log(chalk.white('Adding project to sln.')); 42 | this.spawnCommandSync('dotnet', [ 43 | 'sln', 44 | this.destinationPath(this.props.company + '.sln'), 45 | 'add', 46 | this.destinationPath(`${this.props.moduleName}/${this.props.moduleName}.csproj`) 47 | ]); 48 | } 49 | 50 | _writeSolution() { 51 | let namespace = this.props.company; 52 | let slnFileName = this.destinationPath(namespace + '.sln'); 53 | this.log( 54 | chalk.white( 55 | 'Looking for sln [' + slnFileName + ']. Result: ' + this.fs.exists(slnFileName) 56 | ) 57 | ); 58 | if (this.fs.exists(slnFileName) === false) { 59 | this._createSolutionFromTemplate(); 60 | } 61 | this._addProjectToSolution(); 62 | } 63 | 64 | _copyCommon(namespace, moduleName) { 65 | this.fs.copyTpl( 66 | this.templatePath('../../gulp/*.js'), 67 | this.destinationPath(moduleName + '/_BuildScripts/gulp/'), 68 | { 69 | namespace: namespace, 70 | moduleName: moduleName 71 | } 72 | ); 73 | } 74 | 75 | _defaultInstall() { 76 | if (!this.options.noinstall) { 77 | let hasYarn = this._hasYarn(); 78 | process.chdir(this.props.moduleName); 79 | this.installDependencies({ npm: !hasYarn, bower: false, yarn: hasYarn }); 80 | } 81 | } 82 | 83 | _writeJsConfig() { 84 | this.fs.extendJSON(this.destinationPath(this.props.moduleName + '/jsconfig.json'), { 85 | compilerOptions: { 86 | target: 'es6', 87 | module: 'commonjs', 88 | allowSyntheticDefaultImports: true 89 | }, 90 | exclude: ['node_modules'] 91 | }); 92 | } 93 | 94 | _writeTsConfig() { 95 | this.fs.extendJSON(this.destinationPath(this.props.moduleName + '/tsconfig.json'), { 96 | compilerOptions: { 97 | module: 'es6', 98 | target: 'es6', 99 | moduleResolution: 'node', 100 | baseUrl: 'src', 101 | allowSyntheticDefaultImports: true, 102 | noImplicitAny: false, 103 | sourceMap: true, 104 | outDir: 'ts-build', 105 | jsx: 'react' 106 | }, 107 | exclude: ['node_modules'] 108 | }); 109 | } 110 | 111 | _writeBabelRc() { 112 | this.fs.extendJSON(this.destinationPath(this.props.moduleName + '/.babelrc'), { 113 | presets: ['@babel/preset-env', '@babel/preset-react'], 114 | plugins: [ 115 | '@babel/plugin-transform-object-assign', 116 | '@babel/plugin-proposal-object-rest-spread' 117 | ], 118 | env: { 119 | production: { 120 | plugins: ['transform-react-remove-prop-types'] 121 | } 122 | } 123 | }); 124 | } 125 | 126 | _createYarnWorkspace() { 127 | if (!this._hasYarn()) return; 128 | 129 | const workspaceJson = { 130 | name: this.props.namespace, 131 | version: '1.0.0', 132 | description: 'Project workspace', 133 | private: true, 134 | workspaces: [this.props.moduleName], 135 | scripts: { 136 | // eslint-disable-next-line prettier/prettier 137 | 'test': 'lerna run test', 138 | // eslint-disable-next-line prettier/prettier 139 | 'clean': 'lerna run clean', 140 | // eslint-disable-next-line prettier/prettier 141 | 'build': 'lerna run build', 142 | // eslint-disable-next-line prettier/prettier 143 | 'build-client': 'lerna run build-client', 144 | // eslint-disable-next-line prettier/prettier 145 | 'package': 'lerna run package' 146 | }, 147 | devDependencies: { 148 | // eslint-disable-next-line prettier/prettier 149 | 'browser-sync': '^2.26.3' 150 | }, 151 | dependencies: { 152 | // eslint-disable-next-line prettier/prettier 153 | 'lerna': '^3.8.4' 154 | } 155 | }; 156 | 157 | this.fs.extendJSON(this.destinationPath('package.json'), workspaceJson); 158 | 159 | const lernaJson = { 160 | lerna: '3.8.4', 161 | npmClient: 'yarn', 162 | packages: [this.props.moduleName], 163 | version: '1.0.0' 164 | }; 165 | 166 | this.fs.extendJSON(this.destinationPath('lerna.json'), lernaJson); 167 | } 168 | }; 169 | -------------------------------------------------------------------------------- /generators/mvc/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const DnnGeneratorBase = require('../lib/DnnGeneratorBase'); 3 | const chalk = require('chalk'); 4 | 5 | module.exports = class extends DnnGeneratorBase { 6 | constructor(args, opts) { 7 | super(args, opts); 8 | 9 | // This method adds support for a `--test` flag 10 | this.option('noinstall'); 11 | } 12 | 13 | prompting() { 14 | const prompts = [ 15 | { 16 | when: !this.options.company, 17 | type: 'input', 18 | name: 'company', 19 | message: 'Namespace for your module (Usually a company name)?', 20 | store: true, 21 | validate: str => { 22 | return str.length > 0; 23 | } 24 | }, 25 | { 26 | when: !this.options.name, 27 | type: 'input', 28 | name: 'name', 29 | message: 'What is the name of your MVC Module?', 30 | default: this.appname, 31 | validate: str => { 32 | return str.length > 0; 33 | } 34 | }, 35 | { 36 | when: !this.options.description, 37 | type: 'input', 38 | name: 'description', 39 | message: 'Describe your module:', 40 | validate: str => { 41 | return str.length > 0; 42 | } 43 | }, 44 | { 45 | when: !this.options.companyUrl, 46 | type: 'input', 47 | name: 'companyUrl', 48 | message: 'Company Website:', 49 | store: true, 50 | validate: str => { 51 | return str.length > 0; 52 | } 53 | }, 54 | { 55 | when: !this.options.emailAddy, 56 | type: 'input', 57 | name: 'emailAddy', 58 | message: 'Your e-mail address:', 59 | store: true, 60 | validate: str => { 61 | return str.length > 0; 62 | } 63 | } 64 | ]; 65 | 66 | return this.prompt(prompts).then(props => { 67 | // To access props later use this.props.someAnswer; 68 | props.currentDate = new Date(); 69 | props.namespace = this._pascalCaseName(props.company); 70 | props.moduleName = this._pascalCaseName(props.name); 71 | 72 | this.props = props; 73 | }); 74 | } 75 | 76 | writing() { 77 | this.log(chalk.white('Creating MVC Module.')); 78 | 79 | let namespace = this.props.namespace; 80 | let moduleName = this.props.moduleName; 81 | let currentDate = this.props.currentDate; 82 | 83 | let template = { 84 | namespace: namespace, 85 | moduleName: moduleName, 86 | moduleFriendlyName: this.props.name, 87 | description: this.props.description, 88 | companyUrl: this.props.companyUrl, 89 | emailAddy: this.props.emailAddy, 90 | currentYear: currentDate.getFullYear(), 91 | version: '1.0.0', 92 | menuLinkName: this.props.menuLinkName, 93 | parentMenu: this.props.parentMenu 94 | }; 95 | 96 | this.fs.copyTpl( 97 | this.templatePath('../../common/build/*.*'), 98 | this.destinationPath(moduleName + '/_BuildScripts'), 99 | template 100 | ); 101 | 102 | this.fs.copyTpl( 103 | this.templatePath('../../common/csproj/Providers/**'), 104 | this.destinationPath(moduleName + '/Providers'), 105 | template 106 | ); 107 | 108 | this.fs.copyTpl( 109 | this.templatePath('../../common/csproj/NuGet.config'), 110 | this.destinationPath(moduleName + '/NuGet.config'), 111 | template 112 | ); 113 | 114 | // Do all templated copies 115 | this.fs.copyTpl( 116 | this.templatePath('../../common/src/**'), 117 | this.destinationPath(moduleName + '/src/'), 118 | template 119 | ); 120 | 121 | this.fs.copyTpl( 122 | this.templatePath('App_LocalResources/**'), 123 | this.destinationPath(moduleName + '/App_LocalResources/'), 124 | template 125 | ); 126 | 127 | this.fs.copyTpl( 128 | this.templatePath('_BuildScripts/**'), 129 | this.destinationPath(moduleName + '/_BuildScripts/'), 130 | template 131 | ); 132 | 133 | this.fs.copyTpl( 134 | this.templatePath('Components/**'), 135 | this.destinationPath(moduleName + '/Components/'), 136 | template 137 | ); 138 | 139 | this.fs.copyTpl( 140 | this.templatePath('Controllers/**'), 141 | this.destinationPath(moduleName + '/Controllers/'), 142 | template 143 | ); 144 | 145 | this.fs.copyTpl( 146 | this.templatePath('Models/**'), 147 | this.destinationPath(moduleName + '/Models/'), 148 | template 149 | ); 150 | 151 | this.fs.copyTpl( 152 | this.templatePath('src/**'), 153 | this.destinationPath(moduleName + '/src/'), 154 | template 155 | ); 156 | 157 | this.fs.copyTpl( 158 | this.templatePath('Views/**'), 159 | this.destinationPath(moduleName + '/Views/'), 160 | template 161 | ); 162 | 163 | this.fs.copyTpl( 164 | this.templatePath('RouteConfig.cs'), 165 | this.destinationPath(moduleName + '/RouteConfig.cs'), 166 | { 167 | namespace: namespace, 168 | moduleName: moduleName 169 | } 170 | ); 171 | 172 | this.fs.copyTpl( 173 | this.templatePath('manifest.dnn'), 174 | this.destinationPath(moduleName + '/' + moduleName + '.dnn'), 175 | { 176 | namespace: namespace, 177 | moduleName: moduleName, 178 | moduleFriendlyName: this.props.name, 179 | description: this.props.description, 180 | companyUrl: this.props.companyUrl, 181 | emailAddy: this.props.emailAddy 182 | } 183 | ); 184 | 185 | this.fs.copyTpl( 186 | this.templatePath('../../common/csproj/_Project.csproj'), 187 | this.destinationPath(moduleName + '/' + moduleName + '.csproj'), 188 | template 189 | ); 190 | 191 | this.fs.copyTpl( 192 | this.templatePath('package.json'), 193 | this.destinationPath(moduleName + '/package.json'), 194 | template 195 | ); 196 | 197 | const pkgJson = { 198 | devDependencies: { 199 | // eslint-disable-next-line prettier/prettier 200 | 'archiver': '^3.0.0', 201 | 'copy-webpack-plugin': '^4.6.0', 202 | 'html-webpack-plugin': '^3.2.0', 203 | // eslint-disable-next-line prettier/prettier 204 | 'marked': '^0.5.2', 205 | // eslint-disable-next-line prettier/prettier 206 | 'webpack': '^4.27.1', 207 | 'webpack-cli': '^3.1.2', 208 | 'webpack-dev-server': '^3.1.10', 209 | 'webpack-node-externals': '^1.7.2' 210 | } 211 | }; 212 | 213 | // Extend package.json file in destination path 214 | this.fs.extendJSON(this.destinationPath(moduleName + '/package.json'), pkgJson); 215 | } 216 | 217 | install() { 218 | this._writeSolution(); 219 | this._defaultInstall(); 220 | } 221 | 222 | end() { 223 | this.log(chalk.white('Installed MVC Module npm Dependencies.')); 224 | this.log(chalk.white('Running dotnet restore.')); 225 | this.spawnCommand('dotnet', ['restore']); 226 | process.chdir('../'); 227 | this.log(chalk.white('All Ready!')); 228 | } 229 | }; 230 | -------------------------------------------------------------------------------- /generators/mvc/templates/App_LocalResources/Settings.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Basic Settings 122 | 123 | 124 | Module Settings 125 | 126 | 127 | Put your value for Setting 1 here. 128 | 129 | 130 | Setting One 131 | 132 | 133 | Put your value for Setting 2 here. 134 | 135 | 136 | Setting Two 137 | 138 | -------------------------------------------------------------------------------- /generators/mvc/templates/Components/FeatureController.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ' Copyright (c) 2015 Christoc.com 3 | ' All rights reserved. 4 | ' 5 | ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 6 | ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 7 | ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 8 | ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 9 | ' DEALINGS IN THE SOFTWARE. 10 | ' 11 | */ 12 | 13 | using System.Collections.Generic; 14 | //using System.Xml; 15 | using DotNetNuke.Entities.Modules; 16 | using DotNetNuke.Services.Search; 17 | 18 | namespace <%= namespace%>.Modules.<%= moduleName %>.Components 19 | { 20 | 21 | /// ----------------------------------------------------------------------------- 22 | /// 23 | /// The Controller class for DnnMvcModule 24 | /// 25 | /// The FeatureController class is defined as the BusinessController in the manifest file (.dnn) 26 | /// DotNetNuke will poll this class to find out which Interfaces the class implements. 27 | /// 28 | /// The IPortable interface is used to import/export content from a DNN module 29 | /// 30 | /// The ISearchable interface is used by DNN to index the content of a module 31 | /// 32 | /// The IUpgradeable interface allows module developers to execute code during the upgrade 33 | /// process for a module. 34 | /// 35 | /// Below you will find stubbed out implementations of each, uncomment and populate with your own data 36 | /// 37 | /// ----------------------------------------------------------------------------- 38 | 39 | //uncomment the interfaces to add the support. 40 | public class FeatureController //: IPortable, ISearchable, IUpgradeable 41 | { 42 | 43 | 44 | #region Optional Interfaces 45 | 46 | /// ----------------------------------------------------------------------------- 47 | /// 48 | /// ExportModule implements the IPortable ExportModule Interface 49 | /// 50 | /// The Id of the module to be exported 51 | /// ----------------------------------------------------------------------------- 52 | //public string ExportModule(int ModuleID) 53 | //{ 54 | //string strXML = ""; 55 | 56 | //List colDnnMvcModules = GetDnnMvcModules(ModuleID); 57 | //if (colDnnMvcModules.Count != 0) 58 | //{ 59 | // strXML += ""; 60 | 61 | // foreach (DnnMvcModuleInfo objDnnMvcModule in colDnnMvcModules) 62 | // { 63 | // strXML += ""; 64 | // strXML += "" + DotNetNuke.Common.Utilities.XmlUtils.XMLEncode(objDnnMvcModule.Content) + ""; 65 | // strXML += ""; 66 | // } 67 | // strXML += ""; 68 | //} 69 | 70 | //return strXML; 71 | 72 | // throw new System.NotImplementedException("The method or operation is not implemented."); 73 | //} 74 | 75 | /// ----------------------------------------------------------------------------- 76 | /// 77 | /// ImportModule implements the IPortable ImportModule Interface 78 | /// 79 | /// The Id of the module to be imported 80 | /// The content to be imported 81 | /// The version of the module to be imported 82 | /// The Id of the user performing the import 83 | /// ----------------------------------------------------------------------------- 84 | //public void ImportModule(int ModuleID, string Content, string Version, int UserID) 85 | //{ 86 | //XmlNode xmlDnnMvcModules = DotNetNuke.Common.Globals.GetContent(Content, "DnnMvcModules"); 87 | //foreach (XmlNode xmlDnnMvcModule in xmlDnnMvcModules.SelectNodes("DnnMvcModule")) 88 | //{ 89 | // DnnMvcModuleInfo objDnnMvcModule = new DnnMvcModuleInfo(); 90 | // objDnnMvcModule.ModuleId = ModuleID; 91 | // objDnnMvcModule.Content = xmlDnnMvcModule.SelectSingleNode("content").InnerText; 92 | // objDnnMvcModule.CreatedByUser = UserID; 93 | // AddDnnMvcModule(objDnnMvcModule); 94 | //} 95 | 96 | // throw new System.NotImplementedException("The method or operation is not implemented."); 97 | //} 98 | 99 | /// ----------------------------------------------------------------------------- 100 | /// 101 | /// GetSearchItems implements the ISearchable Interface 102 | /// 103 | /// The ModuleInfo for the module to be Indexed 104 | /// ----------------------------------------------------------------------------- 105 | //public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo) 106 | //{ 107 | //SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection(); 108 | 109 | //List colDnnMvcModules = GetDnnMvcModules(ModInfo.ModuleID); 110 | 111 | //foreach (DnnMvcModuleInfo objDnnMvcModule in colDnnMvcModules) 112 | //{ 113 | // SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objDnnMvcModule.Content, objDnnMvcModule.CreatedByUser, objDnnMvcModule.CreatedDate, ModInfo.ModuleID, objDnnMvcModule.ItemId.ToString(), objDnnMvcModule.Content, "ItemId=" + objDnnMvcModule.ItemId.ToString()); 114 | // SearchItemCollection.Add(SearchItem); 115 | //} 116 | 117 | //return SearchItemCollection; 118 | 119 | // throw new System.NotImplementedException("The method or operation is not implemented."); 120 | //} 121 | 122 | /// ----------------------------------------------------------------------------- 123 | /// 124 | /// UpgradeModule implements the IUpgradeable Interface 125 | /// 126 | /// The current version of the module 127 | /// ----------------------------------------------------------------------------- 128 | //public string UpgradeModule(string Version) 129 | //{ 130 | // throw new System.NotImplementedException("The method or operation is not implemented."); 131 | //} 132 | 133 | #endregion 134 | 135 | } 136 | 137 | } 138 | -------------------------------------------------------------------------------- /generators/mvc/templates/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 3 | ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 4 | ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 5 | ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 6 | ' DEALINGS IN THE SOFTWARE. 7 | */ 8 | using DotNetNuke.Web.Mvc.Framework.Controllers; 9 | using DotNetNuke.Collections; 10 | using System.Web.Mvc; 11 | using DotNetNuke.Security; 12 | using DotNetNuke.Web.Mvc.Framework.ActionFilters; 13 | 14 | namespace <%= namespace%>.Modules.<%= moduleName %>.Controllers 15 | { 16 | [DnnHandleError] 17 | public class HomeController : DnnController 18 | { 19 | /// 20 | /// 21 | /// 22 | /// 23 | [ModuleAction(ControlKey = "Edit", TitleKey = "AddItem")] 24 | public ActionResult Index() 25 | { 26 | return View(); 27 | } 28 | 29 | /// 30 | /// 31 | /// 32 | /// 33 | public ActionResult Edit() 34 | { 35 | ViewBag.Message = "Your application description page."; 36 | 37 | return View(); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /generators/mvc/templates/Controllers/SettingsController.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 3 | ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 4 | ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 5 | ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 6 | ' DEALINGS IN THE SOFTWARE. 7 | */ 8 | using DotNetNuke.Web.Mvc.Framework.Controllers; 9 | using DotNetNuke.Collections; 10 | using System.Web.Mvc; 11 | using DotNetNuke.Security; 12 | using DotNetNuke.Web.Mvc.Framework.ActionFilters; 13 | 14 | namespace <%= namespace%>.Modules.<%= moduleName %>.Controllers 15 | { 16 | [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Edit)] 17 | [DnnHandleError] 18 | public class SettingsController : DnnController 19 | { 20 | /// 21 | /// 22 | /// 23 | /// 24 | [HttpGet] 25 | public ActionResult Settings() 26 | { 27 | var settings = new Models.Settings(); 28 | settings.Setting1 = ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("Setting1", false); 29 | settings.Setting2 = ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("Setting2", System.DateTime.Now); 30 | 31 | return View(settings); 32 | } 33 | 34 | /// 35 | /// 36 | /// 37 | /// 38 | /// 39 | [HttpPost] 40 | [ValidateInput(false)] 41 | [DotNetNuke.Web.Mvc.Framework.ActionFilters.ValidateAntiForgeryToken] 42 | public ActionResult Settings(Models.Settings settings) 43 | { 44 | ModuleContext.Configuration.ModuleSettings["Setting1"] = settings.Setting1.ToString(); 45 | ModuleContext.Configuration.ModuleSettings["Setting2"] = settings.Setting2.ToUniversalTime().ToString("u"); 46 | 47 | return RedirectToDefaultRoute(); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /generators/mvc/templates/Models/Settings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 3 | ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 4 | ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 5 | ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 6 | ' DEALINGS IN THE SOFTWARE. 7 | ' 8 | */ 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | namespace <%= namespace %>.Modules.<%= moduleName %>.Models 13 | { 14 | public class Settings 15 | { 16 | public bool Setting1 { get; set; } 17 | public DateTime Setting2 { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /generators/mvc/templates/Resources/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtrutledge/generator-dnn/8143dec94b2728c5bed1406e0c287c993ff78120/generators/mvc/templates/Resources/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /generators/mvc/templates/Resources/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtrutledge/generator-dnn/8143dec94b2728c5bed1406e0c287c993ff78120/generators/mvc/templates/Resources/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /generators/mvc/templates/Resources/bootstrap/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.3.2 3 | * http://getbootstrap.com/2.3.2/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2013 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) 27 | * ======================================================= */ 28 | 29 | $(function () { 30 | 31 | $.support.transition = (function () { 32 | 33 | var transitionEnd = (function () { 34 | 35 | var el = document.createElement('bootstrap') 36 | , transEndEventNames = { 37 | 'WebkitTransition' : 'webkitTransitionEnd' 38 | , 'MozTransition' : 'transitionend' 39 | , 'OTransition' : 'oTransitionEnd otransitionend' 40 | , 'transition' : 'transitionend' 41 | } 42 | , name 43 | 44 | for (name in transEndEventNames){ 45 | if (el.style[name] !== undefined) { 46 | return transEndEventNames[name] 47 | } 48 | } 49 | 50 | }()) 51 | 52 | return transitionEnd && { 53 | end: transitionEnd 54 | } 55 | 56 | })() 57 | 58 | }) 59 | 60 | }(window.jQuery); 61 | /* ============================================================ 62 | * bootstrap-dropdown.js v2.3.2 63 | * http://getbootstrap.com/2.3.2/javascript.html#dropdowns 64 | * ============================================================ 65 | * Copyright 2013 Twitter, Inc. 66 | * 67 | * Licensed under the Apache License, Version 2.0 (the "License"); 68 | * you may not use this file except in compliance with the License. 69 | * You may obtain a copy of the License at 70 | * 71 | * http://www.apache.org/licenses/LICENSE-2.0 72 | * 73 | * Unless required by applicable law or agreed to in writing, software 74 | * distributed under the License is distributed on an "AS IS" BASIS, 75 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 76 | * See the License for the specific language governing permissions and 77 | * limitations under the License. 78 | * ============================================================ */ 79 | 80 | 81 | !function ($) { 82 | 83 | "use strict"; // jshint ;_; 84 | 85 | 86 | /* DROPDOWN CLASS DEFINITION 87 | * ========================= */ 88 | 89 | var toggle = '[data-toggle=dropdown]' 90 | , Dropdown = function (element) { 91 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 92 | $('html').on('click.dropdown.data-api', function () { 93 | $el.parent().removeClass('open') 94 | }) 95 | } 96 | 97 | Dropdown.prototype = { 98 | 99 | constructor: Dropdown 100 | 101 | , toggle: function (e) { 102 | var $this = $(this) 103 | , $parent 104 | , isActive 105 | 106 | if ($this.is('.disabled, :disabled')) return 107 | 108 | $parent = getParent($this) 109 | 110 | isActive = $parent.hasClass('open') 111 | 112 | clearMenus() 113 | 114 | if (!isActive) { 115 | if ('ontouchstart' in document.documentElement) { 116 | // if mobile we we use a backdrop because click events don't delegate 117 | $('