Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
framadate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
framadate
Commits
54fd8464
Commit
54fd8464
authored
6 years ago
by
m
Browse files
Options
Downloads
Patches
Plain Diff
Ne pas effacer les sélections après l'erreur "Vous avez déjà voté"
https://framagit.org/framasoft/framadate/issues/194
parent
5b4b8a86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
studs.php
+4
-0
4 additions, 0 deletions
studs.php
tpl/part/vote_table_classic.tpl
+13
-5
13 additions, 5 deletions
tpl/part/vote_table_classic.tpl
tpl/part/vote_table_date.tpl
+13
-10
13 additions, 10 deletions
tpl/part/vote_table_date.tpl
with
30 additions
and
15 deletions
studs.php
+
4
−
0
View file @
54fd8464
...
...
@@ -50,6 +50,8 @@ $resultPubliclyVisible = true;
$slots
=
[];
$votes
=
[];
$comments
=
[];
$selectedNewVotes
=
[];
/* Services */
/*----------*/
...
...
@@ -180,6 +182,7 @@ if ($accessGranted) {
}
}
catch
(
AlreadyExistsException
$aee
)
{
$message
=
new
Message
(
'danger'
,
__
(
'Error'
,
'You already voted'
));
$selectedNewVotes
=
$choices
;
}
catch
(
ConcurrentEditionException
$cee
)
{
$message
=
new
Message
(
'danger'
,
__
(
'Error'
,
'Poll has been updated before you vote'
));
}
catch
(
ConcurrentVoteException
$cve
)
{
...
...
@@ -237,5 +240,6 @@ $smarty->assign('accessGranted', $accessGranted);
$smarty
->
assign
(
'resultPubliclyVisible'
,
$resultPubliclyVisible
);
$smarty
->
assign
(
'editedVoteUniqueId'
,
$editedVoteUniqueId
);
$smarty
->
assign
(
'ValueMax'
,
$poll
->
ValueMax
);
$smarty
->
assign
(
'selectedNewVotes'
,
$selectedNewVotes
);
$smarty
->
display
(
'studs.tpl'
);
This diff is collapsed.
Click to expand it.
tpl/part/vote_table_classic.tpl
+
13
−
5
View file @
54fd8464
...
...
@@ -181,26 +181,34 @@
<ul
class=
"list-unstyled choice"
>
{
if
$poll
->
ValueMax
eq
NULL
||
$best_choices
[
'y'
][
$i
]
lt
$poll
->
ValueMax
}
<li
class=
"yes"
>
<input
type=
"radio"
id=
"y-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
"2"
/>
<input
type=
"radio"
id=
"y-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
"2"
{(!
isset
($
selectedNewVotes
[$
id
])
||
("2"
!==
$
selectedNewVotes
[$
id
]))
?
""
:
"
checked=
\"checked\""}
/>
<label
class=
"btn btn-default btn-xs"
for=
"y-choice-
{
$id
}
"
title=
"{__('Poll results', 'Vote yes for')|html}
{
$slot
->
title
|
html
}
"
>
<i
class=
"glyphicon glyphicon-ok"
></i><span
class=
"sr-only"
>
{__('Generic', 'Yes')}
</span>
</label>
</li>
<li
class=
"ifneedbe"
>
<input
type=
"radio"
id=
"i-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
"1"
/>
<input
type=
"radio"
id=
"i-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
"1"
{(!
isset
($
selectedNewVotes
[$
id
])
||
("1"
!==
$
selectedNewVotes
[$
id
]))
?
""
:
"
checked=
\"checked\""}
/>
<label
class=
"btn btn-default btn-xs"
for=
"i-choice-
{
$id
}
"
title=
"{__('Poll results', 'Vote ifneedbe for')|html}
{
$slot
->
title
|
html
}
"
>
(
<i
class=
"glyphicon glyphicon-ok"
></i>
)
<span
class=
"sr-only"
>
{__('Generic', 'Ifneedbe')}
</span>
</label>
</li>
{/
if
}
<li
class=
"no"
>
<input
type=
"radio"
id=
"n-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
"0"
/>
<label
class=
"btn btn-default btn-xs startunchecked"
for=
"n-choice-
{
$id
}
"
title=
"{__('Poll results', 'Vote no for')|html}
{
$slot
->
title
|
html
}
"
>
<input
type=
"radio"
id=
"n-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
"0"
{(!
isset
($
selectedNewVotes
[$
id
])
||
("0"
!==
$
selectedNewVotes
[$
id
]))
?
""
:
"
checked=
\"checked\""}
/>
<label
class=
"btn btn-default btn-xs {(!isset($selectedNewVotes[$id]) || ("
0"
!==
$
selectedNewVotes
[$
id
]))
?
"
startunchecked
"
:
""}"
for=
"n-choice-
{
$id
}
"
title=
"{__('Poll results', 'Vote no for')|html}
{
$slot
->
title
|
html
}
"
>
<i
class=
"glyphicon glyphicon-ban-circle"
></i><span
class=
"sr-only"
>
{__('Generic', 'No')}
</span>
</label>
</li>
<li
class=
"hide"
>
<input
type=
"radio"
id=
"n-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
" "
checked
/>
<input
type=
"radio"
id=
"n-choice-
{
$id
}
"
name=
"choices[
{
$id
}
]"
value=
" "
{(
isset
($
selectedNewVotes
[$
id
])
||
(""
!==
$
selectedNewVotes
[$
id
]))
?
""
:
"
checked=
\"checked\""}
/>
</li>
</ul>
</td>
...
...
This diff is collapsed.
Click to expand it.
tpl/part/vote_table_date.tpl
+
13
−
10
View file @
54fd8464
...
...
@@ -239,40 +239,43 @@
{
foreach
$slots
as
$slot
}
{
foreach
$slot
->
moments
as
$moment
}
<td
class=
"bg-info"
headers=
"M
{
$headersM
[
$i
]
}
D
{
$headersD
[
$i
]
}
H
{
$headersH
[
$i
]
}
"
>
<ul
class=
"list-unstyled choice"
>
{
if
$poll
->
ValueMax
eq
NULL
||
$best_choices
[
'y'
][
$i
]
lt
$poll
->
ValueMax
}
<li
class=
"yes"
>
<input
type=
"radio"
id=
"y-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
"2"
/>
<input
type=
"radio"
id=
"y-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
"2"
{(!
isset
($
selectedNewVotes
[$
i
])
||
("2"
!==
$
selectedNewVotes
[$
i
]))
?
""
:
"
checked=
\"checked\""}
/>
<label
class=
"btn btn-default btn-xs"
for=
"y-choice-
{
$i
}
"
title=
"{__('Poll results', 'Vote yes for')|html}
{
$slot
->
day
|
date_format
:
$date_format.txt_short
|
html
}
-
{
$moment
|
html
}
"
>
<i
class=
"glyphicon glyphicon-ok"
></i><span
class=
"sr-only"
>
{__('Generic', 'Yes')}
</span>
</label>
</li>
<li
class=
"ifneedbe"
>
<input
type=
"radio"
id=
"i-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
"1"
/>
<input
type=
"radio"
id=
"i-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
"1"
{(!
isset
($
selectedNewVotes
[$
i
])
||
("1"
!==
$
selectedNewVotes
[$
i
]))
?
""
:
"
checked=
\"checked\""}
/>
<label
class=
"btn btn-default btn-xs"
for=
"i-choice-
{
$i
}
"
title=
"{__('Poll results', 'Vote ifneedbe for')|html}
{
$slot
->
day
|
date_format
:
$date_format.txt_short
|
html
}
-
{
$moment
|
html
}
"
>
(
<i
class=
"glyphicon glyphicon-ok"
></i>
)
<span
class=
"sr-only"
>
{__('Generic', 'Ifneedbe')}
</span>
</label>
</li>
{/
if
}
{/
if
}
<li
class=
"no"
>
<input
type=
"radio"
id=
"n-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
"0"
/>
<input
type=
"radio"
id=
"n-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
"0"
{(!
isset
($
selectedNewVotes
[$
i
])
||
("0"
!==
$
selectedNewVotes
[$
i
]))
?
""
:
"
checked=
\"checked\""}
/>
<label
class=
"btn btn-default btn-xs startunchecked"
for=
"n-choice-
{
$i
}
"
title=
"{__('Poll results', 'Vote no for')|html}
{
$slot
->
day
|
date_format
:
$date_format.txt_short
|
html
}
-
{
$moment
|
html
}
"
>
<i
class=
"glyphicon glyphicon-ban-circle"
></i><span
class=
"sr-only"
>
{__('Generic', 'No')}
</span>
</label>
</li>
<li
class=
"hide"
>
<input
type=
"radio"
id=
"n-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
" "
checked
/>
<input
type=
"radio"
id=
"n-choice-
{
$i
}
"
name=
"choices[
{
$i
}
]"
value=
" "
{(
isset
($
selectedNewVotes
[$
i
])
||
(""
!==
$
selectedNewVotes
[$
i
]))
?
""
:
"
checked=
\"checked\""}
/>
</li>
</ul>
</td>
{
$i
=
$i
+
1
}
{/
foreach
}
{/
foreach
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment