diff --git a/app/assets/images/register_module/logo-default.png b/app/assets/images/register_module/logo-default.png new file mode 100644 index 0000000..173223d Binary files /dev/null and b/app/assets/images/register_module/logo-default.png differ diff --git a/app/assets/stylesheets/register_module/module_store.scss b/app/assets/stylesheets/register_module/module_store.scss new file mode 100644 index 0000000..239c67d --- /dev/null +++ b/app/assets/stylesheets/register_module/module_store.scss @@ -0,0 +1,145 @@ +#module-store{ + margin-top: 100px; + margin-bottom: 50px; + margin-left: 20px; + .filter{ + border: 1px solid #3e97f1; + display: inline-block; + background-color: #f0f0f0; + // box-shadow: 5px 5px #cecece; + width: 225px; + min-height: 300px; + color: #3e6fd4; + border-radius: 5px; + h3{ + background-color: #3e97f1; + color: #fff; + margin-top: 0px; + padding-top: 10px; + text-align: center; + border-bottom: 1px solid #7c7c7c; + padding-bottom: 10px; + font-size: 20px; + border-radius: 5px 5px 0 0; + // box-shadow: 5px 0 #3e97f1; + + } + .filter-checkbox{ + padding: 0; + margin: 0 5px; + padding-bottom: 5px; + height: 15px; + } + label{ + margin-bottom: 0px; + } + .module-type { + ul{ + margin-top: 20px; + list-style: none; + padding-left: 15px; + li{ + margin-bottom: 10px; + } + } + } + .tag-filter{ + h4{ + margin-left: 10px; + font-size: 17px; + margin-top: 5px; + } + ul{ + margin-top: 20px; + list-style: none; + padding-left: 15px; + li{ + margin-bottom: 10px; + } + } + } + .filter-column { + padding: 10px; + margin: 10px; + padding-bottom: 15px; + border-bottom: 1px dotted #7c7c7c; + } + } + + .app-holder{ + display: inline-block; + vertical-align: top; + margin-left: 50px; + width: calc(100% - 300px); + h3.heading{ + margin-top: 0px; + margin-bottom: 35px; + padding-bottom: 15px; + border-bottom: 1px dotted #7d7d7d; + color: #7d7d7d; + } + ul.app-list{ + list-style: none; + li.app{ + display: inline-block; + width: 200px; + height: 250px; + margin-right: 50px; + margin-bottom: 75px; + border-radius: 2px; + color: #fff; + text-align: center; + + + &.optional{ + background-color: #cfb891; + .icon { + i{ + color: #a76664; + } + } + } + &.default{ + background-color: #99b0c7; + .icon { + i{ + color: #3471af; + } + } + } + div.icon{ + // border: 1px solid #cecece; + background-color: #fff; + font-size: 6em; + width: calc(100% - 10px); + margin-top: 5px; + margin-bottom: 10px; + i.no-logo{ + font-size: 0.4em; + } + } + div.app-info{ + margin-left: 20px; + text-align: left; + .name{ + font-size: 18px; + font-weight: bold; + } + } + div.module-type{ + display: inline; + position: relative; + bottom: -20px; + padding: 0 10px; + border-radius: 10px; + // margin: 20px 5px 0 5px; + // width: calc(100% - 10px); + background-color: #fff; + color: #7c7c7c; + font-weight: bold; + font-size: 16px; + } + } + } + } +} \ No newline at end of file diff --git a/app/controllers/register_modules_controller.rb b/app/controllers/register_modules_controller.rb new file mode 100644 index 0000000..de57a68 --- /dev/null +++ b/app/controllers/register_modules_controller.rb @@ -0,0 +1,10 @@ +class RegisterModulesController < ApplicationController + def index + @data = {} + ma = ModuleApp.where(:key => "register_module").first + @data["tags"] = ma.tags + @data["categories"] = ma.categories.enabled + @data["apps"] = RegisteredModule.can_display + @data + end +end \ No newline at end of file diff --git a/app/models/registered_module.rb b/app/models/registered_module.rb index 1c48196..dbe48a2 100644 --- a/app/models/registered_module.rb +++ b/app/models/registered_module.rb @@ -7,6 +7,7 @@ class RegisteredModule field :module_key field :git_path + field :icon_class field :name, as: :slug_title, localize: true field :description, localize: true field :create_user_id, type: BSON::ObjectId @@ -15,6 +16,9 @@ class RegisteredModule field :completed, type: Boolean, :default => false field :module_type, type: BSON::ObjectId field :step_number, type: Integer + field :display_in_frontend, type: Boolean, :default => false + + scope :can_display, ->{where(:display_in_frontend => true)} mount_uploader :template, TemplateUploader @@ -27,4 +31,8 @@ class RegisteredModule self.save end + def get_colour_class + self.category.title == "Default" ? "default" : "optional" + end + end \ No newline at end of file diff --git a/app/views/admin/admin_modules/uploadfiles.html.erb b/app/views/admin/admin_modules/uploadfiles.html.erb index ce6eb31..4953836 100644 --- a/app/views/admin/admin_modules/uploadfiles.html.erb +++ b/app/views/admin/admin_modules/uploadfiles.html.erb @@ -70,12 +70,26 @@