Skip to content

Commit

Permalink
Merge pull request #42 from rwfalcao/master
Browse files Browse the repository at this point in the history
Everything we have so far
  • Loading branch information
kelvin-neves authored Apr 6, 2018
2 parents 6b96a39 + f481ed0 commit 810bf7d
Show file tree
Hide file tree
Showing 14 changed files with 262 additions and 102 deletions.
3 changes: 2 additions & 1 deletion ideax/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.contrib import admin
from .models import Idea, UserProfile, Popular_Vote, Comment
from .models import Idea, UserProfile, Popular_Vote, Comment, Category

admin.site.register(Idea)
admin.site.register(UserProfile)
admin.site.register(Popular_Vote)
admin.site.register(Comment)
admin.site.register(Category)
118 changes: 115 additions & 3 deletions ideax/static/css/idea.css
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ flex-flow: column;
font-size: 1em;
font-weight: bold;
z-index: 1;
max-width: 85%;
}

.idea-header h1,
Expand Down Expand Up @@ -415,7 +416,9 @@ input.menu-input{
border-right: 1px solid #E1E1E1;
z-index: 5;
box-shadow: 1px 2px 3px rgba(0,0,0,0.2);
margin-right: 35px
position: absolute;
top: 35px;
right: 20px;

}

Expand Down Expand Up @@ -770,6 +773,8 @@ input#id_title {
border-radius: 2px;
//box-shadow: 0 1px 2px #c9cccd;
//border: 1px solid #E1E1E1;
display: flex;
flex-direction: column;
}

.idea-desc p{
Expand Down Expand Up @@ -835,7 +840,7 @@ input#id_title {

#idea-tab{
display: flex;
justify-content: space-between;
justify-content: flex-start;
}

.tab-content{
Expand All @@ -861,6 +866,25 @@ input#id_title {
margin: 25px 0;
}

#comment-message{
margin: 15px 0 0px 0
}

#commentForm{
margin-bottom: 0;
}

#commentContent{
resize: none;
}
.nav-link.active{
font-weight: bold;
}

.form-group.comment-group{
margin-top: 5px;
}

.media-left {
margin-left: 25px;
}
Expand All @@ -882,6 +906,66 @@ input#id_title {
font-size: 0.7em;
}



.action-group{
display: flex;
flex-direction: column;
align-items: center;
margin-top: 50px;

}

.action-group a{
display: block;
width: 50%;
padding: 8px 0px;
text-align: center;
border-radius: 6px;
font-size: 1em;
font-weight: bold;
margin: 10px 0;

}


.action-group .edit{
color: #1f5093;
//color: #fefefe;
border: solid 3px #1f5093;
}

.action-group .discard{
color: #e52d2a;
//color: #fefefe;
border: solid 3px #e52d2a;
}

.action-group a:hover{
text-decoration: none;
}

.idea-page-action .action-icon{
font-size: 1.5em;
margin-right: 5px
}

.action-group .edit:hover{
background: #1f5093;
color: #fefefe;
transition: all 0.3s;
border: 3px solid #1f5093;

}

.action-group .discard:hover{
background: #e52d2a;
color: #fefefe;
transition: all 0.3s;
border: 3px solid #e52d2a;

}

/* gereic idea form */
.idea-form{
width: 70%;
Expand All @@ -903,6 +987,8 @@ input#id_title {
height: 130px;
}

textarea { resize: none; }

