Skip to content

Commit 810bf7d

Browse files
authored
Merge pull request #42 from rwfalcao/master
Everything we have so far
2 parents 6b96a39 + f481ed0 commit 810bf7d

File tree

14 files changed

+262
-102
lines changed

14 files changed

+262
-102
lines changed

ideax/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from django.contrib import admin
2-
from .models import Idea, UserProfile, Popular_Vote, Comment
2+
from .models import Idea, UserProfile, Popular_Vote, Comment, Category
33

44
admin.site.register(Idea)
55
admin.site.register(UserProfile)
66
admin.site.register(Popular_Vote)
77
admin.site.register(Comment)
8+
admin.site.register(Category)

ideax/static/css/idea.css

Lines changed: 115 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ flex-flow: column;
323323
font-size: 1em;
324324
font-weight: bold;
325325
z-index: 1;
326+
max-width: 85%;
326327
}
327328

328329
.idea-header h1,
@@ -415,7 +416,9 @@ input.menu-input{
415416
border-right: 1px solid #E1E1E1;
416417
z-index: 5;
417418
box-shadow: 1px 2px 3px rgba(0,0,0,0.2);
418-
margin-right: 35px
419+
position: absolute;
420+
top: 35px;
421+
right: 20px;
419422

420423
}
421424

@@ -770,6 +773,8 @@ input#id_title {
770773
border-radius: 2px;
771774
//box-shadow: 0 1px 2px #c9cccd;
772775
//border: 1px solid #E1E1E1;
776+
display: flex;
777+
flex-direction: column;
773778
}
774779

775780
.idea-desc p{
@@ -835,7 +840,7 @@ input#id_title {
835840

836841
#idea-tab{
837842
display: flex;
838-
justify-content: space-between;
843+
justify-content: flex-start;
839844
}
840845

841846
.tab-content{
@@ -861,6 +866,25 @@ input#id_title {
861866
margin: 25px 0;
862867
}
863868

869+
#comment-message{
870+
margin: 15px 0 0px 0
871+
}
872+
873+
#commentForm{
874+
margin-bottom: 0;
875+
}
876+
877+
#commentContent{
878+
resize: none;
879+
}
880+
.nav-link.active{
881+
font-weight: bold;
882+
}
883+
884+
.form-group.comment-group{
885+
margin-top: 5px;
886+
}
887+
864888
.media-left {
865889
margin-left: 25px;
866890
}
@@ -882,6 +906,66 @@ input#id_title {
882906
font-size: 0.7em;
883907
}
884908

909+
910+
911+
.action-group{
912+
display: flex;
913+
flex-direction: column;
914+
align-items: center;
915+
margin-top: 50px;
916+
917+
}
918+
919+
.action-group a{
920+
display: block;
921+
width: 50%;
922+
padding: 8px 0px;
923+
text-align: center;
924+
border-radius: 6px;
925+
font-size: 1em;
926+
font-weight: bold;
927+
margin: 10px 0;
928+
929+
}
930+
931+
932+
.action-group .edit{
933+
color: #1f5093;
934+
//color: #fefefe;
935+
border: solid 3px #1f5093;
936+
}
937+
938+
.action-group .discard{
939+
color: #e52d2a;
940+
//color: #fefefe;
941+
border: solid 3px #e52d2a;
942+
}
943+
944+
.action-group a:hover{
945+
text-decoration: none;
946+
}
947+
948+
.idea-page-action .action-icon{
949+
font-size: 1.5em;
950+
margin-right: 5px
951+
}
952+
953+
.action-group .edit:hover{
954+
background: #1f5093;
955+
color: #fefefe;
956+
transition: all 0.3s;
957+
border: 3px solid #1f5093;
958+
959+
}
960+
961+
.action-group .discard:hover{
962+
background: #e52d2a;
963+
color: #fefefe;
964+
transition: all 0.3s;
965+
border: 3px solid #e52d2a;
966+
967+
}
968+
885969
/* gereic idea form */
886970
.idea-form{
887971
width: 70%;
@@ -903,6 +987,8 @@ input#id_title {
903987
height: 130px;
904988
}
905989

