diff --git a/app/assets/javascripts/proposals_dashboard.coffee b/app/assets/javascripts/proposals_dashboard.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/proposals_dashboard.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 5de3bb76d..51149006d 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -8,6 +8,7 @@ @import 'participation'; @import 'pages'; @import 'proposal'; +@import 'proposals_dashboard'; @import 'legislation'; @import 'legislation_process'; @import 'community'; diff --git a/app/assets/stylesheets/proposals_dashboard.scss b/app/assets/stylesheets/proposals_dashboard.scss new file mode 100644 index 000000000..818b32c35 --- /dev/null +++ b/app/assets/stylesheets/proposals_dashboard.scss @@ -0,0 +1,132 @@ +.proposals-dashboard { + display: flex; + // flex-flow: row nowrap; + // justify-content: flex-start; + // align-items: flex-start; + flex-direction: column; + margin-top: -1.5rem; + + .column-wrapper { + flex: 2; + display: flex; + + .left-column { + flex: 0 0 150pt; + background: lightgray; + margin-right: 5px; + // width: 150pt; + padding: 5pt; + // min-height: 775px; + + .state-box { + .logo { + height: 100pt; + width: 100pt; + margin-left: 20pt; + margin-right: 20pt; + border-radius: 50pt; + background-color: #fff3cb; + border: 2pt solid white; + } + + .status { + height: 25pt; + width: 100pt; + margin-left: 20pt; + margin-right: 20pt; + padding-top: 3pt; + color: #055392; + font-weight: bold; + text-align: center; + vertical-align: middle; + } + + .draft { + background-color: #ffe699; + } + + .published { + background-color: #d3ebd2; + } + } + + .menu { + color: #a9a9a9; + font-size: 16pt; + + .menu-title { + margin-top: 10pt; + } + + .menu-entry { + color: #a9a9a9; + padding-left: 25pt; + line-height: 30pt; + vertical-align: middle; + display: block; + } + + .menu-entry:focus, .menu-entry:active, .menu-entry:hover { + outline: 0; + text-decoration: none; + } + + .selected { + font-weight: bold; + color: #454545; + } + + .menu-entry.selected { + text-decoration: underline #a9a9a9; + } + } + } + + .right-column { + background: lightgray; + flex: 1 1; + padding: 5pt; + //min-height: 775px; + + .progress-info { + display: flex; + flex-flow: row wrap; + justify-content: flex-start; + align-items: center; + align-content: stretch; + width: 1440px; + } + + .cell-data { + flex-grow: 1; + width: 33%; + font-size: 16pt; + font-weight: bold; + line-height: 32pt; + vertical-align: middle; + padding-left: 42pt; + + .caption { + width: 150pt; + float: left; + } + + .value { + width: 50pt; + float: left; + text-align: right; + } + + .value:after { + clear: both; + } + } + + .body { + background-color: white; + height: 500px; + } + } + } +} + diff --git a/app/controllers/proposals_dashboard_controller.rb b/app/controllers/proposals_dashboard_controller.rb new file mode 100644 index 000000000..740084795 --- /dev/null +++ b/app/controllers/proposals_dashboard_controller.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# Proposals dashboard +class ProposalsDashboardController < ApplicationController + before_action :authenticate_user! + + helper_method :proposal + respond_to :html + layout 'proposals_dashboard' + + def index + authorize! :dashboard, proposal + end + + private + + def proposal + @proposal ||= Proposal.find(params[:proposal_id]) + end +end diff --git a/app/helpers/proposals_dashboard_helper.rb b/app/helpers/proposals_dashboard_helper.rb new file mode 100644 index 000000000..4ebbfa078 --- /dev/null +++ b/app/helpers/proposals_dashboard_helper.rb @@ -0,0 +1,2 @@ +module ProposalsDashboardHelper +end diff --git a/app/models/abilities/common.rb b/app/models/abilities/common.rb index a046c4813..e125f7076 100644 --- a/app/models/abilities/common.rb +++ b/app/models/abilities/common.rb @@ -19,6 +19,9 @@ module Abilities can :publish, Proposal do |proposal| proposal.draft? && proposal.author.id == user.id end + can :dashboard, Proposal do |proposal| + proposal.author.id == user.id + end can [:retire_form, :retire], Proposal, author_id: user.id diff --git a/app/views/layouts/proposals_dashboard.html.erb b/app/views/layouts/proposals_dashboard.html.erb new file mode 100644 index 000000000..e771ff277 --- /dev/null +++ b/app/views/layouts/proposals_dashboard.html.erb @@ -0,0 +1,63 @@ + + +
+ + + + <%= render "layouts/tracking_data" %> + <%= render "layouts/meta_tags" %> +- <%= t '.improve_it' %> -
-+ <%= t '.improve_it' %> +
+