div.idea-form-header {
background: #6E6E6E;
color: #fff;
Expand Down Expand Up @@ -931,14 +1017,39 @@ div.idea-form-body{
flex-direction: column;
}

.idea-form-body .button-group{
align-self: flex-end;
}

.idea-form-body .button-group a,
.idea-desc .button-group a{
width: 100px;
background-color: #6E6E6E;
border: 1px solid #ccc;
margin-top: 25px;
color: #fefefe;
}

.idea-desc .button-group{
align-self: center;
}




div.idea-form-body button{
width: 100px;
align-self: flex-end;

background-color: #6E6E6E;
border: 1px solid #ccc;
margin-top: 25px;
}

div.idea-form-body button:hover,
div.idea-form-body a:hover{
background: #333 !important;
}

div.idea-form-body .form-group select{
width: 40%;
}
Expand Down Expand Up @@ -1193,6 +1304,7 @@ padding: 8% 15% 0 15%;
.idea-desc{
width: 100%;
}

.idea-interaction{
width: 100%;
}
Expand Down
15 changes: 1 addition & 14 deletions ideax/static/js/idea.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@ function vote(url, idLike, idDislike, aLike, aDislike){
}

$(function () {


var teste = function() {
var length = $("#id_oportunity").val().length + $("#id_solution").val().length + $("#id_target").val().length;
$("#character_count").html(length+"/3000")

}

$(document).on("keyup", "#id_oportunity", teste);
$(document).on("keyup", "#id_solution", teste);
$(document).on("keyup", "#id_target", teste);


var loadForm = function(){
var btn = $(this);
var idModal = btn.attr("data-modal");
Expand Down Expand Up @@ -221,7 +208,7 @@ $(document).on("keyup", "#id_target", teste);
</div>\
<div class="form-group">\
<div class="col-lg-10 col-lg-offset-2">\
<button type="submit" class="btn btn-primary">Submit</button>\
<button type="submit" class="btn btn-primary">Comentar</button>\
</div>\
</div>\
</fieldset>\
Expand Down
1 change: 0 additions & 1 deletion ideax/templates/ideax/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<html>
<head>
<title>Ideia X</title>
<link href='//fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{% static 'css/idea.css' %}">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet">
Expand Down
25 changes: 23 additions & 2 deletions ideax/templates/ideax/idea_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ <h3>{% trans 'Oportunity' %}</h3>
<p>{{ idea.solution|linebreaksbr }}</p>
<h3>{% trans 'Target' %}</h3>
<p>{{ idea.target|linebreaksbr }}</p>
<div class="button-group">
<a class="back-redirect btn" href="/">{% trans 'Return' %}</a>
</div>
</div>
<div class="separator"></div>

Expand All @@ -42,12 +45,17 @@ <h3>{% trans 'Target' %}</h3>
<li class="nav-item">
<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>
</li>
<li class="nav-item">
<!-- <li class="nav-item">
<a class="nav-link" id="evaluation-tab" data-toggle="tab" href="#evaluation" role="tab" aria-controls="evaluation" aria-selected="false">Avaliação</a>
</li>
<li class="nav-item">
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Histórico</a>
</li>
</li> -->
<!-- {% if request.user.userprofile == idea.author or request.user.userprofile.manager %}
<li class="nav-item">
<a class="nav-link" id="actions-tab" data-toggle="tab" href="#actions" role="tab" aria-controls="actions" aria-selected="false">Ações</a>
</li>
{% endif %} -->
</ul>
<div class="tab-content" id="myTabContent">
<div id="comments-area" class="tab-pane fade show active comments" role="tabpanel" aria-labelledby="comment-group-tab">
Expand Down Expand Up @@ -77,6 +85,19 @@ <h3>{% trans 'Target' %}</h3>
</div>
<div class="tab-pane fade" id="evaluation" role="tabpanel" aria-labelledby="evaluation-tab">Avaliação</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">Contact</div>
<!-- {% if request.user.userprofile == idea.author or request.user.userprofile.manager %}
<div class="tab-pane fade" id="actions" role="tabpanel" aria-labelledby="actinos-tab">
<div class="action-group">
<a href="" class="idea-page-action edit">
<span class="action-icon"><i class="far fa-edit"></i></span> Editar ideia
</a>
<a href="" class="idea-page-action discard">
<span class="action-icon"><i class="far fa-trash-alt"></i></span> Descartar ideia
</a>
</div>
</div>
{% endif %} -->
</div>
</div>

Expand Down
5 changes: 4 additions & 1 deletion ideax/templates/ideax/idea_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ <h4 class="modal-title">{% trans 'Update_Idea' %}</h4>
</div>
<div class="idea-form-body">
{% include 'ideax/includes/partial_idea_form.html' %}
<button type="submit" class="btn btn-primary">{% trans 'Update' %}</button>
<div class="button-group">
<a class="back-redirect btn" href="/">{% trans 'Return' %}</a>
<button type="submit" class="btn btn-primary">{% trans 'Update' %}</button>
</div>
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ideax/templates/ideax/idea_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ul>
</nav>
{% for message in messages %}
<div class="alert alert-dismissible alert-{{ message.tags }}">
<div class="alert alert-dismissible alert-{% if message.tags == 'error' %}danger{%else%}{{message.tags}}{%endif%}">
<button type="button" class="close" data-dismiss="alert">×</button>
{{ message }}
</div>
Expand Down
5 changes: 4 additions & 1 deletion ideax/templates/ideax/idea_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ <h4>{% trans 'Create Idea' %}</h4>
</div>
<div class="idea-form-body">
{% include 'ideax/includes/partial_idea_form.html' %}
<button type="submit" class="btn btn-primary">{% trans 'Save' %}</button>
<div class="button-group">
<a class="back-redirect btn" href="/">{% trans 'Return' %}</a>
<button type="submit" class="btn btn-primary">{% trans 'Save' %}</button>
</div>
</div>
</form>
</div>
Expand Down
4 changes: 4 additions & 0 deletions ideax/templates/ideax/includes/idea_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ <h1 class="idea-title" data-toggle="tooltip" data-placement="bottom" title="{{ i
{% endif%} -->

<!-- idea card phase change and actions -->
{% if idea.id in ideas_created_by_me or request.user.userprofile.manager %}
<div class="idea-options">
<input class="menu-input" type="checkbox" id="menu{{idea.pk}}">
<label for="menu{{idea.pk}}">
Expand All @@ -38,16 +39,19 @@ <h1 class="idea-title" data-toggle="tooltip" data-placement="bottom" title="{{ i
<li><a href="{% url 'change_phase' pk=idea.pk new_phase=7%}">{% trans 'Freezed' %}</a></li>
{% endif %}
<li class="actions">
{% if idea.id in ideas_created_by_me or request.user.userprofile.manager %}
<div class="action edit">
<a class="js-update-idea" href="{% url 'idea_edit' pk=idea.pk %}"><i class="far fa-edit"></i></a>
</div>
<div class="action delete">
<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>
</div>
{%endif%}
</li>
</ul>
</div>
</div>
{%endif%}
</div>
<!-- idea body -->

Expand Down
4 changes: 2 additions & 2 deletions ideax/templates/ideax/includes/partial_comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<div class="media-body">
<div class="mt-0 comment-header">
<span class="c-author">{{ node.author.user}}</span>
<span class="c-date">{{ node.date|date:"d/m/Y h:m"}}</span>
<span class="c-date">{{ node.date|date:"d/m/Y H:m"}}</span>
</div>
<div class="comment-body">
{{ node.raw_comment|safe }}
</div>
<div class="reply-link reply-container">
<a href="javascript:void(0)" data-idea-id="{{idea_id}}" data-parent-id="{{ node.id }}" name="replyButton">reply</a>
<a href="javascript:void(0)" data-idea-id="{{idea_id}}" data-parent-id="{{ node.id }}" name="replyButton">{% trans 'reply' %}</a>
</div>
{% if not node.is_leaf_node %}
<div class="reply">
Expand Down
5 changes: 0 additions & 5 deletions ideax/templates/ideax/includes/partial_idea_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
{% endfor %}
</div>

<div class="form-group">
<label style="text-align: right;">Caracteres digitados: </label>
<p id="character_count" style="text-align: right;">0/3000</p>
</div>

<div class="form-group{% if form.category.errors %} has-error{% endif %}">
<label for="{{form.category.id_for_label}}">{{form.category.label}}</label>
{{ form.category|add_class:'form_control' }}
Expand Down
Loading

0 comments on commit 810bf7d

Please sign in to comment.