990+
textarea { resize: none; }
991+
906992
div.idea-form-header {
907993
background: #6E6E6E;
908994
color: #fff;
@@ -931,14 +1017,39 @@ div.idea-form-body{
9311017
flex-direction: column;
9321018
}
9331019

1020+
.idea-form-body .button-group{
1021+
align-self: flex-end;
1022+
}
1023+
1024+
.idea-form-body .button-group a,
1025+
.idea-desc .button-group a{
1026+
width: 100px;
1027+
background-color: #6E6E6E;
1028+
border: 1px solid #ccc;
1029+
margin-top: 25px;
1030+
color: #fefefe;
1031+
}
1032+
1033+
.idea-desc .button-group{
1034+
align-self: center;
1035+
}
1036+
1037+
1038+
1039+
9341040
div.idea-form-body button{
9351041
width: 100px;
936-
align-self: flex-end;
1042+
9371043
background-color: #6E6E6E;
9381044
border: 1px solid #ccc;
9391045
margin-top: 25px;
9401046
}
9411047

1048+
div.idea-form-body button:hover,
1049+
div.idea-form-body a:hover{
1050+
background: #333 !important;
1051+
}
1052+
9421053
div.idea-form-body .form-group select{
9431054
width: 40%;
9441055
}
@@ -1193,6 +1304,7 @@ padding: 8% 15% 0 15%;
11931304
.idea-desc{
11941305
width: 100%;
11951306
}
1307+
11961308
.idea-interaction{
11971309
width: 100%;
11981310
}

ideax/static/js/idea.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,6 @@ function vote(url, idLike, idDislike, aLike, aDislike){
5858
}
5959

6060
$(function () {
61-
62-
63-
var teste = function() {
64-
var length = $("#id_oportunity").val().length + $("#id_solution").val().length + $("#id_target").val().length;
65-
$("#character_count").html(length+"/3000")
66-
67-
}
68-
69-
$(document).on("keyup", "#id_oportunity", teste);
70-
$(document).on("keyup", "#id_solution", teste);
71-
$(document).on("keyup", "#id_target", teste);
72-
73-
7461
var loadForm = function(){
7562
var btn = $(this);
7663
var idModal = btn.attr("data-modal");
@@ -221,7 +208,7 @@ $(document).on("keyup", "#id_target", teste);
221208
</div>\
222209
<div class="form-group">\
223210
<div class="col-lg-10 col-lg-offset-2">\
224-
<button type="submit" class="btn btn-primary">Submit</button>\
211+
<button type="submit" class="btn btn-primary">Comentar</button>\
225212
</div>\
226213
</div>\
227214
</fieldset>\

ideax/templates/ideax/base.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<html>
66
<head>
77
<title>Ideia X</title>
8-
<link href='//fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
98
<link rel="stylesheet" href="{% static 'css/idea.css' %}">
109
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
1110
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet">

ideax/templates/ideax/idea_detail.html

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ <h3>{% trans 'Oportunity' %}</h3>
3434
<p>{{ idea.solution|linebreaksbr }}</p>
3535
<h3>{% trans 'Target' %}</h3>
3636
<p>{{ idea.target|linebreaksbr }}</p>
37+
<div class="button-group">
38+
<a class="back-redirect btn" href="/">{% trans 'Return' %}</a>
39+
</div>
3740
</div>
3841
<div class="separator"></div>
3942

@@ -42,12 +45,17 @@ <h3>{% trans 'Target' %}</h3>
4245
<li class="nav-item">
4346
<a class="nav-link active" id="comments-area-tab" data-toggle="tab" href="#comments-area" role="tab" aria-controls="comments-area" aria-selected="true">Comentários</a>
4447
</li>
45-
<li class="nav-item">
48+
<!-- <li class="nav-item">
4649
<a class="nav-link" id="evaluation-tab" data-toggle="tab" href="#evaluation" role="tab" aria-controls="evaluation" aria-selected="false">Avaliação</a>
4750
</li>
4851
<li class="nav-item">
4952
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Histórico</a>
50-
</li>
53+
</li> -->
54+
<!-- {% if request.user.userprofile == idea.author or request.user.userprofile.manager %}
55+
<li class="nav-item">
56+
<a class="nav-link" id="actions-tab" data-toggle="tab" href="#actions" role="tab" aria-controls="actions" aria-selected="false">Ações</a>
57+
</li>
58+
{% endif %} -->
5159
</ul>
5260
<div class="tab-content" id="myTabContent">
5361
<div id="comments-area" class="tab-pane fade show active comments" role="tabpanel" aria-labelledby="comment-group-tab">
@@ -77,6 +85,19 @@ <h3>{% trans 'Target' %}</h3>
7785
</div>
7886
<div class="tab-pane fade" id="evaluation" role="tabpanel" aria-labelledby="evaluation-tab">Avaliação</div>
7987
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">Contact</div>
88+
<!-- {% if request.user.userprofile == idea.author or request.user.userprofile.manager %}
89+
<div class="tab-pane fade" id="actions" role="tabpanel" aria-labelledby="actinos-tab">
90+
<div class="action-group">
91+
<a href="" class="idea-page-action edit">
92+
<span class="action-icon"><i class="far fa-edit"></i></span> Editar ideia
93+
</a>
94+
<a href="" class="idea-page-action discard">
95+
<span class="action-icon"><i class="far fa-trash-alt"></i></span> Descartar ideia
96+
</a>
97+
98+
</div>
99+
</div>
100+
{% endif %} -->
80101
</div>
81102
</div>
82103

ideax/templates/ideax/idea_edit.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ <h4 class="modal-title">{% trans 'Update_Idea' %}</h4>
1313
</div>
1414
<div class="idea-form-body">
1515
{% include 'ideax/includes/partial_idea_form.html' %}
16-
<button type="submit" class="btn btn-primary">{% trans 'Update' %}</button>
16+
<div class="button-group">
17+
<a class="back-redirect btn" href="/">{% trans 'Return' %}</a>
18+
<button type="submit" class="btn btn-primary">{% trans 'Update' %}</button>
19+
</div>
1720
</div>
1821
</form>
1922
</div>

ideax/templates/ideax/idea_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</ul>
1919
</nav>
2020
{% for message in messages %}
21-
<div class="alert alert-dismissible alert-{{ message.tags }}">
21+
<div class="alert alert-dismissible alert-{% if message.tags == 'error' %}danger{%else%}{{message.tags}}{%endif%}">
2222
<button type="button" class="close" data-dismiss="alert">×</button>
2323
{{ message }}
2424
</div>

ideax/templates/ideax/idea_new.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ <h4>{% trans 'Create Idea' %}</h4>
1212
</div>
1313
<div class="idea-form-body">
1414
{% include 'ideax/includes/partial_idea_form.html' %}
15-
<button type="submit" class="btn btn-primary">{% trans 'Save' %}</button>
15+
<div class="button-group">
16+
<a class="back-redirect btn" href="/">{% trans 'Return' %}</a>
17+
<button type="submit" class="btn btn-primary">{% trans 'Save' %}</button>
18+
</div>
1619
</div>
1720
</form>
1821
</div>

ideax/templates/ideax/includes/idea_detail.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ <h1 class="idea-title" data-toggle="tooltip" data-placement="bottom" title="{{ i
2121
{% endif%} -->
2222

2323
<!-- idea card phase change and actions -->
24+
{% if idea.id in ideas_created_by_me or request.user.userprofile.manager %}
2425
<div class="idea-options">
2526
<input class="menu-input" type="checkbox" id="menu{{idea.pk}}">
2627
<label for="menu{{idea.pk}}">
@@ -38,16 +39,19 @@ <h1 class="idea-title" data-toggle="tooltip" data-placement="bottom" title="{{ i
3839
<li><a href="{% url 'change_phase' pk=idea.pk new_phase=7%}">{% trans 'Freezed' %}</a></li>
3940
{% endif %}
4041
<li class="actions">
42+
{% if idea.id in ideas_created_by_me or request.user.userprofile.manager %}
4143
<div class="action edit">
4244
<a class="js-update-idea" href="{% url 'idea_edit' pk=idea.pk %}"><i class="far fa-edit"></i></a>
4345
</div>
4446
<div class="action delete">
4547
<button class="js-remove-idea" data-modal="#modal-idea-crud" data-url="{% url 'idea_remove' pk=idea.pk %}"><i class="far fa-trash-alt"></i></button>
4648
</div>
49+
{%endif%}
4750
</li>
4851
</ul>
4952
</div>
5053
</div>
54+
{%endif%}
5155
</div>
5256
<!-- idea body -->
5357

ideax/templates/ideax/includes/partial_comments.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
<div class="media-body">
1111
<div class="mt-0 comment-header">
1212
<span class="c-author">{{ node.author.user}}</span>
13-
<span class="c-date">{{ node.date|date:"d/m/Y h:m"}}</span>
13+
<span class="c-date">{{ node.date|date:"d/m/Y H:m"}}</span>
1414
</div>
1515
<div class="comment-body">
1616
{{ node.raw_comment|safe }}
1717
</div>
1818
<div class="reply-link reply-container">
19-
<a href="javascript:void(0)" data-idea-id="{{idea_id}}" data-parent-id="{{ node.id }}" name="replyButton">reply</a>
19+
<a href="javascript:void(0)" data-idea-id="{{idea_id}}" data-parent-id="{{ node.id }}" name="replyButton">{% trans 'reply' %}</a>
2020
</div>
2121
{% if not node.is_leaf_node %}
2222
<div class="reply">

0 commit comments

Comments
 (0)