          :aria-valuemax "100"}
         (str completed "%")]]]
      [:div.col-md-9
-      ;[:div.row
-       [:div.col-md-12
-        [:h1.uppercase-header (:name metabadge)]
-        [:div.description (:description badge)]
-        [:div {:style {:margin-top "10px"}}[:label (str (t :metabadge/Minimumrequired) ": ")] min_required]
-        [:div [:label (str (t :metabadge/Amountearned)": ")] amount_received]
-
-        [:div.panel
-         [:div.panel-body
-          [:div.panel-heading [:span [:i {:class "fa fa-puzzle-piece"}] (if (empty? (rest required_badges)) (t :metabadge/Requiredbadge) (t :metabadge/Requiredbadges))]]
-          [:hr]
-          [:div.icons
-           (reduce (fn [result badge]
-                     (let [{:keys [badge-info received current user_badge]} badge
-                           {:keys [name image criteria]} badge-info
-                           {:keys [id issued_on status]} user_badge]
-                       (conj result
-                             (if received
-                               [:a {:href "#" :on-click #(mo/open-modal [:badge :info] {:badge-id id})} [:img.img-circle {:src image :alt name :title name :class (if current "img-thumbnail" "")}]]
-                               [:a {:href "#" :on-click #(mo/open-modal [:metabadge :dummy] badge)}
-                                [:img.not-received.img-circle {:src image :alt name :title name} ]]))
-                       )) [:div] (sort-by :received required_badges))]]]
-        [:div {:class "row criteria-html"}
-         [:div.col-md-12
-          [:h2.uppercase-header (t :badge/Criteria)]
-          [:div {:dangerouslySetInnerHTML {:__html (:criteria badge)}}]]]
-        ]]]
-
-    ; ]
-    ))
+      [:div.col-md-12
+       [:h1.uppercase-header (:name metabadge)]
+       [:div.description (:description badge)]
+       [:div {:style {:margin-top "10px"}}[:label (str (t :metabadge/Minimumrequired) ": ")] min_required]
+       [:div [:label (str (t :metabadge/Amountearned)": ")] amount_received]
+       [:div.panel
+        [:div.panel-body
+         [:div.panel-heading [:span [:i {:class "fa fa-puzzle-piece"}] (if (empty? (rest required_badges)) (t :metabadge/Requiredbadge) (t :metabadge/Requiredbadges))]]
+         [:hr]
+         [:div.icons
+          (reduce (fn [result badge]
+                    (let [{:keys [badge-info received current user_badge]} badge
+                          {:keys [name image criteria]} badge-info
+                          {:keys [id issued_on status]} user_badge]
+                      (conj result
+                            (if received
+                              (if (= "declined" status)
+                                [:a {:href "#" :on-click #(mo/open-modal [:metabadge :declined] badge)} [:img.img-circle {:src image :alt name :title name :class (if current "img-thumbnail" "")}]]
+                                [:a {:href "#" :on-click #(mo/open-modal [:badge :info] {:badge-id id})} [:img.img-circle {:src image :alt name :title name :class (if current "img-thumbnail" "")}]])
+                              [:a {:href "#" :on-click #(mo/open-modal [:metabadge :dummy] badge)}
+                               [:img.not-received.img-circle {:src image :alt name :title name} ]]))
+                      )) [:div] (sort-by :received required_badges))]]]
+       [:div {:class "row criteria-html"}
+        [:div.col-md-12
+         [:h2.uppercase-header (t :badge/Criteria)]
+         [:div {:dangerouslySetInnerHTML {:__html (:criteria badge)}}]]]
+       ]]]))
 
 (defn history [metabadge]
   (let [{:keys [badge required_badges milestone? min_required]} metabadge

         :aria-valuemax "100"}
        (str completed "%")]]]
     [:div.col-md-9 {:id "badge-stats"}
       [:div.panel
        [:div.panel-body
         [:div.row.header
          [:div.flip-table
           [:div.col-md-6]
           [:div.col-md-2 (t :metabadge/Dateissued)]
           [:div.col-md-4 (t :metabadge/Badgestatus)]]]
         (reduce (fn [r badge]
                   (let [{:keys [badge-info received current user_badge]} badge
                         {:keys [name image criteria]} badge-info
                         {:keys [id issued_on status]} user_badge
                         image-class (if-not received " opaque")]
                     (conj r [:div.col-md-12
                              [:div.flip-table
                               [:div.col-md-1 [:img.badge-icon {:src image :class image-class}]]
                               [:div.col-md-5 (if received [:a {:href "#" :on-click #(mo/open-modal [:badge :info] {:badge-id id})} name]
                                                [:a {:href "#" :on-click #(mo/open-modal [:metabadge :dummy] badge)} name]
                                                )]

                               [:div.col-md-2 [:label (t :metabadge/Dateissued)] (if issued_on (date-from-unix-time (* 1000 issued_on)) "-")]
                               [:div.col-md-4 [:label (t :metabadge/Badgestatus)] status]]]))) [:div.row.body] (sort-by #(-> % :user_badge :issued_on) (->> required_badges (filter :received))))]]]];]
    ))

(defn modal-navi [metabadge state]
  [:div.row.flip

            [salava.core.i18n :refer [t]]
            [salava.metabadge.ui.metabadge :as mb]
            [salava.core.ui.modal :as mo]
            [salava.core.time :refer [date-from-unix-time]]
            [salava.core.ui.error :as err]
            [salava.badge.ui.modal :refer []]))

(defn current-badge [metabadge]
  (let [{:keys [milestone? required_badges badge]} (-> metabadge first)]
