Skip to content

Commit

Permalink
#212 Project page
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-santos committed Jan 7, 2014
1 parent 8024e64 commit b0fcf7f
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 28 deletions.
23 changes: 22 additions & 1 deletion djangoproject/statfiles/static/css2/fs_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ textarea[rows="3"]{
word-break: break-all;
}

.no-wrap{
white-space: nowrap;
}

.disabled{
cursor:default;
}
Expand Down Expand Up @@ -395,7 +399,7 @@ a.propose-new{
.user-picture{
width:50px;
height:50px;
background-color: #D8D8D8;
background-color: #ECECEC;
display:inline-block;
}

Expand Down Expand Up @@ -1037,14 +1041,20 @@ input[type='checkbox'].fs-input:checked + label {

div.project-logo {
height:58px;
line-height:56px;
width:100%;
}

div.project-logo:before {
content:"";
}

div.project-logo > img{
max-height: 50px;
max-width: 180px;
height: auto;
width: auto;
vertical-align:middle;
}

/* FS Cards > Sponsored Card
Expand Down Expand Up @@ -1166,6 +1176,17 @@ div.fakeinput{
display:inline-block;
}

.newtag:before{
content:"";
}

.poptags{
min-width:10px;
min-height:10px;
position:absolute!important;
z-index:1000;
}

.padding5{
padding:5px 0;
}
Expand Down
Binary file modified djangoproject/statfiles/static/img2/fs_tag_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,30 @@ angular.module('contenteditable', []).
// If strip-br attribute is provided then we strip this out
if (attrs.stripBr) {
html = html.replace(/<br>/g,"");
element[0].innerHTML = html;
element[0].innerHTML = html; // Firefox replaces caret at beginning after this
placeCaretAtEnd(element[0]); // So we fix it here, otherwise if you type "html" you will get "lmth"
}
ngModel.$setViewValue(html);
}

// Places de caret at de end of element
function placeCaretAtEnd(element) {
element.focus();
if (typeof window.getSelection != "undefined"
&& typeof document.createRange != "undefined") {
var range = document.createRange();
range.selectNodeContents(element);
range.collapse(false);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
} else if (typeof document.body.createTextRange != "undefined") {
var textRange = document.body.createTextRange();
textRange.moveToElementText(element);
textRange.collapse(false);
textRange.select();
}
}
}
};
});
22 changes: 13 additions & 9 deletions djangoproject/statfiles/static/js/tags/taglist.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<div>
<a class="iconized tag right" ng-hide="editingTags" ng-click="editingTags=true" style="margin:2px">edit tags</a>
<a class="iconized tag right" ng-hide="editingTags" ng-click="editTags()" style="margin:2px">edit tags</a>
<a class="iconized done right" ng-show="editingTags" ng-click="editingTags=false" style="margin:2px">done</a>
<div class="clearfix"></div>
<div ng-class="{fakeinput:editingTags}" ng-click="focus()">
<div ng-class="{fakeinput:editingTags}" ng-click="focus($event)">
<span href class="tag" ng-repeat="tag in tags">{[{tag}]} <a href ng-show="editingTags" ng-click="remove($index)">x</a></span>
<span style="position:relative" ng-show="editingTags">
<span class="newtag" contenteditable='true' strip-br="true" ng-model="newtag" ng-keypress="tagChanged()" ng-change="tagChanged()" ng-class="{padding5:(newtag.length>0)}"></span>
<div class="fs-box" ng-show="poptags" style="position:absolute;z-index:1000;">
<ul><li ng-repeat="poptag in poptags" ng-click="addTag(poptag)">{{ poptag.name }}</li></ul>
</div>
<img src="/static/img2/ajax-loader.gif" ng-show="loading">
</span>
<div style="position:relative!important;display:inline-block;">
<span ng-show="editingTags">
<span class="newtag" contenteditable='true' strip-br="true" ng-model="newtag" ng-keypress="tagChanged($event)" ng-change="tagChanged($event)"></span>
<div class="poptags">
<div class="fs-box" ng-show="poptags">
<ul><li ng-repeat="poptag in poptags" ng-click="addTag(poptag)"><span class="no-wrap">{{ poptag.name }}</span></li></ul>
</div>
</div>
<img src="/static/img2/ajax-loader.gif" ng-show="loading">
</span>
</div>
</div>
</div>
16 changes: 13 additions & 3 deletions djangoproject/statfiles/static/js/tags/taglist.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,28 @@ mod.directive('taglist', function() {
$scope.poptags = [];
}
}

$scope.editTags = function(){
$scope.editingTags = true;
$scope.poptags = [];
$scope.newtag = null;

};

$scope.tagChanged = function(){
$scope.tagChanged = function($event){
restartTimer();
};

$scope.focus = function(){
event.currentTarget.getElementsByClassName('newtag')[0].focus();
$scope.focus = function($event){
if($scope.editingTags){
$event.currentTarget.getElementsByClassName('newtag')[0].focus();
}
};

$scope.addTag = function(t){
$scope.tags.push(t.name);
$scope.poptags = [];
$scope.newtag = null;
TagApi.addTag(t.name, $scope.type, $scope.objid);
};

Expand Down
22 changes: 13 additions & 9 deletions djangoproject/templates/core2/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -491,31 +491,35 @@ <h3 class="boxed">Overview</h3>
<a href="{{ issue.project.get_view_link }}"> <span class="font-size-18 darkblue-text ubahn issue-title"> {{ issue.project.name }}</span> </a>
<div class="divider small"><!--Small Divider--></div>
<!-- Issue Project Logo -->
<div class="project-logo">
<img src="{{ issue.get_card_image }}"/>
</div>
<a href="{{ issue.project.get_view_link }}">
<div class="project-logo">
<img src="{{ issue.get_card_image }}"/>
</div>
</a>
<div class="vgap-15"><!-- Vertical Gap 15px --></div>
<!--Issue Values-->
<div class="issue-values">
{% if issue.getTotalOffersPriceUSD or issue.getTotalOffersPriceBTC %}
<h1 class="orange-text arial">
{% if issue.getTotalOffersPriceUSD %}
<span>US$ {{ issue.getTotalOffersPriceUSD }}</span>
{% endif %}
{% if issue.getTotalOffersPriceBTC %}
<span>BTC {{ issue.getTotalOffersPriceBTC }}</span>
{% endif %}
{% if issue.getTotalOffersPriceUSD and issue.getTotalOffersPriceBTC %}<div class="vgap-5"><!-- Vertical Gap 5px --></div>{% endif %}
{% if issue.getTotalOffersPriceUSD %}
<span>US$ {{ issue.getTotalOffersPriceUSD }}</span>
{% endif %}
</h1>
<h4 class="orange-text arial">Offered</h4>
{% endif %}
</br>
{% if issue.getTotalPaidPriceUSD or issue.getTotalPaidPriceBTC %}
<h1 class="arial">
{% if issue.getTotalPaidPriceUSD %}
<span>US$ {{ issue.getTotalPaidPriceUSD }}</span>
{% endif %}
{% if issue.getTotalPaidPriceBTC %}
<span>BTC {{ issue.getTotalPaidPriceBTC }}</span>
{% endif %}
{% if issue.getTotalPaidPriceUSD and issue.getTotalPaidPriceBTC %}<div class="vgap-5"><!-- Vertical Gap 5px --></div>{% endif %}
{% if issue.getTotalPaidPriceUSD %}
<span>US$ {{ issue.getTotalPaidPriceUSD }}</span>
{% endif %}
</h1>
<h4 class="arial">Paid</h4>
Expand Down
10 changes: 5 additions & 5 deletions djangoproject/templates/core2/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ <h3 class="arial green-text">{{ project.name }}</h3>
<watch-entity entity="PROJECT" objid="{{ project.id }}" watching="watching" watch-link="watchLink"></watch-entity>
</div>
</div>
<span class="word-break" ng-if="project.homeURL">Official site: <a class="external-link" href="{{ project.homeURL }}">{{ project.homeURL }}</a></span>
<div class="vgap-5" ng-if="(project.homeURL) && (project.trackerURL)"><!-- Vertical Gap 5px --></div>
<span class="word-break" ng-if="project.trackerURL">Issue tracker: <a class="external-link" href="{{ project.trackerURL }}">{{ project.trackerURL }}</a></span>
<div class="vgap-15" ng-if="(project.homeURL) || (project.trackerURL)"><!-- Vertical Gap 15px --></div>
<span class="word-break" ng-show="project.homeURL">Official site: <a class="external-link" href="{{ project.homeURL }}">{{ project.homeURL }}</a></span>
<div class="vgap-5" ng-show="(project.homeURL) && (project.trackerURL)"><!-- Vertical Gap 5px --></div>
<span class="word-break" ng-show="project.trackerURL">Issue tracker: <a class="external-link" href="{{ project.trackerURL }}">{{ project.trackerURL }}</a></span>
<div class="vgap-15" ng-show="(project.homeURL) || (project.trackerURL)"><!-- Vertical Gap 15px --></div>
{# <p class="text-align-justify" style="min-height:52px;">{{ project.description|markdown|safe }}</p>#}
<div id="bootstrap-content">{{ project.description|markdown|safe }}</div>
<div id="bootstrap-content" class="text-align-justify">{{ project.description|markdown|safe }}</div>
<!-- Tags -->
<div class="vgap-30"><!-- Vertical Gap 30px --></div>
<div class="tag-list" ng-show="false"> <!-- SEO -->
Expand Down

0 comments on commit b0fcf7f

Please sign in to comment.