Skip to content

Commit cf388d0

Browse files
authored
2019-10-31-01 (#4458)
2019-10-31-01
2 parents 53349a6 + a74fa9b commit cf388d0

45 files changed

Lines changed: 781 additions & 603 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/assets/stylesheets/new_design/_constants.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $default-padding: 2 * $default-spacer;
77
// layouts
88
$two-columns-padding: 60px;
99
$two-columns-breakpoint: 980px;
10+
$sub-header-bottom-margin: 3 * $default-spacer;
1011

1112
// z-order
1213
$alert-z-index: 100;

app/assets/stylesheets/new_design/editable_champs/piece_justificative.scss renamed to app/assets/stylesheets/new_design/attachment.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
@import "../constants";
1+
@import "constants";
22

3-
.piece-justificative-actions {
3+
.attachment-actions {
44
display: flex;
55
margin-bottom: $default-spacer;
66
}
77

8-
.piece-justificative-action {
8+
.attachment-action {
99
margin-right: $default-spacer;
1010

1111
.button {
1212
text-transform: lowercase;
1313
}
1414
}
1515

16-
.piece-justificative-input.hidden {
16+
.attachment-input.hidden {
1717
display: none;
1818
}

app/assets/stylesheets/new_design/common.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ sup {
6161
.container {
6262
@include horizontal-padding($default-padding);
6363
max-width: $page-width + 2 * $default-padding;
64-
margin: 0 auto;
64+
margin-left: auto;
65+
margin-right: auto;
6566
}
6667

6768
.small-container {
6869
@include horizontal-padding($default-padding);
6970
max-width: $small-page-width + 2 * $default-padding;
70-
margin: 0 auto;
71+
margin-left: auto;
72+
margin-right: auto;
7173
}

app/assets/stylesheets/new_design/forms.scss

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@
7070

7171
// Align checkboxes on the top-left side of the label
7272
&.editable-champ-checkbox,
73+
&.editable-champ-radio.vertical,
7374
&.editable-champ-engagement {
7475
label {
7576
padding-left: 28px;
7677
}
7778

78-
input[type=checkbox] {
79+
input[type=checkbox],
80+
input[type=radio] {
7981
position: absolute;
8082
top: 1px;
8183
left: 0px;
@@ -92,18 +94,6 @@
9294
margin-left: 0;
9395
}
9496
}
95-
96-
&.vertical {
97-
label {
98-
display: block;
99-
margin-left: 0;
100-
margin-bottom: 0;
101-
}
102-
103-
input[type=radio] {
104-
margin-bottom: 16px;
105-
}
106-
}
10797
}
10898

10999
input[type=text]:not([data-address='true']),
@@ -114,7 +104,7 @@
114104
input[type=tel],
115105
textarea,
116106
select,
117-
.piece-justificative {
107+
.attachment {
118108
display: block;
119109
margin-bottom: 2 * $default-padding;
120110

app/assets/stylesheets/new_design/icons.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
background-image: image-url("icons/bubble.svg");
6060
}
6161

62-
&.attachment {
63-
background-image: image-url("icons/attachment.svg");
62+
&.attached {
63+
background-image: image-url("icons/attached.svg");
6464
}
6565

6666
&.preview {

app/assets/stylesheets/new_design/layouts.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,20 @@
5252
.blank-tab {
5353
text-align: center;
5454
}
55+
56+
.sticky--top {
57+
position: sticky;
58+
// scss-lint:disable VendorPrefix
59+
position: -webkit-sticky; // This is needed on Safari (tested on 12.1)
60+
// scss-lint:enable VendorPrefix
61+
top: 0;
62+
}
63+
64+
.sticky--bottom {
65+
position: sticky;
66+
// scss-lint:disable VendorPrefix
67+
position: -webkit-sticky; // This is needed on Safari (tested on 12.1)
68+
// scss-lint:enable VendorPrefix
69+
bottom: 0;
70+
}
71+
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
@import "colors";
2+
@import "constants";
3+
4+
// scss-lint:disable SelectorFormat
5+
6+
.procedure-form .page-title {
7+
text-align: left;
8+
}
9+
10+
.procedure-form__columns {
11+
display: flex;
12+
margin-top: -$sub-header-bottom-margin;
13+
}
14+
15+
// We want to make the form as large as possible,
16+
// without shrinking the preview too much.
17+
//
18+
// A balanced compromised seems to make the form
19+
// slighly larger than the preview (flex 10/9), and
20+
// to reduce the margins on the preview as much as
21+
// possible.
22+
.procedure-form__column--form {
23+
flex: 10;
24+
padding: 0 $default-padding;
25+
background-color: $light-grey;
26+
}
27+
28+
.procedure-form__column--preview {
29+
flex: 9;
30+
padding: 0 2 * $default-padding;
31+
// Gain a little horizontal space by using the white
32+
// space on the right as our margin.
33+
padding-right: 0;
34+
}
35+
36+
// Hide the preview panel on smaller screens
37+
@media screen and (max-width: 800px) {
38+
.procedure-form__column--preview {
39+
display: none;
40+
}
41+
}
42+
43+
.procedure-form__preview .procedure-preview {
44+
max-width: 450px;
45+
margin: 0 auto;
46+
}
47+
48+
.procedure-form__preview-title {
49+
font-size: 1.2rem;
50+
font-weight: bold;
51+
opacity: 0.5;
52+
margin-top: $default-spacer * 4;
53+
margin-bottom: $default-spacer * 8;
54+
}
55+
56+
.procedure-form__actions {
57+
display: flex;
58+
margin-left: -$default-padding;
59+
margin-right: -$default-padding;
60+
padding: $default-spacer $default-padding;
61+
background: $light-grey;
62+
border-top: 1px solid $border-grey;
63+
64+
.button.send {
65+
margin-left: auto;
66+
}
67+
}
68+
69+
.procedure-form__options-details {
70+
margin-bottom: $default-padding;
71+
}
72+
73+
.procedure-form__options-summary {
74+
cursor: pointer;
75+
76+
.header-section {
77+
display: inline-block;
78+
}
79+
}

app/assets/stylesheets/new_design/sub_header.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.sub-header {
55
background-color: $light-grey;
66
padding-top: $default-padding;
7-
margin-bottom: 3 * $default-spacer;
7+
margin-bottom: $sub-header-bottom-margin;
88
border-bottom: 1px solid $border-grey;
99

1010
.container {

app/controllers/admin/procedures_controller.rb

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Admin::ProceduresController < AdminController
22
include SmartListing::Helper::ControllerExtensions
33
helper SmartListing::Helper
44

5-
before_action :retrieve_procedure, only: [:show, :edit, :delete_logo, :delete_deliberation, :delete_notice, :monavis, :update_monavis, :publish_validate, :publish]
5+
before_action :retrieve_procedure, only: [:show, :delete_logo, :delete_deliberation, :delete_notice, :publish_validate, :publish]
66

77
def index
88
if current_administrateur.procedures.count != 0
@@ -49,9 +49,6 @@ def show
4949
@current_administrateur = current_administrateur
5050
end
5151

52-
def edit
53-
end
54-
5552
def destroy
5653
procedure = current_administrateur.procedures.find(params[:id])
5754

@@ -66,40 +63,6 @@ def destroy
6663
redirect_to admin_procedures_draft_path
6764
end
6865

69-
def new
70-
@procedure ||= Procedure.new(for_individual: true)
71-
end
72-
73-
def create
74-
@procedure = Procedure.new(procedure_params.merge(administrateurs: [current_administrateur]))
75-
76-
if !@procedure.save
77-
flash.now.alert = @procedure.errors.full_messages
78-
render 'new'
79-
else
80-
flash.notice = 'Démarche enregistrée.'
81-
current_administrateur.instructeur.assign_to_procedure(@procedure)
82-
83-
redirect_to champs_procedure_path(@procedure)
84-
end
85-
end
86-
87-
def update
88-
@procedure = current_administrateur.procedures.find(params[:id])
89-
90-
if !@procedure.update(procedure_params)
91-
flash.now.alert = @procedure.errors.full_messages
92-
render 'edit'
93-
elsif @procedure.brouillon?
94-
reset_procedure
95-
flash.notice = 'Démarche modifiée. Tous les dossiers de cette démarche ont été supprimés.'
96-
redirect_to edit_admin_procedure_path(id: @procedure.id)
97-
else
98-
flash.notice = 'Démarche modifiée.'
99-
redirect_to edit_admin_procedure_path(id: @procedure.id)
100-
end
101-
end
102-
10366
def publish_validate
10467
@procedure.assign_attributes(publish_params)
10568
end
@@ -182,18 +145,6 @@ def new_from_existing
182145
render layout: 'application'
183146
end
184147

185-
def monavis
186-
end
187-
188-
def update_monavis
189-
if !@procedure.update(procedure_params)
190-
flash.now.alert = @procedure.errors.full_messages
191-
else
192-
flash.notice = 'le champ MonAvis a bien été mis à jour'
193-
end
194-
render 'monavis'
195-
end
196-
197148
def active_class
198149
@active_class = 'active'
199150
end
@@ -238,7 +189,7 @@ def publish_params
238189
end
239190

240191
def procedure_params
241-
editable_params = [:libelle, :description, :organisation, :direction, :lien_site_web, :cadre_juridique, :deliberation, :notice, :web_hook_url, :euro_flag, :logo, :auto_archive_on, :monavis_embed]
192+
editable_params = [:libelle, :description, :organisation, :direction, :lien_site_web, :cadre_juridique, :deliberation, :notice, :web_hook_url, :euro_flag, :logo, :auto_archive_on]
242193
permited_params = if @procedure&.locked?
243194
params.require(:procedure).permit(*editable_params)
244195
else

0 commit comments

Comments
 (0)